@modelform/react-native 0.12.0 → 0.14.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 +63 -0
- package/dist/{chunk-YUSXYDXG.mjs → chunk-72OFPTDE.mjs} +492 -0
- package/dist/{chunk-G67L7TFK.js → chunk-XWSPLZNC.js} +594 -102
- package/dist/core/formFill.d.ts +89 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +36 -2
- package/dist/core/index.mjs +35 -1
- package/dist/core/speech.d.ts +36 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +861 -467
- package/dist/index.mjs +849 -455
- package/dist/ui/inputs/Dictation.d.ts +30 -0
- package/dist/ui/inputs/InputForm.d.ts +17 -1
- package/dist/ui/inputs/VoiceFill.d.ts +28 -0
- package/dist/ui/inputs/formContext.d.ts +7 -0
- package/dist/ui/speech.d.ts +34 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -234,7 +234,24 @@
|
|
|
234
234
|
|
|
235
235
|
|
|
236
236
|
|
|
237
|
-
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
var _chunkXWSPLZNCjs = require('./chunk-XWSPLZNC.js');
|
|
238
255
|
|
|
239
256
|
// src/ui/theme.tsx
|
|
240
257
|
var _react = require('react');
|
|
@@ -424,7 +441,7 @@ function DashboardProvider({ dashboard, resolve, refreshKey: externalKey = 0, on
|
|
|
424
441
|
if (!dashboard.refresh) return;
|
|
425
442
|
let ms;
|
|
426
443
|
try {
|
|
427
|
-
ms =
|
|
444
|
+
ms = _chunkXWSPLZNCjs.parseDuration.call(void 0, dashboard.refresh);
|
|
428
445
|
} catch (e2) {
|
|
429
446
|
return;
|
|
430
447
|
}
|
|
@@ -432,7 +449,7 @@ function DashboardProvider({ dashboard, resolve, refreshKey: externalKey = 0, on
|
|
|
432
449
|
return () => clearInterval(id);
|
|
433
450
|
}, [dashboard.refresh, refresh]);
|
|
434
451
|
const refreshKey = tick + externalKey;
|
|
435
|
-
const range3 = _react.useMemo.call(void 0, () =>
|
|
452
|
+
const range3 = _react.useMemo.call(void 0, () => _chunkXWSPLZNCjs.parseRange.call(void 0, rawRange), [rawRange, refreshKey]);
|
|
436
453
|
const shared = _react.useMemo.call(void 0, () => /* @__PURE__ */ new Map(), [range3, vars.variables, vars.variableInfo]);
|
|
437
454
|
const value = _react.useMemo.call(void 0,
|
|
438
455
|
() => ({
|
|
@@ -469,8 +486,8 @@ function DashboardProvider({ dashboard, resolve, refreshKey: externalKey = 0, on
|
|
|
469
486
|
] });
|
|
470
487
|
}
|
|
471
488
|
function useDashboardVariables(dashboard, resolve, rawRange) {
|
|
472
|
-
const [state, setState] = _react.useState.call(void 0, () => ({ values:
|
|
473
|
-
const [resolving, setResolving] = _react.useState.call(void 0, () => !!resolve &&
|
|
489
|
+
const [state, setState] = _react.useState.call(void 0, () => ({ values: _chunkXWSPLZNCjs.initialVariableValues.call(void 0, dashboard), options: {}, errors: {} }));
|
|
490
|
+
const [resolving, setResolving] = _react.useState.call(void 0, () => !!resolve && _chunkXWSPLZNCjs.refreshedVariables.call(void 0, dashboard, "load").length > 0);
|
|
474
491
|
const [runKey, setRunKey] = _react.useState.call(void 0, 0);
|
|
475
492
|
const pending = _react.useRef.call(void 0, /* @__PURE__ */ new Set());
|
|
476
493
|
const stateRef = _react.useRef.call(void 0, state);
|
|
@@ -503,7 +520,7 @@ function useDashboardVariables(dashboard, resolve, rawRange) {
|
|
|
503
520
|
setState(update);
|
|
504
521
|
setResolving(false);
|
|
505
522
|
};
|
|
506
|
-
|
|
523
|
+
_chunkXWSPLZNCjs.resolveVariables.call(void 0, dashboard, { values, options, names, resolve: resolve2, range: _chunkXWSPLZNCjs.parseRange.call(void 0, rawRange), signal: controller.signal }).then(
|
|
507
524
|
(res) => finish((s) => ({
|
|
508
525
|
// Only the re-run variables change, so a pick made while this ran isn't overwritten.
|
|
509
526
|
values: { ...s.values, ...Object.fromEntries([...names].filter((n) => n in res.values).map((n) => [n, res.values[n]])) },
|
|
@@ -517,11 +534,11 @@ function useDashboardVariables(dashboard, resolve, rawRange) {
|
|
|
517
534
|
const [loadedDashboard, setLoadedDashboard] = _react.useState.call(void 0, dashboard);
|
|
518
535
|
if (dashboard !== loadedDashboard) {
|
|
519
536
|
setLoadedDashboard(dashboard);
|
|
520
|
-
setState((s) => ({ ...s, values: { ...
|
|
537
|
+
setState((s) => ({ ...s, values: { ..._chunkXWSPLZNCjs.initialVariableValues.call(void 0, dashboard), ...s.values } }));
|
|
521
538
|
}
|
|
522
539
|
_react.useEffect.call(void 0, () => {
|
|
523
|
-
const roots =
|
|
524
|
-
schedule([...roots, ...
|
|
540
|
+
const roots = _chunkXWSPLZNCjs.refreshedVariables.call(void 0, dashboard, "load");
|
|
541
|
+
schedule([...roots, ..._chunkXWSPLZNCjs.variableDependents.call(void 0, dashboard, roots)]);
|
|
525
542
|
}, [dashboard, schedule]);
|
|
526
543
|
const mounted = _react.useRef.call(void 0, false);
|
|
527
544
|
_react.useEffect.call(void 0, () => {
|
|
@@ -529,17 +546,17 @@ function useDashboardVariables(dashboard, resolve, rawRange) {
|
|
|
529
546
|
mounted.current = true;
|
|
530
547
|
return;
|
|
531
548
|
}
|
|
532
|
-
const roots =
|
|
533
|
-
schedule([...roots, ...
|
|
549
|
+
const roots = _chunkXWSPLZNCjs.refreshedVariables.call(void 0, dashboard, "range");
|
|
550
|
+
schedule([...roots, ..._chunkXWSPLZNCjs.variableDependents.call(void 0, dashboard, roots)]);
|
|
534
551
|
}, [rawRange]);
|
|
535
552
|
const setVariable = _react.useCallback.call(void 0,
|
|
536
553
|
(name, value) => {
|
|
537
554
|
setState((s) => ({ ...s, values: { ...s.values, [name]: value } }));
|
|
538
|
-
schedule(
|
|
555
|
+
schedule(_chunkXWSPLZNCjs.variableDependents.call(void 0, dashboard, [name]));
|
|
539
556
|
},
|
|
540
557
|
[dashboard, schedule]
|
|
541
558
|
);
|
|
542
|
-
const info = _react.useMemo.call(void 0, () =>
|
|
559
|
+
const info = _react.useMemo.call(void 0, () => _chunkXWSPLZNCjs.variableInfo.call(void 0, dashboard, state.options), [dashboard, state.options]);
|
|
543
560
|
return _react.useMemo.call(void 0,
|
|
544
561
|
() => ({
|
|
545
562
|
variables: state.values,
|
|
@@ -569,7 +586,7 @@ function usePanelData(panel, widthPx, enabled = true) {
|
|
|
569
586
|
_react.useEffect.call(void 0, () => {
|
|
570
587
|
if (!enabled || !request || !variablesReady) return;
|
|
571
588
|
const controller = new AbortController();
|
|
572
|
-
|
|
589
|
+
_chunkXWSPLZNCjs.queryPanel.call(void 0, request.panel, request.options, controller.signal).then((frames) => !controller.signal.aborted && setResult({ request, frames })).catch((e) => !controller.signal.aborted && setResult({ request, frames: [], error: String(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _5 => _5.message]), () => ( e))) }));
|
|
573
590
|
return () => controller.abort();
|
|
574
591
|
}, [enabled, request, variablesReady]);
|
|
575
592
|
if (!enabled) return IDLE;
|
|
@@ -579,7 +596,7 @@ function usePanelData(panel, widthPx, enabled = true) {
|
|
|
579
596
|
function usePanelLinks(panel) {
|
|
580
597
|
const { dashboard, variables, variableInfo: variableInfo2, range: range3, openLinks } = useDashboard();
|
|
581
598
|
const resolve = _react.useCallback.call(void 0,
|
|
582
|
-
(links, data) =>
|
|
599
|
+
(links, data) => _chunkXWSPLZNCjs.resolveLinks.call(void 0, links, { dashboard, values: variables, info: variableInfo2, scoped: panel.scopedVars, range: range3, timezone: dashboard.timezone, data }),
|
|
583
600
|
[dashboard, variables, variableInfo2, panel.scopedVars, range3]
|
|
584
601
|
);
|
|
585
602
|
return { resolve, openLinks };
|
|
@@ -620,7 +637,7 @@ var RenderBoundary = (_class = class extends _react.Component {constructor(...ar
|
|
|
620
637
|
|
|
621
638
|
// src/ui/inputs/formContext.ts
|
|
622
639
|
|
|
623
|
-
var groupKey = (g) => g.id != null ? `#${g.id}` :
|
|
640
|
+
var groupKey = (g) => g.id != null ? `#${g.id}` : _chunkXWSPLZNCjs.groupFields.call(void 0, g).map((f) => f.options.metric).join("|");
|
|
624
641
|
var InputFormContext = _react.createContext.call(void 0, null);
|
|
625
642
|
function useInputForm() {
|
|
626
643
|
const v = _react.useContext.call(void 0, InputFormContext);
|
|
@@ -681,14 +698,14 @@ var ArrowIcon = ({ color, dir }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
|
681
698
|
function displayExpr(expr) {
|
|
682
699
|
if (expr.trim().startsWith("now")) return expr;
|
|
683
700
|
try {
|
|
684
|
-
return
|
|
701
|
+
return _chunkXWSPLZNCjs.formatLocalDateTime.call(void 0, _chunkXWSPLZNCjs.parseTime.call(void 0, expr));
|
|
685
702
|
} catch (e3) {
|
|
686
703
|
return expr;
|
|
687
704
|
}
|
|
688
705
|
}
|
|
689
706
|
function tryParse(expr, roundUp, now = Date.now()) {
|
|
690
707
|
try {
|
|
691
|
-
return
|
|
708
|
+
return _chunkXWSPLZNCjs.parseTime.call(void 0, expr, now, roundUp);
|
|
692
709
|
} catch (e4) {
|
|
693
710
|
return null;
|
|
694
711
|
}
|
|
@@ -702,7 +719,7 @@ function endOfDay(ms) {
|
|
|
702
719
|
return new Date(d.getFullYear(), d.getMonth(), d.getDate() + 1).getTime() - 1e3;
|
|
703
720
|
}
|
|
704
721
|
function resolveTo(expr) {
|
|
705
|
-
return /^\s*\d{4}-\d{1,2}-\d{1,2}\s*$/.test(expr) ?
|
|
722
|
+
return /^\s*\d{4}-\d{1,2}-\d{1,2}\s*$/.test(expr) ? _chunkXWSPLZNCjs.formatLocalDateTime.call(void 0, endOfDay(_chunkXWSPLZNCjs.parseTime.call(void 0, expr))) : expr;
|
|
706
723
|
}
|
|
707
724
|
function TimeRangeSheet({ visible, value, onApply, onClose }) {
|
|
708
725
|
const theme = useDashTheme();
|
|
@@ -713,12 +730,12 @@ function TimeRangeSheet({ visible, value, onApply, onClose }) {
|
|
|
713
730
|
const [now] = _react.useState.call(void 0, () => Date.now());
|
|
714
731
|
const [month, setMonth] = _react.useState.call(void 0, () => new Date(_nullishCoalesce(tryParse(value.from, false), () => ( now))));
|
|
715
732
|
const fromMs = tryParse(from, false, now);
|
|
716
|
-
const toMs = tryParse(
|
|
717
|
-
const fromError =
|
|
718
|
-
const toError =
|
|
733
|
+
const toMs = tryParse(_chunkXWSPLZNCjs.timeExprError.call(void 0, to) ? to : resolveTo(to), true, now);
|
|
734
|
+
const fromError = _chunkXWSPLZNCjs.timeExprError.call(void 0, from);
|
|
735
|
+
const toError = _chunkXWSPLZNCjs.timeExprError.call(void 0, to);
|
|
719
736
|
const orderError = fromMs != null && toMs != null && fromMs >= toMs ? "\u201CTo\u201D must be after \u201CFrom\u201D" : null;
|
|
720
737
|
const valid = !fromError && !toError && !orderError;
|
|
721
|
-
const normalize = (expr) => expr.trim().startsWith("now") ? expr.trim() :
|
|
738
|
+
const normalize = (expr) => expr.trim().startsWith("now") ? expr.trim() : _chunkXWSPLZNCjs.formatLocalDateTime.call(void 0, _chunkXWSPLZNCjs.parseTime.call(void 0, expr));
|
|
722
739
|
const apply = () => {
|
|
723
740
|
if (!valid) return;
|
|
724
741
|
onApply({ from: normalize(from), to: normalize(resolveTo(to)) });
|
|
@@ -727,14 +744,14 @@ function TimeRangeSheet({ visible, value, onApply, onClose }) {
|
|
|
727
744
|
const pickDay = (day) => {
|
|
728
745
|
const end = endOfDay(day);
|
|
729
746
|
if (active === "from") {
|
|
730
|
-
setFrom(
|
|
731
|
-
if (toMs == null || toMs <= day) setTo(
|
|
747
|
+
setFrom(_chunkXWSPLZNCjs.formatLocalDateTime.call(void 0, day));
|
|
748
|
+
if (toMs == null || toMs <= day) setTo(_chunkXWSPLZNCjs.formatLocalDateTime.call(void 0, end));
|
|
732
749
|
setActive("to");
|
|
733
750
|
} else if (fromMs != null && day < startOfDay(fromMs)) {
|
|
734
|
-
setFrom(
|
|
735
|
-
setTo(
|
|
751
|
+
setFrom(_chunkXWSPLZNCjs.formatLocalDateTime.call(void 0, day));
|
|
752
|
+
setTo(_chunkXWSPLZNCjs.formatLocalDateTime.call(void 0, end));
|
|
736
753
|
} else {
|
|
737
|
-
setTo(
|
|
754
|
+
setTo(_chunkXWSPLZNCjs.formatLocalDateTime.call(void 0, end));
|
|
738
755
|
}
|
|
739
756
|
};
|
|
740
757
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -770,7 +787,7 @@ function TimeRangeSheet({ visible, value, onApply, onClose }) {
|
|
|
770
787
|
}
|
|
771
788
|
),
|
|
772
789
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles3.sectionTitle, { color: theme.textSecondary }], children: "Relative ranges" }),
|
|
773
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles3.chips, children:
|
|
790
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles3.chips, children: _chunkXWSPLZNCjs.RELATIVE_RANGES.map((r) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
774
791
|
Chip,
|
|
775
792
|
{
|
|
776
793
|
label: r.label,
|
|
@@ -914,17 +931,17 @@ var FilterIcon = ({ color }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _re
|
|
|
914
931
|
var CalendarIcon = ({ color }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg2.default, { width: 18, height: 18, viewBox: "0 0 24 24", fill: "none", stroke: color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Path, { d: "M5 5h14a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1zM4 10h16M8 3v4M16 3v4" }) });
|
|
915
932
|
var ChevronIcon = ({ color, open }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg2.default, { width: 16, height: 16, viewBox: "0 0 24 24", fill: "none", stroke: color, strokeWidth: 2.2, strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Path, { d: open ? "M6 15l6-6 6 6" : "M6 9l6 6 6-6" }) });
|
|
916
933
|
var CheckIcon = ({ color }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg2.default, { width: 18, height: 18, viewBox: "0 0 24 24", fill: "none", stroke: color, strokeWidth: 2.4, strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Path, { d: "M5 12.5l4.5 4.5L19 7" }) });
|
|
917
|
-
function DashboardToolbar({ presets =
|
|
934
|
+
function DashboardToolbar({ presets = _chunkXWSPLZNCjs.TIME_PRESETS }) {
|
|
918
935
|
const theme = useDashTheme();
|
|
919
936
|
const { dashboard, rawRange, setRawRange, variables, variableErrors } = useDashboard();
|
|
920
937
|
const [filtersOpen, setFiltersOpen] = _react.useState.call(void 0, false);
|
|
921
938
|
const [rangeOpen, setRangeOpen] = _react.useState.call(void 0, false);
|
|
922
939
|
const [rangeKey, setRangeKey] = _react.useState.call(void 0, 0);
|
|
923
940
|
const custom = !presets.some((p) => rawRange.from === p.from && rawRange.to === p.to);
|
|
924
|
-
const vars =
|
|
941
|
+
const vars = _chunkXWSPLZNCjs.visibleVariables.call(void 0, dashboard);
|
|
925
942
|
const active = vars.filter((v) => {
|
|
926
943
|
const cur = variables[v.name];
|
|
927
|
-
return v.includeAll && cur != null && !(Array.isArray(cur) ? cur.includes(
|
|
944
|
+
return v.includeAll && cur != null && !(Array.isArray(cur) ? cur.includes(_chunkXWSPLZNCjs.ALL) : cur === _chunkXWSPLZNCjs.ALL);
|
|
928
945
|
}).length;
|
|
929
946
|
const hasError = vars.some((v) => variableErrors[v.name]);
|
|
930
947
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles4.toolbar, children: [
|
|
@@ -950,7 +967,7 @@ function DashboardToolbar({ presets = _chunkG67L7TFKjs.TIME_PRESETS }) {
|
|
|
950
967
|
setRangeOpen(true);
|
|
951
968
|
},
|
|
952
969
|
accessibilityRole: "button",
|
|
953
|
-
accessibilityLabel: custom ? `Time range, ${
|
|
970
|
+
accessibilityLabel: custom ? `Time range, ${_chunkXWSPLZNCjs.describeRange.call(void 0, rawRange)}` : "Custom time range",
|
|
954
971
|
style: ({ pressed }) => [
|
|
955
972
|
custom ? styles4.rangeButton : styles4.iconButton,
|
|
956
973
|
{ borderColor: custom ? theme.accent : theme.border, backgroundColor: theme.surface },
|
|
@@ -958,7 +975,7 @@ function DashboardToolbar({ presets = _chunkG67L7TFKjs.TIME_PRESETS }) {
|
|
|
958
975
|
],
|
|
959
976
|
children: [
|
|
960
977
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, CalendarIcon, { color: custom ? theme.accent : theme.textSecondary }),
|
|
961
|
-
custom && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles4.rangeLabel, { color: theme.accent }], numberOfLines: 1, children:
|
|
978
|
+
custom && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles4.rangeLabel, { color: theme.accent }], numberOfLines: 1, children: _chunkXWSPLZNCjs.describeRange.call(void 0, rawRange) })
|
|
962
979
|
]
|
|
963
980
|
}
|
|
964
981
|
),
|
|
@@ -1014,14 +1031,14 @@ function FilterSection({ variable: v, open, onToggle }) {
|
|
|
1014
1031
|
const theme = useDashTheme();
|
|
1015
1032
|
const { variables, variableInfo: variableInfo2, variableErrors, variablesReady, setVariable } = useDashboard();
|
|
1016
1033
|
const current = variables[v.name];
|
|
1017
|
-
const summary =
|
|
1018
|
-
const options = [...v.includeAll ? [{ text: "All", value:
|
|
1034
|
+
const summary = _chunkXWSPLZNCjs.valueText.call(void 0, current, variableInfo2[v.name]) || (variablesReady ? "None" : "\u2026");
|
|
1035
|
+
const options = [...v.includeAll ? [{ text: "All", value: _chunkXWSPLZNCjs.ALL }] : [], ..._nullishCoalesce(_optionalChain([variableInfo2, 'access', _9 => _9[v.name], 'optionalAccess', _10 => _10.options]), () => ( []))];
|
|
1019
1036
|
const error = variableErrors[v.name];
|
|
1020
1037
|
const choose = (value, selected) => {
|
|
1021
|
-
if (v.multi && value !==
|
|
1022
|
-
const cur = (Array.isArray(current) ? current : [current]).filter((c) => c && c !==
|
|
1038
|
+
if (v.multi && value !== _chunkXWSPLZNCjs.ALL) {
|
|
1039
|
+
const cur = (Array.isArray(current) ? current : [current]).filter((c) => c && c !== _chunkXWSPLZNCjs.ALL);
|
|
1023
1040
|
const next = selected ? cur.filter((c) => c !== value) : [...cur, value];
|
|
1024
|
-
setVariable(v.name, next.length ? next : [
|
|
1041
|
+
setVariable(v.name, next.length ? next : [_chunkXWSPLZNCjs.ALL]);
|
|
1025
1042
|
} else {
|
|
1026
1043
|
setVariable(v.name, v.multi ? [value] : value);
|
|
1027
1044
|
if (!v.multi) onToggle();
|
|
@@ -1161,7 +1178,7 @@ function barCategory(panel, frame) {
|
|
|
1161
1178
|
}
|
|
1162
1179
|
function categoryLabels(field) {
|
|
1163
1180
|
if (field.type !== "time") return field.values.map((v) => v == null ? "" : String(v));
|
|
1164
|
-
const times = field.values.map((v) => v == null ? null :
|
|
1181
|
+
const times = field.values.map((v) => v == null ? null : _chunkXWSPLZNCjs.toMillis.call(void 0, v));
|
|
1165
1182
|
let step = Infinity;
|
|
1166
1183
|
times.forEach((t, i) => {
|
|
1167
1184
|
const prev = times[i - 1];
|
|
@@ -1207,19 +1224,19 @@ function formatTooltipTime(t) {
|
|
|
1207
1224
|
return new Date(t).toLocaleString(void 0, { month: "short", day: "numeric", hour: "2-digit", minute: "2-digit" });
|
|
1208
1225
|
}
|
|
1209
1226
|
function styledSeries(panel, frames, scheme) {
|
|
1210
|
-
return styleSeries(panel,
|
|
1227
|
+
return styleSeries(panel, _chunkXWSPLZNCjs.toSeries.call(void 0, frames), frames, scheme);
|
|
1211
1228
|
}
|
|
1212
1229
|
function styledXYSeries(panel, frames, scheme) {
|
|
1213
|
-
const { series, x } =
|
|
1214
|
-
const xConfig = x ?
|
|
1230
|
+
const { series, x } = _chunkXWSPLZNCjs.toXYSeries.call(void 0, frames, _optionalChain([panel, 'access', _18 => _18.options, 'optionalAccess', _19 => _19.xField]) || void 0);
|
|
1231
|
+
const xConfig = x ? _chunkXWSPLZNCjs.resolveFieldConfig.call(void 0, panel, x.field, x.frame, x.field.name) : {};
|
|
1215
1232
|
return { series: styleSeries(panel, series, frames, scheme), xConfig };
|
|
1216
1233
|
}
|
|
1217
1234
|
function styleSeries(panel, series, frames, scheme) {
|
|
1218
1235
|
const frameOf = /* @__PURE__ */ new Map();
|
|
1219
1236
|
frames.forEach((f) => f.fields.forEach((field) => frameOf.set(field, f)));
|
|
1220
1237
|
return series.map((s, i) => {
|
|
1221
|
-
const config =
|
|
1222
|
-
return { ...s, name: _nullishCoalesce(config.displayName, () => ( s.name)), config, color:
|
|
1238
|
+
const config = _chunkXWSPLZNCjs.resolveFieldConfig.call(void 0, panel, s.field, frameOf.get(s.field), s.name);
|
|
1239
|
+
return { ...s, name: _nullishCoalesce(config.displayName, () => ( s.name)), config, color: _chunkXWSPLZNCjs.seriesColor.call(void 0, i, scheme, config) };
|
|
1223
1240
|
});
|
|
1224
1241
|
}
|
|
1225
1242
|
function reducedValues(panel, frames, scheme) {
|
|
@@ -1227,30 +1244,30 @@ function reducedValues(panel, frames, scheme) {
|
|
|
1227
1244
|
const out = [];
|
|
1228
1245
|
const multiple = frames.length > 1;
|
|
1229
1246
|
frames.forEach(
|
|
1230
|
-
(frame, fi) =>
|
|
1231
|
-
const raw =
|
|
1232
|
-
const config =
|
|
1247
|
+
(frame, fi) => _chunkXWSPLZNCjs.numberFields.call(void 0, frame).forEach((field) => {
|
|
1248
|
+
const raw = _chunkXWSPLZNCjs.fieldDisplayName.call(void 0, field, frame, multiple);
|
|
1249
|
+
const config = _chunkXWSPLZNCjs.resolveFieldConfig.call(void 0, panel, field, frame, raw);
|
|
1233
1250
|
const values = field.values.map((v) => v == null ? null : Number(v));
|
|
1234
|
-
const value =
|
|
1235
|
-
const color =
|
|
1236
|
-
const step =
|
|
1237
|
-
const mapped =
|
|
1251
|
+
const value = _chunkXWSPLZNCjs.reduce.call(void 0, values, calc);
|
|
1252
|
+
const color = _chunkXWSPLZNCjs.seriesColor.call(void 0, out.length, scheme, config);
|
|
1253
|
+
const step = _chunkXWSPLZNCjs.thresholdStep.call(void 0, value, config);
|
|
1254
|
+
const mapped = _chunkXWSPLZNCjs.mappedResult.call(void 0, value, config);
|
|
1238
1255
|
out.push({
|
|
1239
1256
|
key: `${fi}/${field.name}/${JSON.stringify(_nullishCoalesce(field.labels, () => ( {})))}`,
|
|
1240
1257
|
name: _nullishCoalesce(config.displayName, () => ( raw)),
|
|
1241
1258
|
value,
|
|
1242
|
-
text: _optionalChain([mapped, 'optionalAccess', _24 => _24.text]) ||
|
|
1259
|
+
text: _optionalChain([mapped, 'optionalAccess', _24 => _24.text]) || _chunkXWSPLZNCjs.formatValue.call(void 0, value, config),
|
|
1243
1260
|
mapped,
|
|
1244
1261
|
config,
|
|
1245
1262
|
color,
|
|
1246
|
-
stateColor: _optionalChain([mapped, 'optionalAccess', _25 => _25.color]) ?
|
|
1263
|
+
stateColor: _optionalChain([mapped, 'optionalAccess', _25 => _25.color]) ? _chunkXWSPLZNCjs.resolveColor.call(void 0, mapped.color, color) : step ? _chunkXWSPLZNCjs.resolveColor.call(void 0, step.color, color) : color,
|
|
1247
1264
|
sparkline: values,
|
|
1248
1265
|
field,
|
|
1249
1266
|
frame
|
|
1250
1267
|
});
|
|
1251
1268
|
})
|
|
1252
1269
|
);
|
|
1253
|
-
return
|
|
1270
|
+
return _chunkXWSPLZNCjs.uniqueNames.call(void 0, out, (v) => v.field, frames);
|
|
1254
1271
|
}
|
|
1255
1272
|
function yDomain(series, includeZero) {
|
|
1256
1273
|
let min = Infinity;
|
|
@@ -1311,22 +1328,22 @@ function NoData({ message = "No data" }) {
|
|
|
1311
1328
|
}
|
|
1312
1329
|
function rowTooltipItems(panel, frame, row, multiple) {
|
|
1313
1330
|
return frame.fields.flatMap((f) => {
|
|
1314
|
-
const name =
|
|
1315
|
-
const config =
|
|
1331
|
+
const name = _chunkXWSPLZNCjs.fieldDisplayName.call(void 0, f, frame, multiple);
|
|
1332
|
+
const config = _chunkXWSPLZNCjs.resolveFieldConfig.call(void 0, panel, f, frame, name);
|
|
1316
1333
|
if (_optionalChain([config, 'access', _36 => _36.custom, 'optionalAccess', _37 => _37.hideFrom, 'optionalAccess', _38 => _38.tooltip])) return [];
|
|
1317
1334
|
const v = f.values[row];
|
|
1318
|
-
const value = v == null ? "\u2014" : f.type === "number" ?
|
|
1335
|
+
const value = v == null ? "\u2014" : f.type === "number" ? _chunkXWSPLZNCjs.formatDisplay.call(void 0, Number(v), config) : f.type === "time" ? formatTooltipTime(_chunkXWSPLZNCjs.toMillis.call(void 0, v)) : String(v);
|
|
1319
1336
|
return [{ name: _nullishCoalesce(config.displayName, () => ( name)), value }];
|
|
1320
1337
|
});
|
|
1321
1338
|
}
|
|
1322
1339
|
function rowLinks(panel, frame, row, multiple, resolve) {
|
|
1323
1340
|
return mergeLinks(
|
|
1324
1341
|
frame.fields.flatMap((f) => {
|
|
1325
|
-
const name =
|
|
1326
|
-
const config =
|
|
1342
|
+
const name = _chunkXWSPLZNCjs.fieldDisplayName.call(void 0, f, frame, multiple);
|
|
1343
|
+
const config = _chunkXWSPLZNCjs.resolveFieldConfig.call(void 0, panel, f, frame, name);
|
|
1327
1344
|
if (!_optionalChain([config, 'access', _39 => _39.links, 'optionalAccess', _40 => _40.length])) return [];
|
|
1328
1345
|
const v = f.values[row];
|
|
1329
|
-
const text = v == null ? void 0 : f.type === "number" ?
|
|
1346
|
+
const text = v == null ? void 0 : f.type === "number" ? _chunkXWSPLZNCjs.formatDisplay.call(void 0, Number(v), config) : String(v);
|
|
1330
1347
|
return [{ name: _nullishCoalesce(config.displayName, () => ( name)), links: resolve(config.links, { frame, row, field: f, fieldName: _nullishCoalesce(config.displayName, () => ( name)), value: v, text }) }];
|
|
1331
1348
|
})
|
|
1332
1349
|
);
|
|
@@ -1339,7 +1356,7 @@ function valueLinks(panel, v, resolve) {
|
|
|
1339
1356
|
fieldName: v.name,
|
|
1340
1357
|
seriesName: v.name,
|
|
1341
1358
|
value: v.value,
|
|
1342
|
-
text:
|
|
1359
|
+
text: _chunkXWSPLZNCjs.formatValue.call(void 0, v.value, v.config),
|
|
1343
1360
|
calc: _nullishCoalesce(_optionalChain([panel, 'access', _44 => _44.options, 'optionalAccess', _45 => _45.reduceOptions, 'optionalAccess', _46 => _46.calcs, 'optionalAccess', _47 => _47[0]]), () => ( "lastNotNull"))
|
|
1344
1361
|
});
|
|
1345
1362
|
}
|
|
@@ -1408,6 +1425,120 @@ var styles5 = _reactnative.StyleSheet.create({
|
|
|
1408
1425
|
tooltipValue: { fontSize: 12, fontWeight: "600", marginLeft: "auto", paddingLeft: 8 }
|
|
1409
1426
|
});
|
|
1410
1427
|
|
|
1428
|
+
// src/ui/inputs/Dictation.tsx
|
|
1429
|
+
|
|
1430
|
+
|
|
1431
|
+
|
|
1432
|
+
|
|
1433
|
+
var listening = null;
|
|
1434
|
+
function stopListening() {
|
|
1435
|
+
_optionalChain([listening, 'optionalAccess', _55 => _55.abort, 'call', _56 => _56()]);
|
|
1436
|
+
listening = null;
|
|
1437
|
+
}
|
|
1438
|
+
function claimListening(session, done = false) {
|
|
1439
|
+
if (done) {
|
|
1440
|
+
if (listening === session) listening = null;
|
|
1441
|
+
} else listening = session;
|
|
1442
|
+
}
|
|
1443
|
+
var HINT_MS = 4e3;
|
|
1444
|
+
function useDictation(panel, value, onChange, choices) {
|
|
1445
|
+
const form = useInputForm();
|
|
1446
|
+
const speech = form.speech;
|
|
1447
|
+
const [on, setOn] = _react.useState.call(void 0, false);
|
|
1448
|
+
const [hint, setHint] = _react.useState.call(void 0, null);
|
|
1449
|
+
const session = _react.useRef.call(void 0, null);
|
|
1450
|
+
const latest = _react.useRef.call(void 0, { value, onChange, choices });
|
|
1451
|
+
_react.useEffect.call(void 0, () => {
|
|
1452
|
+
latest.current = { value, onChange, choices };
|
|
1453
|
+
});
|
|
1454
|
+
_react.useEffect.call(void 0,
|
|
1455
|
+
() => () => {
|
|
1456
|
+
_optionalChain([session, 'access', _57 => _57.current, 'optionalAccess', _58 => _58.abort, 'call', _59 => _59()]);
|
|
1457
|
+
},
|
|
1458
|
+
[]
|
|
1459
|
+
);
|
|
1460
|
+
_react.useEffect.call(void 0, () => {
|
|
1461
|
+
if (on || !hint) return;
|
|
1462
|
+
const t = setTimeout(() => setHint(null), HINT_MS);
|
|
1463
|
+
return () => clearTimeout(t);
|
|
1464
|
+
}, [on, hint]);
|
|
1465
|
+
const toggle = () => {
|
|
1466
|
+
if (!speech) return;
|
|
1467
|
+
if (session.current) {
|
|
1468
|
+
session.current.stop();
|
|
1469
|
+
return;
|
|
1470
|
+
}
|
|
1471
|
+
stopListening();
|
|
1472
|
+
setHint(null);
|
|
1473
|
+
let mine = null;
|
|
1474
|
+
let ended = false;
|
|
1475
|
+
const end = () => {
|
|
1476
|
+
ended = true;
|
|
1477
|
+
if (session.current === mine) session.current = null;
|
|
1478
|
+
claimListening(mine, true);
|
|
1479
|
+
setOn(false);
|
|
1480
|
+
};
|
|
1481
|
+
try {
|
|
1482
|
+
mine = speech.start({
|
|
1483
|
+
lang: form.speechLang,
|
|
1484
|
+
hints: _chunkXWSPLZNCjs.dictationHints.call(void 0, panel, choices),
|
|
1485
|
+
onText(text, final) {
|
|
1486
|
+
if (!final) return setHint(text ? `\u201C${text}\u201D` : null);
|
|
1487
|
+
const result = _chunkXWSPLZNCjs.spokenValue.call(void 0, panel, text, latest.current.value, latest.current.choices);
|
|
1488
|
+
if ("value" in result) {
|
|
1489
|
+
latest.current.onChange(result.value);
|
|
1490
|
+
setHint(null);
|
|
1491
|
+
} else setHint(result.problem);
|
|
1492
|
+
},
|
|
1493
|
+
onError: (message) => setHint(message),
|
|
1494
|
+
onEnd: end
|
|
1495
|
+
});
|
|
1496
|
+
} catch (e5) {
|
|
1497
|
+
setHint("Dictation couldn\u2019t start");
|
|
1498
|
+
return;
|
|
1499
|
+
}
|
|
1500
|
+
if (!ended) {
|
|
1501
|
+
session.current = mine;
|
|
1502
|
+
claimListening(mine);
|
|
1503
|
+
setOn(true);
|
|
1504
|
+
}
|
|
1505
|
+
};
|
|
1506
|
+
return { available: !!speech && _chunkXWSPLZNCjs.takesDictation.call(void 0, panel), listening: on, hint, toggle };
|
|
1507
|
+
}
|
|
1508
|
+
function MicButton({ dictation, title, label, size = 32 }) {
|
|
1509
|
+
const theme = useDashTheme();
|
|
1510
|
+
if (!dictation.available) return null;
|
|
1511
|
+
const on = dictation.listening;
|
|
1512
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1513
|
+
_reactnative.Pressable,
|
|
1514
|
+
{
|
|
1515
|
+
onPress: dictation.toggle,
|
|
1516
|
+
accessibilityRole: "button",
|
|
1517
|
+
accessibilityLabel: on ? "Stop dictating" : _nullishCoalesce(label, () => ( (title ? `Dictate ${title}` : "Dictate"))),
|
|
1518
|
+
accessibilityState: { selected: on },
|
|
1519
|
+
hitSlop: 6,
|
|
1520
|
+
style: ({ pressed }) => [
|
|
1521
|
+
styles6.mic,
|
|
1522
|
+
{ width: size, height: size, borderRadius: size / 2, borderColor: on ? theme.accent : theme.border },
|
|
1523
|
+
{ backgroundColor: on ? theme.accent : pressed ? theme.grid : theme.surface }
|
|
1524
|
+
],
|
|
1525
|
+
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: [
|
|
1526
|
+
/* @__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" }),
|
|
1527
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Path, { d: "M19 11a7 7 0 0 1-14 0M12 18v3" })
|
|
1528
|
+
] })
|
|
1529
|
+
}
|
|
1530
|
+
);
|
|
1531
|
+
}
|
|
1532
|
+
function DictationHint({ dictation }) {
|
|
1533
|
+
const theme = useDashTheme();
|
|
1534
|
+
if (!dictation.hint) return null;
|
|
1535
|
+
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 });
|
|
1536
|
+
}
|
|
1537
|
+
var styles6 = _reactnative.StyleSheet.create({
|
|
1538
|
+
mic: { borderWidth: 1, alignItems: "center", justifyContent: "center" },
|
|
1539
|
+
hint: { fontSize: 12, fontStyle: "italic" }
|
|
1540
|
+
});
|
|
1541
|
+
|
|
1411
1542
|
// src/ui/inputs/InputPanels.tsx
|
|
1412
1543
|
|
|
1413
1544
|
function InputPanelBody({ panel }) {
|
|
@@ -1456,61 +1587,73 @@ function NumberInput({ panel, value, onChange }) {
|
|
|
1456
1587
|
const base = typeof value === "number" ? value : Number(text) || 0;
|
|
1457
1588
|
onChange(Number(clamp2(base + dir * step).toFixed(decimalsOf(step))));
|
|
1458
1589
|
};
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [
|
|
1462
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1590
|
+
const dictation = useDictation(panel, value, onChange);
|
|
1591
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles7.dictated, children: [
|
|
1592
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [styles7.numberRow, compact && styles7.numberRowCompact], onLayout, children: [
|
|
1593
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, StepButton, { label: "\u2212", onPress: () => bump(-1), compact }),
|
|
1594
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [styles7.numberField, compact && styles7.numberFieldCompact, { borderColor: theme.border }], children: [
|
|
1595
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1596
|
+
_reactnative.TextInput,
|
|
1597
|
+
{
|
|
1598
|
+
value: text,
|
|
1599
|
+
onChangeText: (t) => {
|
|
1600
|
+
setText(t);
|
|
1601
|
+
const n = Number(t.replace(",", "."));
|
|
1602
|
+
if (t.trim() && !Number.isNaN(n)) onChange(clamp2(integer ? Math.round(n) : n));
|
|
1603
|
+
else if (!t.trim()) onChange(null);
|
|
1604
|
+
},
|
|
1605
|
+
keyboardType,
|
|
1606
|
+
placeholder: _nullishCoalesce(placeholder, () => ( "\u2014")),
|
|
1607
|
+
placeholderTextColor: theme.textMuted,
|
|
1608
|
+
style: [styles7.numberText, compact && styles7.numberTextCompact, { color: theme.text }],
|
|
1609
|
+
accessibilityLabel: unit ? `${panel.title} (${unit})` : panel.title,
|
|
1610
|
+
selectTextOnFocus: true
|
|
1611
|
+
}
|
|
1612
|
+
),
|
|
1613
|
+
unit && !compact ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles7.unit, { color: theme.textMuted }], children: unit }) : null,
|
|
1614
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, MicButton, { dictation, title: panel.title, size: compact ? 24 : 28 })
|
|
1615
|
+
] }),
|
|
1616
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, StepButton, { label: "+", onPress: () => bump(1), compact })
|
|
1481
1617
|
] }),
|
|
1482
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1618
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, DictationHint, { dictation })
|
|
1483
1619
|
] });
|
|
1484
1620
|
}
|
|
1485
1621
|
function DurationInput({ panel, value, onChange }) {
|
|
1486
1622
|
const theme = useDashTheme();
|
|
1487
|
-
const toDigits = (v) => typeof v === "number" ?
|
|
1623
|
+
const toDigits = (v) => typeof v === "number" ? _chunkXWSPLZNCjs.formatClock.call(void 0, v).replace(/\D/g, "").replace(/^0+/, "") : "";
|
|
1488
1624
|
const [digits, setDigits] = _react.useState.call(void 0, toDigits(value));
|
|
1489
1625
|
const [syncedValue, setSyncedValue] = _react.useState.call(void 0, value);
|
|
1490
1626
|
if (value !== syncedValue) {
|
|
1491
1627
|
setSyncedValue(value);
|
|
1492
|
-
setDigits((d) => value == null ?
|
|
1628
|
+
setDigits((d) => value == null ? _chunkXWSPLZNCjs.parseClockDigits.call(void 0, d) == null ? d : "" : _chunkXWSPLZNCjs.parseClockDigits.call(void 0, d) === value ? d : toDigits(value));
|
|
1493
1629
|
}
|
|
1494
1630
|
const masked = digits ? maskClock(digits) : "";
|
|
1495
|
-
const invalid = !!digits &&
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
{
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1631
|
+
const invalid = !!digits && _chunkXWSPLZNCjs.parseClockDigits.call(void 0, digits) == null;
|
|
1632
|
+
const dictation = useDictation(panel, value, onChange);
|
|
1633
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles7.dictated, children: [
|
|
1634
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [styles7.numberField, { borderColor: invalid ? theme.danger : theme.border }], children: [
|
|
1635
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1636
|
+
_reactnative.TextInput,
|
|
1637
|
+
{
|
|
1638
|
+
value: masked,
|
|
1639
|
+
onChangeText: (t) => {
|
|
1640
|
+
const d = t.replace(/\D/g, "").replace(/^0+/, "").slice(0, 6);
|
|
1641
|
+
setDigits(d);
|
|
1642
|
+
onChange(_chunkXWSPLZNCjs.parseClockDigits.call(void 0, d));
|
|
1643
|
+
},
|
|
1644
|
+
keyboardType: "number-pad",
|
|
1645
|
+
placeholder: _nullishCoalesce(panel.options.placeholder, () => ( "00:00.00")),
|
|
1646
|
+
placeholderTextColor: theme.textMuted,
|
|
1647
|
+
style: [styles7.numberText, { color: invalid ? theme.danger : theme.text }],
|
|
1648
|
+
accessibilityLabel: panel.title,
|
|
1649
|
+
accessibilityHint: "Type the digits only, for example 13245 for 1 minute 32.45 seconds",
|
|
1650
|
+
selection: { start: masked.length, end: masked.length }
|
|
1651
|
+
}
|
|
1652
|
+
),
|
|
1653
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, MicButton, { dictation, title: panel.title, size: 28 })
|
|
1654
|
+
] }),
|
|
1655
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, DictationHint, { dictation })
|
|
1656
|
+
] });
|
|
1514
1657
|
}
|
|
1515
1658
|
function maskClock(digits) {
|
|
1516
1659
|
const p = digits.slice(-6).padStart(6, "0");
|
|
@@ -1524,8 +1667,8 @@ function StepButton({ label, onPress, compact }) {
|
|
|
1524
1667
|
onPress,
|
|
1525
1668
|
accessibilityRole: "button",
|
|
1526
1669
|
accessibilityLabel: label === "+" ? "Increase" : "Decrease",
|
|
1527
|
-
style: ({ pressed }) => [
|
|
1528
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
1670
|
+
style: ({ pressed }) => [styles7.stepBtn, compact && styles7.stepBtnCompact, { borderColor: theme.border, backgroundColor: pressed ? theme.grid : theme.surface }],
|
|
1671
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles7.stepText, { color: theme.text }], children: label })
|
|
1529
1672
|
}
|
|
1530
1673
|
);
|
|
1531
1674
|
}
|
|
@@ -1539,7 +1682,7 @@ function SliderInput({ panel, value, onChange }) {
|
|
|
1539
1682
|
const origin = min < 0 && max > 0 ? toFrac(0) : 0;
|
|
1540
1683
|
const fillStart = Math.min(origin, frac);
|
|
1541
1684
|
const labelAt = (x) => {
|
|
1542
|
-
if (!_optionalChain([labels, 'optionalAccess',
|
|
1685
|
+
if (!_optionalChain([labels, 'optionalAccess', _60 => _60.length])) return void 0;
|
|
1543
1686
|
const i = labels.length === 1 ? 0 : toFrac(x) * (labels.length - 1);
|
|
1544
1687
|
return Number.isInteger(Math.round(i * 1e6) / 1e6) ? labels[Math.round(i)] : void 0;
|
|
1545
1688
|
};
|
|
@@ -1549,17 +1692,17 @@ function SliderInput({ panel, value, onChange }) {
|
|
|
1549
1692
|
const raw = min + Math.min(1, Math.max(0, x / size.width)) * (max - min);
|
|
1550
1693
|
onChange(Number((Math.round((raw - min) / step) * step + min).toFixed(decimalsOf(step))));
|
|
1551
1694
|
};
|
|
1552
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
1553
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
1554
|
-
!_optionalChain([labels, 'optionalAccess',
|
|
1555
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
1556
|
-
!_optionalChain([labels, 'optionalAccess',
|
|
1695
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles7.sliderWrap, children: [
|
|
1696
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles7.sliderLabels, children: [
|
|
1697
|
+
!_optionalChain([labels, 'optionalAccess', _61 => _61.length]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles7.minmax, { color: theme.textMuted }], children: min }),
|
|
1698
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles7.sliderValue, { color: theme.text }, !!_optionalChain([labels, 'optionalAccess', _62 => _62.length]) && styles7.sliderValueCentered], children: display }),
|
|
1699
|
+
!_optionalChain([labels, 'optionalAccess', _63 => _63.length]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles7.minmax, { color: theme.textMuted }], children: max })
|
|
1557
1700
|
] }),
|
|
1558
1701
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1559
1702
|
_reactnative.View,
|
|
1560
1703
|
{
|
|
1561
1704
|
onLayout,
|
|
1562
|
-
style:
|
|
1705
|
+
style: styles7.sliderHit,
|
|
1563
1706
|
onStartShouldSetResponder: () => true,
|
|
1564
1707
|
onMoveShouldSetResponder: () => true,
|
|
1565
1708
|
onResponderTerminationRequest: () => false,
|
|
@@ -1570,11 +1713,11 @@ function SliderInput({ panel, value, onChange }) {
|
|
|
1570
1713
|
accessibilityActions: [{ name: "increment" }, { name: "decrement" }],
|
|
1571
1714
|
onAccessibilityAction: (e) => onChange(Math.min(max, Math.max(min, (_nullishCoalesce(v, () => ( min))) + (e.nativeEvent.actionName === "increment" ? step : -step)))),
|
|
1572
1715
|
children: [
|
|
1573
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { pointerEvents: "none", style: [
|
|
1716
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { pointerEvents: "none", style: [styles7.track, { backgroundColor: theme.grid }], children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1574
1717
|
_reactnative.View,
|
|
1575
1718
|
{
|
|
1576
1719
|
style: [
|
|
1577
|
-
|
|
1720
|
+
styles7.trackFill,
|
|
1578
1721
|
{ left: `${fillStart * 100}%`, width: `${v == null ? 0 : Math.abs(frac - origin) * 100}%`, backgroundColor: theme.accent }
|
|
1579
1722
|
]
|
|
1580
1723
|
}
|
|
@@ -1583,16 +1726,16 @@ function SliderInput({ panel, value, onChange }) {
|
|
|
1583
1726
|
_reactnative.View,
|
|
1584
1727
|
{
|
|
1585
1728
|
pointerEvents: "none",
|
|
1586
|
-
style: [
|
|
1729
|
+
style: [styles7.thumb, { left: frac * size.width - 11, backgroundColor: theme.accent, borderColor: theme.surface }]
|
|
1587
1730
|
}
|
|
1588
1731
|
)
|
|
1589
1732
|
]
|
|
1590
1733
|
}
|
|
1591
1734
|
),
|
|
1592
|
-
!!_optionalChain([labels, 'optionalAccess',
|
|
1735
|
+
!!_optionalChain([labels, 'optionalAccess', _64 => _64.length]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles7.tickRow, children: labels.map((l, i) => {
|
|
1593
1736
|
const last = labels.length - 1;
|
|
1594
|
-
const edge = i === 0 ?
|
|
1595
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
1737
|
+
const edge = i === 0 ? styles7.tickStart : i === last ? styles7.tickEnd : { left: `${i / last * 100}%` };
|
|
1738
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles7.minmax, styles7.tick, edge, { color: theme.textMuted }], numberOfLines: 1, children: l }, i);
|
|
1596
1739
|
}) })
|
|
1597
1740
|
] });
|
|
1598
1741
|
}
|
|
@@ -1602,27 +1745,34 @@ function SelectInput({ panel, value, onChange }) {
|
|
|
1602
1745
|
const { choicesFrom, multi, placeholder } = panel.options;
|
|
1603
1746
|
const choices = _nullishCoalesce((choicesFrom ? form.choices[choicesFrom] : panel.options.choices), () => ( []));
|
|
1604
1747
|
const selected = Array.isArray(value) ? value : value == null ? [] : [value];
|
|
1748
|
+
const dictation = useDictation(panel, value, onChange, choices);
|
|
1605
1749
|
if (!choices.length && placeholder) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: { color: theme.textMuted }, children: placeholder });
|
|
1606
|
-
return /* @__PURE__ */ _jsxruntime.
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1750
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles7.selectWrap, children: [
|
|
1751
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles7.wrap, children: [
|
|
1752
|
+
choices.map((c) => {
|
|
1753
|
+
const on = selected.includes(c.value);
|
|
1754
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1755
|
+
Chip,
|
|
1756
|
+
{
|
|
1757
|
+
label: c.label,
|
|
1758
|
+
selected: on,
|
|
1759
|
+
onPress: () => {
|
|
1760
|
+
if (!multi) return onChange(on ? null : c.value);
|
|
1761
|
+
const next = on ? selected.filter((s) => s !== c.value) : [...selected, c.value];
|
|
1762
|
+
onChange(next.length ? next : null);
|
|
1763
|
+
}
|
|
1764
|
+
},
|
|
1765
|
+
String(c.value)
|
|
1766
|
+
);
|
|
1767
|
+
}),
|
|
1768
|
+
choices.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MicButton, { dictation, title: panel.title })
|
|
1769
|
+
] }),
|
|
1770
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, DictationHint, { dictation })
|
|
1771
|
+
] });
|
|
1622
1772
|
}
|
|
1623
1773
|
function ToggleInput({ panel, value, onChange }) {
|
|
1624
1774
|
const theme = useDashTheme();
|
|
1625
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
1775
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles7.toggleRow, children: [
|
|
1626
1776
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: { color: theme.textSecondary, flex: 1 }, children: value == null ? "Not set" : value ? "Yes" : "No" }),
|
|
1627
1777
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Switch, { value: !!value, onValueChange: (v) => onChange(v), trackColor: { true: theme.accent }, accessibilityLabel: panel.title })
|
|
1628
1778
|
] });
|
|
@@ -1633,7 +1783,7 @@ function RatingInput({ panel, value, onChange }) {
|
|
|
1633
1783
|
const min = Math.round(_nullishCoalesce(panel.options.min, () => ( 1)));
|
|
1634
1784
|
const max = Math.round(_nullishCoalesce(panel.options.max, () => ( 5)));
|
|
1635
1785
|
const levels = Array.from({ length: Math.min(Math.max(0, max - min + 1), MAX_RATING_LEVELS) }, (_, i) => min + i);
|
|
1636
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style:
|
|
1786
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles7.rating, children: levels.map((n) => {
|
|
1637
1787
|
const on = typeof value === "number" && n <= value;
|
|
1638
1788
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1639
1789
|
_reactnative.Pressable,
|
|
@@ -1642,7 +1792,7 @@ function RatingInput({ panel, value, onChange }) {
|
|
|
1642
1792
|
accessibilityRole: "button",
|
|
1643
1793
|
accessibilityLabel: `${n} of ${max}`,
|
|
1644
1794
|
accessibilityState: { selected: value === n },
|
|
1645
|
-
style: [
|
|
1795
|
+
style: [styles7.ratingDot, { borderColor: on ? theme.accent : theme.border, backgroundColor: on ? theme.accent : theme.surface }],
|
|
1646
1796
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: { color: on ? "#fff" : theme.textSecondary, fontWeight: "600" }, children: n })
|
|
1647
1797
|
},
|
|
1648
1798
|
n
|
|
@@ -1651,17 +1801,25 @@ function RatingInput({ panel, value, onChange }) {
|
|
|
1651
1801
|
}
|
|
1652
1802
|
function FreeTextInput({ panel, value, onChange }) {
|
|
1653
1803
|
const theme = useDashTheme();
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
{
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1804
|
+
const dictation = useDictation(panel, value, onChange);
|
|
1805
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles7.dictated, children: [
|
|
1806
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles7.fill, children: [
|
|
1807
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1808
|
+
_reactnative.TextInput,
|
|
1809
|
+
{
|
|
1810
|
+
value: typeof value === "string" ? value : "",
|
|
1811
|
+
onChangeText: (t) => onChange(t || null),
|
|
1812
|
+
placeholder: _nullishCoalesce(panel.options.placeholder, () => ( "Type here")),
|
|
1813
|
+
placeholderTextColor: theme.textMuted,
|
|
1814
|
+
multiline: true,
|
|
1815
|
+
accessibilityLabel: panel.title,
|
|
1816
|
+
style: [styles7.textArea, dictation.available && styles7.textAreaWithMic, { color: theme.text, borderColor: theme.border }]
|
|
1817
|
+
}
|
|
1818
|
+
),
|
|
1819
|
+
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 }) })
|
|
1820
|
+
] }),
|
|
1821
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, DictationHint, { dictation })
|
|
1822
|
+
] });
|
|
1665
1823
|
}
|
|
1666
1824
|
function SuggestTextInput({ panel, value, onChange }) {
|
|
1667
1825
|
const theme = useDashTheme();
|
|
@@ -1686,30 +1844,38 @@ function SuggestTextInput({ panel, value, onChange }) {
|
|
|
1686
1844
|
}, [store, metric, suggestWith]);
|
|
1687
1845
|
const withText = suggestWith ? form.value(suggestWith) : null;
|
|
1688
1846
|
const own = entries.filter((e) => e.metric === metric);
|
|
1689
|
-
const scoped = suggestWith && typeof withText === "string" && withText.trim() ?
|
|
1847
|
+
const scoped = suggestWith && typeof withText === "string" && withText.trim() ? _chunkXWSPLZNCjs.entriesSavedWith.call(void 0, entries, metric, suggestWith, withText) : [];
|
|
1690
1848
|
const query = typed ? text : "";
|
|
1691
|
-
const fromScoped =
|
|
1692
|
-
const suggestions = (fromScoped.length ? fromScoped :
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1849
|
+
const fromScoped = _chunkXWSPLZNCjs.textSuggestions.call(void 0, scoped, query);
|
|
1850
|
+
const suggestions = (fromScoped.length ? fromScoped : _chunkXWSPLZNCjs.textSuggestions.call(void 0, own, query)).filter((s) => s.toLowerCase() !== text.trim().toLowerCase());
|
|
1851
|
+
const dictation = useDictation(panel, value, (v) => {
|
|
1852
|
+
setTyped(false);
|
|
1853
|
+
onChange(v);
|
|
1854
|
+
});
|
|
1855
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles7.suggest, children: [
|
|
1856
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles7.lineRow, children: [
|
|
1857
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1858
|
+
_reactnative.TextInput,
|
|
1859
|
+
{
|
|
1860
|
+
value: text,
|
|
1861
|
+
onChangeText: (t) => {
|
|
1862
|
+
setTyped(!!t);
|
|
1863
|
+
onChange(t || null);
|
|
1864
|
+
},
|
|
1865
|
+
placeholder: _nullishCoalesce(placeholder, () => ( "Type here")),
|
|
1866
|
+
placeholderTextColor: theme.textMuted,
|
|
1867
|
+
style: [styles7.textLine, { color: theme.text, borderColor: theme.border }],
|
|
1868
|
+
accessibilityLabel: panel.title,
|
|
1869
|
+
autoCorrect: false,
|
|
1870
|
+
autoCapitalize: "words",
|
|
1871
|
+
returnKeyType: "done",
|
|
1872
|
+
selectTextOnFocus: true
|
|
1873
|
+
}
|
|
1874
|
+
),
|
|
1875
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, MicButton, { dictation, title: panel.title })
|
|
1876
|
+
] }),
|
|
1877
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, DictationHint, { dictation }),
|
|
1878
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.ScrollView, { horizontal: true, keyboardShouldPersistTaps: "handled", showsHorizontalScrollIndicator: false, contentContainerStyle: styles7.wrap, children: suggestions.map((s) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1713
1879
|
Chip,
|
|
1714
1880
|
{
|
|
1715
1881
|
label: s,
|
|
@@ -1728,13 +1894,13 @@ function CounterInput({ panel }) {
|
|
|
1728
1894
|
const { metric, increment = 1, unit } = panel.options;
|
|
1729
1895
|
const [today, setToday] = _react.useState.call(void 0, 0);
|
|
1730
1896
|
_react.useEffect.call(void 0, () => {
|
|
1731
|
-
const load = () => store.list({ metrics: [metric], from:
|
|
1897
|
+
const load = () => store.list({ metrics: [metric], from: _chunkXWSPLZNCjs.startOf.call(void 0, /* @__PURE__ */ new Date(), "d").getTime() }).then((rows) => setToday(rows.reduce((a, e) => a + (_nullishCoalesce(e.value, () => ( 0))), 0)));
|
|
1732
1898
|
load();
|
|
1733
1899
|
return store.subscribe(load);
|
|
1734
1900
|
}, [store, metric]);
|
|
1735
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
1901
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles7.counter, children: [
|
|
1736
1902
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: { flex: 1 }, children: [
|
|
1737
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.Text, { style: [
|
|
1903
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.Text, { style: [styles7.counterValue, { color: theme.text }], children: [
|
|
1738
1904
|
today,
|
|
1739
1905
|
unit ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: { fontSize: 14, color: theme.textMuted }, children: ` ${unit}` }) : null
|
|
1740
1906
|
] }),
|
|
@@ -1746,8 +1912,8 @@ function CounterInput({ panel }) {
|
|
|
1746
1912
|
onPress: () => store.add([{ metric, ts: Date.now(), value: increment, text: null }]),
|
|
1747
1913
|
accessibilityRole: "button",
|
|
1748
1914
|
accessibilityLabel: `Add ${increment}`,
|
|
1749
|
-
style: ({ pressed }) => [
|
|
1750
|
-
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.Text, { style:
|
|
1915
|
+
style: ({ pressed }) => [styles7.counterBtn, { backgroundColor: theme.accent, opacity: pressed ? 0.8 : 1 }],
|
|
1916
|
+
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.Text, { style: styles7.counterBtnText, children: [
|
|
1751
1917
|
"+",
|
|
1752
1918
|
increment
|
|
1753
1919
|
] })
|
|
@@ -1755,7 +1921,13 @@ function CounterInput({ panel }) {
|
|
|
1755
1921
|
)
|
|
1756
1922
|
] });
|
|
1757
1923
|
}
|
|
1758
|
-
var
|
|
1924
|
+
var styles7 = _reactnative.StyleSheet.create({
|
|
1925
|
+
fill: { flex: 1 },
|
|
1926
|
+
dictated: { flex: 1, gap: 4 },
|
|
1927
|
+
selectWrap: { gap: 4 },
|
|
1928
|
+
lineRow: { flexDirection: "row", alignItems: "center", gap: 8 },
|
|
1929
|
+
textAreaWithMic: { paddingRight: 44 },
|
|
1930
|
+
textAreaMic: { position: "absolute", top: 8, right: 8 },
|
|
1759
1931
|
numberRow: { flex: 1, flexDirection: "row", alignItems: "center", gap: 8 },
|
|
1760
1932
|
numberField: { flex: 1, flexDirection: "row", alignItems: "center", borderWidth: 1, borderRadius: 8, paddingHorizontal: 10, height: 44 },
|
|
1761
1933
|
// Android gives TextInput default padding that eats into narrow fields.
|
|
@@ -1786,7 +1958,7 @@ var styles6 = _reactnative.StyleSheet.create({
|
|
|
1786
1958
|
rating: { flex: 1, flexDirection: "row", alignItems: "center", justifyContent: "space-between", gap: 6 },
|
|
1787
1959
|
ratingDot: { flex: 1, maxWidth: 52, aspectRatio: 1, borderRadius: 26, borderWidth: 1, alignItems: "center", justifyContent: "center" },
|
|
1788
1960
|
suggest: { flex: 1, gap: 8 },
|
|
1789
|
-
textLine: { height: 44, borderWidth: 1, borderRadius: 8, paddingHorizontal: 10, paddingVertical: 0, fontSize: 16 },
|
|
1961
|
+
textLine: { flex: 1, height: 44, borderWidth: 1, borderRadius: 8, paddingHorizontal: 10, paddingVertical: 0, fontSize: 16 },
|
|
1790
1962
|
textArea: { flex: 1, borderWidth: 1, borderRadius: 8, padding: 10, fontSize: 15, textAlignVertical: "top" },
|
|
1791
1963
|
counter: { flex: 1, flexDirection: "row", alignItems: "center", gap: 12 },
|
|
1792
1964
|
counterValue: { fontSize: 28, fontWeight: "600", fontVariant: ["tabular-nums"] },
|
|
@@ -1804,9 +1976,9 @@ function titleText(v) {
|
|
|
1804
1976
|
function summaryText(f, v) {
|
|
1805
1977
|
if (v == null || v === "" || Array.isArray(v) && !v.length) return void 0;
|
|
1806
1978
|
if (f.type === "input-toggle") return v ? f.title || "Yes" : void 0;
|
|
1807
|
-
if (f.type === "input-duration" && typeof v === "number") return
|
|
1979
|
+
if (f.type === "input-duration" && typeof v === "number") return _chunkXWSPLZNCjs.formatClock.call(void 0, v);
|
|
1808
1980
|
if (f.type === "input-select" && f.options.choices) {
|
|
1809
|
-
const label = (x) => _nullishCoalesce(_optionalChain([f, 'access',
|
|
1981
|
+
const label = (x) => _nullishCoalesce(_optionalChain([f, 'access', _65 => _65.options, 'access', _66 => _66.choices, 'access', _67 => _67.find, 'call', _68 => _68((c) => c.value === x), 'optionalAccess', _69 => _69.label]), () => ( String(x)));
|
|
1810
1982
|
return Array.isArray(v) ? v.map(label).join(", ") : label(v);
|
|
1811
1983
|
}
|
|
1812
1984
|
const text = Array.isArray(v) ? v.join(", ") : String(v);
|
|
@@ -1823,19 +1995,19 @@ function dropIndex(from, dy, keys, span) {
|
|
|
1823
1995
|
function InputGroupBody({ panel }) {
|
|
1824
1996
|
const theme = useDashTheme();
|
|
1825
1997
|
const form = useInputForm();
|
|
1826
|
-
const group = _optionalChain([form, 'access',
|
|
1998
|
+
const group = _optionalChain([form, 'access', _70 => _70.group, 'optionalCall', _71 => _71(panel)]);
|
|
1827
1999
|
const [collapsed, setCollapsed] = _react.useState.call(void 0, /* @__PURE__ */ new Set());
|
|
1828
2000
|
const [drag, setDrag] = _react.useState.call(void 0, null);
|
|
1829
2001
|
const [heights, setHeights] = _react.useState.call(void 0, {});
|
|
1830
2002
|
const dragging = _react.useRef.call(void 0, null);
|
|
1831
|
-
const [wasEdited, setWasEdited] = _react.useState.call(void 0, _optionalChain([group, 'optionalAccess',
|
|
2003
|
+
const [wasEdited, setWasEdited] = _react.useState.call(void 0, _optionalChain([group, 'optionalAccess', _72 => _72.edited]));
|
|
1832
2004
|
if (group && group.edited !== wasEdited) {
|
|
1833
2005
|
setWasEdited(group.edited);
|
|
1834
2006
|
if (!group.edited) setCollapsed(/* @__PURE__ */ new Set());
|
|
1835
2007
|
}
|
|
1836
2008
|
if (!group) return null;
|
|
1837
2009
|
const label = panel.options.itemTitle || "Item";
|
|
1838
|
-
const collapseFilled = (except) => setCollapsed(new Set(group.items.filter((i) => i.key !== except && !
|
|
2010
|
+
const collapseFilled = (except) => setCollapsed(new Set(group.items.filter((i) => i.key !== except && !_chunkXWSPLZNCjs.isEmptyItem.call(void 0, panel, i.values)).map((i) => i.key)));
|
|
1839
2011
|
const toggle = (key) => setCollapsed((c) => {
|
|
1840
2012
|
const next = new Set(c);
|
|
1841
2013
|
if (!next.delete(key)) next.add(key);
|
|
@@ -1869,11 +2041,11 @@ function InputGroupBody({ panel }) {
|
|
|
1869
2041
|
if (to <= i && i < drag.from) return room;
|
|
1870
2042
|
return 0;
|
|
1871
2043
|
};
|
|
1872
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.ScrollView, { style:
|
|
2044
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.ScrollView, { style: styles8.fill, contentContainerStyle: styles8.list, nestedScrollEnabled: true, keyboardShouldPersistTaps: "handled", scrollEnabled: !drag, children: [
|
|
1873
2045
|
group.items.map((item, i) => {
|
|
1874
2046
|
const named = panel.options.titleFrom ? titleText(item.values[panel.options.titleFrom]) : void 0;
|
|
1875
2047
|
const title = _nullishCoalesce(named, () => ( `${label} ${i + 1}`));
|
|
1876
|
-
const troubled =
|
|
2048
|
+
const troubled = _chunkXWSPLZNCjs.groupFields.call(void 0, panel).some((f) => group.fieldProblem(i, f.options.metric));
|
|
1877
2049
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1878
2050
|
ItemCard,
|
|
1879
2051
|
{
|
|
@@ -1890,7 +2062,7 @@ function InputGroupBody({ panel }) {
|
|
|
1890
2062
|
group.duplicate(i);
|
|
1891
2063
|
},
|
|
1892
2064
|
dragOffset: shift(i, item.key),
|
|
1893
|
-
lifted: _optionalChain([drag, 'optionalAccess',
|
|
2065
|
+
lifted: _optionalChain([drag, 'optionalAccess', _73 => _73.key]) === item.key,
|
|
1894
2066
|
onLayout: (h) => setHeights((all) => all[item.key] === h ? all : { ...all, [item.key]: h }),
|
|
1895
2067
|
handle: {
|
|
1896
2068
|
onStartShouldSetResponder: () => true,
|
|
@@ -1913,7 +2085,7 @@ function InputGroupBody({ panel }) {
|
|
|
1913
2085
|
group.add();
|
|
1914
2086
|
},
|
|
1915
2087
|
accessibilityRole: "button",
|
|
1916
|
-
style: ({ pressed }) => [
|
|
2088
|
+
style: ({ pressed }) => [styles8.add, { borderColor: theme.accent, opacity: pressed ? 0.7 : 1 }],
|
|
1917
2089
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.Text, { style: { color: theme.accent, fontWeight: "600" }, children: [
|
|
1918
2090
|
"+ ",
|
|
1919
2091
|
panel.options.addLabel || `Add ${label.toLowerCase()}`
|
|
@@ -1924,7 +2096,7 @@ function InputGroupBody({ panel }) {
|
|
|
1924
2096
|
}
|
|
1925
2097
|
function ItemCard({ panel, group, form, index, title, last, collapsed, onToggle, onDuplicate, dragOffset, lifted, onLayout, handle }) {
|
|
1926
2098
|
const theme = useDashTheme();
|
|
1927
|
-
const fields = _react.useMemo.call(void 0, () =>
|
|
2099
|
+
const fields = _react.useMemo.call(void 0, () => _chunkXWSPLZNCjs.groupFields.call(void 0, panel), [panel]);
|
|
1928
2100
|
const item = group.items[index];
|
|
1929
2101
|
const scoped = _react.useMemo.call(void 0,
|
|
1930
2102
|
() => ({
|
|
@@ -1944,7 +2116,7 @@ function ItemCard({ panel, group, form, index, title, last, collapsed, onToggle,
|
|
|
1944
2116
|
accessibilityRole: "button",
|
|
1945
2117
|
accessibilityLabel: a11y,
|
|
1946
2118
|
hitSlop: 6,
|
|
1947
|
-
style: ({ pressed }) => [
|
|
2119
|
+
style: ({ pressed }) => [styles8.iconBtn, { opacity: disabled ? 0.3 : pressed ? 0.6 : 1 }],
|
|
1948
2120
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: { color: theme.textSecondary, fontSize: 15 }, children: text })
|
|
1949
2121
|
}
|
|
1950
2122
|
);
|
|
@@ -1954,41 +2126,41 @@ function ItemCard({ panel, group, form, index, title, last, collapsed, onToggle,
|
|
|
1954
2126
|
{
|
|
1955
2127
|
onLayout: (e) => onLayout(e.nativeEvent.layout.height),
|
|
1956
2128
|
style: [
|
|
1957
|
-
|
|
2129
|
+
styles8.item,
|
|
1958
2130
|
{ borderColor: lifted ? theme.accent : theme.border, backgroundColor: theme.surface },
|
|
1959
2131
|
!!dragOffset && { transform: [{ translateY: dragOffset }] },
|
|
1960
2132
|
lifted && { zIndex: 1, opacity: 0.95 }
|
|
1961
2133
|
],
|
|
1962
2134
|
children: [
|
|
1963
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
1964
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { ...handle, style:
|
|
1965
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.Pressable, { onPress: onToggle, style:
|
|
1966
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.Text, { style: [
|
|
2135
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles8.itemHeader, children: [
|
|
2136
|
+
/* @__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" }) }),
|
|
2137
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.Pressable, { onPress: onToggle, style: styles8.titleArea, accessibilityRole: "button", accessibilityLabel: `${collapsed ? "Expand" : "Collapse"} ${title}`, accessibilityState: { expanded: !collapsed }, children: [
|
|
2138
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.Text, { style: [styles8.itemTitle, { color: theme.text }], numberOfLines: 1, children: [
|
|
1967
2139
|
collapsed ? "\u25B8 " : "\u25BE ",
|
|
1968
2140
|
title
|
|
1969
2141
|
] }),
|
|
1970
|
-
!!summary && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
2142
|
+
!!summary && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles8.summary, { color: theme.textSecondary }], numberOfLines: 1, children: summary })
|
|
1971
2143
|
] }),
|
|
1972
2144
|
button("\u2191", () => group.move(index, -1), `Move ${title} up`, index === 0),
|
|
1973
2145
|
button("\u2193", () => group.move(index, 1), `Move ${title} down`, last),
|
|
1974
2146
|
button("\u29C9", onDuplicate, `Duplicate ${title}`, !group.canAdd),
|
|
1975
2147
|
button("\u2715", () => group.remove(index), `Remove ${title}`)
|
|
1976
2148
|
] }),
|
|
1977
|
-
!collapsed && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InputFormContext.Provider, { value: scoped, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style:
|
|
1978
|
-
const problem = _optionalChain([scoped, 'access',
|
|
1979
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [
|
|
1980
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
1981
|
-
!!f.title && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
1982
|
-
!!problem && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
2149
|
+
!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) => {
|
|
2150
|
+
const problem = _optionalChain([scoped, 'access', _74 => _74.problem, 'optionalCall', _75 => _75(f.options.metric)]);
|
|
2151
|
+
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: [
|
|
2152
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles8.fieldHeader, children: [
|
|
2153
|
+
!!f.title && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles8.fieldTitle, { color: theme.textSecondary }], numberOfLines: 1, children: f.title }),
|
|
2154
|
+
!!problem && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles8.problem, { color: theme.danger }], numberOfLines: 1, accessibilityRole: "alert", children: problem })
|
|
1983
2155
|
] }),
|
|
1984
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style:
|
|
2156
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles8.fieldBody, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InputPanelBody, { panel: f }) })
|
|
1985
2157
|
] }, f.options.metric);
|
|
1986
2158
|
}) }) })
|
|
1987
2159
|
]
|
|
1988
2160
|
}
|
|
1989
2161
|
);
|
|
1990
2162
|
}
|
|
1991
|
-
var
|
|
2163
|
+
var styles8 = _reactnative.StyleSheet.create({
|
|
1992
2164
|
fill: { flex: 1 },
|
|
1993
2165
|
list: { gap: 8, paddingBottom: 4 },
|
|
1994
2166
|
item: { borderWidth: 1, borderRadius: 8, padding: 8, gap: 6 },
|
|
@@ -2022,17 +2194,17 @@ function StatPanel({ panel, frames }) {
|
|
|
2022
2194
|
const theme = useDashTheme();
|
|
2023
2195
|
const values = _react.useMemo.call(void 0, () => reducedValues(panel, frames, theme.scheme), [panel, frames, theme.scheme]);
|
|
2024
2196
|
if (!values.length) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, {});
|
|
2025
|
-
const horizontal = _optionalChain([panel, 'access',
|
|
2026
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
2197
|
+
const horizontal = _optionalChain([panel, 'access', _76 => _76.options, 'optionalAccess', _77 => _77.orientation]) === "horizontal";
|
|
2198
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles9.grid, { flexDirection: horizontal ? "column" : "row" }], children: values.map((v) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StatTile, { v, showName: values.length > 1, panel }, v.key)) });
|
|
2027
2199
|
}
|
|
2028
2200
|
function StatTile({ v, showName, panel }) {
|
|
2029
2201
|
const theme = useDashTheme();
|
|
2030
2202
|
const [size, onLayout] = useLayout();
|
|
2031
|
-
const colorMode = _nullishCoalesce(_optionalChain([panel, 'access',
|
|
2032
|
-
const graph = (_nullishCoalesce(_optionalChain([panel, 'access',
|
|
2203
|
+
const colorMode = _nullishCoalesce(_optionalChain([panel, 'access', _78 => _78.options, 'optionalAccess', _79 => _79.colorMode]), () => ( "value"));
|
|
2204
|
+
const graph = (_nullishCoalesce(_optionalChain([panel, 'access', _80 => _80.options, 'optionalAccess', _81 => _81.graphMode]), () => ( "area"))) === "area" && v.sparkline.filter((x) => x != null).length > 1;
|
|
2033
2205
|
const fontSize = Math.max(18, Math.min(56, size.height * (graph ? 0.4 : 0.5), size.width / 4.5));
|
|
2034
2206
|
const { resolve, openLinks } = usePanelLinks(panel);
|
|
2035
|
-
const hasLinks = !!_optionalChain([v, 'access',
|
|
2207
|
+
const hasLinks = !!_optionalChain([v, 'access', _82 => _82.config, 'access', _83 => _83.links, 'optionalAccess', _84 => _84.length]);
|
|
2036
2208
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2037
2209
|
_reactnative.Pressable,
|
|
2038
2210
|
{
|
|
@@ -2041,17 +2213,17 @@ function StatTile({ v, showName, panel }) {
|
|
|
2041
2213
|
onPress: () => openLinks(valueLinks(panel, v, resolve), v.name),
|
|
2042
2214
|
accessibilityRole: hasLinks ? "link" : void 0,
|
|
2043
2215
|
style: ({ pressed }) => [
|
|
2044
|
-
|
|
2216
|
+
styles9.tile,
|
|
2045
2217
|
// With a sparkline, the number sits in the top half so the line runs beneath it.
|
|
2046
2218
|
graph && { justifyContent: "flex-start", paddingTop: 4 },
|
|
2047
2219
|
colorMode === "background" && { backgroundColor: withAlpha(v.stateColor, 0.14) },
|
|
2048
2220
|
pressed && { opacity: 0.7 }
|
|
2049
2221
|
],
|
|
2050
2222
|
children: [
|
|
2051
|
-
colorMode !== "none" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
2223
|
+
colorMode !== "none" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles9.accent, { backgroundColor: v.stateColor }] }),
|
|
2052
2224
|
graph && size.width > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Sparkline, { values: v.sparkline, width: size.width, height: size.height * 0.4, color: v.stateColor }),
|
|
2053
|
-
showName && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
2054
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
2225
|
+
showName && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles9.name, { color: theme.textSecondary }], numberOfLines: 1, children: v.name }),
|
|
2226
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles9.value, { color: theme.text, fontSize }], numberOfLines: 1, adjustsFontSizeToFit: true, children: v.text })
|
|
2055
2227
|
]
|
|
2056
2228
|
}
|
|
2057
2229
|
);
|
|
@@ -2066,7 +2238,7 @@ function Sparkline({ values, width, height, color }) {
|
|
|
2066
2238
|
values.forEach((v, i) => {
|
|
2067
2239
|
if (v != null) line += `${line ? "L" : "M"}${x(i)},${y(v)}`;
|
|
2068
2240
|
});
|
|
2069
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnativesvg2.default, { width, height, style:
|
|
2241
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnativesvg2.default, { width, height, style: styles9.spark, children: [
|
|
2070
2242
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Path, { d: `${line}L${width},${height}L0,${height}Z`, fill: color, opacity: 0.1 }),
|
|
2071
2243
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Path, { d: line, stroke: color, strokeWidth: 2, fill: "none", strokeLinejoin: "round" })
|
|
2072
2244
|
] });
|
|
@@ -2075,7 +2247,7 @@ function withAlpha(hex, alpha) {
|
|
|
2075
2247
|
if (!/^#[0-9a-f]{6}$/i.test(hex)) return hex;
|
|
2076
2248
|
return `${hex}${Math.round(alpha * 255).toString(16).padStart(2, "0")}`;
|
|
2077
2249
|
}
|
|
2078
|
-
var
|
|
2250
|
+
var styles9 = _reactnative.StyleSheet.create({
|
|
2079
2251
|
grid: { flex: 1, gap: 8 },
|
|
2080
2252
|
tile: { flex: 1, justifyContent: "center", paddingLeft: 12, borderRadius: 6, overflow: "hidden" },
|
|
2081
2253
|
accent: { position: "absolute", left: 0, top: 6, bottom: 6, width: 3, borderRadius: 2 },
|
|
@@ -2091,13 +2263,13 @@ function GaugePanel({ panel, frames }) {
|
|
|
2091
2263
|
const theme = useDashTheme();
|
|
2092
2264
|
const values = _react.useMemo.call(void 0, () => reducedValues(panel, frames, theme.scheme), [panel, frames, theme.scheme]);
|
|
2093
2265
|
if (!values.length) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, {});
|
|
2094
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style:
|
|
2266
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles10.row, children: values.map((v) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Gauge, { v, showName: values.length > 1, panel }, v.key)) });
|
|
2095
2267
|
}
|
|
2096
2268
|
function Gauge({ v, showName, panel }) {
|
|
2097
2269
|
const theme = useDashTheme();
|
|
2098
2270
|
const [size, onLayout] = useLayout();
|
|
2099
2271
|
const { resolve, openLinks } = usePanelLinks(panel);
|
|
2100
|
-
const hasLinks = !!_optionalChain([v, 'access',
|
|
2272
|
+
const hasLinks = !!_optionalChain([v, 'access', _85 => _85.config, 'access', _86 => _86.links, 'optionalAccess', _87 => _87.length]);
|
|
2101
2273
|
const min = _nullishCoalesce(v.config.min, () => ( 0));
|
|
2102
2274
|
const max = _nullishCoalesce(v.config.max, () => ( 100));
|
|
2103
2275
|
const frac = v.value == null ? 0 : Math.min(1, Math.max(0, (v.value - min) / (max - min || 1)));
|
|
@@ -2109,7 +2281,7 @@ function Gauge({ v, showName, panel }) {
|
|
|
2109
2281
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2110
2282
|
_reactnative.Pressable,
|
|
2111
2283
|
{
|
|
2112
|
-
style: ({ pressed }) => [
|
|
2284
|
+
style: ({ pressed }) => [styles10.fill, pressed && { opacity: 0.7 }],
|
|
2113
2285
|
onLayout,
|
|
2114
2286
|
disabled: !hasLinks,
|
|
2115
2287
|
onPress: () => openLinks(valueLinks(panel, v, resolve), v.name),
|
|
@@ -2119,9 +2291,9 @@ function Gauge({ v, showName, panel }) {
|
|
|
2119
2291
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Path, { d: arc(cx, cy, r, 0, 1), stroke: withAlpha(v.stateColor, 0.18), strokeWidth: stroke, fill: "none", strokeLinecap: "round" }),
|
|
2120
2292
|
frac > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Path, { d: arc(cx, cy, r, 0, frac), stroke: v.stateColor, strokeWidth: stroke, fill: "none", strokeLinecap: "round" })
|
|
2121
2293
|
] }),
|
|
2122
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [_reactnative.StyleSheet.absoluteFill,
|
|
2123
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
2124
|
-
showName && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
2294
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [_reactnative.StyleSheet.absoluteFill, styles10.center, { top: d * 0.12 }], pointerEvents: "none", children: [
|
|
2295
|
+
/* @__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 }),
|
|
2296
|
+
showName && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles10.name, { color: theme.textSecondary }], numberOfLines: 1, children: v.name })
|
|
2125
2297
|
] })
|
|
2126
2298
|
]
|
|
2127
2299
|
}
|
|
@@ -2140,32 +2312,32 @@ function BarGaugePanel({ panel, frames }) {
|
|
|
2140
2312
|
const values = _react.useMemo.call(void 0, () => reducedValues(panel, frames, theme.scheme), [panel, frames, theme.scheme]);
|
|
2141
2313
|
const { resolve, openLinks } = usePanelLinks(panel);
|
|
2142
2314
|
if (!values.length) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, {});
|
|
2143
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style:
|
|
2315
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles10.bars, children: values.map((v) => {
|
|
2144
2316
|
const min = _nullishCoalesce(v.config.min, () => ( 0));
|
|
2145
2317
|
const max = _nullishCoalesce(v.config.max, () => ( Math.max(...values.map((o) => _nullishCoalesce(o.value, () => ( 0))), 1)));
|
|
2146
2318
|
const frac = v.value == null ? 0 : Math.min(1, Math.max(0, (v.value - min) / (max - min || 1)));
|
|
2147
|
-
const color = v.config.thresholds || _optionalChain([v, 'access',
|
|
2148
|
-
const hasLinks = !!_optionalChain([v, 'access',
|
|
2319
|
+
const color = v.config.thresholds || _optionalChain([v, 'access', _88 => _88.mapped, 'optionalAccess', _89 => _89.color]) ? v.stateColor : _chunkXWSPLZNCjs.resolveColor.call(void 0, _optionalChain([v, 'access', _90 => _90.config, 'access', _91 => _91.color, 'optionalAccess', _92 => _92.fixedColor]), v.color);
|
|
2320
|
+
const hasLinks = !!_optionalChain([v, 'access', _93 => _93.config, 'access', _94 => _94.links, 'optionalAccess', _95 => _95.length]);
|
|
2149
2321
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2150
2322
|
_reactnative.Pressable,
|
|
2151
2323
|
{
|
|
2152
|
-
style: ({ pressed }) => [
|
|
2324
|
+
style: ({ pressed }) => [styles10.barRow, pressed && { opacity: 0.7 }],
|
|
2153
2325
|
disabled: !hasLinks,
|
|
2154
2326
|
onPress: () => openLinks(valueLinks(panel, v, resolve), v.name),
|
|
2155
2327
|
accessibilityRole: hasLinks ? "link" : void 0,
|
|
2156
2328
|
children: [
|
|
2157
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
2158
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
2159
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
2329
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles10.barLabels, children: [
|
|
2330
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles10.name, { color: theme.textSecondary }], numberOfLines: 1, children: v.name }),
|
|
2331
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles10.barValue, { color: theme.text }], children: v.text })
|
|
2160
2332
|
] }),
|
|
2161
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
2333
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles10.track, { backgroundColor: withAlpha(color, 0.18) }], children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles10.meter, { width: `${frac * 100}%`, backgroundColor: color }] }) })
|
|
2162
2334
|
]
|
|
2163
2335
|
},
|
|
2164
2336
|
v.key
|
|
2165
2337
|
);
|
|
2166
2338
|
}) });
|
|
2167
2339
|
}
|
|
2168
|
-
var
|
|
2340
|
+
var styles10 = _reactnative.StyleSheet.create({
|
|
2169
2341
|
fill: { flex: 1 },
|
|
2170
2342
|
row: { flex: 1, flexDirection: "row", gap: 8 },
|
|
2171
2343
|
center: { alignItems: "center", justifyContent: "center" },
|
|
@@ -2208,8 +2380,8 @@ var TILE_LAYERS = /* @__PURE__ */ new Set(["default", "carto", "esri-xyz", "xyz"
|
|
|
2208
2380
|
var fillTemplate = (template, z, x, y) => template.replace("{z}", String(z)).replace("{x}", String(x)).replace("{-y}", String(2 ** z - 1 - y)).replace("{y}", String(y));
|
|
2209
2381
|
var stripTags = (html) => html.replace(/<[^>]*>/g, "").replace(/©/g, "\xA9").trim();
|
|
2210
2382
|
function tileSource(layer, scheme, retina = false) {
|
|
2211
|
-
const config = _nullishCoalesce(_optionalChain([layer, 'optionalAccess',
|
|
2212
|
-
switch (_optionalChain([layer, 'optionalAccess',
|
|
2383
|
+
const config = _nullishCoalesce(_optionalChain([layer, 'optionalAccess', _96 => _96.config]), () => ( {}));
|
|
2384
|
+
switch (_optionalChain([layer, 'optionalAccess', _97 => _97.type])) {
|
|
2213
2385
|
case "osm-standard":
|
|
2214
2386
|
return { url: (z, x, y) => `https://tile.openstreetmap.org/${z}/${x}/${y}.png`, maxZoom: 19, attribution: "\xA9 OpenStreetMap contributors" };
|
|
2215
2387
|
case "esri-xyz": {
|
|
@@ -2270,11 +2442,11 @@ var REGIONS = {
|
|
|
2270
2442
|
oceania: { lat: -10, lon: -140, zoom: 3 }
|
|
2271
2443
|
};
|
|
2272
2444
|
function zoomLimits(panel) {
|
|
2273
|
-
const v = _nullishCoalesce(_optionalChain([panel, 'access',
|
|
2445
|
+
const v = _nullishCoalesce(_optionalChain([panel, 'access', _98 => _98.options, 'optionalAccess', _99 => _99.view]), () => ( {}));
|
|
2274
2446
|
return [_nullishCoalesce(v.minZoom, () => ( 0)), _nullishCoalesce(v.maxZoom, () => ( MAX_ZOOM))];
|
|
2275
2447
|
}
|
|
2276
2448
|
function initialView(panel, layers, width, height) {
|
|
2277
|
-
const v = _nullishCoalesce(_optionalChain([panel, 'access',
|
|
2449
|
+
const v = _nullishCoalesce(_optionalChain([panel, 'access', _100 => _100.options, 'optionalAccess', _101 => _101.view]), () => ( {}));
|
|
2278
2450
|
const [minZoom, maxZoom] = zoomLimits(panel);
|
|
2279
2451
|
const limit = (view) => ({ ...view, zoom: clamp(view.zoom, minZoom, maxZoom) });
|
|
2280
2452
|
if (v.id === "coords") return limit({ lat: _nullishCoalesce(v.lat, () => ( 0)), lon: _nullishCoalesce(v.lon, () => ( 0)), zoom: _nullishCoalesce(v.zoom, () => ( 1)) });
|
|
@@ -2307,7 +2479,7 @@ function geomapLayers(panel, frames, scheme, retina = false, gazetteers = {}) {
|
|
|
2307
2479
|
const o = _nullishCoalesce(panel.options, () => ( {}));
|
|
2308
2480
|
const out = [];
|
|
2309
2481
|
const basemap = o.basemap;
|
|
2310
|
-
out.push({ type: "tiles", key: "basemap", name: _nullishCoalesce(_optionalChain([basemap, 'optionalAccess',
|
|
2482
|
+
out.push({ type: "tiles", key: "basemap", name: _nullishCoalesce(_optionalChain([basemap, 'optionalAccess', _102 => _102.name]), () => ( "Basemap")), opacity: _nullishCoalesce(_optionalChain([basemap, 'optionalAccess', _103 => _103.opacity]), () => ( 1)), source: tileSource(basemap, scheme, retina) });
|
|
2311
2483
|
const multiple = frames.length > 1;
|
|
2312
2484
|
(_nullishCoalesce(o.layers, () => ( DEFAULT_LAYERS))).forEach((layer, li) => {
|
|
2313
2485
|
const key = `${li}/${layer.type}`;
|
|
@@ -2320,12 +2492,12 @@ function geomapLayers(panel, frames, scheme, retina = false, gazetteers = {}) {
|
|
|
2320
2492
|
}
|
|
2321
2493
|
if (!isDataLayer(layer.type)) return;
|
|
2322
2494
|
const filter = layer.filterData;
|
|
2323
|
-
const chosen = _optionalChain([filter, 'optionalAccess',
|
|
2495
|
+
const chosen = _optionalChain([filter, 'optionalAccess', _104 => _104.id]) === "byRefId" && filter.options ? frames.filter((f) => f.refId === filter.options) : frames;
|
|
2324
2496
|
const style = _nullishCoalesce(config.style, () => ( {}));
|
|
2325
2497
|
const color = _nullishCoalesce(style.color, () => ( {}));
|
|
2326
2498
|
const size = _nullishCoalesce(style.size, () => ( {}));
|
|
2327
2499
|
const text = style.text;
|
|
2328
|
-
const fixedColor =
|
|
2500
|
+
const fixedColor = _chunkXWSPLZNCjs.resolveColor.call(void 0, _nullishCoalesce(color.fixed, () => ( "dark-green")), "#37872D");
|
|
2329
2501
|
const heat = layer.type === "heatmap";
|
|
2330
2502
|
const weight = _nullishCoalesce(config.weight, () => ( {}));
|
|
2331
2503
|
const legend = [];
|
|
@@ -2337,14 +2509,14 @@ function geomapLayers(panel, frames, scheme, retina = false, gazetteers = {}) {
|
|
|
2337
2509
|
let { xs, ys } = located;
|
|
2338
2510
|
if (layer.type === "lastPointTracker" && rows.length) [rows, xs, ys] = [rows.slice(-1), xs.slice(-1), ys.slice(-1)];
|
|
2339
2511
|
const find = (field) => field ? fieldByName(frame, field, multiple) : void 0;
|
|
2340
|
-
const configOf = (f) =>
|
|
2512
|
+
const configOf = (f) => _chunkXWSPLZNCjs.resolveFieldConfig.call(void 0, panel, f, frame, _chunkXWSPLZNCjs.fieldDisplayName.call(void 0, f, frame, multiple));
|
|
2341
2513
|
let colors = rows.map(() => fixedColor);
|
|
2342
2514
|
const colorField = !heat ? find(color.field) : void 0;
|
|
2343
2515
|
if (colorField) {
|
|
2344
2516
|
const cConfig = configOf(colorField);
|
|
2345
2517
|
const values = rows.map((i) => num(colorField.values[i]));
|
|
2346
2518
|
const extent = range(values);
|
|
2347
|
-
colors = values.map((v) =>
|
|
2519
|
+
colors = values.map((v) => _chunkXWSPLZNCjs.valueColor.call(void 0, v, cConfig, fixedColor, extent));
|
|
2348
2520
|
if (showsLegend(layer) && legend.length === 0) legend.push(...thresholdLegend(`${key}/${frames.indexOf(frame)}`, cConfig, fixedColor));
|
|
2349
2521
|
}
|
|
2350
2522
|
const dim = heat ? weight : size;
|
|
@@ -2380,7 +2552,7 @@ function geomapLayers(panel, frames, scheme, retina = false, gazetteers = {}) {
|
|
|
2380
2552
|
name,
|
|
2381
2553
|
opacity,
|
|
2382
2554
|
points,
|
|
2383
|
-
symbol: markerSymbol(_optionalChain([style, 'access',
|
|
2555
|
+
symbol: markerSymbol(_optionalChain([style, 'access', _105 => _105.symbol, 'optionalAccess', _106 => _106.fixed])),
|
|
2384
2556
|
fillOpacity: _nullishCoalesce(style.opacity, () => ( 0.4)),
|
|
2385
2557
|
fontSize: _nullishCoalesce(textConfig.fontSize, () => ( 12)),
|
|
2386
2558
|
labelOffset: [_nullishCoalesce(textConfig.offsetX, () => ( 0)), _nullishCoalesce(textConfig.offsetY, () => ( 0))],
|
|
@@ -2391,37 +2563,37 @@ function geomapLayers(panel, frames, scheme, retina = false, gazetteers = {}) {
|
|
|
2391
2563
|
});
|
|
2392
2564
|
return out;
|
|
2393
2565
|
}
|
|
2394
|
-
var showsLegend = (layer) => _optionalChain([layer, 'access',
|
|
2566
|
+
var showsLegend = (layer) => _optionalChain([layer, 'access', _107 => _107.config, 'optionalAccess', _108 => _108.showLegend]) !== false;
|
|
2395
2567
|
function markerSymbol(path) {
|
|
2396
2568
|
const name = typeof path === "string" ? path.replace(/^.*\//, "").replace(/\.svg$/, "") : "";
|
|
2397
2569
|
return name === "square" || name === "triangle" || name === "star" || name === "cross" || name === "x" ? name : "circle";
|
|
2398
2570
|
}
|
|
2399
2571
|
function thresholdLegend(key, config, fallback) {
|
|
2400
|
-
if (_optionalChain([config, 'access',
|
|
2401
|
-
const steps = _nullishCoalesce(_optionalChain([config, 'access',
|
|
2572
|
+
if (_optionalChain([config, 'access', _109 => _109.color, 'optionalAccess', _110 => _110.mode]) && config.color.mode !== "thresholds") return [];
|
|
2573
|
+
const steps = _nullishCoalesce(_optionalChain([config, 'access', _111 => _111.thresholds, 'optionalAccess', _112 => _112.steps]), () => ( []));
|
|
2402
2574
|
if (steps.length < 2) return [];
|
|
2403
2575
|
return steps.map((s, i) => ({
|
|
2404
2576
|
key: `${key}/${i}`,
|
|
2405
|
-
name: s.value == null ? `< ${
|
|
2406
|
-
color:
|
|
2577
|
+
name: s.value == null ? `< ${_chunkXWSPLZNCjs.formatValue.call(void 0, steps[i + 1].value, config)}` : `${_chunkXWSPLZNCjs.formatValue.call(void 0, s.value, config)}+`,
|
|
2578
|
+
color: _chunkXWSPLZNCjs.resolveColor.call(void 0, s.color, fallback)
|
|
2407
2579
|
}));
|
|
2408
2580
|
}
|
|
2409
2581
|
var isDataLayer = (type) => type === "markers" || type === "heatmap" || type === "route" || type === "lastPointTracker";
|
|
2410
2582
|
var lookupField = (frame) => frame.fields.find((f) => f.name.toLowerCase() === "lookup");
|
|
2411
2583
|
function gazetteerPaths(panel, frames) {
|
|
2412
2584
|
const paths = /* @__PURE__ */ new Set();
|
|
2413
|
-
for (const layer of _nullishCoalesce(_optionalChain([panel, 'access',
|
|
2585
|
+
for (const layer of _nullishCoalesce(_optionalChain([panel, 'access', _113 => _113.options, 'optionalAccess', _114 => _114.layers]), () => ( DEFAULT_LAYERS))) {
|
|
2414
2586
|
if (!isDataLayer(layer.type)) continue;
|
|
2415
|
-
const mode = _nullishCoalesce(_optionalChain([layer, 'access',
|
|
2416
|
-
if (mode === "lookup") paths.add(_optionalChain([layer, 'access',
|
|
2417
|
-
else if (mode === "auto" && frames.some(lookupField)) paths.add(
|
|
2587
|
+
const mode = _nullishCoalesce(_optionalChain([layer, 'access', _115 => _115.location, 'optionalAccess', _116 => _116.mode]), () => ( "auto"));
|
|
2588
|
+
if (mode === "lookup") paths.add(_optionalChain([layer, 'access', _117 => _117.location, 'optionalAccess', _118 => _118.gazetteer]) || _chunkXWSPLZNCjs.DEFAULT_GAZETTEER);
|
|
2589
|
+
else if (mode === "auto" && frames.some(lookupField)) paths.add(_chunkXWSPLZNCjs.DEFAULT_GAZETTEER);
|
|
2418
2590
|
}
|
|
2419
2591
|
return [...paths];
|
|
2420
2592
|
}
|
|
2421
2593
|
var LAT_NAMES = ["lat", "latitude"];
|
|
2422
2594
|
var LON_NAMES = ["lon", "lng", "long", "longitude"];
|
|
2423
2595
|
function fieldByName(frame, name, multiple) {
|
|
2424
|
-
return _nullishCoalesce(frame.fields.find((f) => f.name === name), () => ( frame.fields.find((f) =>
|
|
2596
|
+
return _nullishCoalesce(frame.fields.find((f) => f.name === name), () => ( frame.fields.find((f) => _chunkXWSPLZNCjs.fieldDisplayName.call(void 0, f, frame, multiple) === name)));
|
|
2425
2597
|
}
|
|
2426
2598
|
function locate2(frame, location = {}, gazetteers = {}) {
|
|
2427
2599
|
const mode = _nullishCoalesce(location.mode, () => ( "auto"));
|
|
@@ -2440,10 +2612,10 @@ function locate2(frame, location = {}, gazetteers = {}) {
|
|
|
2440
2612
|
lat = named(LAT_NAMES);
|
|
2441
2613
|
lon = named(LON_NAMES);
|
|
2442
2614
|
if (!lat || !lon) hash = named(["geohash"]);
|
|
2443
|
-
if ((!lat || !lon) && !hash) [lookup, gazetteer] = [lookupField(frame), gazetteers[
|
|
2615
|
+
if ((!lat || !lon) && !hash) [lookup, gazetteer] = [lookupField(frame), gazetteers[_chunkXWSPLZNCjs.DEFAULT_GAZETTEER]];
|
|
2444
2616
|
} else if (mode === "lookup") {
|
|
2445
2617
|
lookup = location.lookup ? fieldByName(frame, location.lookup, false) : lookupField(frame);
|
|
2446
|
-
gazetteer = gazetteers[location.gazetteer ||
|
|
2618
|
+
gazetteer = gazetteers[location.gazetteer || _chunkXWSPLZNCjs.DEFAULT_GAZETTEER];
|
|
2447
2619
|
}
|
|
2448
2620
|
const rows = [];
|
|
2449
2621
|
const xs = [];
|
|
@@ -2492,8 +2664,8 @@ function decodeGeohash(hash) {
|
|
|
2492
2664
|
}
|
|
2493
2665
|
function cellText(field, v, config) {
|
|
2494
2666
|
if (v == null) return "";
|
|
2495
|
-
if (field.type === "number") return
|
|
2496
|
-
if (field.type === "time") return new Date(
|
|
2667
|
+
if (field.type === "number") return _chunkXWSPLZNCjs.formatDisplay.call(void 0, Number(v), config);
|
|
2668
|
+
if (field.type === "time") return new Date(_chunkXWSPLZNCjs.toMillis.call(void 0, v)).toLocaleString();
|
|
2497
2669
|
return String(v);
|
|
2498
2670
|
}
|
|
2499
2671
|
function num(v) {
|
|
@@ -2633,13 +2805,13 @@ function GeomapPanel({ panel, frames }) {
|
|
|
2633
2805
|
])
|
|
2634
2806
|
);
|
|
2635
2807
|
}, [layers, view, size.width, size.height]);
|
|
2636
|
-
const tooltips = _optionalChain([panel, 'access',
|
|
2808
|
+
const tooltips = _optionalChain([panel, 'access', _119 => _119.options, 'optionalAccess', _120 => _120.tooltip, 'optionalAccess', _121 => _121.mode]) !== "none";
|
|
2637
2809
|
const pick = (x, y) => {
|
|
2638
2810
|
let best = null;
|
|
2639
2811
|
let bestD = HIT_PX * HIT_PX;
|
|
2640
2812
|
for (const l of layers) {
|
|
2641
2813
|
if (l.type === "tiles" || l.type === "heatmap" || !l.tooltip) continue;
|
|
2642
|
-
_optionalChain([screen, 'access',
|
|
2814
|
+
_optionalChain([screen, 'access', _122 => _122.get, 'call', _123 => _123(l.key), 'optionalAccess', _124 => _124.forEach, 'call', _125 => _125(({ px, py }, group) => {
|
|
2643
2815
|
for (let i = 0; i < px.length; i++) {
|
|
2644
2816
|
const d = (px[i] - x) ** 2 + (py[i] - y) ** 2;
|
|
2645
2817
|
if (d <= bestD) {
|
|
@@ -2689,12 +2861,12 @@ function GeomapPanel({ panel, frames }) {
|
|
|
2689
2861
|
}
|
|
2690
2862
|
};
|
|
2691
2863
|
const shown = picked && resolvePicked(layers, screen, picked);
|
|
2692
|
-
const controls = _nullishCoalesce(_optionalChain([panel, 'access',
|
|
2864
|
+
const controls = _nullishCoalesce(_optionalChain([panel, 'access', _126 => _126.options, 'optionalAccess', _127 => _127.controls]), () => ( {}));
|
|
2693
2865
|
const attribution = [...new Set(layers.flatMap((l) => l.type === "tiles" && l.source.attribution ? [l.source.attribution] : []))].join(" ");
|
|
2694
2866
|
const legend = layers.flatMap((l) => l.type === "markers" || l.type === "route" ? l.legend : []);
|
|
2695
2867
|
const ready = size.width > 0 && size.height > 0;
|
|
2696
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
2697
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [
|
|
2868
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles11.fill, children: [
|
|
2869
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [styles11.fill, styles11.map, { backgroundColor: theme.grid }], onLayout, ...responder, children: [
|
|
2698
2870
|
ready && // Nothing inside takes touches, so locationX/Y are always relative to the map.
|
|
2699
2871
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { pointerEvents: "none", style: _reactnative.StyleSheet.absoluteFill, children: [
|
|
2700
2872
|
layers.map(
|
|
@@ -2722,13 +2894,13 @@ function GeomapPanel({ panel, frames }) {
|
|
|
2722
2894
|
onOpenLink: (l) => links.openLinks([l])
|
|
2723
2895
|
}
|
|
2724
2896
|
),
|
|
2725
|
-
controls.showZoom !== false && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
2897
|
+
controls.showZoom !== false && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles11.zoom, children: [
|
|
2726
2898
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, MapButton, { label: "+", onPress: () => zoomTo(view, Math.round(view.zoom) + 1) }),
|
|
2727
2899
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, MapButton, { label: "\u2212", onPress: () => zoomTo(view, Math.round(view.zoom) - 1) }),
|
|
2728
2900
|
moved && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MapButton, { label: "\u27F2", onPress: () => setMoved(null) })
|
|
2729
2901
|
] }),
|
|
2730
|
-
error ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { pointerEvents: "none", style: [
|
|
2731
|
-
controls.showAttribution !== false && attribution ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { pointerEvents: "none", style: [
|
|
2902
|
+
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,
|
|
2903
|
+
controls.showAttribution !== false && attribution ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { pointerEvents: "none", style: [styles11.attribution, { color: theme.textSecondary, backgroundColor: theme.surface }], numberOfLines: 1, children: attribution }) : null
|
|
2732
2904
|
] }),
|
|
2733
2905
|
legend.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Legend, { items: legend })
|
|
2734
2906
|
] });
|
|
@@ -2743,17 +2915,17 @@ function useGazetteers(panel, frames) {
|
|
|
2743
2915
|
let live = true;
|
|
2744
2916
|
let ds;
|
|
2745
2917
|
try {
|
|
2746
|
-
ds = _optionalChain([resolve, 'optionalCall',
|
|
2747
|
-
} catch (
|
|
2918
|
+
ds = _optionalChain([resolve, 'optionalCall', _128 => _128(_chunkXWSPLZNCjs.normalizeRef.call(void 0, panel.datasource))]);
|
|
2919
|
+
} catch (e6) {
|
|
2748
2920
|
}
|
|
2749
2921
|
const paths = key.split("\n");
|
|
2750
|
-
Promise.allSettled(paths.map((p) =>
|
|
2922
|
+
Promise.allSettled(paths.map((p) => _chunkXWSPLZNCjs.loadGazetteer.call(void 0, p, ds))).then((results) => {
|
|
2751
2923
|
if (!live) return;
|
|
2752
2924
|
const gazetteers = {};
|
|
2753
2925
|
const errors = [];
|
|
2754
2926
|
results.forEach((r, i) => {
|
|
2755
2927
|
if (r.status === "fulfilled") gazetteers[paths[i]] = r.value;
|
|
2756
|
-
else errors.push(`Couldn't load ${paths[i]}: ${_nullishCoalesce(_optionalChain([r, 'access',
|
|
2928
|
+
else errors.push(`Couldn't load ${paths[i]}: ${_nullishCoalesce(_optionalChain([r, 'access', _129 => _129.reason, 'optionalAccess', _130 => _130.message]), () => ( r.reason))}`);
|
|
2757
2929
|
});
|
|
2758
2930
|
setState({ key, gazetteers, error: errors.join("\n") || void 0 });
|
|
2759
2931
|
});
|
|
@@ -2765,7 +2937,7 @@ function useGazetteers(panel, frames) {
|
|
|
2765
2937
|
}
|
|
2766
2938
|
function MapButton({ label, onPress }) {
|
|
2767
2939
|
const theme = useDashTheme();
|
|
2768
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Pressable, { onPress, hitSlop: 4, style: [
|
|
2940
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Pressable, { onPress, hitSlop: 4, style: [styles11.button, { backgroundColor: theme.surface, borderColor: theme.border }], children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles11.buttonText, { color: theme.text }], children: label }) });
|
|
2769
2941
|
}
|
|
2770
2942
|
function Tiles({ layer, view, width, height }) {
|
|
2771
2943
|
const tiles = visibleTiles(layer.source, view, width, height);
|
|
@@ -2805,7 +2977,7 @@ function markerPaths(layer, screen, width, height, textColor) {
|
|
|
2805
2977
|
if (px[i] < -r || px[i] > width + r || py[i] < -r || py[i] > height + r) continue;
|
|
2806
2978
|
const parts = _nullishCoalesce(byColor.get(p.colors[i]), () => ( byColor.set(p.colors[i], []).get(p.colors[i])));
|
|
2807
2979
|
parts.push(symbolPath(layer.symbol, px[i], py[i], r));
|
|
2808
|
-
const label = _optionalChain([p, 'access',
|
|
2980
|
+
const label = _optionalChain([p, 'access', _131 => _131.labels, 'optionalAccess', _132 => _132[i]]);
|
|
2809
2981
|
if (label && labels.length < MAX_LABELS)
|
|
2810
2982
|
labels.push(
|
|
2811
2983
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2844,7 +3016,7 @@ function resolvePicked(layers, screen, picked) {
|
|
|
2844
3016
|
const layer = layers.find((l) => l.key === picked.layer);
|
|
2845
3017
|
if (!layer || layer.type !== "markers" && layer.type !== "route") return null;
|
|
2846
3018
|
const p = layer.points[picked.group];
|
|
2847
|
-
const s = _optionalChain([screen, 'access',
|
|
3019
|
+
const s = _optionalChain([screen, 'access', _133 => _133.get, 'call', _134 => _134(layer.key), 'optionalAccess', _135 => _135[picked.group]]);
|
|
2848
3020
|
if (!p || !s || picked.index >= p.rows.length) return null;
|
|
2849
3021
|
return {
|
|
2850
3022
|
layer,
|
|
@@ -2856,7 +3028,7 @@ function resolvePicked(layers, screen, picked) {
|
|
|
2856
3028
|
py: s.py[picked.index]
|
|
2857
3029
|
};
|
|
2858
3030
|
}
|
|
2859
|
-
var
|
|
3031
|
+
var styles11 = _reactnative.StyleSheet.create({
|
|
2860
3032
|
fill: { flex: 1 },
|
|
2861
3033
|
map: { overflow: "hidden", borderRadius: 4 },
|
|
2862
3034
|
zoom: { position: "absolute", top: 6, left: 6, gap: 4 },
|
|
@@ -2882,7 +3054,7 @@ var styles10 = _reactnative.StyleSheet.create({
|
|
|
2882
3054
|
var DEFAULT_WIDTH = 120;
|
|
2883
3055
|
function cellType(config) {
|
|
2884
3056
|
const custom = _nullishCoalesce(config.custom, () => ( {}));
|
|
2885
|
-
const type = _nullishCoalesce(_optionalChain([custom, 'access',
|
|
3057
|
+
const type = _nullishCoalesce(_optionalChain([custom, 'access', _136 => _136.cellOptions, 'optionalAccess', _137 => _137.type]), () => ( custom.displayMode));
|
|
2886
3058
|
if (type === "color-text" || type === "color-background" || type === "gauge") return type;
|
|
2887
3059
|
if (type === "color-background-solid") return "color-background";
|
|
2888
3060
|
if (type === "gradient-gauge" || type === "lcd-gauge" || type === "basic") return "gauge";
|
|
@@ -2890,10 +3062,10 @@ function cellType(config) {
|
|
|
2890
3062
|
}
|
|
2891
3063
|
function tableColumns(panel, frame, multipleFrames = false) {
|
|
2892
3064
|
return frame.fields.flatMap((field, i) => {
|
|
2893
|
-
const raw =
|
|
2894
|
-
const config =
|
|
3065
|
+
const raw = _chunkXWSPLZNCjs.fieldDisplayName.call(void 0, field, frame, multipleFrames);
|
|
3066
|
+
const config = _chunkXWSPLZNCjs.resolveFieldConfig.call(void 0, panel, field, frame, raw);
|
|
2895
3067
|
const custom = _nullishCoalesce(config.custom, () => ( {}));
|
|
2896
|
-
if (custom.hidden || _optionalChain([custom, 'access',
|
|
3068
|
+
if (custom.hidden || _optionalChain([custom, 'access', _138 => _138.hideFrom, 'optionalAccess', _139 => _139.viz])) return [];
|
|
2897
3069
|
const numeric = field.type === "number";
|
|
2898
3070
|
const align = custom.align === "left" || custom.align === "center" || custom.align === "right" ? custom.align : numeric ? "right" : "left";
|
|
2899
3071
|
const type = cellType(config);
|
|
@@ -2906,8 +3078,8 @@ function tableColumns(panel, frame, multipleFrames = false) {
|
|
|
2906
3078
|
width: Math.max(Number(custom.width) || DEFAULT_WIDTH, Number(custom.minWidth) || 0),
|
|
2907
3079
|
align,
|
|
2908
3080
|
cellType: type,
|
|
2909
|
-
applyToRow: type === "color-background" && !!_optionalChain([custom, 'access',
|
|
2910
|
-
wrap: !!_optionalChain([custom, 'access',
|
|
3081
|
+
applyToRow: type === "color-background" && !!_optionalChain([custom, 'access', _140 => _140.cellOptions, 'optionalAccess', _141 => _141.applyToRow]),
|
|
3082
|
+
wrap: !!_optionalChain([custom, 'access', _142 => _142.cellOptions, 'optionalAccess', _143 => _143.wrapText]),
|
|
2911
3083
|
extent: numeric ? extentOf(field.values) : void 0,
|
|
2912
3084
|
reducers: footerReducers(panel, config, [field.name, _nullishCoalesce(config.displayName, () => ( raw))])
|
|
2913
3085
|
}
|
|
@@ -2915,11 +3087,11 @@ function tableColumns(panel, frame, multipleFrames = false) {
|
|
|
2915
3087
|
});
|
|
2916
3088
|
}
|
|
2917
3089
|
function footerReducers(panel, config, names) {
|
|
2918
|
-
const own = _optionalChain([config, 'access',
|
|
2919
|
-
if (_optionalChain([own, 'optionalAccess',
|
|
2920
|
-
const legacy = _optionalChain([panel, 'access',
|
|
2921
|
-
if (!_optionalChain([legacy, 'optionalAccess',
|
|
2922
|
-
const reducer = _optionalChain([legacy, 'access',
|
|
3090
|
+
const own = _optionalChain([config, 'access', _144 => _144.custom, 'optionalAccess', _145 => _145.footer, 'optionalAccess', _146 => _146.reducers]);
|
|
3091
|
+
if (_optionalChain([own, 'optionalAccess', _147 => _147.length])) return own;
|
|
3092
|
+
const legacy = _optionalChain([panel, 'access', _148 => _148.options, 'optionalAccess', _149 => _149.footer]);
|
|
3093
|
+
if (!_optionalChain([legacy, 'optionalAccess', _150 => _150.show])) return [];
|
|
3094
|
+
const reducer = _optionalChain([legacy, 'access', _151 => _151.reducer, 'optionalAccess', _152 => _152.length]) ? legacy.reducer : ["sum"];
|
|
2923
3095
|
if (legacy.countRows && reducer[0] === "count") return ["countAll"];
|
|
2924
3096
|
const fields = Array.isArray(legacy.fields) ? legacy.fields : legacy.fields ? [legacy.fields] : [];
|
|
2925
3097
|
return !fields.length || names.some((n) => fields.includes(n)) ? reducer : [];
|
|
@@ -2934,16 +3106,16 @@ function tableFooter(columns) {
|
|
|
2934
3106
|
counted = true;
|
|
2935
3107
|
return [{ label: "Count", text: String(c.field.values.length) }];
|
|
2936
3108
|
}
|
|
2937
|
-
if (!
|
|
2938
|
-
const label =
|
|
3109
|
+
if (!_chunkXWSPLZNCjs.isReducer.call(void 0, r)) return [];
|
|
3110
|
+
const label = _chunkXWSPLZNCjs.REDUCER_LABELS[r];
|
|
2939
3111
|
if (r === "count") return [{ label, text: String(c.field.values.length) }];
|
|
2940
3112
|
if (c.field.type !== "number") {
|
|
2941
3113
|
if (r === "distinctCount") return [{ label, text: String(new Set(c.field.values.filter((v) => v != null)).size) }];
|
|
2942
3114
|
return [];
|
|
2943
3115
|
}
|
|
2944
|
-
const value =
|
|
3116
|
+
const value = _chunkXWSPLZNCjs.reduce.call(void 0, c.field.values.map((v) => v == null ? null : Number(v)), r);
|
|
2945
3117
|
const counts = r === "distinctCount" || r === "changeCount";
|
|
2946
|
-
return [{ label, text: counts ? String(_nullishCoalesce(value, () => ( 0))) :
|
|
3118
|
+
return [{ label, text: counts ? String(_nullishCoalesce(value, () => ( 0))) : _chunkXWSPLZNCjs.formatValue.call(void 0, value, c.config) }];
|
|
2947
3119
|
});
|
|
2948
3120
|
return lines.length === 1 && lines[0].label !== "Count" ? [{ text: lines[0].text }] : lines;
|
|
2949
3121
|
});
|
|
@@ -2962,17 +3134,17 @@ function extentOf(values) {
|
|
|
2962
3134
|
}
|
|
2963
3135
|
function cellDisplay(col, raw, fallbackColor) {
|
|
2964
3136
|
const { config, field } = col;
|
|
2965
|
-
const mapped =
|
|
3137
|
+
const mapped = _chunkXWSPLZNCjs.mappedResult.call(void 0, raw, config);
|
|
2966
3138
|
const num4 = field.type === "number" && raw != null && Number.isFinite(Number(raw)) ? Number(raw) : null;
|
|
2967
|
-
const text = _nullishCoalesce(_optionalChain([mapped, 'optionalAccess',
|
|
3139
|
+
const text = _nullishCoalesce(_optionalChain([mapped, 'optionalAccess', _153 => _153.text]), () => ( (raw == null ? _nullishCoalesce(config.noValue, () => ( "")) : field.type === "number" ? _chunkXWSPLZNCjs.formatValue.call(void 0, num4, config) : field.type === "time" ? new Date(_chunkXWSPLZNCjs.toMillis.call(void 0, raw)).toLocaleString() : String(raw))));
|
|
2968
3140
|
if (col.cellType === "auto") return { text };
|
|
2969
|
-
const mode = _optionalChain([config, 'access',
|
|
2970
|
-
const named = _nullishCoalesce(_optionalChain([mapped, 'optionalAccess',
|
|
2971
|
-
const color = named === "text" ? void 0 : _optionalChain([mapped, 'optionalAccess',
|
|
3141
|
+
const mode = _optionalChain([config, 'access', _154 => _154.color, 'optionalAccess', _155 => _155.mode]);
|
|
3142
|
+
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([_chunkXWSPLZNCjs.thresholdStep.call(void 0, num4, config), 'optionalAccess', _159 => _159.color]) : void 0)));
|
|
3143
|
+
const color = named === "text" ? void 0 : _optionalChain([mapped, 'optionalAccess', _160 => _160.color]) ? _chunkXWSPLZNCjs.resolveColor.call(void 0, mapped.color, fallbackColor) : num4 == null ? void 0 : _chunkXWSPLZNCjs.valueColor.call(void 0, num4, config, fallbackColor, col.extent);
|
|
2972
3144
|
if (col.cellType === "color-text") return { text, color };
|
|
2973
3145
|
if (col.cellType === "color-background") return { text, background: color };
|
|
2974
|
-
const min = _nullishCoalesce(config.min, () => ( Math.min(0, _nullishCoalesce(_optionalChain([col, 'access',
|
|
2975
|
-
const max = _nullishCoalesce(_nullishCoalesce(config.max, () => ( _optionalChain([col, 'access',
|
|
3146
|
+
const min = _nullishCoalesce(config.min, () => ( Math.min(0, _nullishCoalesce(_optionalChain([col, 'access', _161 => _161.extent, 'optionalAccess', _162 => _162[0]]), () => ( 0)))));
|
|
3147
|
+
const max = _nullishCoalesce(_nullishCoalesce(config.max, () => ( _optionalChain([col, 'access', _163 => _163.extent, 'optionalAccess', _164 => _164[1]]))), () => ( 1));
|
|
2976
3148
|
const gauge = num4 == null ? void 0 : Math.min(1, Math.max(0, (num4 - min) / (max - min || 1)));
|
|
2977
3149
|
return { text, gauge, gaugeColor: color };
|
|
2978
3150
|
}
|
|
@@ -2985,12 +3157,12 @@ function contrastText(background, fallback) {
|
|
|
2985
3157
|
return lum > 0.55 ? "#111111" : "#ffffff";
|
|
2986
3158
|
}
|
|
2987
3159
|
function initialSort(panel, columns) {
|
|
2988
|
-
const first = _optionalChain([panel, 'access',
|
|
2989
|
-
const col = _optionalChain([first, 'optionalAccess',
|
|
3160
|
+
const first = _optionalChain([panel, 'access', _165 => _165.options, 'optionalAccess', _166 => _166.sortBy, 'optionalAccess', _167 => _167[0]]);
|
|
3161
|
+
const col = _optionalChain([first, 'optionalAccess', _168 => _168.displayName]) != null ? columns.find((c) => c.name === first.displayName || c.field.name === first.displayName) : void 0;
|
|
2990
3162
|
return col ? { key: col.key, desc: !!first.desc } : null;
|
|
2991
3163
|
}
|
|
2992
3164
|
function nextSort(current, key) {
|
|
2993
|
-
if (_optionalChain([current, 'optionalAccess',
|
|
3165
|
+
if (_optionalChain([current, 'optionalAccess', _169 => _169.key]) !== key) return { key, desc: false };
|
|
2994
3166
|
return current.desc ? null : { key, desc: true };
|
|
2995
3167
|
}
|
|
2996
3168
|
function sortedRows(columns, length, sort) {
|
|
@@ -2999,7 +3171,7 @@ function sortedRows(columns, length, sort) {
|
|
|
2999
3171
|
if (!col) return rows;
|
|
3000
3172
|
const { field } = col;
|
|
3001
3173
|
const dir = sort.desc ? -1 : 1;
|
|
3002
|
-
const key = (v) => field.type === "time" ?
|
|
3174
|
+
const key = (v) => field.type === "time" ? _chunkXWSPLZNCjs.toMillis.call(void 0, v) : field.type === "number" || field.type === "boolean" ? Number(v) : v;
|
|
3003
3175
|
const empty = (v) => v == null || v === "" || typeof v === "number" && Number.isNaN(v);
|
|
3004
3176
|
return rows.sort((a, b) => {
|
|
3005
3177
|
const va = field.values[a];
|
|
@@ -3025,7 +3197,7 @@ function PieChartPanel({ panel, frames }) {
|
|
|
3025
3197
|
if (!values.length) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, {});
|
|
3026
3198
|
const total = values.reduce((a, v) => a + (_nullishCoalesce(v.value, () => ( 0))), 0);
|
|
3027
3199
|
const r = Math.min(size.width, size.height) / 2 - 2;
|
|
3028
|
-
const inner = _optionalChain([panel, 'access',
|
|
3200
|
+
const inner = _optionalChain([panel, 'access', _170 => _170.options, 'optionalAccess', _171 => _171.pieType]) === "pie" ? 0 : r * 0.62;
|
|
3029
3201
|
const cx = size.width / 2;
|
|
3030
3202
|
const cy = size.height / 2;
|
|
3031
3203
|
const gap = values.length > 1 ? 0.02 : 0;
|
|
@@ -3036,8 +3208,8 @@ function PieChartPanel({ panel, frames }) {
|
|
|
3036
3208
|
slices.push({ key: v.key, d: donutSlice(cx, cy, r, inner, angle + gap / 2, angle + sweep - gap / 2), color: v.color });
|
|
3037
3209
|
angle += sweep;
|
|
3038
3210
|
}
|
|
3039
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
3040
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style:
|
|
3211
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles12.fill, children: [
|
|
3212
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles12.fill, onLayout, children: r > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg2.default, { width: size.width, height: size.height, children: slices.map((s) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Path, { d: s.d, fill: s.color }, s.key)) }) }),
|
|
3041
3213
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3042
3214
|
Legend,
|
|
3043
3215
|
{
|
|
@@ -3065,15 +3237,15 @@ function TablePanel({ panel, frames }) {
|
|
|
3065
3237
|
const columns = _react.useMemo.call(void 0, () => frame ? tableColumns(panel, frame, frames.length > 1) : [], [panel, frame, frames.length]);
|
|
3066
3238
|
const [tapped, setSort] = _react.useState.call(void 0, );
|
|
3067
3239
|
const sort = tapped === void 0 ? initialSort(panel, columns) : tapped;
|
|
3068
|
-
const order = _react.useMemo.call(void 0, () => sortedRows(columns, frame ?
|
|
3069
|
-
if (!frame || !
|
|
3240
|
+
const order = _react.useMemo.call(void 0, () => sortedRows(columns, frame ? _chunkXWSPLZNCjs.frameLength.call(void 0, frame) : 0, sort), [columns, frame, sort]);
|
|
3241
|
+
if (!frame || !_chunkXWSPLZNCjs.frameLength.call(void 0, frame)) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, {});
|
|
3070
3242
|
const shown = order.slice(0, 500);
|
|
3071
3243
|
const rowColumn = columns.find((c) => c.applyToRow);
|
|
3072
3244
|
const footer = tableFooter(columns);
|
|
3073
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.ScrollView, { horizontal: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
3074
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.ScrollView, { nestedScrollEnabled: true, style:
|
|
3075
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
3076
|
-
const active = _optionalChain([sort, 'optionalAccess',
|
|
3245
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.ScrollView, { horizontal: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles12.fill, children: [
|
|
3246
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.ScrollView, { nestedScrollEnabled: true, style: styles12.fill, children: [
|
|
3247
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles12.tr, { borderBottomColor: theme.border }], children: columns.map((c) => {
|
|
3248
|
+
const active = _optionalChain([sort, 'optionalAccess', _172 => _172.key]) === c.key;
|
|
3077
3249
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3078
3250
|
_reactnative.Pressable,
|
|
3079
3251
|
{
|
|
@@ -3082,7 +3254,7 @@ function TablePanel({ panel, frames }) {
|
|
|
3082
3254
|
accessibilityLabel: `Sort by ${c.name}`,
|
|
3083
3255
|
accessibilityState: { selected: active },
|
|
3084
3256
|
style: { width: c.width },
|
|
3085
|
-
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.Text, { style: [
|
|
3257
|
+
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.Text, { style: [styles12.th, { color: active ? theme.text : theme.textSecondary, textAlign: c.align }], numberOfLines: 2, children: [
|
|
3086
3258
|
c.name,
|
|
3087
3259
|
active ? sort.desc ? " \u2193" : " \u2191" : ""
|
|
3088
3260
|
] })
|
|
@@ -3092,12 +3264,12 @@ function TablePanel({ panel, frames }) {
|
|
|
3092
3264
|
}) }),
|
|
3093
3265
|
shown.map((i) => {
|
|
3094
3266
|
const rowBg = rowColumn ? cellDisplay(rowColumn, rowColumn.field.values[i], theme.accent).background : void 0;
|
|
3095
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
3267
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles12.tr, { borderBottomColor: theme.grid }, rowBg ? { backgroundColor: rowBg } : null], children: columns.map((c) => {
|
|
3096
3268
|
const d = cellDisplay(c, c.field.values[i], theme.accent);
|
|
3097
3269
|
const bg = _nullishCoalesce(d.background, () => ( rowBg));
|
|
3098
|
-
const linked = !!_optionalChain([c, 'access',
|
|
3270
|
+
const linked = !!_optionalChain([c, 'access', _173 => _173.config, 'access', _174 => _174.links, 'optionalAccess', _175 => _175.length]);
|
|
3099
3271
|
const color = _nullishCoalesce(d.color, () => ( (bg ? contrastText(bg, theme.text) : linked ? theme.accent : theme.text)));
|
|
3100
|
-
const cellStyle = [
|
|
3272
|
+
const cellStyle = [styles12.td, { width: c.width }, d.background ? { backgroundColor: d.background } : null];
|
|
3101
3273
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3102
3274
|
_reactnative.Pressable,
|
|
3103
3275
|
{
|
|
@@ -3109,8 +3281,8 @@ function TablePanel({ panel, frames }) {
|
|
|
3109
3281
|
accessibilityRole: linked ? "link" : void 0,
|
|
3110
3282
|
style: ({ pressed }) => [cellStyle, pressed && { opacity: 0.6 }],
|
|
3111
3283
|
children: [
|
|
3112
|
-
d.gauge != null && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
3113
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3284
|
+
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)) }] }) }),
|
|
3285
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles12.cellText, { color, textAlign: c.align }, c.field.type === "number" && styles12.num], numberOfLines: c.wrap ? void 0 : 1, children: d.text })
|
|
3114
3286
|
]
|
|
3115
3287
|
},
|
|
3116
3288
|
c.key
|
|
@@ -3118,7 +3290,7 @@ function TablePanel({ panel, frames }) {
|
|
|
3118
3290
|
}) }, i);
|
|
3119
3291
|
})
|
|
3120
3292
|
] }),
|
|
3121
|
-
footer && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
3293
|
+
footer && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles12.tr, styles12.footer, { borderTopColor: theme.border }], children: columns.map((c, ci) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles12.td, { width: c.width }], children: footer[ci].map((line, li) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.Text, { style: [styles12.cellText, styles12.footerText, { color: theme.text, textAlign: c.align }], numberOfLines: 1, children: [
|
|
3122
3294
|
line.label ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: { color: theme.textMuted, fontWeight: "400" }, children: `${line.label} ` }) : null,
|
|
3123
3295
|
line.text
|
|
3124
3296
|
] }, li)) }, c.key)) })
|
|
@@ -3126,12 +3298,12 @@ function TablePanel({ panel, frames }) {
|
|
|
3126
3298
|
}
|
|
3127
3299
|
function TextPanel({ panel }) {
|
|
3128
3300
|
const theme = useDashTheme();
|
|
3129
|
-
const raw = _optionalChain([panel, 'access',
|
|
3301
|
+
const raw = _optionalChain([panel, 'access', _176 => _176.options, 'optionalAccess', _177 => _177.content]);
|
|
3130
3302
|
const content = typeof raw === "string" ? raw : "";
|
|
3131
|
-
const text = _optionalChain([panel, 'access',
|
|
3303
|
+
const text = _optionalChain([panel, 'access', _178 => _178.options, 'optionalAccess', _179 => _179.mode]) === "html" ? content.replace(/<[^>]+>/g, "") : content;
|
|
3132
3304
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.ScrollView, { children: text.split(/\n{2,}/).map((block, i) => {
|
|
3133
3305
|
const heading = /^#{1,6}\s+/.test(block);
|
|
3134
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3306
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles12.para, { color: heading ? theme.text : theme.textSecondary }, heading && styles12.heading], children: block.replace(/^#{1,6}\s+/, "").replace(/\*\*(.+?)\*\*/g, "$1").replace(/\[(.+?)\]\(.+?\)/g, "$1") }, i);
|
|
3135
3307
|
}) });
|
|
3136
3308
|
}
|
|
3137
3309
|
function BarChartPanel({ panel, frames, width }) {
|
|
@@ -3141,13 +3313,13 @@ function BarChartPanel({ panel, frames, width }) {
|
|
|
3141
3313
|
const frame = frames[0];
|
|
3142
3314
|
const category = frame && barCategory(panel, frame);
|
|
3143
3315
|
if (!frame || !values.length) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, {});
|
|
3144
|
-
const xField = _optionalChain([panel, 'access',
|
|
3316
|
+
const xField = _optionalChain([panel, 'access', _180 => _180.options, 'optionalAccess', _181 => _181.xField]);
|
|
3145
3317
|
if (xField && !category) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, { message: `No field named \u201C${String(xField)}\u201D` });
|
|
3146
3318
|
const allNumeric = frame.fields.filter((f) => f.type === "number");
|
|
3147
3319
|
const at = (f) => values[allNumeric.indexOf(f)];
|
|
3148
3320
|
const numeric = category ? allNumeric.filter((f) => f !== category) : [];
|
|
3149
3321
|
if (category && !numeric.length) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, { message: `No number fields to draw besides \u201C${category.name}\u201D` });
|
|
3150
|
-
const fields = category ? numeric.map((f) => ({ key: f.name, name: _nullishCoalesce(_optionalChain([at, 'call',
|
|
3322
|
+
const fields = category ? numeric.map((f) => ({ key: f.name, name: _nullishCoalesce(_optionalChain([at, 'call', _182 => _182(f), 'optionalAccess', _183 => _183.name]), () => ( f.name)), color: _nullishCoalesce(_optionalChain([at, 'call', _184 => _184(f), 'optionalAccess', _185 => _185.color]), () => ( theme.accent)), config: _nullishCoalesce(_optionalChain([at, 'call', _186 => _186(f), 'optionalAccess', _187 => _187.config]), () => ( {})), values: f.values.map(num2) })) : [{ key: "reduced", name: "", color: theme.accent, config: values[0].config, values: values.map((v) => v.value) }];
|
|
3151
3323
|
const labels = category ? categoryLabels(category) : values.map((v) => v.name);
|
|
3152
3324
|
const colorAt = (fi, i) => category ? fields[fi].color : values[i].color;
|
|
3153
3325
|
const axes = barAxes(
|
|
@@ -3161,34 +3333,34 @@ function BarChartPanel({ panel, frames, width }) {
|
|
|
3161
3333
|
const gridAxis = _nullishCoalesce(left, () => ( right));
|
|
3162
3334
|
const plotW = width - (left ? AXIS_W : 0) - (right ? AXIS_W : 0);
|
|
3163
3335
|
const every = Math.max(1, Math.ceil(labels.length / Math.max(1, Math.floor(plotW / 44))));
|
|
3164
|
-
const axisColumn = (axis) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
3336
|
+
const axisColumn = (axis) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles12.axis, axis.side === "left" ? styles12.axisLeft : styles12.axisRight], children: plot.height > 0 && axis.ticks.map((t) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3165
3337
|
_reactnative.Text,
|
|
3166
3338
|
{
|
|
3167
|
-
style: [
|
|
3339
|
+
style: [styles12.tick, { color: theme.textMuted, top: plot.height * (1 - barFraction(axis, t)) - 7 }, axis.side === "left" ? styles12.tickLeft : styles12.tickRight],
|
|
3168
3340
|
numberOfLines: 1,
|
|
3169
|
-
children:
|
|
3341
|
+
children: _chunkXWSPLZNCjs.formatValue.call(void 0, t, { ...axis.config, decimals: tickDecimals(axis.ticks) })
|
|
3170
3342
|
},
|
|
3171
3343
|
t
|
|
3172
3344
|
)) });
|
|
3173
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
3174
|
-
(_optionalChain([left, 'optionalAccess',
|
|
3175
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3176
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3345
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles12.fill, children: [
|
|
3346
|
+
(_optionalChain([left, 'optionalAccess', _188 => _188.label]) || _optionalChain([right, 'optionalAccess', _189 => _189.label])) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles12.axisLabels, children: [
|
|
3347
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles12.axisLabel, { color: theme.textMuted }], children: _nullishCoalesce(_optionalChain([left, 'optionalAccess', _190 => _190.label]), () => ( "")) }),
|
|
3348
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles12.axisLabel, { color: theme.textMuted }], children: _nullishCoalesce(_optionalChain([right, 'optionalAccess', _191 => _191.label]), () => ( "")) })
|
|
3177
3349
|
] }),
|
|
3178
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
3350
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles12.barRow, children: [
|
|
3179
3351
|
left && axisColumn(left),
|
|
3180
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
3181
|
-
gridAxis && plot.height > 0 && gridAxis.ticks.map((t) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
3182
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style:
|
|
3352
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles12.fill, onLayout: onPlotLayout, children: [
|
|
3353
|
+
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)),
|
|
3354
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles12.barchart, children: labels.map((_, i) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles12.barStack, children: fields.map((f, fi) => {
|
|
3183
3355
|
const axis = axisOf(fi);
|
|
3184
3356
|
const base = barFraction(axis, Math.min(Math.max(0, axis.bottom), axis.top));
|
|
3185
3357
|
const end = barFraction(axis, _nullishCoalesce(f.values[i], () => ( 0)));
|
|
3186
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style:
|
|
3358
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles12.barSlot, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3187
3359
|
_reactnative.View,
|
|
3188
3360
|
{
|
|
3189
3361
|
style: [
|
|
3190
|
-
|
|
3191
|
-
end < base &&
|
|
3362
|
+
styles12.bar,
|
|
3363
|
+
end < base && styles12.barDown,
|
|
3192
3364
|
{ bottom: `${Math.min(base, end) * 100}%`, height: `${Math.abs(end - base) * 100}%`, backgroundColor: colorAt(fi, i) }
|
|
3193
3365
|
]
|
|
3194
3366
|
}
|
|
@@ -3197,7 +3369,7 @@ function BarChartPanel({ panel, frames, width }) {
|
|
|
3197
3369
|
] }),
|
|
3198
3370
|
right && axisColumn(right)
|
|
3199
3371
|
] }),
|
|
3200
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
3372
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles12.barLabels, { marginLeft: left ? AXIS_W : 0, marginRight: right ? AXIS_W : 0 }], children: labels.map((label, i) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles12.barLabel, { color: theme.textMuted }], numberOfLines: 1, children: i % every === 0 ? label : " " }, i)) }),
|
|
3201
3373
|
category && fields.length > 1 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Legend, { items: fields })
|
|
3202
3374
|
] });
|
|
3203
3375
|
}
|
|
@@ -3210,7 +3382,7 @@ function num2(v) {
|
|
|
3210
3382
|
function UnsupportedPanel({ panel }) {
|
|
3211
3383
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, { message: `"${panel.type}" panels aren't supported yet` });
|
|
3212
3384
|
}
|
|
3213
|
-
var
|
|
3385
|
+
var styles12 = _reactnative.StyleSheet.create({
|
|
3214
3386
|
fill: { flex: 1 },
|
|
3215
3387
|
tr: { flexDirection: "row", borderBottomWidth: _reactnative.StyleSheet.hairlineWidth },
|
|
3216
3388
|
th: { paddingVertical: 6, paddingHorizontal: 6, fontSize: 12, fontWeight: "600" },
|
|
@@ -3269,9 +3441,9 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3269
3441
|
[numericX, panel, frames, theme.scheme]
|
|
3270
3442
|
);
|
|
3271
3443
|
if (!series.length || series.every((s) => s.values.every((v) => v == null))) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, {});
|
|
3272
|
-
const style = (s) => _nullishCoalesce(_optionalChain([s, 'access',
|
|
3444
|
+
const style = (s) => _nullishCoalesce(_optionalChain([s, 'access', _192 => _192.config, 'access', _193 => _193.custom, 'optionalAccess', _194 => _194.drawStyle]), () => ( (panel.type === "graph" && panel.bars ? "bars" : "line")));
|
|
3273
3445
|
const anyBars = series.some((s) => style(s) === "bars");
|
|
3274
|
-
const anyFill = series.some((s) => (_nullishCoalesce(_optionalChain([s, 'access',
|
|
3446
|
+
const anyFill = series.some((s) => (_nullishCoalesce(_optionalChain([s, 'access', _195 => _195.config, 'access', _196 => _196.custom, 'optionalAccess', _197 => _197.fillOpacity]), () => ( 0))) > 0);
|
|
3275
3447
|
const yTitle = series.map((s) => axisTitle(s.config)).find(Boolean);
|
|
3276
3448
|
const xTitle = numericX ? axisTitle(xConfig) : void 0;
|
|
3277
3449
|
const PAD = {
|
|
@@ -3292,7 +3464,7 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3292
3464
|
const y = linearScale(yMin, yMax, PAD.top + plotH, PAD.top);
|
|
3293
3465
|
const span = xTo - xFrom;
|
|
3294
3466
|
const xTicks = numericX ? numberTicks(xFrom, xTo, plotW) : timeTicks(xFrom, xTo, plotW);
|
|
3295
|
-
const xLabel = (t) => numericX ?
|
|
3467
|
+
const xLabel = (t) => numericX ? _chunkXWSPLZNCjs.formatValue.call(void 0, t, { ...xConfig, decimals: tickDecimals(xTicks) }) : formatTimeTick(t, span);
|
|
3296
3468
|
const unitConfig = series[0].config;
|
|
3297
3469
|
const barSeries = series.filter((s) => style(s) === "bars");
|
|
3298
3470
|
const pointsCount = Math.max(...series.map((s) => s.times.length));
|
|
@@ -3300,7 +3472,7 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3300
3472
|
const groupW = Math.min(slot * 0.8, BAR_MAX * barSeries.length);
|
|
3301
3473
|
const barW = Math.max(2, groupW / Math.max(barSeries.length, 1) - (barSeries.length > 1 ? 2 : 0));
|
|
3302
3474
|
const canPinch = plotW > 0;
|
|
3303
|
-
const twoFingers = (e) => canPinch && (_nullishCoalesce(_optionalChain([e, 'access',
|
|
3475
|
+
const twoFingers = (e) => canPinch && (_nullishCoalesce(_optionalChain([e, 'access', _198 => _198.nativeEvent, 'access', _199 => _199.touches, 'optionalAccess', _200 => _200.length]), () => ( 0))) >= 2;
|
|
3304
3476
|
const onPinchMove = (e) => {
|
|
3305
3477
|
const touches = _nullishCoalesce(e.nativeEvent.touches, () => ( []));
|
|
3306
3478
|
if (touches.length < 2) return;
|
|
@@ -3310,11 +3482,11 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3310
3482
|
if (!pinch.current) pinch.current = { start: { from: xFrom, to: xTo }, dist, frac };
|
|
3311
3483
|
const p = pinch.current;
|
|
3312
3484
|
const limits = extent ? { minSpan: (extent[1] - extent[0]) / 1e3, maxSpan: extent[1] - extent[0], minFrom: extent[0], maxTo: extent[1] } : { maxTo: Math.max(Date.now(), p.start.to) };
|
|
3313
|
-
setPreview(
|
|
3485
|
+
setPreview(_chunkXWSPLZNCjs.zoomRange.call(void 0, p.start, dist / p.dist, p.frac, frac, limits));
|
|
3314
3486
|
};
|
|
3315
3487
|
const onPinchEnd = (commit) => {
|
|
3316
3488
|
if (commit && pinch.current && preview) {
|
|
3317
|
-
if (!extent) setRawRange({ from:
|
|
3489
|
+
if (!extent) setRawRange({ from: _chunkXWSPLZNCjs.formatLocalDateTime.call(void 0, preview.from), to: _chunkXWSPLZNCjs.formatLocalDateTime.call(void 0, preview.to) });
|
|
3318
3490
|
else setXZoom(preview.to - preview.from >= extent[1] - extent[0] ? null : preview);
|
|
3319
3491
|
}
|
|
3320
3492
|
pinch.current = null;
|
|
@@ -3323,15 +3495,15 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3323
3495
|
const hover = hoverX == null || !touching && pinned !== id ? null : nearest(series, xFrom + (hoverX - PAD.left) / (plotW || 1) * span);
|
|
3324
3496
|
const hoverLinks = hover ? mergeLinks(
|
|
3325
3497
|
hover.rows.flatMap(
|
|
3326
|
-
(r) => r.value == null || !_optionalChain([r, 'access',
|
|
3498
|
+
(r) => r.value == null || !_optionalChain([r, 'access', _201 => _201.series, 'access', _202 => _202.config, 'access', _203 => _203.links, 'optionalAccess', _204 => _204.length]) ? [] : [{ name: r.name, links: resolve(r.series.config.links, linkData(r, frames, numericX ? String(_nullishCoalesce(_optionalChain([panel, 'access', _205 => _205.options, 'optionalAccess', _206 => _206.xField]), () => ( ""))) : void 0)) }]
|
|
3327
3499
|
)
|
|
3328
3500
|
) : [];
|
|
3329
3501
|
const isPinned = !!hover && pinned === id;
|
|
3330
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
3502
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles13.fill, children: [
|
|
3331
3503
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3332
3504
|
_reactnative.View,
|
|
3333
3505
|
{
|
|
3334
|
-
style:
|
|
3506
|
+
style: styles13.fill,
|
|
3335
3507
|
onStartShouldSetResponderCapture: twoFingers,
|
|
3336
3508
|
onMoveShouldSetResponderCapture: twoFingers,
|
|
3337
3509
|
onResponderTerminationRequest: () => false,
|
|
@@ -3346,7 +3518,7 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3346
3518
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3347
3519
|
_reactnative.View,
|
|
3348
3520
|
{
|
|
3349
|
-
style:
|
|
3521
|
+
style: styles13.fill,
|
|
3350
3522
|
onLayout,
|
|
3351
3523
|
onStartShouldSetResponder: () => true,
|
|
3352
3524
|
onResponderGrant: (e) => {
|
|
@@ -3369,7 +3541,7 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3369
3541
|
size.width > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnativesvg2.default, { width: size.width, height: size.height, children: [
|
|
3370
3542
|
ticks.map((t) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnativesvg.G, { children: [
|
|
3371
3543
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Line, { x1: PAD.left, x2: PAD.left + plotW, y1: y(t), y2: y(t), stroke: theme.grid, strokeWidth: 1 }),
|
|
3372
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Text, { x: PAD.left - 6, y: y(t) + 3, fontSize: 10, fill: theme.textMuted, textAnchor: "end", children:
|
|
3544
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Text, { x: PAD.left - 6, y: y(t) + 3, fontSize: 10, fill: theme.textMuted, textAnchor: "end", children: _chunkXWSPLZNCjs.formatValue.call(void 0, t, { ...unitConfig, decimals: tickDecimals(ticks) }) })
|
|
3373
3545
|
] }, t)),
|
|
3374
3546
|
xTicks.map((t) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3375
3547
|
_reactnativesvg.Text,
|
|
@@ -3395,12 +3567,12 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3395
3567
|
})
|
|
3396
3568
|
),
|
|
3397
3569
|
series.filter((s) => style(s) !== "bars").map((s) => {
|
|
3398
|
-
const fill = (_nullishCoalesce(_optionalChain([s, 'access',
|
|
3399
|
-
const showPoints = style(s) === "points" || _optionalChain([s, 'access',
|
|
3400
|
-
const segs = segments(s, x, y, _optionalChain([s, 'access',
|
|
3570
|
+
const fill = (_nullishCoalesce(_optionalChain([s, 'access', _207 => _207.config, 'access', _208 => _208.custom, 'optionalAccess', _209 => _209.fillOpacity]), () => ( 0))) / 100;
|
|
3571
|
+
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;
|
|
3572
|
+
const segs = segments(s, x, y, _optionalChain([s, 'access', _216 => _216.config, 'access', _217 => _217.custom, 'optionalAccess', _218 => _218.lineInterpolation]) === "stepAfter");
|
|
3401
3573
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnativesvg.G, { children: [
|
|
3402
3574
|
fill > 0 && segs.map((seg, i) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Path, { d: `${seg.d}L${seg.lastX},${y(Math.max(yMin, 0))}L${seg.firstX},${y(Math.max(yMin, 0))}Z`, fill: s.color, opacity: fill }, `f${i}`)),
|
|
3403
|
-
style(s) !== "points" && segs.map((seg, i) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Path, { d: seg.d, stroke: s.color, strokeWidth: _nullishCoalesce(_optionalChain([s, 'access',
|
|
3575
|
+
style(s) !== "points" && segs.map((seg, i) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Path, { d: seg.d, stroke: s.color, strokeWidth: _nullishCoalesce(_optionalChain([s, 'access', _219 => _219.config, 'access', _220 => _220.custom, 'optionalAccess', _221 => _221.lineWidth]), () => ( 2)), fill: "none", strokeLinejoin: "round", strokeLinecap: "round" }, `l${i}`)),
|
|
3404
3576
|
showPoints && s.times.map(
|
|
3405
3577
|
(t, i) => s.values[i] == null ? null : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Circle, { cx: x(t), cy: y(s.values[i]), r: 4, fill: s.color, stroke: theme.surface, strokeWidth: 2 }, i)
|
|
3406
3578
|
)
|
|
@@ -3420,8 +3592,8 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3420
3592
|
onPress: () => setXZoom(null),
|
|
3421
3593
|
accessibilityRole: "button",
|
|
3422
3594
|
hitSlop: 8,
|
|
3423
|
-
style: ({ pressed }) => [
|
|
3424
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3595
|
+
style: ({ pressed }) => [styles13.reset, { backgroundColor: theme.surface, borderColor: theme.border }, pressed && { opacity: 0.7 }],
|
|
3596
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles13.resetText, { color: theme.accent }], children: "Reset zoom" })
|
|
3425
3597
|
}
|
|
3426
3598
|
),
|
|
3427
3599
|
hover && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
@@ -3430,16 +3602,16 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3430
3602
|
pointerEvents: isPinned ? "auto" : "none",
|
|
3431
3603
|
onStartShouldSetResponder: () => isPinned,
|
|
3432
3604
|
style: [
|
|
3433
|
-
|
|
3605
|
+
styles13.tooltip,
|
|
3434
3606
|
{ backgroundColor: theme.surface, borderColor: theme.border },
|
|
3435
3607
|
x(hover.time) > size.width / 2 ? { right: size.width - x(hover.time) + 8 } : { left: x(hover.time) + 8 }
|
|
3436
3608
|
],
|
|
3437
3609
|
children: [
|
|
3438
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3439
|
-
hover.rows.map((r) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
3440
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
3441
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3442
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3610
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles13.tooltipTime, { color: theme.textMuted }], children: numericX ? _chunkXWSPLZNCjs.formatValue.call(void 0, hover.time, xConfig) : formatTooltipTime(hover.time) }),
|
|
3611
|
+
hover.rows.map((r) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles13.tooltipRow, children: [
|
|
3612
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles13.swatch, { backgroundColor: r.color }] }),
|
|
3613
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles13.tooltipName, { color: theme.textSecondary }], numberOfLines: 1, children: r.name }),
|
|
3614
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles13.tooltipValue, { color: theme.text }], children: _chunkXWSPLZNCjs.formatValue.call(void 0, r.value, r.config) })
|
|
3443
3615
|
] }, r.key)),
|
|
3444
3616
|
isPinned && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TooltipLinks, { links: hoverLinks, onOpen: (l) => openLinks([l]) })
|
|
3445
3617
|
]
|
|
@@ -3524,8 +3696,8 @@ function linkData(r, frames, xField) {
|
|
|
3524
3696
|
if (frame && xField === void 0) {
|
|
3525
3697
|
row = r.index;
|
|
3526
3698
|
} else if (frame) {
|
|
3527
|
-
const xf = _nullishCoalesce(frame.fields.find((f) => f.name === xField), () => (
|
|
3528
|
-
const at = _optionalChain([xf, 'optionalAccess',
|
|
3699
|
+
const xf = _nullishCoalesce(frame.fields.find((f) => f.name === xField), () => ( _chunkXWSPLZNCjs.numberFields.call(void 0, frame)[0]));
|
|
3700
|
+
const at = _optionalChain([xf, 'optionalAccess', _222 => _222.values, 'access', _223 => _223.findIndex, 'call', _224 => _224((v, k) => Number(v) === r.time && Number(r.series.field.values[k]) === r.value)]);
|
|
3529
3701
|
row = at != null && at >= 0 ? at : void 0;
|
|
3530
3702
|
}
|
|
3531
3703
|
return {
|
|
@@ -3535,11 +3707,11 @@ function linkData(r, frames, xField) {
|
|
|
3535
3707
|
fieldName: r.name,
|
|
3536
3708
|
seriesName: r.name,
|
|
3537
3709
|
value: r.value,
|
|
3538
|
-
text:
|
|
3710
|
+
text: _chunkXWSPLZNCjs.formatValue.call(void 0, r.value, r.config),
|
|
3539
3711
|
time: xField === void 0 ? r.time : void 0
|
|
3540
3712
|
};
|
|
3541
3713
|
}
|
|
3542
|
-
var
|
|
3714
|
+
var styles13 = _reactnative.StyleSheet.create({
|
|
3543
3715
|
fill: { flex: 1 },
|
|
3544
3716
|
tooltip: {
|
|
3545
3717
|
position: "absolute",
|
|
@@ -3580,14 +3752,14 @@ function mappings(panel) {
|
|
|
3580
3752
|
frame: frame(s.frame),
|
|
3581
3753
|
x: byName(s.x),
|
|
3582
3754
|
y: byName(s.y),
|
|
3583
|
-
color: byName(_optionalChain([s, 'access',
|
|
3584
|
-
size: byName(_optionalChain([s, 'access',
|
|
3755
|
+
color: byName(_optionalChain([s, 'access', _225 => _225.pointColor, 'optionalAccess', _226 => _226.field])),
|
|
3756
|
+
size: byName(_optionalChain([s, 'access', _227 => _227.pointSize, 'optionalAccess', _228 => _228.field])),
|
|
3585
3757
|
sizeRange: s.pointSize,
|
|
3586
3758
|
name: { fixed: s.name }
|
|
3587
3759
|
}));
|
|
3588
3760
|
return { manual: true, series, exclude: [] };
|
|
3589
3761
|
}
|
|
3590
|
-
return { manual: false, series: [{ frame: frame(_optionalChain([o, 'access',
|
|
3762
|
+
return { manual: false, series: [{ frame: frame(_optionalChain([o, 'access', _229 => _229.dims, 'optionalAccess', _230 => _230.frame])), x: byName(_optionalChain([o, 'access', _231 => _231.dims, 'optionalAccess', _232 => _232.x])) }], exclude: _nullishCoalesce(_optionalChain([o, 'access', _233 => _233.dims, 'optionalAccess', _234 => _234.exclude]), () => ( [])) };
|
|
3591
3763
|
}
|
|
3592
3764
|
return { manual: o.mapping === "manual", series: _nullishCoalesce(o.series, () => ( [])), exclude: [] };
|
|
3593
3765
|
}
|
|
@@ -3596,11 +3768,11 @@ function xySeries(panel, frames, scheme) {
|
|
|
3596
3768
|
const { manual, series: maps, exclude } = mappings(panel);
|
|
3597
3769
|
const multiple = frames.length > 1;
|
|
3598
3770
|
const out = [];
|
|
3599
|
-
const config = (field, frame) =>
|
|
3600
|
-
const find = (pick, frame, fields = frame.fields) => pick ? fields.filter((f) =>
|
|
3771
|
+
const config = (field, frame) => _chunkXWSPLZNCjs.resolveFieldConfig.call(void 0, panel, field, frame, _chunkXWSPLZNCjs.fieldDisplayName.call(void 0, field, frame, multiple));
|
|
3772
|
+
const find = (pick, frame, fields = frame.fields) => pick ? fields.filter((f) => _chunkXWSPLZNCjs.fieldMatches.call(void 0, pick.matcher, f, frame, _chunkXWSPLZNCjs.fieldDisplayName.call(void 0, f, frame, multiple))) : [];
|
|
3601
3773
|
for (const [mi, m] of (maps.length ? maps : [{}]).entries()) {
|
|
3602
|
-
const matcher = _optionalChain([m, 'access',
|
|
3603
|
-
const chosen = _optionalChain([matcher, 'optionalAccess',
|
|
3774
|
+
const matcher = _optionalChain([m, 'access', _235 => _235.frame, 'optionalAccess', _236 => _236.matcher]);
|
|
3775
|
+
const chosen = _optionalChain([matcher, 'optionalAccess', _237 => _237.id]) === "byIndex" ? frames.filter((_, i) => i === matcher.options) : frames;
|
|
3604
3776
|
for (const frame of chosen) {
|
|
3605
3777
|
const numeric = frame.fields.filter(isNumeric);
|
|
3606
3778
|
const xField = _nullishCoalesce(find(m.x, frame, numeric)[0], () => ( numeric[0]));
|
|
@@ -3611,41 +3783,41 @@ function xySeries(panel, frames, scheme) {
|
|
|
3611
3783
|
const yFields = m.y ? find(m.y, frame, numeric).filter((f) => f !== xField) : manual ? [] : numeric.filter((f) => !used.has(f) && !exclude.includes(f.name));
|
|
3612
3784
|
for (const yField of yFields) {
|
|
3613
3785
|
const yConfig = config(yField, frame);
|
|
3614
|
-
if (_optionalChain([yConfig, 'access',
|
|
3786
|
+
if (_optionalChain([yConfig, 'access', _238 => _238.custom, 'optionalAccess', _239 => _239.hideFrom, 'optionalAccess', _240 => _240.viz]) && !manual) continue;
|
|
3615
3787
|
const xConfig = config(xField, frame);
|
|
3616
|
-
const color =
|
|
3617
|
-
const base = _optionalChain([yConfig, 'access',
|
|
3788
|
+
const color = _chunkXWSPLZNCjs.seriesColor.call(void 0, out.length, scheme, yConfig);
|
|
3789
|
+
const base = _optionalChain([yConfig, 'access', _241 => _241.color, 'optionalAccess', _242 => _242.mode]) === "thresholds" ? _chunkXWSPLZNCjs.valueColor.call(void 0, null, yConfig, color) : color;
|
|
3618
3790
|
const rows = [];
|
|
3619
3791
|
const xs = [];
|
|
3620
3792
|
const ys = [];
|
|
3621
3793
|
yField.values.forEach((yv, i) => {
|
|
3622
3794
|
const xv = xField.values[i];
|
|
3623
3795
|
if (xv == null || yv == null) return;
|
|
3624
|
-
const xn = xField.type === "time" ?
|
|
3625
|
-
const yn = yField.type === "time" ?
|
|
3796
|
+
const xn = xField.type === "time" ? _chunkXWSPLZNCjs.toMillis.call(void 0, xv) : Number(xv);
|
|
3797
|
+
const yn = yField.type === "time" ? _chunkXWSPLZNCjs.toMillis.call(void 0, yv) : Number(yv);
|
|
3626
3798
|
if (!Number.isFinite(xn) || !Number.isFinite(yn)) return;
|
|
3627
3799
|
rows.push(i);
|
|
3628
3800
|
xs.push(xn);
|
|
3629
3801
|
ys.push(yn);
|
|
3630
3802
|
});
|
|
3631
|
-
const pointSize = _optionalChain([yConfig, 'access',
|
|
3632
|
-
const fixedSize = _nullishCoalesce(_nullishCoalesce(_optionalChain([m, 'access',
|
|
3803
|
+
const pointSize = _optionalChain([yConfig, 'access', _243 => _243.custom, 'optionalAccess', _244 => _244.pointSize]);
|
|
3804
|
+
const fixedSize = _nullishCoalesce(_nullishCoalesce(_optionalChain([m, 'access', _245 => _245.sizeRange, 'optionalAccess', _246 => _246.fixed]), () => ( _optionalChain([pointSize, 'optionalAccess', _247 => _247.fixed]))), () => ( 5));
|
|
3633
3805
|
let colors = rows.map(() => base);
|
|
3634
3806
|
if (colorField) {
|
|
3635
3807
|
const cConfig = config(colorField, frame);
|
|
3636
3808
|
const values = rows.map((i) => num3(colorField.values[i]));
|
|
3637
3809
|
const extent = range2(values);
|
|
3638
|
-
colors = values.map((v) =>
|
|
3810
|
+
colors = values.map((v) => _chunkXWSPLZNCjs.valueColor.call(void 0, v, cConfig, base, extent));
|
|
3639
3811
|
}
|
|
3640
3812
|
let sizes = rows.map(() => fixedSize);
|
|
3641
3813
|
if (sizeField) {
|
|
3642
3814
|
const values = rows.map((i) => num3(sizeField.values[i]));
|
|
3643
3815
|
const [lo, hi] = _nullishCoalesce(range2(values), () => ( [0, 1]));
|
|
3644
|
-
const [min, max] = [_nullishCoalesce(_nullishCoalesce(_optionalChain([m, 'access',
|
|
3816
|
+
const [min, max] = [_nullishCoalesce(_nullishCoalesce(_optionalChain([m, 'access', _248 => _248.sizeRange, 'optionalAccess', _249 => _249.min]), () => ( _optionalChain([pointSize, 'optionalAccess', _250 => _250.min]))), () => ( 5)), _nullishCoalesce(_nullishCoalesce(_optionalChain([m, 'access', _251 => _251.sizeRange, 'optionalAccess', _252 => _252.max]), () => ( _optionalChain([pointSize, 'optionalAccess', _253 => _253.max]))), () => ( 20))];
|
|
3645
3817
|
sizes = values.map((v) => v == null ? min : min + (v - lo) / (hi - lo || 1) * (max - min));
|
|
3646
3818
|
}
|
|
3647
|
-
const fixedName = _optionalChain([m, 'access',
|
|
3648
|
-
const yName = _nullishCoalesce(yConfig.displayName, () => (
|
|
3819
|
+
const fixedName = _optionalChain([m, 'access', _254 => _254.name, 'optionalAccess', _255 => _255.fixed]);
|
|
3820
|
+
const yName = _nullishCoalesce(yConfig.displayName, () => ( _chunkXWSPLZNCjs.fieldDisplayName.call(void 0, yField, frame, multiple)));
|
|
3649
3821
|
out.push({
|
|
3650
3822
|
key: `${mi}/${frames.indexOf(frame)}/${yField.name}`,
|
|
3651
3823
|
name: fixedName ? yFields.length > 1 ? `${fixedName} ${yName}` : fixedName : yName,
|
|
@@ -3660,8 +3832,8 @@ function xySeries(panel, frames, scheme) {
|
|
|
3660
3832
|
ys,
|
|
3661
3833
|
colors,
|
|
3662
3834
|
sizes,
|
|
3663
|
-
show: _nullishCoalesce(_optionalChain([yConfig, 'access',
|
|
3664
|
-
lineWidth: _nullishCoalesce(_optionalChain([yConfig, 'access',
|
|
3835
|
+
show: _nullishCoalesce(_optionalChain([yConfig, 'access', _256 => _256.custom, 'optionalAccess', _257 => _257.show]), () => ( "points")),
|
|
3836
|
+
lineWidth: _nullishCoalesce(_optionalChain([yConfig, 'access', _258 => _258.custom, 'optionalAccess', _259 => _259.lineWidth]), () => ( 1))
|
|
3665
3837
|
});
|
|
3666
3838
|
}
|
|
3667
3839
|
}
|
|
@@ -3712,10 +3884,10 @@ function XYChartPanel({ panel, frames }) {
|
|
|
3712
3884
|
const { resolve, openLinks } = usePanelLinks(panel);
|
|
3713
3885
|
const series = _react.useMemo.call(void 0, () => xySeries(panel, frames, theme.scheme), [panel, frames, theme.scheme]);
|
|
3714
3886
|
const first = series[0];
|
|
3715
|
-
const showX = _optionalChain([first, 'optionalAccess',
|
|
3716
|
-
const showY = _optionalChain([first, 'optionalAccess',
|
|
3717
|
-
const xTitle = showX ? axisTitle(_optionalChain([first, 'optionalAccess',
|
|
3718
|
-
const yTitle = showY ? axisTitle(_optionalChain([first, 'optionalAccess',
|
|
3887
|
+
const showX = _optionalChain([first, 'optionalAccess', _260 => _260.xConfig, 'access', _261 => _261.custom, 'optionalAccess', _262 => _262.axisPlacement]) !== "hidden";
|
|
3888
|
+
const showY = _optionalChain([first, 'optionalAccess', _263 => _263.yConfig, 'access', _264 => _264.custom, 'optionalAccess', _265 => _265.axisPlacement]) !== "hidden";
|
|
3889
|
+
const xTitle = showX ? axisTitle(_optionalChain([first, 'optionalAccess', _266 => _266.xConfig])) : void 0;
|
|
3890
|
+
const yTitle = showY ? axisTitle(_optionalChain([first, 'optionalAccess', _267 => _267.yConfig])) : void 0;
|
|
3719
3891
|
const pad = {
|
|
3720
3892
|
top: EDGE,
|
|
3721
3893
|
right: EDGE,
|
|
@@ -3736,17 +3908,17 @@ function XYChartPanel({ panel, frames }) {
|
|
|
3736
3908
|
if (!first || !layout || series.every((s) => !s.rows.length)) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, {});
|
|
3737
3909
|
const xTicks = showX ? axisTicks(layout.x0, layout.x1, plotW < 220 ? 2 : plotW < 400 ? 3 : 5) : [];
|
|
3738
3910
|
const yTicks = showY ? axisTicks(layout.y0, layout.y1, plotH < 100 ? 2 : 4) : [];
|
|
3739
|
-
const gridX = _optionalChain([first, 'access',
|
|
3740
|
-
const gridY = _optionalChain([first, 'access',
|
|
3911
|
+
const gridX = _optionalChain([first, 'access', _268 => _268.xConfig, 'access', _269 => _269.custom, 'optionalAccess', _270 => _270.axisGridShow]) !== false;
|
|
3912
|
+
const gridY = _optionalChain([first, 'access', _271 => _271.yConfig, 'access', _272 => _272.custom, 'optionalAccess', _273 => _273.axisGridShow]) !== false;
|
|
3741
3913
|
const hover = touch && (touching || pinned === id) ? nearestPoint(series, layout.points, touch) : null;
|
|
3742
3914
|
const hoverLinks = hover ? rowLinks(panel, hover.series.frame, hover.series.rows[hover.index], frames.length > 1, resolve) : [];
|
|
3743
3915
|
const isPinned = !!hover && pinned === id;
|
|
3744
|
-
const legendItems = series.filter((s) => !_optionalChain([s, 'access',
|
|
3745
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
3916
|
+
const legendItems = series.filter((s) => !_optionalChain([s, 'access', _274 => _274.yConfig, 'access', _275 => _275.custom, 'optionalAccess', _276 => _276.hideFrom, 'optionalAccess', _277 => _277.legend]));
|
|
3917
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles14.fill, children: [
|
|
3746
3918
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3747
3919
|
_reactnative.View,
|
|
3748
3920
|
{
|
|
3749
|
-
style:
|
|
3921
|
+
style: styles14.fill,
|
|
3750
3922
|
onLayout,
|
|
3751
3923
|
onStartShouldSetResponder: () => true,
|
|
3752
3924
|
onResponderGrant: (e) => {
|
|
@@ -3768,7 +3940,7 @@ function XYChartPanel({ panel, frames }) {
|
|
|
3768
3940
|
size.width > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnativesvg2.default, { width: size.width, height: size.height, children: [
|
|
3769
3941
|
yTicks.map((t) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnativesvg.G, { children: [
|
|
3770
3942
|
gridY && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Line, { x1: pad.left, x2: pad.left + plotW, y1: layout.y(t), y2: layout.y(t), stroke: theme.grid, strokeWidth: 1 }),
|
|
3771
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Text, { x: pad.left - 6, y: layout.y(t) + 3, fontSize: 10, fill: theme.textMuted, textAnchor: "end", children:
|
|
3943
|
+
/* @__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: _chunkXWSPLZNCjs.formatValue.call(void 0, t, { ...first.yConfig, decimals: _nullishCoalesce(first.yConfig.decimals, () => ( tickDecimals(yTicks))) }) })
|
|
3772
3944
|
] }, `y${t}`)),
|
|
3773
3945
|
xTicks.map((t) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnativesvg.G, { children: [
|
|
3774
3946
|
gridX && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Line, { x1: layout.x(t), x2: layout.x(t), y1: pad.top, y2: pad.top + plotH, stroke: theme.grid, strokeWidth: 1 }),
|
|
@@ -3780,7 +3952,7 @@ function XYChartPanel({ panel, frames }) {
|
|
|
3780
3952
|
fontSize: 10,
|
|
3781
3953
|
fill: theme.textMuted,
|
|
3782
3954
|
textAnchor: layout.x(t) - pad.left < 20 ? "start" : pad.left + plotW - layout.x(t) < 20 ? "end" : "middle",
|
|
3783
|
-
children:
|
|
3955
|
+
children: _chunkXWSPLZNCjs.formatValue.call(void 0, t, { ...first.xConfig, decimals: _nullishCoalesce(first.xConfig.decimals, () => ( tickDecimals(xTicks))) })
|
|
3784
3956
|
}
|
|
3785
3957
|
)
|
|
3786
3958
|
] }, `x${t}`)),
|
|
@@ -3850,7 +4022,7 @@ function nearestPoint(series, points, at) {
|
|
|
3850
4022
|
});
|
|
3851
4023
|
return best;
|
|
3852
4024
|
}
|
|
3853
|
-
var
|
|
4025
|
+
var styles14 = _reactnative.StyleSheet.create({
|
|
3854
4026
|
fill: { flex: 1 }
|
|
3855
4027
|
});
|
|
3856
4028
|
|
|
@@ -3893,15 +4065,15 @@ function DashboardView({ mode = "auto", header, footer, refreshable }) {
|
|
|
3893
4065
|
const width = (measured.width || window.width) - insets.left - insets.right;
|
|
3894
4066
|
const layoutMode = mode === "auto" ? width >= TABLET_WIDTH ? "grid" : "phone" : mode;
|
|
3895
4067
|
const sections = _react.useMemo.call(void 0,
|
|
3896
|
-
() =>
|
|
4068
|
+
() => _chunkXWSPLZNCjs.layoutDashboard.call(void 0, dashboard, layoutMode, { values: variables, info: variableInfo2 }),
|
|
3897
4069
|
[dashboard, layoutMode, variables, variableInfo2]
|
|
3898
4070
|
);
|
|
3899
4071
|
const [toggled, setToggled] = _react.useState.call(void 0, {});
|
|
3900
4072
|
const { seen, viewportH, onScroll, onViewportLayout, onSectionLayout } = useSeenSections(window.height);
|
|
3901
4073
|
const maxPanelH = Math.max(MIN_PANEL_H, viewportH - SIDE * 2);
|
|
3902
4074
|
const contentW = width - SIDE * 2;
|
|
3903
|
-
const canRefresh = _nullishCoalesce(refreshable, () => ( dashboard.panels.some((p) =>
|
|
3904
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [
|
|
4075
|
+
const canRefresh = _nullishCoalesce(refreshable, () => ( dashboard.panels.some((p) => _chunkXWSPLZNCjs.panelHasQueries.call(void 0, p) || _optionalChain([p, 'access', _278 => _278.panels, 'optionalAccess', _279 => _279.some, 'call', _280 => _280(_chunkXWSPLZNCjs.panelHasQueries)]))));
|
|
4076
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [styles15.fill, { backgroundColor: theme.background }], onLayout, children: [
|
|
3905
4077
|
width > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3906
4078
|
_reactnative.ScrollView,
|
|
3907
4079
|
{
|
|
@@ -3909,31 +4081,31 @@ function DashboardView({ mode = "auto", header, footer, refreshable }) {
|
|
|
3909
4081
|
onScrollBeginDrag: () => setPinned(null),
|
|
3910
4082
|
onLayout: onViewportLayout,
|
|
3911
4083
|
scrollEventThrottle: 100,
|
|
3912
|
-
contentContainerStyle: [
|
|
4084
|
+
contentContainerStyle: [styles15.content, { paddingLeft: SIDE + insets.left, paddingRight: SIDE + insets.right }],
|
|
3913
4085
|
keyboardShouldPersistTaps: "handled",
|
|
3914
4086
|
refreshControl: canRefresh ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.RefreshControl, { refreshing: false, onRefresh: refresh }) : void 0,
|
|
3915
4087
|
children: [
|
|
3916
4088
|
header,
|
|
3917
4089
|
sections.map((section) => {
|
|
3918
4090
|
const collapsed = _nullishCoalesce(toggled[section.key], () => ( section.collapsed));
|
|
3919
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
4091
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles15.section, onLayout: (e) => onSectionLayout(section.key, e), children: [
|
|
3920
4092
|
section.row && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3921
4093
|
_reactnative.Pressable,
|
|
3922
4094
|
{
|
|
3923
4095
|
onPress: () => setToggled((t) => ({ ...t, [section.key]: !collapsed })),
|
|
3924
|
-
style:
|
|
4096
|
+
style: styles15.rowHeader,
|
|
3925
4097
|
accessibilityRole: "button",
|
|
3926
4098
|
accessibilityState: { expanded: !collapsed },
|
|
3927
4099
|
children: [
|
|
3928
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3929
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
4100
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles15.chevron, { color: theme.textMuted }], children: collapsed ? "\u25B8" : "\u25BE" }),
|
|
4101
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles15.rowTitle, { color: theme.text }], numberOfLines: 2, children: _chunkXWSPLZNCjs.interpolate.call(void 0, _nullishCoalesce(section.row.title, () => ( "")), { values: variables, info: variableInfo2, scoped: section.row.scopedVars, timezone: dashboard.timezone }) })
|
|
3930
4102
|
]
|
|
3931
4103
|
}
|
|
3932
4104
|
),
|
|
3933
4105
|
!collapsed && layoutMode === "grid" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, GridSection, { grid: section.grid, width: contentW, maxPanelH, deferred: !seen.has(section.key) }),
|
|
3934
|
-
!collapsed && layoutMode === "phone" && section.rows.map((row, ri) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style:
|
|
3935
|
-
const w = (contentW + GAP2) * (cell.span /
|
|
3936
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PanelCard, { panel: cell.panel, width: w, height: Math.min(
|
|
4106
|
+
!collapsed && layoutMode === "phone" && section.rows.map((row, ri) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles15.row, children: row.cells.map((cell) => {
|
|
4107
|
+
const w = (contentW + GAP2) * (cell.span / _chunkXWSPLZNCjs.GRID_COLUMNS) - GAP2;
|
|
4108
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PanelCard, { panel: cell.panel, width: w, height: Math.min(_chunkXWSPLZNCjs.gridUnitsToPx.call(void 0, row.h), maxPanelH), deferred: !seen.has(section.key) }, cell.key);
|
|
3937
4109
|
}) }, ri))
|
|
3938
4110
|
] }, section.key);
|
|
3939
4111
|
})
|
|
@@ -3944,10 +4116,10 @@ function DashboardView({ mode = "auto", header, footer, refreshable }) {
|
|
|
3944
4116
|
] });
|
|
3945
4117
|
}
|
|
3946
4118
|
function GridSection({ grid, width, maxPanelH, deferred }) {
|
|
3947
|
-
const colW = (width + GAP2) /
|
|
3948
|
-
const tallest = Math.max(0, ...grid.cells.map((c) =>
|
|
4119
|
+
const colW = (width + GAP2) / _chunkXWSPLZNCjs.GRID_COLUMNS;
|
|
4120
|
+
const tallest = Math.max(0, ...grid.cells.map((c) => _chunkXWSPLZNCjs.gridUnitsToPx.call(void 0, c.h)));
|
|
3949
4121
|
const scale = tallest > maxPanelH ? maxPanelH / tallest : 1;
|
|
3950
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: { height:
|
|
4122
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: { height: _chunkXWSPLZNCjs.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: _chunkXWSPLZNCjs.gridOffsetPx.call(void 0, cell.y) * scale }], children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PanelCard, { panel: cell.panel, width: cell.w * colW - GAP2, height: _chunkXWSPLZNCjs.gridUnitsToPx.call(void 0, cell.h) * scale, deferred }) }, cell.key)) });
|
|
3951
4123
|
}
|
|
3952
4124
|
function useSeenSections(viewportHeight) {
|
|
3953
4125
|
const [seen, setSeen] = _react.useState.call(void 0, /* @__PURE__ */ new Set());
|
|
@@ -3996,27 +4168,29 @@ function PanelCard(props) {
|
|
|
3996
4168
|
}
|
|
3997
4169
|
function PanelError({ panel, width, height, error }) {
|
|
3998
4170
|
const theme = useDashTheme();
|
|
3999
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [
|
|
4000
|
-
!!panel.title && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
4001
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
4002
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
4171
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [styles15.card, { width, height, backgroundColor: theme.surface, borderColor: theme.danger }], accessibilityRole: "alert", children: [
|
|
4172
|
+
!!panel.title && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles15.title, styles15.errorTitle, { color: theme.text }], numberOfLines: 1, children: panel.title }),
|
|
4173
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles15.errorText, { color: theme.danger }], children: "This panel couldn\u2019t be shown." }),
|
|
4174
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles15.errorText, { color: theme.textMuted }], numberOfLines: 3, children: error.message })
|
|
4003
4175
|
] });
|
|
4004
4176
|
}
|
|
4005
4177
|
function PanelCardContent({ panel, width, height, deferred }) {
|
|
4006
4178
|
const theme = useDashTheme();
|
|
4007
4179
|
const { dashboard, variables, variableInfo: variableInfo2 } = useDashboard();
|
|
4008
4180
|
const { resolve, openLinks } = usePanelLinks(panel);
|
|
4009
|
-
const group =
|
|
4010
|
-
const input =
|
|
4181
|
+
const group = _chunkXWSPLZNCjs.isInputGroup.call(void 0, panel);
|
|
4182
|
+
const input = _chunkXWSPLZNCjs.isInputPanel.call(void 0, panel) || group;
|
|
4011
4183
|
const form = _react.useContext.call(void 0, InputFormContext);
|
|
4012
|
-
const problem = group ? _optionalChain([form, 'optionalAccess',
|
|
4013
|
-
const hasLinks = !!_optionalChain([panel, 'access',
|
|
4014
|
-
const
|
|
4015
|
-
const
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4184
|
+
const problem = group ? _optionalChain([form, 'optionalAccess', _281 => _281.group, 'optionalCall', _282 => _282(panel), 'optionalAccess', _283 => _283.problem]) : _chunkXWSPLZNCjs.isInputPanel.call(void 0, panel) ? _optionalChain([form, 'optionalAccess', _284 => _284.problem, 'optionalCall', _285 => _285(panel.options.metric)]) : void 0;
|
|
4185
|
+
const hasLinks = !!_optionalChain([panel, 'access', _286 => _286.links, 'optionalAccess', _287 => _287.length]);
|
|
4186
|
+
const filled = !group && _chunkXWSPLZNCjs.isInputPanel.call(void 0, panel) && !!_optionalChain([form, 'optionalAccess', _288 => _288.filled, 'optionalCall', _289 => _289(panel.options.metric)]);
|
|
4187
|
+
const hasTitle = !!panel.title || hasLinks || !!problem || filled;
|
|
4188
|
+
const title = panel.title ? _chunkXWSPLZNCjs.interpolate.call(void 0, panel.title, { values: variables, info: variableInfo2, scoped: panel.scopedVars, timezone: dashboard.timezone }) : "";
|
|
4189
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [styles15.card, { width, height, backgroundColor: theme.surface, borderColor: filled ? theme.accent : theme.border }, filled && { borderWidth: 2 }], children: [
|
|
4190
|
+
hasTitle && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles15.titleRow, children: [
|
|
4191
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles15.title, { color: theme.text }], numberOfLines: 1, children: title }),
|
|
4192
|
+
filled && !problem && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles15.problem, { color: theme.accent }], numberOfLines: 1, children: "From voice" }),
|
|
4193
|
+
!!problem && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles15.problem, { color: theme.danger }], numberOfLines: 1, accessibilityRole: "alert", children: problem }),
|
|
4020
4194
|
hasLinks && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4021
4195
|
_reactnative.Pressable,
|
|
4022
4196
|
{
|
|
@@ -4024,28 +4198,28 @@ function PanelCardContent({ panel, width, height, deferred }) {
|
|
|
4024
4198
|
accessibilityRole: "button",
|
|
4025
4199
|
accessibilityLabel: panel.links.length === 1 ? panel.links[0].title || "Open link" : "Panel links",
|
|
4026
4200
|
hitSlop: 10,
|
|
4027
|
-
style: ({ pressed }) => [
|
|
4201
|
+
style: ({ pressed }) => [styles15.titleLink, pressed && { opacity: 0.6 }],
|
|
4028
4202
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, LinkIcon, { color: theme.textMuted })
|
|
4029
4203
|
}
|
|
4030
4204
|
)
|
|
4031
4205
|
] }),
|
|
4032
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style:
|
|
4206
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles15.body, children: deferred && !input ? null : input ? group ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InputGroupBody, { panel }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InputPanelBody, { panel }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DataPanelBody, { panel, width: width - 24, height: height - (hasTitle ? TITLE_H : 0) - 16 }) })
|
|
4033
4207
|
] });
|
|
4034
4208
|
}
|
|
4035
4209
|
function DataPanelBody({ panel, width, height }) {
|
|
4036
4210
|
const theme = useDashTheme();
|
|
4037
|
-
const needsData =
|
|
4211
|
+
const needsData = _chunkXWSPLZNCjs.panelHasQueries.call(void 0, panel);
|
|
4038
4212
|
const data = usePanelData(panel, width, needsData);
|
|
4039
4213
|
const Component2 = panelComponent(panel.type);
|
|
4040
4214
|
if (needsData && data.error) {
|
|
4041
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style:
|
|
4215
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles15.center, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles15.error, { color: theme.danger }], numberOfLines: 4, children: data.error }) });
|
|
4042
4216
|
}
|
|
4043
4217
|
if (needsData && data.loading && !data.frames.length) {
|
|
4044
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style:
|
|
4218
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles15.center, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.ActivityIndicator, { color: theme.textMuted }) });
|
|
4045
4219
|
}
|
|
4046
4220
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component2, { panel, frames: data.frames, width, height });
|
|
4047
4221
|
}
|
|
4048
|
-
var
|
|
4222
|
+
var styles15 = _reactnative.StyleSheet.create({
|
|
4049
4223
|
fill: { flex: 1 },
|
|
4050
4224
|
content: { padding: SIDE, paddingBottom: 32, gap: GAP2 },
|
|
4051
4225
|
section: { gap: GAP2 },
|
|
@@ -4070,41 +4244,185 @@ var styles14 = _reactnative.StyleSheet.create({
|
|
|
4070
4244
|
|
|
4071
4245
|
|
|
4072
4246
|
|
|
4247
|
+
// src/ui/speech.ts
|
|
4248
|
+
var WEB_ERRORS = {
|
|
4249
|
+
"not-allowed": "Microphone access is blocked for this site",
|
|
4250
|
+
"service-not-allowed": "Speech recognition isn\u2019t allowed in this browser",
|
|
4251
|
+
"audio-capture": "No microphone found",
|
|
4252
|
+
network: "Speech recognition needs an internet connection",
|
|
4253
|
+
"no-speech": "Didn\u2019t hear anything",
|
|
4254
|
+
"language-not-supported": "Speech recognition doesn\u2019t support this language"
|
|
4255
|
+
};
|
|
4256
|
+
function webSpeechRecognizer() {
|
|
4257
|
+
const g = globalThis;
|
|
4258
|
+
const Recognition = _nullishCoalesce(g.SpeechRecognition, () => ( g.webkitSpeechRecognition));
|
|
4259
|
+
if (!Recognition) return null;
|
|
4260
|
+
return {
|
|
4261
|
+
start(o) {
|
|
4262
|
+
const r = new Recognition();
|
|
4263
|
+
if (o.lang) r.lang = o.lang;
|
|
4264
|
+
r.interimResults = true;
|
|
4265
|
+
r.continuous = !!o.continuous;
|
|
4266
|
+
r.maxAlternatives = 1;
|
|
4267
|
+
let delivered = false;
|
|
4268
|
+
let aborted = false;
|
|
4269
|
+
let lastText = "";
|
|
4270
|
+
r.onresult = (e) => {
|
|
4271
|
+
let text = "";
|
|
4272
|
+
let final = true;
|
|
4273
|
+
for (let i = 0; i < e.results.length; i++) {
|
|
4274
|
+
text += e.results[i][0].transcript;
|
|
4275
|
+
if (!e.results[i].isFinal) final = false;
|
|
4276
|
+
}
|
|
4277
|
+
lastText = text.trim();
|
|
4278
|
+
if (o.continuous) final = false;
|
|
4279
|
+
if (final) delivered = true;
|
|
4280
|
+
o.onText(lastText, final);
|
|
4281
|
+
};
|
|
4282
|
+
r.onerror = (e) => {
|
|
4283
|
+
if (e.error === "aborted") return;
|
|
4284
|
+
o.onError(_nullishCoalesce(WEB_ERRORS[e.error], () => ( "Speech recognition stopped")));
|
|
4285
|
+
};
|
|
4286
|
+
r.onend = () => {
|
|
4287
|
+
if (!delivered && !aborted && lastText) o.onText(lastText, true);
|
|
4288
|
+
o.onEnd();
|
|
4289
|
+
};
|
|
4290
|
+
try {
|
|
4291
|
+
r.start();
|
|
4292
|
+
} catch (e7) {
|
|
4293
|
+
queueMicrotask(() => {
|
|
4294
|
+
o.onError("Speech recognition couldn\u2019t start");
|
|
4295
|
+
o.onEnd();
|
|
4296
|
+
});
|
|
4297
|
+
}
|
|
4298
|
+
return {
|
|
4299
|
+
stop: () => r.stop(),
|
|
4300
|
+
abort: () => {
|
|
4301
|
+
aborted = true;
|
|
4302
|
+
r.abort();
|
|
4303
|
+
}
|
|
4304
|
+
};
|
|
4305
|
+
}
|
|
4306
|
+
};
|
|
4307
|
+
}
|
|
4308
|
+
|
|
4309
|
+
// src/ui/inputs/VoiceFill.tsx
|
|
4310
|
+
|
|
4311
|
+
function useVoiceFill({ speech, lang, filler, form, onFilled, onError }) {
|
|
4312
|
+
const [on, setOn] = _react.useState.call(void 0, false);
|
|
4313
|
+
const [filling, setFilling] = _react.useState.call(void 0, false);
|
|
4314
|
+
const [heard, setHeard] = _react.useState.call(void 0, null);
|
|
4315
|
+
const session = _react.useRef.call(void 0, null);
|
|
4316
|
+
const alive = _react.useRef.call(void 0, true);
|
|
4317
|
+
const latest = _react.useRef.call(void 0, { form, filler, onFilled, onError });
|
|
4318
|
+
_react.useEffect.call(void 0, () => {
|
|
4319
|
+
latest.current = { form, filler, onFilled, onError };
|
|
4320
|
+
});
|
|
4321
|
+
_react.useEffect.call(void 0, () => {
|
|
4322
|
+
alive.current = true;
|
|
4323
|
+
return () => {
|
|
4324
|
+
alive.current = false;
|
|
4325
|
+
_optionalChain([session, 'access', _290 => _290.current, 'optionalAccess', _291 => _291.abort, 'call', _292 => _292()]);
|
|
4326
|
+
};
|
|
4327
|
+
}, []);
|
|
4328
|
+
const fill = async (said) => {
|
|
4329
|
+
const { form: f, filler: run } = latest.current;
|
|
4330
|
+
if (!run) return;
|
|
4331
|
+
setFilling(true);
|
|
4332
|
+
let result;
|
|
4333
|
+
try {
|
|
4334
|
+
result = await run(f, said);
|
|
4335
|
+
} catch (e8) {
|
|
4336
|
+
result = { values: {}, problems: [{ key: "", problem: "Couldn\u2019t fill the form" }] };
|
|
4337
|
+
}
|
|
4338
|
+
if (!alive.current) return;
|
|
4339
|
+
setFilling(false);
|
|
4340
|
+
latest.current.onFilled(result, said);
|
|
4341
|
+
};
|
|
4342
|
+
const toggle = () => {
|
|
4343
|
+
if (!speech || !filler) return;
|
|
4344
|
+
if (session.current) {
|
|
4345
|
+
session.current.stop();
|
|
4346
|
+
return;
|
|
4347
|
+
}
|
|
4348
|
+
stopListening();
|
|
4349
|
+
setHeard(null);
|
|
4350
|
+
let mine = null;
|
|
4351
|
+
let ended = false;
|
|
4352
|
+
const end = () => {
|
|
4353
|
+
ended = true;
|
|
4354
|
+
if (session.current === mine) session.current = null;
|
|
4355
|
+
claimListening(mine, true);
|
|
4356
|
+
if (alive.current) {
|
|
4357
|
+
setOn(false);
|
|
4358
|
+
setHeard(null);
|
|
4359
|
+
}
|
|
4360
|
+
};
|
|
4361
|
+
try {
|
|
4362
|
+
mine = speech.start({
|
|
4363
|
+
lang,
|
|
4364
|
+
hints: _chunkXWSPLZNCjs.fillHints.call(void 0, form),
|
|
4365
|
+
continuous: true,
|
|
4366
|
+
onText(text, final) {
|
|
4367
|
+
if (!final) return setHeard(text || null);
|
|
4368
|
+
if (text.trim()) fill(text.trim());
|
|
4369
|
+
},
|
|
4370
|
+
onError: (message) => alive.current && latest.current.onError(message),
|
|
4371
|
+
onEnd: end
|
|
4372
|
+
});
|
|
4373
|
+
} catch (e9) {
|
|
4374
|
+
onError("Dictation couldn\u2019t start");
|
|
4375
|
+
return;
|
|
4376
|
+
}
|
|
4377
|
+
if (!ended) {
|
|
4378
|
+
session.current = mine;
|
|
4379
|
+
claimListening(mine);
|
|
4380
|
+
setOn(true);
|
|
4381
|
+
}
|
|
4382
|
+
};
|
|
4383
|
+
return { available: !!speech && !!filler && form.fields.length > 0, listening: on, filling, heard, toggle };
|
|
4384
|
+
}
|
|
4385
|
+
|
|
4386
|
+
// src/ui/inputs/InputForm.tsx
|
|
4387
|
+
|
|
4073
4388
|
var NO_CHOICES = {};
|
|
4074
4389
|
var NO_DEFAULTS = {};
|
|
4390
|
+
var webSpeech;
|
|
4391
|
+
var defaultSpeech = () => _reactnative.Platform.OS === "web" ? webSpeech ??= webSpeechRecognizer() : null;
|
|
4075
4392
|
function savedValues(panels, entries) {
|
|
4076
4393
|
const values = {};
|
|
4077
4394
|
for (const p of panels) {
|
|
4078
4395
|
const mine = entries.filter((e) => e.metric === p.options.metric);
|
|
4079
|
-
values[p.options.metric] = p.options.multi ? mine.length ? mine.map((e) => _nullishCoalesce(e.text, () => ( e.value))) : null :
|
|
4396
|
+
values[p.options.metric] = p.options.multi ? mine.length ? mine.map((e) => _nullishCoalesce(e.text, () => ( e.value))) : null : _chunkXWSPLZNCjs.entryToInputValue.call(void 0, p, mine[0]);
|
|
4080
4397
|
}
|
|
4081
4398
|
return values;
|
|
4082
4399
|
}
|
|
4083
4400
|
async function lastItems(store, group) {
|
|
4084
|
-
const metrics =
|
|
4401
|
+
const metrics = _chunkXWSPLZNCjs.groupFields.call(void 0, group).map((f) => f.options.metric);
|
|
4085
4402
|
const latest = (await Promise.all(metrics.map((m) => store.latest(m)))).filter((e) => !!e).sort((a, b) => b.ts - a.ts)[0];
|
|
4086
4403
|
if (!latest) return [];
|
|
4087
|
-
return
|
|
4404
|
+
return _chunkXWSPLZNCjs.entriesToItems.call(void 0, group, _chunkXWSPLZNCjs.sameSave.call(void 0, latest, await store.list({ metrics, from: latest.ts, to: latest.ts })));
|
|
4088
4405
|
}
|
|
4089
4406
|
function freshItem(group, position, last) {
|
|
4090
4407
|
const item = {};
|
|
4091
|
-
for (const f of
|
|
4408
|
+
for (const f of _chunkXWSPLZNCjs.groupFields.call(void 0, group)) {
|
|
4092
4409
|
const d = f.options.default;
|
|
4093
|
-
const v = d === "last" ? _optionalChain([last, 'optionalAccess',
|
|
4410
|
+
const v = d === "last" ? _optionalChain([last, 'optionalAccess', _293 => _293[position], 'optionalAccess', _294 => _294[f.options.metric]]) : d;
|
|
4094
4411
|
if (v !== void 0 && v !== null) item[f.options.metric] = v;
|
|
4095
4412
|
}
|
|
4096
4413
|
return item;
|
|
4097
4414
|
}
|
|
4098
4415
|
function baseItems(group, editing, last) {
|
|
4099
4416
|
const start = group.options.start;
|
|
4100
|
-
const values = editing ?
|
|
4417
|
+
const values = editing ? _chunkXWSPLZNCjs.entriesToItems.call(void 0, group, editing) : start === "last" && _optionalChain([last, 'optionalAccess', _295 => _295.length]) ? last : Array.from({ length: typeof start === "number" ? Math.max(0, start) : 1 }, (_, i) => freshItem(group, i, last));
|
|
4101
4418
|
return values.map((v, i) => ({ key: `b${i}`, values: v, edited: [] }));
|
|
4102
4419
|
}
|
|
4103
4420
|
var nextItemKey = 1;
|
|
4104
|
-
function InputForm({ dashboard, store, onSaved, choices = NO_CHOICES, header, timestamp, defaults: given = NO_DEFAULTS, beforeSave, editing }) {
|
|
4421
|
+
function InputForm({ dashboard, store, onSaved, choices = NO_CHOICES, header, timestamp, defaults: given = NO_DEFAULTS, beforeSave, editing, speech: givenSpeech, speechLang, filler = _chunkXWSPLZNCjs.ruleFiller }) {
|
|
4422
|
+
const speech = givenSpeech === void 0 ? defaultSpeech() : givenSpeech;
|
|
4105
4423
|
const theme = useDashTheme();
|
|
4106
|
-
const panels = _react.useMemo.call(void 0, () =>
|
|
4107
|
-
const groups = _react.useMemo.call(void 0, () =>
|
|
4424
|
+
const panels = _react.useMemo.call(void 0, () => _chunkXWSPLZNCjs.plainInputPanels.call(void 0, dashboard), [dashboard]);
|
|
4425
|
+
const groups = _react.useMemo.call(void 0, () => _chunkXWSPLZNCjs.inputGroups.call(void 0, dashboard), [dashboard]);
|
|
4108
4426
|
const saved = _react.useMemo.call(void 0, () => editing ? savedValues(panels, editing) : NO_DEFAULTS, [panels, editing]);
|
|
4109
4427
|
const [defaults, setDefaults] = _react.useState.call(void 0, {});
|
|
4110
4428
|
const [edits, setEdits] = _react.useState.call(void 0, {});
|
|
@@ -4113,6 +4431,9 @@ function InputForm({ dashboard, store, onSaved, choices = NO_CHOICES, header, ti
|
|
|
4113
4431
|
const [offsetMs, setOffsetMs] = _react.useState.call(void 0, 0);
|
|
4114
4432
|
const [status, setStatus] = _react.useState.call(void 0, null);
|
|
4115
4433
|
const [checked, setChecked] = _react.useState.call(void 0, false);
|
|
4434
|
+
const [filled, setFilled] = _react.useState.call(void 0, {});
|
|
4435
|
+
const [beforeFill, setBeforeFill] = _react.useState.call(void 0, null);
|
|
4436
|
+
const fillable = _react.useMemo.call(void 0, () => _chunkXWSPLZNCjs.fillForm.call(void 0, dashboard, choices), [dashboard, choices]);
|
|
4116
4437
|
_react.useEffect.call(void 0, () => {
|
|
4117
4438
|
let run = 0;
|
|
4118
4439
|
const load = async () => {
|
|
@@ -4120,12 +4441,12 @@ function InputForm({ dashboard, store, onSaved, choices = NO_CHOICES, header, ti
|
|
|
4120
4441
|
const next = {};
|
|
4121
4442
|
for (const p of panels) {
|
|
4122
4443
|
const d = p.options.default;
|
|
4123
|
-
if (d === "last") next[p.options.metric] =
|
|
4444
|
+
if (d === "last") next[p.options.metric] = _chunkXWSPLZNCjs.entryToInputValue.call(void 0, p, await store.latest(p.options.metric));
|
|
4124
4445
|
else if (d !== void 0) next[p.options.metric] = d;
|
|
4125
4446
|
}
|
|
4126
4447
|
const lastNext = {};
|
|
4127
4448
|
for (const g of groups) {
|
|
4128
|
-
const wanted = g.options.start === "last" ||
|
|
4449
|
+
const wanted = g.options.start === "last" || _chunkXWSPLZNCjs.groupFields.call(void 0, g).some((f) => f.options.default === "last");
|
|
4129
4450
|
if (wanted) lastNext[groupKey(g)] = await lastItems(store, g);
|
|
4130
4451
|
}
|
|
4131
4452
|
if (mine === run) {
|
|
@@ -4149,41 +4470,73 @@ function InputForm({ dashboard, store, onSaved, choices = NO_CHOICES, header, ti
|
|
|
4149
4470
|
setValue: (m, v) => {
|
|
4150
4471
|
setStatus(null);
|
|
4151
4472
|
setEdits((e) => ({ ...e, [m]: v }));
|
|
4473
|
+
setFilled((f) => {
|
|
4474
|
+
if (!(m in f)) return f;
|
|
4475
|
+
const { [m]: _, ...rest } = f;
|
|
4476
|
+
return rest;
|
|
4477
|
+
});
|
|
4478
|
+
setBeforeFill(null);
|
|
4152
4479
|
},
|
|
4153
4480
|
isDirty: (m) => m in edits,
|
|
4481
|
+
filled: (m) => m in filled,
|
|
4154
4482
|
store,
|
|
4155
4483
|
choices,
|
|
4484
|
+
speech,
|
|
4485
|
+
speechLang,
|
|
4156
4486
|
problem: (m) => {
|
|
4157
4487
|
const p = panels.find((x) => x.options.metric === m);
|
|
4158
|
-
return p && (checked || m in edits) ?
|
|
4488
|
+
return p && (checked || m in edits) ? _chunkXWSPLZNCjs.inputProblem.call(void 0, p, value(m)) : void 0;
|
|
4159
4489
|
},
|
|
4160
4490
|
group: (g) => groupState(g, itemsOf(g), last[groupKey(g)], groupKey(g) in groupEdits, checked, (update) => {
|
|
4161
4491
|
setStatus(null);
|
|
4162
4492
|
setGroupEdits((all) => ({ ...all, [groupKey(g)]: update(_nullishCoalesce(_nullishCoalesce(all[groupKey(g)], () => ( base[groupKey(g)])), () => ( []))) }));
|
|
4163
4493
|
})
|
|
4164
4494
|
};
|
|
4165
|
-
}, [edits, saved, defaults, given, store, choices, panels, checked, itemsOf, last, groupEdits, base]);
|
|
4495
|
+
}, [edits, saved, defaults, given, store, choices, speech, speechLang, panels, checked, itemsOf, last, groupEdits, base, filled]);
|
|
4496
|
+
const clearFill = () => {
|
|
4497
|
+
setFilled({});
|
|
4498
|
+
setBeforeFill(null);
|
|
4499
|
+
};
|
|
4500
|
+
const onFilled = _react.useCallback.call(void 0,
|
|
4501
|
+
(result, said) => {
|
|
4502
|
+
const keys = Object.keys(result.values);
|
|
4503
|
+
const label = (key) => _nullishCoalesce(_optionalChain([fillable, 'access', _296 => _296.fields, 'access', _297 => _297.find, 'call', _298 => _298((f) => f.key === key), 'optionalAccess', _299 => _299.label]), () => ( key));
|
|
4504
|
+
const problem = result.problems[0];
|
|
4505
|
+
const problemText = problem ? problem.key ? `${label(problem.key)}: ${problem.problem.charAt(0).toLowerCase()}${problem.problem.slice(1)}` : problem.problem : "";
|
|
4506
|
+
if (!keys.length) {
|
|
4507
|
+
setStatus(problem ? `Couldn\u2019t fill. ${problemText}` : `Didn\u2019t catch any fields in \u201C${said}\u201D`);
|
|
4508
|
+
return;
|
|
4509
|
+
}
|
|
4510
|
+
setBeforeFill(edits);
|
|
4511
|
+
setEdits({ ...edits, ...result.values });
|
|
4512
|
+
setFilled(Object.fromEntries(keys.map((k) => [k, true])));
|
|
4513
|
+
const more = result.problems.length > 1 ? ` (+${result.problems.length - 1} more)` : "";
|
|
4514
|
+
setStatus(`Filled ${keys.length} ${keys.length === 1 ? "field" : "fields"}. Check, then Save${problem ? `. ${problemText}${more}` : ""}`);
|
|
4515
|
+
},
|
|
4516
|
+
[fillable, edits]
|
|
4517
|
+
);
|
|
4518
|
+
const voice = useVoiceFill({ speech, lang: speechLang, filler, form: fillable, onFilled, onError: setStatus });
|
|
4166
4519
|
const dirty = Object.keys(edits).length + groups.reduce((n, g) => n + groupChanges(_nullishCoalesce(base[groupKey(g)], () => ( [])), groupEdits[groupKey(g)]), 0);
|
|
4167
4520
|
const recordedGroups = _react.useCallback.call(void 0,
|
|
4168
|
-
() => groups.filter((g) => editing || groupKey(g) in groupEdits ||
|
|
4521
|
+
() => groups.filter((g) => editing || groupKey(g) in groupEdits || _chunkXWSPLZNCjs.groupFields.call(void 0, g).some((f) => f.options.record === "always")),
|
|
4169
4522
|
[groups, editing, groupEdits]
|
|
4170
4523
|
);
|
|
4171
4524
|
const save = _react.useCallback.call(void 0, async () => {
|
|
4172
4525
|
const problems = panels.flatMap((p) => {
|
|
4173
|
-
const problem =
|
|
4526
|
+
const problem = _chunkXWSPLZNCjs.inputProblem.call(void 0, p, state.value(p.options.metric));
|
|
4174
4527
|
return problem ? [`${p.title || p.options.metric}: ${problem.toLowerCase()}`] : [];
|
|
4175
4528
|
});
|
|
4176
|
-
for (const g of recordedGroups()) problems.push(...
|
|
4529
|
+
for (const g of recordedGroups()) problems.push(..._chunkXWSPLZNCjs.groupProblems.call(void 0, g, itemsOf(g).map((i) => i.values)));
|
|
4177
4530
|
if (problems.length) {
|
|
4178
4531
|
setChecked(true);
|
|
4179
4532
|
setStatus(problems.length === 1 ? `Can\u2019t save. ${problems[0]}` : `Can\u2019t save: ${problems.length} fields need fixing`);
|
|
4180
4533
|
return;
|
|
4181
4534
|
}
|
|
4182
|
-
const ts = _nullishCoalesce(_optionalChain([editing, 'optionalAccess',
|
|
4183
|
-
const saveId = _nullishCoalesce(_optionalChain([editing, 'optionalAccess',
|
|
4535
|
+
const ts = _nullishCoalesce(_optionalChain([editing, 'optionalAccess', _300 => _300[0], 'optionalAccess', _301 => _301.ts]), () => ( (header !== void 0 ? _nullishCoalesce(_optionalChain([timestamp, 'optionalCall', _302 => _302()]), () => ( Date.now())) : Date.now() + offsetMs)));
|
|
4536
|
+
const saveId = _nullishCoalesce(_optionalChain([editing, 'optionalAccess', _303 => _303.find, 'call', _304 => _304((e) => e.save), 'optionalAccess', _305 => _305.save]), () => ( _chunkXWSPLZNCjs.newSaveId.call(void 0, )));
|
|
4184
4537
|
const entries = [
|
|
4185
|
-
...panels.filter((p) => editing || p.options.metric in edits || p.options.record === "always").flatMap((p) =>
|
|
4186
|
-
...recordedGroups().flatMap((g) =>
|
|
4538
|
+
...panels.filter((p) => editing || p.options.metric in edits || p.options.record === "always").flatMap((p) => _chunkXWSPLZNCjs.toEntries.call(void 0, p, state.value(p.options.metric), ts, { save: saveId })),
|
|
4539
|
+
...recordedGroups().flatMap((g) => _chunkXWSPLZNCjs.groupToEntries.call(void 0, g, itemsOf(g).map((i) => i.values), ts, saveId))
|
|
4187
4540
|
];
|
|
4188
4541
|
if (!entries.length) return;
|
|
4189
4542
|
const extra = beforeSave ? await beforeSave(ts) : [];
|
|
@@ -4192,26 +4545,49 @@ function InputForm({ dashboard, store, onSaved, choices = NO_CHOICES, header, ti
|
|
|
4192
4545
|
setEdits({});
|
|
4193
4546
|
setGroupEdits({});
|
|
4194
4547
|
setChecked(false);
|
|
4548
|
+
clearFill();
|
|
4195
4549
|
setOffsetMs(0);
|
|
4196
4550
|
setStatus(`Saved ${added.length} ${added.length === 1 ? "value" : "values"}`);
|
|
4197
|
-
_optionalChain([onSaved, 'optionalCall',
|
|
4551
|
+
_optionalChain([onSaved, 'optionalCall', _306 => _306(added.length, added)]);
|
|
4198
4552
|
}, [panels, edits, state, offsetMs, store, onSaved, header, timestamp, beforeSave, editing, recordedGroups, itemsOf]);
|
|
4199
4553
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InputFormContext.Provider, { value: state, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DashboardProvider, { dashboard, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4200
4554
|
DashboardView,
|
|
4201
4555
|
{
|
|
4202
4556
|
header: header !== void 0 ? header : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TimestampPicker, { offsetMs, onChange: setOffsetMs }),
|
|
4203
|
-
footer: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [
|
|
4204
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4205
|
-
|
|
4557
|
+
footer: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [styles16.footer, { backgroundColor: theme.surface, borderTopColor: theme.border }], children: [
|
|
4558
|
+
voice.available && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MicButton, { dictation: voice, label: "Fill the form by voice", size: 36 }),
|
|
4559
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4560
|
+
_reactnative.Text,
|
|
4561
|
+
{
|
|
4562
|
+
style: [styles16.status, { color: _optionalChain([status, 'optionalAccess', _307 => _307.startsWith, 'call', _308 => _308("Can\u2019t")]) || _optionalChain([status, 'optionalAccess', _309 => _309.startsWith, 'call', _310 => _310("Couldn\u2019t")]) ? theme.danger : theme.textSecondary }],
|
|
4563
|
+
accessibilityLiveRegion: "polite",
|
|
4564
|
+
children: voice.listening ? voice.heard ? `\u201C${voice.heard}\u201D` : "Listening\u2026 say each field\u2019s name and its value, then tap to stop" : voice.filling ? "Filling\u2026" : _nullishCoalesce(status, () => ( (dirty ? `${dirty} unsaved ${dirty === 1 ? "change" : "changes"}` : "Nothing to save")))
|
|
4565
|
+
}
|
|
4566
|
+
),
|
|
4567
|
+
beforeFill && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4568
|
+
_reactnative.Pressable,
|
|
4569
|
+
{
|
|
4570
|
+
onPress: () => {
|
|
4571
|
+
setEdits(beforeFill);
|
|
4572
|
+
clearFill();
|
|
4573
|
+
setStatus(null);
|
|
4574
|
+
},
|
|
4575
|
+
style: styles16.secondary,
|
|
4576
|
+
accessibilityRole: "button",
|
|
4577
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: { color: theme.textSecondary, fontWeight: "500" }, children: "Undo" })
|
|
4578
|
+
}
|
|
4579
|
+
),
|
|
4580
|
+
dirty > 0 && !beforeFill && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4206
4581
|
_reactnative.Pressable,
|
|
4207
4582
|
{
|
|
4208
4583
|
onPress: () => {
|
|
4209
4584
|
setEdits({});
|
|
4210
4585
|
setGroupEdits({});
|
|
4211
4586
|
setChecked(false);
|
|
4587
|
+
clearFill();
|
|
4212
4588
|
setStatus(null);
|
|
4213
4589
|
},
|
|
4214
|
-
style:
|
|
4590
|
+
style: styles16.secondary,
|
|
4215
4591
|
accessibilityRole: "button",
|
|
4216
4592
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: { color: theme.textSecondary, fontWeight: "500" }, children: "Discard" })
|
|
4217
4593
|
}
|
|
@@ -4222,8 +4598,8 @@ function InputForm({ dashboard, store, onSaved, choices = NO_CHOICES, header, ti
|
|
|
4222
4598
|
onPress: save,
|
|
4223
4599
|
disabled: !dirty,
|
|
4224
4600
|
accessibilityRole: "button",
|
|
4225
|
-
style: ({ pressed }) => [
|
|
4226
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style:
|
|
4601
|
+
style: ({ pressed }) => [styles16.save, { backgroundColor: theme.accent, opacity: !dirty ? 0.4 : pressed ? 0.8 : 1 }],
|
|
4602
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: styles16.saveText, children: "Save" })
|
|
4227
4603
|
}
|
|
4228
4604
|
)
|
|
4229
4605
|
] })
|
|
@@ -4237,14 +4613,14 @@ function groupChanges(base, items) {
|
|
|
4237
4613
|
const edited = items.reduce((n, i) => n + (baseKeys.has(i.key) ? i.edited.length : 0), 0);
|
|
4238
4614
|
const added = items.filter((i) => !baseKeys.has(i.key)).length;
|
|
4239
4615
|
const removed = base.filter((i) => !keys.has(i.key)).length;
|
|
4240
|
-
const moved = edited + added + removed === 0 && items.some((i, n) => _optionalChain([base, 'access',
|
|
4616
|
+
const moved = edited + added + removed === 0 && items.some((i, n) => _optionalChain([base, 'access', _311 => _311[n], 'optionalAccess', _312 => _312.key]) !== i.key) ? 1 : 0;
|
|
4241
4617
|
return edited + added + removed + moved;
|
|
4242
4618
|
}
|
|
4243
4619
|
function groupState(group, items, last, edited, showProblems, update) {
|
|
4244
|
-
const fields =
|
|
4620
|
+
const fields = _chunkXWSPLZNCjs.groupFields.call(void 0, group);
|
|
4245
4621
|
const { max } = group.options;
|
|
4246
4622
|
const fresh = (position) => ({ key: `n${nextItemKey++}`, values: freshItem(group, position, last), edited: [] });
|
|
4247
|
-
const filled = items.filter((i) => !
|
|
4623
|
+
const filled = items.filter((i) => !_chunkXWSPLZNCjs.isEmptyItem.call(void 0, group, i.values)).length;
|
|
4248
4624
|
const { min } = group.options;
|
|
4249
4625
|
return {
|
|
4250
4626
|
items: items.map((i) => ({ key: i.key, values: i.values, edited: i.edited })),
|
|
@@ -4269,8 +4645,8 @@ function groupState(group, items, last, edited, showProblems, update) {
|
|
|
4269
4645
|
fieldProblem: (index, metric) => {
|
|
4270
4646
|
const item = items[index];
|
|
4271
4647
|
const field = fields.find((f) => f.options.metric === metric);
|
|
4272
|
-
if (!item || !field ||
|
|
4273
|
-
return showProblems || item.edited.includes(metric) ?
|
|
4648
|
+
if (!item || !field || _chunkXWSPLZNCjs.isEmptyItem.call(void 0, group, item.values)) return void 0;
|
|
4649
|
+
return showProblems || item.edited.includes(metric) ? _chunkXWSPLZNCjs.inputProblem.call(void 0, field, _nullishCoalesce(item.values[metric], () => ( null))) : void 0;
|
|
4274
4650
|
}
|
|
4275
4651
|
};
|
|
4276
4652
|
}
|
|
@@ -4289,20 +4665,20 @@ function TimestampPicker({ offsetMs, onChange }) {
|
|
|
4289
4665
|
}, []);
|
|
4290
4666
|
const when = new Date(now + offsetMs);
|
|
4291
4667
|
const step = (ms) => () => onChange(Math.min(0, offsetMs + ms));
|
|
4292
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [
|
|
4668
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [styles16.when, { backgroundColor: theme.surface, borderColor: theme.border }], children: [
|
|
4293
4669
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: { flex: 1 }, children: [
|
|
4294
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
4295
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
4670
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles16.whenLabel, { color: theme.textMuted }], children: "Recording for" }),
|
|
4671
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles16.whenValue, { color: theme.text }], children: offsetMs === 0 ? "Now" : when.toLocaleString(void 0, { weekday: "short", month: "short", day: "numeric", hour: "numeric", minute: "2-digit" }) })
|
|
4296
4672
|
] }),
|
|
4297
4673
|
[
|
|
4298
4674
|
["\u22121d", -24 * HOUR],
|
|
4299
4675
|
["\u22121h", -HOUR],
|
|
4300
4676
|
["+1h", HOUR]
|
|
4301
|
-
].map(([label, ms]) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Pressable, { onPress: step(ms), style: [
|
|
4302
|
-
offsetMs !== 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Pressable, { onPress: () => onChange(0), style: [
|
|
4677
|
+
].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)),
|
|
4678
|
+
offsetMs !== 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Pressable, { onPress: () => onChange(0), style: [styles16.stepBtn, { borderColor: theme.accent }], accessibilityRole: "button", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: { color: theme.accent, fontSize: 13, fontWeight: "600" }, children: "Now" }) })
|
|
4303
4679
|
] });
|
|
4304
4680
|
}
|
|
4305
|
-
var
|
|
4681
|
+
var styles16 = _reactnative.StyleSheet.create({
|
|
4306
4682
|
footer: { flexDirection: "row", alignItems: "center", gap: 12, paddingHorizontal: 16, paddingVertical: 10, borderTopWidth: _reactnative.StyleSheet.hairlineWidth },
|
|
4307
4683
|
status: { flex: 1, fontSize: 13 },
|
|
4308
4684
|
secondary: { paddingHorizontal: 8, paddingVertical: 10 },
|
|
@@ -4569,4 +4945,22 @@ var styles15 = _reactnative.StyleSheet.create({
|
|
|
4569
4945
|
|
|
4570
4946
|
|
|
4571
4947
|
|
|
4572
|
-
exports.ALL = _chunkG67L7TFKjs.ALL; exports.AUTHORING_GUIDE = _chunkG67L7TFKjs.AUTHORING_GUIDE; exports.BUNDLE_ACCEPT = _chunkG67L7TFKjs.BUNDLE_ACCEPT; exports.BUNDLE_TYPE = _chunkG67L7TFKjs.BUNDLE_TYPE; exports.CANVAS_GAP = _chunkG67L7TFKjs.CANVAS_GAP; exports.CANVAS_ROW_HEADER = _chunkG67L7TFKjs.CANVAS_ROW_HEADER; exports.Calendar = Calendar; exports.Chip = Chip; exports.ConfigLoader = _chunkG67L7TFKjs.ConfigLoader; exports.DASHBOARD_DS = _chunkG67L7TFKjs.DASHBOARD_DS; exports.DEFAULT_GAZETTEER = _chunkG67L7TFKjs.DEFAULT_GAZETTEER; exports.DOCUMENT_GUIDE = _chunkG67L7TFKjs.DOCUMENT_GUIDE; exports.DashThemeProvider = DashThemeProvider; exports.DashboardProvider = DashboardProvider; exports.DashboardToolbar = DashboardToolbar; exports.DashboardView = DashboardView; exports.EDITABLE_VARIABLE_TYPES = _chunkG67L7TFKjs.EDITABLE_VARIABLE_TYPES; exports.EXAMPLE_TEMPLATE = _chunkG67L7TFKjs.EXAMPLE_TEMPLATE; exports.GRID_COLUMNS = _chunkG67L7TFKjs.GRID_COLUMNS; exports.GROUP_FIELD_TYPES = _chunkG67L7TFKjs.GROUP_FIELD_TYPES; exports.GrafanaClient = _chunkG67L7TFKjs.GrafanaClient; exports.GrafanaDataSource = _chunkG67L7TFKjs.GrafanaDataSource; exports.GrafanaError = _chunkG67L7TFKjs.GrafanaError; exports.HttpConfigFiles = _chunkG67L7TFKjs.HttpConfigFiles; exports.INPUT_GROUP = _chunkG67L7TFKjs.INPUT_GROUP; exports.INPUT_OPTION_KEYS = _chunkG67L7TFKjs.INPUT_OPTION_KEYS; exports.INPUT_TYPES = _chunkG67L7TFKjs.INPUT_TYPES; exports.InputForm = InputForm; exports.InputFormContext = InputFormContext; exports.LOCAL_DATASOURCE_TYPE = _chunkG67L7TFKjs.LOCAL_DATASOURCE_TYPE; exports.Legend = Legend; exports.LocalDataSource = _chunkG67L7TFKjs.LocalDataSource; exports.MANIFEST_VERSION = _chunkG67L7TFKjs.MANIFEST_VERSION; exports.MAPPING_TYPES = _chunkG67L7TFKjs.MAPPING_TYPES; exports.MemoryEntryStore = _chunkG67L7TFKjs.MemoryEntryStore; exports.NAMED_COLORS = _chunkG67L7TFKjs.NAMED_COLORS; exports.NoData = NoData; exports.OPTION_CATEGORIES = _chunkG67L7TFKjs.OPTION_CATEGORIES; exports.OVERRIDE_MATCHERS = _chunkG67L7TFKjs.OVERRIDE_MATCHERS; exports.PANEL_TYPES = _chunkG67L7TFKjs.PANEL_TYPES; exports.PanelCard = PanelCard; exports.REDUCER_LABELS = _chunkG67L7TFKjs.REDUCER_LABELS; exports.REFRESH_CHOICES = _chunkG67L7TFKjs.REFRESH_CHOICES; exports.RELATIVE_RANGES = _chunkG67L7TFKjs.RELATIVE_RANGES; exports.RenderBoundary = RenderBoundary; exports.SERIES_PALETTE = _chunkG67L7TFKjs.SERIES_PALETTE; exports.SNIPPET_VERSION = _chunkG67L7TFKjs.SNIPPET_VERSION; exports.SPECIAL_MATCHES = _chunkG67L7TFKjs.SPECIAL_MATCHES; exports.SaveConflictError = _chunkG67L7TFKjs.SaveConflictError; exports.TEMPLATE_VERSION = _chunkG67L7TFKjs.TEMPLATE_VERSION; exports.TIME_PRESETS = _chunkG67L7TFKjs.TIME_PRESETS; exports.UNIT_CHOICES = _chunkG67L7TFKjs.UNIT_CHOICES; exports.addTime = _chunkG67L7TFKjs.addTime; exports.appSchema = _chunkG67L7TFKjs.appSchema; exports.applyDashboardLink = _chunkG67L7TFKjs.applyDashboardLink; exports.applyJsonEdits = _chunkG67L7TFKjs.applyJsonEdits; exports.applyTemplate = _chunkG67L7TFKjs.applyTemplate; exports.applyTransformations = _chunkG67L7TFKjs.applyTransformations; exports.assembleBundle = _chunkG67L7TFKjs.assembleBundle; exports.assembleFromResponse = _chunkG67L7TFKjs.assembleFromResponse; exports.buildFrames = _chunkG67L7TFKjs.buildFrames; exports.bundleFromFiles = _chunkG67L7TFKjs.bundleFromFiles; exports.bundleRoot = _chunkG67L7TFKjs.bundleRoot; exports.calculateInterval = _chunkG67L7TFKjs.calculateInterval; exports.checkFiles = _chunkG67L7TFKjs.checkFiles; exports.cleanDashboard = _chunkG67L7TFKjs.cleanDashboard; exports.cleanPanelOptions = _chunkG67L7TFKjs.cleanPanelOptions; exports.collapseRow = _chunkG67L7TFKjs.collapseRow; exports.compactGrid = _chunkG67L7TFKjs.compactGrid; exports.copyPanels = _chunkG67L7TFKjs.copyPanels; exports.darkTheme = darkTheme; exports.dashboardSchema = _chunkG67L7TFKjs.dashboardSchema; exports.dashboardSchemaIssues = _chunkG67L7TFKjs.dashboardSchemaIssues; exports.dashboardSourceIds = _chunkG67L7TFKjs.dashboardSourceIds; exports.defaultFetchJson = _chunkG67L7TFKjs.defaultFetchJson; exports.describeRange = _chunkG67L7TFKjs.describeRange; exports.diffJson = _chunkG67L7TFKjs.diffJson; exports.documentChanges = _chunkG67L7TFKjs.documentChanges; exports.documentIdFor = _chunkG67L7TFKjs.documentIdFor; exports.documentKind = _chunkG67L7TFKjs.documentKind; exports.documentPrompt = _chunkG67L7TFKjs.documentPrompt; exports.documentUses = _chunkG67L7TFKjs.documentUses; exports.dropTarget = _chunkG67L7TFKjs.dropTarget; exports.duplicatePanel = _chunkG67L7TFKjs.duplicatePanel; exports.entriesSavedWith = _chunkG67L7TFKjs.entriesSavedWith; exports.entriesToItems = _chunkG67L7TFKjs.entriesToItems; exports.entryToInputValue = _chunkG67L7TFKjs.entryToInputValue; exports.expandRow = _chunkG67L7TFKjs.expandRow; exports.fetchBundle = _chunkG67L7TFKjs.fetchBundle; exports.fetchJsonWithToken = _chunkG67L7TFKjs.fetchJsonWithToken; exports.fieldDisplayName = _chunkG67L7TFKjs.fieldDisplayName; exports.fieldMatches = _chunkG67L7TFKjs.fieldMatches; exports.fixDocumentPrompt = _chunkG67L7TFKjs.fixDocumentPrompt; exports.fixTemplatePrompt = _chunkG67L7TFKjs.fixTemplatePrompt; exports.formatClock = _chunkG67L7TFKjs.formatClock; exports.formatDisplay = _chunkG67L7TFKjs.formatDisplay; exports.formatDuration = _chunkG67L7TFKjs.formatDuration; exports.formatJsonText = _chunkG67L7TFKjs.formatJsonText; exports.formatLocalDateTime = _chunkG67L7TFKjs.formatLocalDateTime; exports.formatValue = _chunkG67L7TFKjs.formatValue; exports.frameLength = _chunkG67L7TFKjs.frameLength; exports.framesToOptions = _chunkG67L7TFKjs.framesToOptions; exports.fromWire = _chunkG67L7TFKjs.fromWire; exports.getPath = _chunkG67L7TFKjs.getPath; exports.gridOffsetPx = _chunkG67L7TFKjs.gridOffsetPx; exports.gridUnitsToPx = _chunkG67L7TFKjs.gridUnitsToPx; exports.groupField = _chunkG67L7TFKjs.groupField; exports.groupFields = _chunkG67L7TFKjs.groupFields; exports.groupKey = groupKey; exports.groupProblems = _chunkG67L7TFKjs.groupProblems; exports.groupToEntries = _chunkG67L7TFKjs.groupToEntries; exports.httpFetchJson = _chunkG67L7TFKjs.httpFetchJson; exports.initialVariableValues = _chunkG67L7TFKjs.initialVariableValues; exports.inputGroups = _chunkG67L7TFKjs.inputGroups; exports.inputPanels = _chunkG67L7TFKjs.inputPanels; exports.inputProblem = _chunkG67L7TFKjs.inputProblem; exports.insertPanel = _chunkG67L7TFKjs.insertPanel; exports.interpolate = _chunkG67L7TFKjs.interpolate; exports.interpolateDeep = _chunkG67L7TFKjs.interpolateDeep; exports.isBundleResponse = _chunkG67L7TFKjs.isBundleResponse; exports.isEditableVariableType = _chunkG67L7TFKjs.isEditableVariableType; exports.isEmptyItem = _chunkG67L7TFKjs.isEmptyItem; exports.isFormPanelType = _chunkG67L7TFKjs.isFormPanelType; exports.isInputGroup = _chunkG67L7TFKjs.isInputGroup; exports.isInputPanel = _chunkG67L7TFKjs.isInputPanel; exports.isInputType = _chunkG67L7TFKjs.isInputType; exports.isLocalDatasource = _chunkG67L7TFKjs.isLocalDatasource; exports.isReducer = _chunkG67L7TFKjs.isReducer; exports.isRow = _chunkG67L7TFKjs.isRow; exports.isSqlDatasource = _chunkG67L7TFKjs.isSqlDatasource; exports.jsonFromAnswer = _chunkG67L7TFKjs.jsonFromAnswer; exports.layoutCanvas = _chunkG67L7TFKjs.layoutCanvas; exports.layoutDashboard = _chunkG67L7TFKjs.layoutDashboard; exports.lightTheme = lightTheme; exports.lineColumn = _chunkG67L7TFKjs.lineColumn; exports.loadGazetteer = _chunkG67L7TFKjs.loadGazetteer; exports.locate = _chunkG67L7TFKjs.locate; exports.makeTemplate = _chunkG67L7TFKjs.makeTemplate; exports.manifestSchemaIssues = _chunkG67L7TFKjs.manifestSchemaIssues; exports.mappedResult = _chunkG67L7TFKjs.mappedResult; exports.mappingProblem = _chunkG67L7TFKjs.mappingProblem; exports.mappingRow = _chunkG67L7TFKjs.mappingRow; exports.mappingRows = _chunkG67L7TFKjs.mappingRows; exports.metricChanges = _chunkG67L7TFKjs.metricChanges; exports.movePanel = _chunkG67L7TFKjs.movePanel; exports.newDocument = _chunkG67L7TFKjs.newDocument; exports.newPanel = _chunkG67L7TFKjs.newPanel; exports.newSaveId = _chunkG67L7TFKjs.newSaveId; exports.newVariable = _chunkG67L7TFKjs.newVariable; exports.nextPanelId = _chunkG67L7TFKjs.nextPanelId; exports.normalizeRef = _chunkG67L7TFKjs.normalizeRef; exports.numberFields = _chunkG67L7TFKjs.numberFields; exports.optionValue = _chunkG67L7TFKjs.optionValue; exports.overrideProperties = _chunkG67L7TFKjs.overrideProperties; exports.panelEdits = _chunkG67L7TFKjs.panelEdits; exports.panelHasQueries = _chunkG67L7TFKjs.panelHasQueries; exports.panelKey = _chunkG67L7TFKjs.panelKey; exports.panelMetrics = _chunkG67L7TFKjs.panelMetrics; exports.panelOptions = _chunkG67L7TFKjs.panelOptions; exports.panelOverrides = _chunkG67L7TFKjs.panelOverrides; exports.panelSize = _chunkG67L7TFKjs.panelSize; exports.panelSpan = _chunkG67L7TFKjs.panelSpan; exports.parseClockDigits = _chunkG67L7TFKjs.parseClockDigits; exports.parseDashboardLink = _chunkG67L7TFKjs.parseDashboardLink; exports.parseDuration = _chunkG67L7TFKjs.parseDuration; exports.parseGazetteer = _chunkG67L7TFKjs.parseGazetteer; exports.parseJsonText = _chunkG67L7TFKjs.parseJsonText; exports.parseLocalDateTime = _chunkG67L7TFKjs.parseLocalDateTime; exports.parseRange = _chunkG67L7TFKjs.parseRange; exports.parseSnippet = _chunkG67L7TFKjs.parseSnippet; exports.parseTemplate = _chunkG67L7TFKjs.parseTemplate; exports.parseTime = _chunkG67L7TFKjs.parseTime; exports.pasteSnippet = _chunkG67L7TFKjs.pasteSnippet; exports.placePanel = _chunkG67L7TFKjs.placePanel; exports.plainInputPanels = _chunkG67L7TFKjs.plainInputPanels; exports.pointerToPath = _chunkG67L7TFKjs.pointerToPath; exports.prepareDashboard = _chunkG67L7TFKjs.prepareDashboard; exports.previewPaste = _chunkG67L7TFKjs.previewPaste; exports.queryPanel = _chunkG67L7TFKjs.queryPanel; exports.queryParam = _chunkG67L7TFKjs.queryParam; exports.readConfigFiles = _chunkG67L7TFKjs.readConfigFiles; exports.readDocumentAnswer = _chunkG67L7TFKjs.readDocumentAnswer; exports.readTemplateAnswer = _chunkG67L7TFKjs.readTemplateAnswer; exports.readingOrder = _chunkG67L7TFKjs.readingOrder; exports.reduce = _chunkG67L7TFKjs.reduce; exports.refineOptions = _chunkG67L7TFKjs.refineOptions; exports.refreshedVariables = _chunkG67L7TFKjs.refreshedVariables; exports.registerPanel = registerPanel; exports.removeDocumentFromManifest = _chunkG67L7TFKjs.removeDocumentFromManifest; exports.removePanel = _chunkG67L7TFKjs.removePanel; exports.renameDocumentInManifest = _chunkG67L7TFKjs.renameDocumentInManifest; exports.renameMetrics = _chunkG67L7TFKjs.renameMetrics; exports.renameVariableInPanels = _chunkG67L7TFKjs.renameVariableInPanels; exports.repack = _chunkG67L7TFKjs.repack; exports.repeatOptions = _chunkG67L7TFKjs.repeatOptions; exports.requiredManifestVersion = _chunkG67L7TFKjs.requiredManifestVersion; exports.resizePanel = _chunkG67L7TFKjs.resizePanel; exports.resolveColor = _chunkG67L7TFKjs.resolveColor; exports.resolveFieldConfig = _chunkG67L7TFKjs.resolveFieldConfig; exports.resolveLinks = _chunkG67L7TFKjs.resolveLinks; exports.resolveTimezone = _chunkG67L7TFKjs.resolveTimezone; exports.resolveUrl = _chunkG67L7TFKjs.resolveUrl; exports.resolveVariables = _chunkG67L7TFKjs.resolveVariables; exports.revalidateBundle = _chunkG67L7TFKjs.revalidateBundle; exports.rowsToMappings = _chunkG67L7TFKjs.rowsToMappings; exports.sameSave = _chunkG67L7TFKjs.sameSave; exports.sampleEntries = _chunkG67L7TFKjs.sampleEntries; exports.screenDocuments = _chunkG67L7TFKjs.screenDocuments; exports.screenOfType = _chunkG67L7TFKjs.screenOfType; exports.selectValue = _chunkG67L7TFKjs.selectValue; exports.seriesColor = _chunkG67L7TFKjs.seriesColor; exports.setHiddenOnPhones = _chunkG67L7TFKjs.setHiddenOnPhones; exports.setJsonValue = _chunkG67L7TFKjs.setJsonValue; exports.setOption = _chunkG67L7TFKjs.setOption; exports.setOptionValue = _chunkG67L7TFKjs.setOptionValue; exports.setOverrides = _chunkG67L7TFKjs.setOverrides; exports.settleLayout = _chunkG67L7TFKjs.settleLayout; exports.snapToGrid = _chunkG67L7TFKjs.snapToGrid; exports.splitPath = _chunkG67L7TFKjs.splitPath; exports.startOf = _chunkG67L7TFKjs.startOf; exports.stringifyCompact = _chunkG67L7TFKjs.stringifyCompact; exports.tabIdFor = _chunkG67L7TFKjs.tabIdFor; exports.templateNeeds = _chunkG67L7TFKjs.templateNeeds; exports.templatePrompt = _chunkG67L7TFKjs.templatePrompt; exports.textSuggestions = _chunkG67L7TFKjs.textSuggestions; exports.thresholdStep = _chunkG67L7TFKjs.thresholdStep; exports.timeExprError = _chunkG67L7TFKjs.timeExprError; exports.timeField = _chunkG67L7TFKjs.timeField; exports.toEntries = _chunkG67L7TFKjs.toEntries; exports.toMillis = _chunkG67L7TFKjs.toMillis; exports.toSeries = _chunkG67L7TFKjs.toSeries; exports.toXYSeries = _chunkG67L7TFKjs.toXYSeries; exports.uniqueNames = _chunkG67L7TFKjs.uniqueNames; exports.useDashTheme = useDashTheme; exports.useDashboard = useDashboard; exports.useInputForm = useInputForm; exports.usePanelData = usePanelData; exports.validateBundle = _chunkG67L7TFKjs.validateBundle; exports.validateDashboard = _chunkG67L7TFKjs.validateDashboard; exports.validateManifest = _chunkG67L7TFKjs.validateManifest; exports.valueColor = _chunkG67L7TFKjs.valueColor; exports.valueText = _chunkG67L7TFKjs.valueText; exports.variableDependents = _chunkG67L7TFKjs.variableDependents; exports.variableInfo = _chunkG67L7TFKjs.variableInfo; exports.variableNameError = _chunkG67L7TFKjs.variableNameError; exports.variableOptions = _chunkG67L7TFKjs.variableOptions; exports.variableOrder = _chunkG67L7TFKjs.variableOrder; exports.variableReferences = _chunkG67L7TFKjs.variableReferences; exports.variableUses = _chunkG67L7TFKjs.variableUses; exports.variableWithCurrent = _chunkG67L7TFKjs.variableWithCurrent; exports.variableWithFlags = _chunkG67L7TFKjs.variableWithFlags; exports.variableWithQuery = _chunkG67L7TFKjs.variableWithQuery; exports.variableWithType = _chunkG67L7TFKjs.variableWithType; exports.visibleVariables = _chunkG67L7TFKjs.visibleVariables; exports.zoomRange = _chunkG67L7TFKjs.zoomRange;
|
|
4948
|
+
|
|
4949
|
+
|
|
4950
|
+
|
|
4951
|
+
|
|
4952
|
+
|
|
4953
|
+
|
|
4954
|
+
|
|
4955
|
+
|
|
4956
|
+
|
|
4957
|
+
|
|
4958
|
+
|
|
4959
|
+
|
|
4960
|
+
|
|
4961
|
+
|
|
4962
|
+
|
|
4963
|
+
|
|
4964
|
+
|
|
4965
|
+
|
|
4966
|
+
exports.ALL = _chunkXWSPLZNCjs.ALL; exports.AUTHORING_GUIDE = _chunkXWSPLZNCjs.AUTHORING_GUIDE; exports.BUNDLE_ACCEPT = _chunkXWSPLZNCjs.BUNDLE_ACCEPT; exports.BUNDLE_TYPE = _chunkXWSPLZNCjs.BUNDLE_TYPE; exports.CANVAS_GAP = _chunkXWSPLZNCjs.CANVAS_GAP; exports.CANVAS_ROW_HEADER = _chunkXWSPLZNCjs.CANVAS_ROW_HEADER; exports.Calendar = Calendar; exports.Chip = Chip; exports.ConfigLoader = _chunkXWSPLZNCjs.ConfigLoader; exports.DASHBOARD_DS = _chunkXWSPLZNCjs.DASHBOARD_DS; exports.DEFAULT_GAZETTEER = _chunkXWSPLZNCjs.DEFAULT_GAZETTEER; exports.DICTATION_TYPES = _chunkXWSPLZNCjs.DICTATION_TYPES; exports.DOCUMENT_GUIDE = _chunkXWSPLZNCjs.DOCUMENT_GUIDE; exports.DashThemeProvider = DashThemeProvider; exports.DashboardProvider = DashboardProvider; exports.DashboardToolbar = DashboardToolbar; exports.DashboardView = DashboardView; exports.EDITABLE_VARIABLE_TYPES = _chunkXWSPLZNCjs.EDITABLE_VARIABLE_TYPES; exports.EXAMPLE_TEMPLATE = _chunkXWSPLZNCjs.EXAMPLE_TEMPLATE; exports.GRID_COLUMNS = _chunkXWSPLZNCjs.GRID_COLUMNS; exports.GROUP_FIELD_TYPES = _chunkXWSPLZNCjs.GROUP_FIELD_TYPES; exports.GrafanaClient = _chunkXWSPLZNCjs.GrafanaClient; exports.GrafanaDataSource = _chunkXWSPLZNCjs.GrafanaDataSource; exports.GrafanaError = _chunkXWSPLZNCjs.GrafanaError; exports.HttpConfigFiles = _chunkXWSPLZNCjs.HttpConfigFiles; exports.INPUT_GROUP = _chunkXWSPLZNCjs.INPUT_GROUP; exports.INPUT_OPTION_KEYS = _chunkXWSPLZNCjs.INPUT_OPTION_KEYS; exports.INPUT_TYPES = _chunkXWSPLZNCjs.INPUT_TYPES; exports.InputForm = InputForm; exports.InputFormContext = InputFormContext; exports.LOCAL_DATASOURCE_TYPE = _chunkXWSPLZNCjs.LOCAL_DATASOURCE_TYPE; exports.Legend = Legend; exports.LocalDataSource = _chunkXWSPLZNCjs.LocalDataSource; exports.MANIFEST_VERSION = _chunkXWSPLZNCjs.MANIFEST_VERSION; exports.MAPPING_TYPES = _chunkXWSPLZNCjs.MAPPING_TYPES; exports.MemoryEntryStore = _chunkXWSPLZNCjs.MemoryEntryStore; exports.NAMED_COLORS = _chunkXWSPLZNCjs.NAMED_COLORS; exports.NoData = NoData; exports.OPTION_CATEGORIES = _chunkXWSPLZNCjs.OPTION_CATEGORIES; exports.OVERRIDE_MATCHERS = _chunkXWSPLZNCjs.OVERRIDE_MATCHERS; exports.PANEL_TYPES = _chunkXWSPLZNCjs.PANEL_TYPES; exports.PanelCard = PanelCard; exports.REDUCER_LABELS = _chunkXWSPLZNCjs.REDUCER_LABELS; exports.REFRESH_CHOICES = _chunkXWSPLZNCjs.REFRESH_CHOICES; exports.RELATIVE_RANGES = _chunkXWSPLZNCjs.RELATIVE_RANGES; exports.RenderBoundary = RenderBoundary; exports.SERIES_PALETTE = _chunkXWSPLZNCjs.SERIES_PALETTE; exports.SNIPPET_VERSION = _chunkXWSPLZNCjs.SNIPPET_VERSION; exports.SPECIAL_MATCHES = _chunkXWSPLZNCjs.SPECIAL_MATCHES; exports.SaveConflictError = _chunkXWSPLZNCjs.SaveConflictError; exports.TEMPLATE_VERSION = _chunkXWSPLZNCjs.TEMPLATE_VERSION; exports.TIME_PRESETS = _chunkXWSPLZNCjs.TIME_PRESETS; exports.UNIT_CHOICES = _chunkXWSPLZNCjs.UNIT_CHOICES; exports.addTime = _chunkXWSPLZNCjs.addTime; exports.appSchema = _chunkXWSPLZNCjs.appSchema; exports.applyDashboardLink = _chunkXWSPLZNCjs.applyDashboardLink; exports.applyJsonEdits = _chunkXWSPLZNCjs.applyJsonEdits; exports.applyTemplate = _chunkXWSPLZNCjs.applyTemplate; exports.applyTransformations = _chunkXWSPLZNCjs.applyTransformations; exports.assembleBundle = _chunkXWSPLZNCjs.assembleBundle; exports.assembleFromResponse = _chunkXWSPLZNCjs.assembleFromResponse; exports.buildFrames = _chunkXWSPLZNCjs.buildFrames; exports.bundleFromFiles = _chunkXWSPLZNCjs.bundleFromFiles; exports.bundleRoot = _chunkXWSPLZNCjs.bundleRoot; exports.calculateInterval = _chunkXWSPLZNCjs.calculateInterval; exports.checkFiles = _chunkXWSPLZNCjs.checkFiles; exports.cleanDashboard = _chunkXWSPLZNCjs.cleanDashboard; exports.cleanPanelOptions = _chunkXWSPLZNCjs.cleanPanelOptions; exports.collapseRow = _chunkXWSPLZNCjs.collapseRow; exports.compactGrid = _chunkXWSPLZNCjs.compactGrid; exports.copyPanels = _chunkXWSPLZNCjs.copyPanels; exports.darkTheme = darkTheme; exports.dashboardSchema = _chunkXWSPLZNCjs.dashboardSchema; exports.dashboardSchemaIssues = _chunkXWSPLZNCjs.dashboardSchemaIssues; exports.dashboardSourceIds = _chunkXWSPLZNCjs.dashboardSourceIds; exports.defaultFetchJson = _chunkXWSPLZNCjs.defaultFetchJson; exports.describeRange = _chunkXWSPLZNCjs.describeRange; exports.dictationHints = _chunkXWSPLZNCjs.dictationHints; exports.diffJson = _chunkXWSPLZNCjs.diffJson; exports.documentChanges = _chunkXWSPLZNCjs.documentChanges; exports.documentIdFor = _chunkXWSPLZNCjs.documentIdFor; exports.documentKind = _chunkXWSPLZNCjs.documentKind; exports.documentPrompt = _chunkXWSPLZNCjs.documentPrompt; exports.documentUses = _chunkXWSPLZNCjs.documentUses; exports.dropTarget = _chunkXWSPLZNCjs.dropTarget; exports.duplicatePanel = _chunkXWSPLZNCjs.duplicatePanel; exports.entriesSavedWith = _chunkXWSPLZNCjs.entriesSavedWith; exports.entriesToItems = _chunkXWSPLZNCjs.entriesToItems; exports.entryToInputValue = _chunkXWSPLZNCjs.entryToInputValue; exports.expandRow = _chunkXWSPLZNCjs.expandRow; exports.fetchBundle = _chunkXWSPLZNCjs.fetchBundle; exports.fetchJsonWithToken = _chunkXWSPLZNCjs.fetchJsonWithToken; exports.fieldDisplayName = _chunkXWSPLZNCjs.fieldDisplayName; exports.fieldMatches = _chunkXWSPLZNCjs.fieldMatches; exports.fillForm = _chunkXWSPLZNCjs.fillForm; exports.fillHints = _chunkXWSPLZNCjs.fillHints; exports.fillPrompt = _chunkXWSPLZNCjs.fillPrompt; exports.fillSchema = _chunkXWSPLZNCjs.fillSchema; exports.fixDocumentPrompt = _chunkXWSPLZNCjs.fixDocumentPrompt; exports.fixTemplatePrompt = _chunkXWSPLZNCjs.fixTemplatePrompt; exports.formatClock = _chunkXWSPLZNCjs.formatClock; exports.formatDisplay = _chunkXWSPLZNCjs.formatDisplay; exports.formatDuration = _chunkXWSPLZNCjs.formatDuration; exports.formatJsonText = _chunkXWSPLZNCjs.formatJsonText; exports.formatLocalDateTime = _chunkXWSPLZNCjs.formatLocalDateTime; exports.formatValue = _chunkXWSPLZNCjs.formatValue; exports.frameLength = _chunkXWSPLZNCjs.frameLength; exports.framesToOptions = _chunkXWSPLZNCjs.framesToOptions; exports.fromWire = _chunkXWSPLZNCjs.fromWire; exports.getPath = _chunkXWSPLZNCjs.getPath; exports.gridOffsetPx = _chunkXWSPLZNCjs.gridOffsetPx; exports.gridUnitsToPx = _chunkXWSPLZNCjs.gridUnitsToPx; exports.groupField = _chunkXWSPLZNCjs.groupField; exports.groupFields = _chunkXWSPLZNCjs.groupFields; exports.groupKey = groupKey; exports.groupProblems = _chunkXWSPLZNCjs.groupProblems; exports.groupToEntries = _chunkXWSPLZNCjs.groupToEntries; exports.httpFetchJson = _chunkXWSPLZNCjs.httpFetchJson; exports.initialVariableValues = _chunkXWSPLZNCjs.initialVariableValues; exports.inputGroups = _chunkXWSPLZNCjs.inputGroups; exports.inputPanels = _chunkXWSPLZNCjs.inputPanels; exports.inputProblem = _chunkXWSPLZNCjs.inputProblem; exports.insertPanel = _chunkXWSPLZNCjs.insertPanel; exports.interpolate = _chunkXWSPLZNCjs.interpolate; exports.interpolateDeep = _chunkXWSPLZNCjs.interpolateDeep; exports.isBundleResponse = _chunkXWSPLZNCjs.isBundleResponse; exports.isEditableVariableType = _chunkXWSPLZNCjs.isEditableVariableType; exports.isEmptyItem = _chunkXWSPLZNCjs.isEmptyItem; exports.isFormPanelType = _chunkXWSPLZNCjs.isFormPanelType; exports.isInputGroup = _chunkXWSPLZNCjs.isInputGroup; exports.isInputPanel = _chunkXWSPLZNCjs.isInputPanel; exports.isInputType = _chunkXWSPLZNCjs.isInputType; exports.isLocalDatasource = _chunkXWSPLZNCjs.isLocalDatasource; exports.isReducer = _chunkXWSPLZNCjs.isReducer; exports.isRow = _chunkXWSPLZNCjs.isRow; exports.isSqlDatasource = _chunkXWSPLZNCjs.isSqlDatasource; exports.jsonFromAnswer = _chunkXWSPLZNCjs.jsonFromAnswer; exports.layoutCanvas = _chunkXWSPLZNCjs.layoutCanvas; exports.layoutDashboard = _chunkXWSPLZNCjs.layoutDashboard; exports.lightTheme = lightTheme; exports.lineColumn = _chunkXWSPLZNCjs.lineColumn; exports.loadGazetteer = _chunkXWSPLZNCjs.loadGazetteer; exports.locate = _chunkXWSPLZNCjs.locate; exports.makeTemplate = _chunkXWSPLZNCjs.makeTemplate; exports.manifestSchemaIssues = _chunkXWSPLZNCjs.manifestSchemaIssues; exports.mappedResult = _chunkXWSPLZNCjs.mappedResult; exports.mappingProblem = _chunkXWSPLZNCjs.mappingProblem; exports.mappingRow = _chunkXWSPLZNCjs.mappingRow; exports.mappingRows = _chunkXWSPLZNCjs.mappingRows; exports.matchChoices = _chunkXWSPLZNCjs.matchChoices; exports.metricChanges = _chunkXWSPLZNCjs.metricChanges; exports.modelFiller = _chunkXWSPLZNCjs.modelFiller; exports.movePanel = _chunkXWSPLZNCjs.movePanel; exports.newDocument = _chunkXWSPLZNCjs.newDocument; exports.newPanel = _chunkXWSPLZNCjs.newPanel; exports.newSaveId = _chunkXWSPLZNCjs.newSaveId; exports.newVariable = _chunkXWSPLZNCjs.newVariable; exports.nextPanelId = _chunkXWSPLZNCjs.nextPanelId; exports.normalizeRef = _chunkXWSPLZNCjs.normalizeRef; exports.numberFields = _chunkXWSPLZNCjs.numberFields; exports.optionValue = _chunkXWSPLZNCjs.optionValue; exports.overrideProperties = _chunkXWSPLZNCjs.overrideProperties; exports.panelEdits = _chunkXWSPLZNCjs.panelEdits; exports.panelHasQueries = _chunkXWSPLZNCjs.panelHasQueries; exports.panelKey = _chunkXWSPLZNCjs.panelKey; exports.panelMetrics = _chunkXWSPLZNCjs.panelMetrics; exports.panelOptions = _chunkXWSPLZNCjs.panelOptions; exports.panelOverrides = _chunkXWSPLZNCjs.panelOverrides; exports.panelSize = _chunkXWSPLZNCjs.panelSize; exports.panelSpan = _chunkXWSPLZNCjs.panelSpan; exports.parseClockDigits = _chunkXWSPLZNCjs.parseClockDigits; exports.parseDashboardLink = _chunkXWSPLZNCjs.parseDashboardLink; exports.parseDuration = _chunkXWSPLZNCjs.parseDuration; exports.parseFillAnswer = _chunkXWSPLZNCjs.parseFillAnswer; exports.parseGazetteer = _chunkXWSPLZNCjs.parseGazetteer; exports.parseJsonText = _chunkXWSPLZNCjs.parseJsonText; exports.parseLocalDateTime = _chunkXWSPLZNCjs.parseLocalDateTime; exports.parseRange = _chunkXWSPLZNCjs.parseRange; exports.parseSnippet = _chunkXWSPLZNCjs.parseSnippet; exports.parseSpokenDuration = _chunkXWSPLZNCjs.parseSpokenDuration; exports.parseSpokenNumber = _chunkXWSPLZNCjs.parseSpokenNumber; exports.parseSpokenYesNo = _chunkXWSPLZNCjs.parseSpokenYesNo; exports.parseTemplate = _chunkXWSPLZNCjs.parseTemplate; exports.parseTime = _chunkXWSPLZNCjs.parseTime; exports.pasteSnippet = _chunkXWSPLZNCjs.pasteSnippet; exports.placePanel = _chunkXWSPLZNCjs.placePanel; exports.plainInputPanels = _chunkXWSPLZNCjs.plainInputPanels; exports.pointerToPath = _chunkXWSPLZNCjs.pointerToPath; exports.prepareDashboard = _chunkXWSPLZNCjs.prepareDashboard; exports.previewPaste = _chunkXWSPLZNCjs.previewPaste; exports.queryPanel = _chunkXWSPLZNCjs.queryPanel; exports.queryParam = _chunkXWSPLZNCjs.queryParam; exports.readConfigFiles = _chunkXWSPLZNCjs.readConfigFiles; exports.readDocumentAnswer = _chunkXWSPLZNCjs.readDocumentAnswer; exports.readFill = _chunkXWSPLZNCjs.readFill; exports.readTemplateAnswer = _chunkXWSPLZNCjs.readTemplateAnswer; exports.readingOrder = _chunkXWSPLZNCjs.readingOrder; exports.reduce = _chunkXWSPLZNCjs.reduce; exports.refineOptions = _chunkXWSPLZNCjs.refineOptions; exports.refreshedVariables = _chunkXWSPLZNCjs.refreshedVariables; exports.registerPanel = registerPanel; exports.removeDocumentFromManifest = _chunkXWSPLZNCjs.removeDocumentFromManifest; exports.removePanel = _chunkXWSPLZNCjs.removePanel; exports.renameDocumentInManifest = _chunkXWSPLZNCjs.renameDocumentInManifest; exports.renameMetrics = _chunkXWSPLZNCjs.renameMetrics; exports.renameVariableInPanels = _chunkXWSPLZNCjs.renameVariableInPanels; exports.repack = _chunkXWSPLZNCjs.repack; exports.repeatOptions = _chunkXWSPLZNCjs.repeatOptions; exports.requiredManifestVersion = _chunkXWSPLZNCjs.requiredManifestVersion; exports.resizePanel = _chunkXWSPLZNCjs.resizePanel; exports.resolveColor = _chunkXWSPLZNCjs.resolveColor; exports.resolveFieldConfig = _chunkXWSPLZNCjs.resolveFieldConfig; exports.resolveLinks = _chunkXWSPLZNCjs.resolveLinks; exports.resolveTimezone = _chunkXWSPLZNCjs.resolveTimezone; exports.resolveUrl = _chunkXWSPLZNCjs.resolveUrl; exports.resolveVariables = _chunkXWSPLZNCjs.resolveVariables; exports.revalidateBundle = _chunkXWSPLZNCjs.revalidateBundle; exports.rowsToMappings = _chunkXWSPLZNCjs.rowsToMappings; exports.ruleFill = _chunkXWSPLZNCjs.ruleFill; exports.ruleFiller = _chunkXWSPLZNCjs.ruleFiller; exports.sameSave = _chunkXWSPLZNCjs.sameSave; exports.sampleEntries = _chunkXWSPLZNCjs.sampleEntries; exports.screenDocuments = _chunkXWSPLZNCjs.screenDocuments; exports.screenOfType = _chunkXWSPLZNCjs.screenOfType; exports.selectValue = _chunkXWSPLZNCjs.selectValue; exports.seriesColor = _chunkXWSPLZNCjs.seriesColor; exports.setHiddenOnPhones = _chunkXWSPLZNCjs.setHiddenOnPhones; exports.setJsonValue = _chunkXWSPLZNCjs.setJsonValue; exports.setOption = _chunkXWSPLZNCjs.setOption; exports.setOptionValue = _chunkXWSPLZNCjs.setOptionValue; exports.setOverrides = _chunkXWSPLZNCjs.setOverrides; exports.settleLayout = _chunkXWSPLZNCjs.settleLayout; exports.snapToGrid = _chunkXWSPLZNCjs.snapToGrid; exports.splitPath = _chunkXWSPLZNCjs.splitPath; exports.spokenValue = _chunkXWSPLZNCjs.spokenValue; exports.startOf = _chunkXWSPLZNCjs.startOf; exports.stringifyCompact = _chunkXWSPLZNCjs.stringifyCompact; exports.tabIdFor = _chunkXWSPLZNCjs.tabIdFor; exports.takesDictation = _chunkXWSPLZNCjs.takesDictation; exports.templateNeeds = _chunkXWSPLZNCjs.templateNeeds; exports.templatePrompt = _chunkXWSPLZNCjs.templatePrompt; exports.textSuggestions = _chunkXWSPLZNCjs.textSuggestions; exports.thresholdStep = _chunkXWSPLZNCjs.thresholdStep; exports.timeExprError = _chunkXWSPLZNCjs.timeExprError; exports.timeField = _chunkXWSPLZNCjs.timeField; exports.toEntries = _chunkXWSPLZNCjs.toEntries; exports.toMillis = _chunkXWSPLZNCjs.toMillis; exports.toSeries = _chunkXWSPLZNCjs.toSeries; exports.toXYSeries = _chunkXWSPLZNCjs.toXYSeries; exports.uniqueNames = _chunkXWSPLZNCjs.uniqueNames; exports.useDashTheme = useDashTheme; exports.useDashboard = useDashboard; exports.useInputForm = useInputForm; exports.usePanelData = usePanelData; exports.validateBundle = _chunkXWSPLZNCjs.validateBundle; exports.validateDashboard = _chunkXWSPLZNCjs.validateDashboard; exports.validateManifest = _chunkXWSPLZNCjs.validateManifest; exports.valueColor = _chunkXWSPLZNCjs.valueColor; exports.valueText = _chunkXWSPLZNCjs.valueText; exports.variableDependents = _chunkXWSPLZNCjs.variableDependents; exports.variableInfo = _chunkXWSPLZNCjs.variableInfo; exports.variableNameError = _chunkXWSPLZNCjs.variableNameError; exports.variableOptions = _chunkXWSPLZNCjs.variableOptions; exports.variableOrder = _chunkXWSPLZNCjs.variableOrder; exports.variableReferences = _chunkXWSPLZNCjs.variableReferences; exports.variableUses = _chunkXWSPLZNCjs.variableUses; exports.variableWithCurrent = _chunkXWSPLZNCjs.variableWithCurrent; exports.variableWithFlags = _chunkXWSPLZNCjs.variableWithFlags; exports.variableWithQuery = _chunkXWSPLZNCjs.variableWithQuery; exports.variableWithType = _chunkXWSPLZNCjs.variableWithType; exports.visibleVariables = _chunkXWSPLZNCjs.visibleVariables; exports.webSpeechRecognizer = webSpeechRecognizer; exports.zoomRange = _chunkXWSPLZNCjs.zoomRange;
|