@adminide-stack/yantra-mobile 12.0.141-alpha.1 → 12.0.141
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/lib/features/agent-chat/NativeAgentChat.js +21 -4
- package/lib/features/agent-chat/NativeAgentChat.js.map +1 -1
- package/lib/features/chat/ApprovalCard.js +353 -0
- package/lib/features/chat/ApprovalCard.js.map +1 -0
- package/lib/features/chat/AskUserCard.js +9 -2
- package/lib/features/chat/AskUserCard.js.map +1 -1
- package/lib/features/chat/askUser.js +25 -3
- package/lib/features/chat/askUser.js.map +1 -1
- package/lib/features/chat/queuedFollowUpRows.js +13 -0
- package/lib/features/chat/queuedFollowUpRows.js.map +1 -0
- package/lib/features/devices/bodyComposition.js +116 -0
- package/lib/features/devices/bodyComposition.js.map +1 -0
- package/lib/features/devices/readings.js.map +1 -1
- package/lib/features/devices/session.js +22 -2
- package/lib/features/devices/session.js.map +1 -1
- package/lib/features/discover/DiscoverArticle.js +105 -92
- package/lib/features/discover/DiscoverArticle.js.map +1 -1
- package/lib/features/discover/DiscoverFeed.js +97 -48
- package/lib/features/discover/DiscoverFeed.js.map +1 -1
- package/lib/features/discover/DiscoverFollowUp.js +135 -0
- package/lib/features/discover/DiscoverFollowUp.js.map +1 -0
- package/lib/features/discover/DiscoverSidebar.js +555 -0
- package/lib/features/discover/DiscoverSidebar.js.map +1 -0
- package/lib/features/discover/DiscoverSkeletons.js +123 -0
- package/lib/features/discover/DiscoverSkeletons.js.map +1 -0
- package/lib/features/discover/DiscoverStoryCards.js +193 -87
- package/lib/features/discover/DiscoverStoryCards.js.map +1 -1
- package/lib/features/discover/followUpQuery.js +42 -0
- package/lib/features/discover/followUpQuery.js.map +1 -0
- package/lib/features/discover/markets.js +37 -0
- package/lib/features/discover/markets.js.map +1 -0
- package/lib/features/discover/useDiscoverSidebar.js +148 -0
- package/lib/features/discover/useDiscoverSidebar.js.map +1 -0
- package/lib/features/discover/weather.js +42 -0
- package/lib/features/discover/weather.js.map +1 -0
- package/lib/features/expenses/ExpensesAgentChatPane.js +1 -1
- package/lib/features/expenses/ExpensesAgentChatPane.js.map +1 -1
- package/lib/features/inbox/InboxAgentChatPane.js +1 -1
- package/lib/features/inbox/InboxAgentChatPane.js.map +1 -1
- package/lib/features/job-search/JobSearchAgentChatPane.js +1 -0
- package/lib/features/job-search/JobSearchAgentChatPane.js.map +1 -1
- package/lib/features/local-services/LocalServicesAgentChatPane.js +1 -1
- package/lib/features/local-services/LocalServicesAgentChatPane.js.map +1 -1
- package/lib/features/movies/MoviesAgentChatPane.js +1 -1
- package/lib/features/movies/MoviesAgentChatPane.js.map +1 -1
- package/lib/features/notion/NotionBlockSheets.js +206 -0
- package/lib/features/notion/NotionBlockSheets.js.map +1 -0
- package/lib/features/notion/NotionBlockView.js +36 -0
- package/lib/features/notion/NotionBlockView.js.map +1 -0
- package/lib/features/notion/NotionCommentsSheet.js +461 -0
- package/lib/features/notion/NotionCommentsSheet.js.map +1 -0
- package/lib/features/notion/NotionConnectionsSheet.js +244 -0
- package/lib/features/notion/NotionConnectionsSheet.js.map +1 -0
- package/lib/features/notion/NotionHistorySheet.js +439 -0
- package/lib/features/notion/NotionHistorySheet.js.map +1 -0
- package/lib/features/notion/NotionMediaBlocks.js +803 -0
- package/lib/features/notion/NotionMediaBlocks.js.map +1 -0
- package/lib/features/notion/NotionMentionSheet.js +279 -0
- package/lib/features/notion/NotionMentionSheet.js.map +1 -0
- package/lib/features/notion/NotionPageMenu.js +585 -0
- package/lib/features/notion/NotionPageMenu.js.map +1 -0
- package/lib/features/notion/NotionPageTree.js +220 -0
- package/lib/features/notion/NotionPageTree.js.map +1 -0
- package/lib/features/notion/NotionPageView.js +1253 -152
- package/lib/features/notion/NotionPageView.js.map +1 -1
- package/lib/features/notion/NotionShareSheet.js +606 -0
- package/lib/features/notion/NotionShareSheet.js.map +1 -0
- package/lib/features/notion/NotionSheets.js +87 -15
- package/lib/features/notion/NotionSheets.js.map +1 -1
- package/lib/features/notion/NotionSidebarSections.js +492 -0
- package/lib/features/notion/NotionSidebarSections.js.map +1 -0
- package/lib/features/notion/NotionWorkspaceAdmin.js +659 -0
- package/lib/features/notion/NotionWorkspaceAdmin.js.map +1 -0
- package/lib/features/notion/NotionWorkspaceView.js +257 -45
- package/lib/features/notion/NotionWorkspaceView.js.map +1 -1
- package/lib/features/notion/database/DatabaseCells.js +554 -0
- package/lib/features/notion/database/DatabaseCells.js.map +1 -0
- package/lib/features/notion/database/DatabaseDateLayouts.js +792 -0
- package/lib/features/notion/database/DatabaseDateLayouts.js.map +1 -0
- package/lib/features/notion/database/DatabaseLayouts.js +461 -0
- package/lib/features/notion/database/DatabaseLayouts.js.map +1 -0
- package/lib/features/notion/database/DatabaseSheets.js +791 -0
- package/lib/features/notion/database/DatabaseSheets.js.map +1 -0
- package/lib/features/notion/database/NotionDatabaseView.js +817 -0
- package/lib/features/notion/database/NotionDatabaseView.js.map +1 -0
- package/lib/features/notion/database/RowPropertiesPanel.js +162 -0
- package/lib/features/notion/database/RowPropertiesPanel.js.map +1 -0
- package/lib/features/notion/database/chartData.js +89 -0
- package/lib/features/notion/database/chartData.js.map +1 -0
- package/lib/features/notion/database/chartView.js +112 -0
- package/lib/features/notion/database/chartView.js.map +1 -0
- package/lib/features/notion/database/connectorButton.js +33 -0
- package/lib/features/notion/database/connectorButton.js.map +1 -0
- package/lib/features/notion/database/databaseCalc.js +208 -0
- package/lib/features/notion/database/databaseCalc.js.map +1 -0
- package/lib/features/notion/database/databaseCalendar.js +157 -0
- package/lib/features/notion/database/databaseCalendar.js.map +1 -0
- package/lib/features/notion/database/databaseCsv.js +98 -0
- package/lib/features/notion/database/databaseCsv.js.map +1 -0
- package/lib/features/notion/database/databaseCsvActions.js +58 -0
- package/lib/features/notion/database/databaseCsvActions.js.map +1 -0
- package/lib/features/notion/database/databaseFilter.js +473 -0
- package/lib/features/notion/database/databaseFilter.js.map +1 -0
- package/lib/features/notion/database/databaseFormula.js +1072 -0
- package/lib/features/notion/database/databaseFormula.js.map +1 -0
- package/lib/features/notion/database/databaseGroup.js +151 -0
- package/lib/features/notion/database/databaseGroup.js.map +1 -0
- package/lib/features/notion/database/databaseRollup.js +58 -0
- package/lib/features/notion/database/databaseRollup.js.map +1 -0
- package/lib/features/notion/database/databaseTimeline.js +156 -0
- package/lib/features/notion/database/databaseTimeline.js.map +1 -0
- package/lib/features/notion/database/databaseView.js +1188 -0
- package/lib/features/notion/database/databaseView.js.map +1 -0
- package/lib/features/notion/database/databaseViews.js +310 -0
- package/lib/features/notion/database/databaseViews.js.map +1 -0
- package/lib/features/notion/database/relationSource.js +92 -0
- package/lib/features/notion/database/relationSource.js.map +1 -0
- package/lib/features/notion/database/uniqueId.js +17 -0
- package/lib/features/notion/database/uniqueId.js.map +1 -0
- package/lib/features/notion/database/useNotionDatabase.js +617 -0
- package/lib/features/notion/database/useNotionDatabase.js.map +1 -0
- package/lib/features/notion/notionAgentRunStatus.js +39 -0
- package/lib/features/notion/notionAgentRunStatus.js.map +1 -0
- package/lib/features/notion/notionCodeLanguages.js +112 -0
- package/lib/features/notion/notionCodeLanguages.js.map +1 -0
- package/lib/features/notion/notionComments.js +86 -0
- package/lib/features/notion/notionComments.js.map +1 -0
- package/lib/features/notion/notionConnections.js +74 -0
- package/lib/features/notion/notionConnections.js.map +1 -0
- package/lib/features/notion/notionDocuments.js +453 -1
- package/lib/features/notion/notionDocuments.js.map +1 -1
- package/lib/features/notion/notionEditorModel.js +142 -7
- package/lib/features/notion/notionEditorModel.js.map +1 -1
- package/lib/features/notion/notionMarkdownShortcuts.js +51 -0
- package/lib/features/notion/notionMarkdownShortcuts.js.map +1 -0
- package/lib/features/notion/notionMedia.js +119 -0
- package/lib/features/notion/notionMedia.js.map +1 -0
- package/lib/features/notion/notionMentionDate.js +32 -0
- package/lib/features/notion/notionMentionDate.js.map +1 -0
- package/lib/features/notion/notionMentionOptions.js +162 -0
- package/lib/features/notion/notionMentionOptions.js.map +1 -0
- package/lib/features/notion/notionNotesAgent.js +445 -0
- package/lib/features/notion/notionNotesAgent.js.map +1 -0
- package/lib/features/notion/notionPageAccess.js +168 -0
- package/lib/features/notion/notionPageAccess.js.map +1 -0
- package/lib/features/notion/notionPageActions.js +138 -0
- package/lib/features/notion/notionPageActions.js.map +1 -0
- package/lib/features/notion/notionPageHistory.js +154 -0
- package/lib/features/notion/notionPageHistory.js.map +1 -0
- package/lib/features/notion/notionPageKinds.js +200 -0
- package/lib/features/notion/notionPageKinds.js.map +1 -0
- package/lib/features/notion/notionRecents.js +48 -0
- package/lib/features/notion/notionRecents.js.map +1 -0
- package/lib/features/notion/notionRichText.js +177 -0
- package/lib/features/notion/notionRichText.js.map +1 -0
- package/lib/features/notion/notionRichTitle.js +336 -0
- package/lib/features/notion/notionRichTitle.js.map +1 -0
- package/lib/features/notion/useNotionWorkspace.js +272 -13
- package/lib/features/notion/useNotionWorkspace.js.map +1 -1
- package/lib/features/notion/usePageActions.js +155 -0
- package/lib/features/notion/usePageActions.js.map +1 -0
- package/lib/features/resume/ResumeAgentChatPane.js +1 -1
- package/lib/features/resume/ResumeAgentChatPane.js.map +1 -1
- package/lib/features/shopping/ShoppingAgentChatPane.js +1 -1
- package/lib/features/shopping/ShoppingAgentChatPane.js.map +1 -1
- package/lib/features/study/StudyAgentChatPane.js +1 -1
- package/lib/features/study/StudyAgentChatPane.js.map +1 -1
- package/lib/features/travel/TravelAgentChatPane.js +1 -1
- package/lib/features/travel/TravelAgentChatPane.js.map +1 -1
- package/lib/features/webbuilder/WebBuilderExperience.js +40 -8
- package/lib/features/webbuilder/WebBuilderExperience.js.map +1 -1
- package/lib/features/webbuilder/buildFragments.js +1 -1
- package/lib/features/webbuilder/buildFragments.js.map +1 -1
- package/lib/features/webbuilder/codeFiles.js +302 -0
- package/lib/features/webbuilder/codeFiles.js.map +1 -0
- package/lib/features/webbuilder/codeHighlight.js +209 -0
- package/lib/features/webbuilder/codeHighlight.js.map +1 -0
- package/lib/features/webbuilder/components/CodeView.js +682 -52
- package/lib/features/webbuilder/components/CodeView.js.map +1 -1
- package/lib/features/webbuilder/components/PreviewScreen.js +59 -38
- package/lib/features/webbuilder/components/PreviewScreen.js.map +1 -1
- package/lib/features/webbuilder/components/ProjectChat.js +3 -3
- package/lib/features/webbuilder/components/ProjectChat.js.map +1 -1
- package/lib/features/webbuilder/stepLabels.js +68 -0
- package/lib/features/webbuilder/stepLabels.js.map +1 -0
- package/lib/hooks/useHostChatSteering.js +45 -0
- package/lib/hooks/useHostChatSteering.js.map +1 -0
- package/lib/screens/Chat/index.js +2 -12
- package/lib/screens/Chat/index.js.map +1 -1
- package/lib/screens/Devices/index.js +205 -3
- package/lib/screens/Devices/index.js.map +1 -1
- package/lib/screens/ExpensesNative/useExpensesHostChat.js +25 -5
- package/lib/screens/ExpensesNative/useExpensesHostChat.js.map +1 -1
- package/lib/screens/InboxNative/useInboxHostChat.js +25 -5
- package/lib/screens/InboxNative/useInboxHostChat.js.map +1 -1
- package/lib/screens/JobSearchNative/useJobSearchHostChat.js +25 -5
- package/lib/screens/JobSearchNative/useJobSearchHostChat.js.map +1 -1
- package/lib/screens/LocalServicesNative/useLocalServicesHostChat.js +25 -5
- package/lib/screens/LocalServicesNative/useLocalServicesHostChat.js.map +1 -1
- package/lib/screens/MoviesNative/useMoviesHostChat.js +25 -5
- package/lib/screens/MoviesNative/useMoviesHostChat.js.map +1 -1
- package/lib/screens/NotionPage/index.js +2 -2
- package/lib/screens/NotionPage/index.js.map +1 -1
- package/lib/screens/ResumeNative/useResumeHostChat.js +25 -5
- package/lib/screens/ResumeNative/useResumeHostChat.js.map +1 -1
- package/lib/screens/ShoppingNative/useShoppingHostChat.js +25 -5
- package/lib/screens/ShoppingNative/useShoppingHostChat.js.map +1 -1
- package/lib/screens/StudyNative/useStudyHostChat.js +25 -5
- package/lib/screens/StudyNative/useStudyHostChat.js.map +1 -1
- package/lib/screens/TravelNative/useTravelHostChat.js +25 -5
- package/lib/screens/TravelNative/useTravelHostChat.js.map +1 -1
- package/lib/screens/WebBuilderNative/codeWorkspaceApi.js +222 -0
- package/lib/screens/WebBuilderNative/codeWorkspaceApi.js.map +1 -0
- package/lib/screens/WebBuilderNative/index.js +1 -1
- package/lib/screens/WebBuilderNative/index.js.map +1 -1
- package/lib/screens/WebBuilderNative/sandboxProxyApi.js +126 -4
- package/lib/screens/WebBuilderNative/sandboxProxyApi.js.map +1 -1
- package/lib/screens/WebBuilderNative/useWebBuilderHost.js +120 -11
- package/lib/screens/WebBuilderNative/useWebBuilderHost.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,792 @@
|
|
|
1
|
+
import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useMemo,useState,useRef,useEffect}from'react';import {useWindowDimensions,View,StyleSheet,Text,ScrollView,Pressable}from'react-native';import {Ionicons}from'@expo/vector-icons';import Svg,{Circle}from'react-native-svg';import {textColorOf}from'../notionRichText.js';import {ui}from'../notionUi.js';import {rowTitle,CellValue}from'./DatabaseCells.js';import {ChoiceSheet}from'./DatabaseSheets.js';import {calendarDateProperty,readCalendarSettings,monthOf,bucketRowsByDay,weekdayLabels,weekOf,monthGrid,weekLabel,monthLabel,isSameMonth,dayLabel,dayNumber,shiftMonth,isWeekend}from'./databaseCalendar.js';import {localDayKey,shiftDayKey}from'./databaseFilter.js';import {splitRowsBySpan,timelineRange,axisTicks,dayOffset,DAY_WIDTH,TIMELINE_ZOOMS,barGeometry}from'./databaseTimeline.js';import {readChartViewSettings,chartViewItems,chartGroupColumns,chartValueColumns,CHART_VIEW_KINDS,CHART_VIEW_SORTS}from'./chartView.js';import {formatChartValue as fmt,defaultChartColor}from'./chartData.js';var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
function Segmented({
|
|
21
|
+
palette,
|
|
22
|
+
items,
|
|
23
|
+
value,
|
|
24
|
+
onChange
|
|
25
|
+
}) {
|
|
26
|
+
return /* @__PURE__ */ jsx(View, { style: [styles.segmented, {
|
|
27
|
+
backgroundColor: palette.fill
|
|
28
|
+
}], children: items.map((it) => {
|
|
29
|
+
const on = it.id === value;
|
|
30
|
+
return /* @__PURE__ */ jsx(Pressable, { accessibilityRole: "button", accessibilityState: {
|
|
31
|
+
selected: on
|
|
32
|
+
}, onPress: () => onChange(it.id), style: [styles.segment, on && {
|
|
33
|
+
backgroundColor: palette.card
|
|
34
|
+
}], children: /* @__PURE__ */ jsx(Text, { style: [styles.segmentText, {
|
|
35
|
+
color: on ? palette.text : palette.textMuted
|
|
36
|
+
}], children: it.label }) }, it.id);
|
|
37
|
+
}) });
|
|
38
|
+
}
|
|
39
|
+
function RowLine({
|
|
40
|
+
p,
|
|
41
|
+
row
|
|
42
|
+
}) {
|
|
43
|
+
const {
|
|
44
|
+
palette
|
|
45
|
+
} = p;
|
|
46
|
+
return /* @__PURE__ */ jsxs(Pressable, { accessibilityRole: "button", accessibilityLabel: `Open ${rowTitle(row) || "Untitled"}`, onPress: () => p.onOpenRow(row), onLongPress: () => p.onRowMenu(row), style: ({
|
|
47
|
+
pressed
|
|
48
|
+
}) => [styles.rowLine, {
|
|
49
|
+
backgroundColor: pressed ? palette.pressed : palette.card,
|
|
50
|
+
borderColor: palette.hairline
|
|
51
|
+
}], children: [
|
|
52
|
+
/* @__PURE__ */ jsx(Ionicons, { name: "document-text-outline", size: 17, color: palette.textMuted }),
|
|
53
|
+
/* @__PURE__ */ jsxs(View, { style: ui.flex, children: [
|
|
54
|
+
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles.rowTitle, {
|
|
55
|
+
color: rowTitle(row) ? palette.text : palette.textFaint
|
|
56
|
+
}], children: rowTitle(row) || "Untitled" }),
|
|
57
|
+
p.rowProps.length ? /* @__PURE__ */ jsx(View, { style: styles.rowProps, children: p.rowProps.map((c) => /* @__PURE__ */ jsx(CellValue, { row, column: c, getValue: p.getValue, isDark: p.isDark, palette }, c.name)) }) : null
|
|
58
|
+
] })
|
|
59
|
+
] });
|
|
60
|
+
}
|
|
61
|
+
function NoDateProperty({
|
|
62
|
+
palette,
|
|
63
|
+
what
|
|
64
|
+
}) {
|
|
65
|
+
return /* @__PURE__ */ jsxs(View, { style: styles.emptyLayout, children: [
|
|
66
|
+
/* @__PURE__ */ jsx(Ionicons, { name: "calendar-outline", size: 34, color: palette.textFaint }),
|
|
67
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.emptyTitle, {
|
|
68
|
+
color: palette.text
|
|
69
|
+
}], children: `A ${what} needs a Date property` }),
|
|
70
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.emptyText, {
|
|
71
|
+
color: palette.textMuted
|
|
72
|
+
}], children: "Add a Date property under Properties, then pick it in View options." })
|
|
73
|
+
] });
|
|
74
|
+
}
|
|
75
|
+
function CalendarLayout(p) {
|
|
76
|
+
var _a;
|
|
77
|
+
const {
|
|
78
|
+
palette
|
|
79
|
+
} = p;
|
|
80
|
+
const column = useMemo(() => calendarDateProperty(p.allColumns, p.groupBy), [p.allColumns, p.groupBy]);
|
|
81
|
+
const cal = readCalendarSettings(p.settings);
|
|
82
|
+
const today = localDayKey(/* @__PURE__ */ new Date());
|
|
83
|
+
const [month, setMonth] = useState(() => monthOf(/* @__PURE__ */ new Date()));
|
|
84
|
+
const [day, setDay] = useState(today);
|
|
85
|
+
const buckets = useMemo(() => column ? bucketRowsByDay(p.rows, column, p.getValue) : null, [column, p.getValue, p.rows]);
|
|
86
|
+
if (!column || !buckets) return /* @__PURE__ */ jsx(NoDateProperty, { palette, what: "calendar" });
|
|
87
|
+
const weekdays = weekdayLabels(cal.weekStartsOn, "narrow");
|
|
88
|
+
const weeks = cal.mode === "week" ? [weekOf(day, cal.weekStartsOn)] : monthGrid(month, cal.weekStartsOn);
|
|
89
|
+
const keep = (d) => cal.showWeekends || !isWeekend(d);
|
|
90
|
+
const dayRows = (_a = buckets.byDay.get(day)) != null ? _a : [];
|
|
91
|
+
const editable = column.type === "date";
|
|
92
|
+
const go = (delta) => {
|
|
93
|
+
if (cal.mode === "week") {
|
|
94
|
+
const next = shiftDayKey(day, delta * 7);
|
|
95
|
+
setDay(next);
|
|
96
|
+
setMonth(monthOf(/* @__PURE__ */ new Date(`${next}T12:00:00`)));
|
|
97
|
+
} else setMonth((m) => shiftMonth(m, delta));
|
|
98
|
+
};
|
|
99
|
+
return /* @__PURE__ */ jsxs(ScrollView, { contentContainerStyle: styles.calendar, children: [
|
|
100
|
+
/* @__PURE__ */ jsxs(View, { style: styles.calHead, children: [
|
|
101
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.calTitle, {
|
|
102
|
+
color: palette.text
|
|
103
|
+
}], children: cal.mode === "week" ? weekLabel(weeks[0]) : monthLabel(month) }),
|
|
104
|
+
/* @__PURE__ */ jsx(View, { style: ui.flex }),
|
|
105
|
+
/* @__PURE__ */ jsx(Pressable, { accessibilityLabel: "Previous", onPress: () => go(-1), hitSlop: 8, style: styles.navBtn, children: /* @__PURE__ */ jsx(Ionicons, { name: "chevron-back", size: 20, color: palette.text }) }),
|
|
106
|
+
/* @__PURE__ */ jsx(Pressable, { accessibilityRole: "button", onPress: () => {
|
|
107
|
+
setMonth(monthOf(/* @__PURE__ */ new Date()));
|
|
108
|
+
setDay(today);
|
|
109
|
+
}, style: [styles.todayBtn, {
|
|
110
|
+
backgroundColor: palette.fill
|
|
111
|
+
}], children: /* @__PURE__ */ jsx(Text, { style: [styles.todayText, {
|
|
112
|
+
color: palette.text
|
|
113
|
+
}], children: "Today" }) }),
|
|
114
|
+
/* @__PURE__ */ jsx(Pressable, { accessibilityLabel: "Next", onPress: () => go(1), hitSlop: 8, style: styles.navBtn, children: /* @__PURE__ */ jsx(Ionicons, { name: "chevron-forward", size: 20, color: palette.text }) })
|
|
115
|
+
] }),
|
|
116
|
+
/* @__PURE__ */ jsx(View, { style: styles.modeRow, children: /* @__PURE__ */ jsx(Segmented, { palette, items: [{
|
|
117
|
+
id: "month",
|
|
118
|
+
label: "Month"
|
|
119
|
+
}, {
|
|
120
|
+
id: "week",
|
|
121
|
+
label: "Week"
|
|
122
|
+
}], value: cal.mode, onChange: (mode) => p.onChangeSettings({
|
|
123
|
+
calendarMode: mode === "week" ? "week" : void 0
|
|
124
|
+
}) }) }),
|
|
125
|
+
/* @__PURE__ */ jsx(View, { style: styles.weekRow, children: weeks[0].map((d, i) => ({
|
|
126
|
+
d,
|
|
127
|
+
i
|
|
128
|
+
})).filter(({
|
|
129
|
+
d
|
|
130
|
+
}) => keep(d)).map(({
|
|
131
|
+
i
|
|
132
|
+
}) => /* @__PURE__ */ jsx(Text, { style: [styles.weekday, {
|
|
133
|
+
color: palette.textMuted
|
|
134
|
+
}], children: weekdays[i] }, i)) }),
|
|
135
|
+
weeks.map((week) => /* @__PURE__ */ jsx(View, { style: styles.weekRow, children: week.filter((d) => keep(d)).map((d) => {
|
|
136
|
+
var _a2;
|
|
137
|
+
const rows = (_a2 = buckets.byDay.get(d)) != null ? _a2 : [];
|
|
138
|
+
const on = d === day;
|
|
139
|
+
const isToday = d === today;
|
|
140
|
+
const dim = cal.mode === "month" && !isSameMonth(d, month);
|
|
141
|
+
return /* @__PURE__ */ jsxs(Pressable, { accessibilityRole: "button", accessibilityLabel: `${dayLabel(d)}, ${rows.length} ${rows.length === 1 ? "row" : "rows"}`, accessibilityState: {
|
|
142
|
+
selected: on
|
|
143
|
+
}, onPress: () => setDay(d), style: [styles.dayCell, on && {
|
|
144
|
+
backgroundColor: palette.primarySoft
|
|
145
|
+
}], children: [
|
|
146
|
+
/* @__PURE__ */ jsx(View, { style: [styles.dayNum, isToday && {
|
|
147
|
+
backgroundColor: palette.primary
|
|
148
|
+
}], children: /* @__PURE__ */ jsx(Text, { style: [styles.dayNumText, {
|
|
149
|
+
color: isToday ? palette.onPrimary : dim ? palette.textFaint : palette.text
|
|
150
|
+
}], children: dayNumber(d) }) }),
|
|
151
|
+
/* @__PURE__ */ jsx(View, { style: styles.dots, children: rows.slice(0, 3).map((r) => /* @__PURE__ */ jsx(View, { style: [styles.dot, {
|
|
152
|
+
backgroundColor: palette.primary
|
|
153
|
+
}] }, r.id)) }),
|
|
154
|
+
rows.length > 3 ? /* @__PURE__ */ jsx(Text, { style: [styles.more, {
|
|
155
|
+
color: palette.textMuted
|
|
156
|
+
}], children: `+${rows.length - 3}` }) : null
|
|
157
|
+
] }, d);
|
|
158
|
+
}) }, week[0])),
|
|
159
|
+
/* @__PURE__ */ jsxs(View, { style: styles.dayHead, children: [
|
|
160
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.dayTitle, {
|
|
161
|
+
color: palette.text
|
|
162
|
+
}], children: dayLabel(day) }),
|
|
163
|
+
editable ? /* @__PURE__ */ jsxs(Pressable, { accessibilityRole: "button", onPress: () => p.onAddRowWith({
|
|
164
|
+
[column.name]: day
|
|
165
|
+
}), style: [styles.addSmall, {
|
|
166
|
+
backgroundColor: palette.primarySoft
|
|
167
|
+
}], children: [
|
|
168
|
+
/* @__PURE__ */ jsx(Ionicons, { name: "add", size: 16, color: palette.primary }),
|
|
169
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.addSmallText, {
|
|
170
|
+
color: palette.primary
|
|
171
|
+
}], children: "New" })
|
|
172
|
+
] }) : null
|
|
173
|
+
] }),
|
|
174
|
+
dayRows.length ? dayRows.map((r) => /* @__PURE__ */ jsx(RowLine, { p, row: r }, r.id)) : /* @__PURE__ */ jsx(Text, { style: [styles.none, {
|
|
175
|
+
color: palette.textMuted
|
|
176
|
+
}], children: "Nothing on this day." }),
|
|
177
|
+
buckets.undated.length ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
178
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.section, {
|
|
179
|
+
color: palette.textMuted
|
|
180
|
+
}], children: `No ${column.name} \xB7 ${buckets.undated.length}` }),
|
|
181
|
+
buckets.undated.map((r) => /* @__PURE__ */ jsx(RowLine, { p, row: r }, r.id))
|
|
182
|
+
] }) : null
|
|
183
|
+
] });
|
|
184
|
+
}
|
|
185
|
+
const BAR_HEIGHT = 30;
|
|
186
|
+
const LANE = 42;
|
|
187
|
+
function TimelineLayout(p) {
|
|
188
|
+
const {
|
|
189
|
+
palette
|
|
190
|
+
} = p;
|
|
191
|
+
const {
|
|
192
|
+
width
|
|
193
|
+
} = useWindowDimensions();
|
|
194
|
+
const column = useMemo(() => calendarDateProperty(p.allColumns, p.groupBy), [p.allColumns, p.groupBy]);
|
|
195
|
+
const [zoom, setZoom] = useState("week");
|
|
196
|
+
const today = localDayKey(/* @__PURE__ */ new Date());
|
|
197
|
+
const split = useMemo(() => column ? splitRowsBySpan(p.rows, column, p.getValue) : null, [column, p.getValue, p.rows]);
|
|
198
|
+
const range = useMemo(() => {
|
|
199
|
+
var _a;
|
|
200
|
+
return timelineRange((_a = split == null ? void 0 : split.dated.map((d) => d.span)) != null ? _a : [], today, zoom);
|
|
201
|
+
}, [split, today, zoom]);
|
|
202
|
+
const dw = DAY_WIDTH[zoom];
|
|
203
|
+
const ticks = useMemo(() => axisTicks(range, zoom), [range, zoom]);
|
|
204
|
+
const scroller = useRef(null);
|
|
205
|
+
useEffect(() => {
|
|
206
|
+
const x = Math.max(0, dayOffset(range, today) * dw - width / 3);
|
|
207
|
+
const t = setTimeout(() => {
|
|
208
|
+
var _a;
|
|
209
|
+
return (_a = scroller.current) == null ? void 0 : _a.scrollTo({
|
|
210
|
+
x,
|
|
211
|
+
animated: false
|
|
212
|
+
});
|
|
213
|
+
}, 0);
|
|
214
|
+
return () => clearTimeout(t);
|
|
215
|
+
}, [dw, range, today, width]);
|
|
216
|
+
if (!column || !split) return /* @__PURE__ */ jsx(NoDateProperty, { palette, what: "timeline" });
|
|
217
|
+
const contentWidth = range.days * dw;
|
|
218
|
+
const todayX = dayOffset(range, today) * dw;
|
|
219
|
+
return /* @__PURE__ */ jsxs(ScrollView, { contentContainerStyle: styles.timelineWrap, children: [
|
|
220
|
+
/* @__PURE__ */ jsxs(View, { style: styles.modeRow, children: [
|
|
221
|
+
/* @__PURE__ */ jsx(Segmented, { palette, items: TIMELINE_ZOOMS, value: zoom, onChange: setZoom }),
|
|
222
|
+
/* @__PURE__ */ jsx(View, { style: ui.flex }),
|
|
223
|
+
/* @__PURE__ */ jsx(Pressable, { accessibilityRole: "button", onPress: () => {
|
|
224
|
+
var _a;
|
|
225
|
+
return (_a = scroller.current) == null ? void 0 : _a.scrollTo({
|
|
226
|
+
x: Math.max(0, todayX - width / 3),
|
|
227
|
+
animated: true
|
|
228
|
+
});
|
|
229
|
+
}, style: [styles.todayBtn, {
|
|
230
|
+
backgroundColor: palette.fill
|
|
231
|
+
}], children: /* @__PURE__ */ jsx(Text, { style: [styles.todayText, {
|
|
232
|
+
color: palette.text
|
|
233
|
+
}], children: "Today" }) })
|
|
234
|
+
] }),
|
|
235
|
+
/* @__PURE__ */ jsx(ScrollView, { ref: scroller, horizontal: true, showsHorizontalScrollIndicator: false, children: /* @__PURE__ */ jsxs(View, { style: {
|
|
236
|
+
width: contentWidth
|
|
237
|
+
}, children: [
|
|
238
|
+
/* @__PURE__ */ jsx(View, { style: [styles.axis, {
|
|
239
|
+
borderBottomColor: palette.hairline
|
|
240
|
+
}], children: ticks.map((t) => /* @__PURE__ */ jsxs(View, { style: [styles.tick, {
|
|
241
|
+
left: t.offset * dw
|
|
242
|
+
}], children: [
|
|
243
|
+
t.major ? /* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles.tickMajor, {
|
|
244
|
+
color: palette.text
|
|
245
|
+
}], children: t.major }) : /* @__PURE__ */ jsx(View, { style: styles.tickSpacer }),
|
|
246
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.tickLabel, {
|
|
247
|
+
color: palette.textMuted
|
|
248
|
+
}], children: t.label })
|
|
249
|
+
] }, t.day)) }),
|
|
250
|
+
/* @__PURE__ */ jsxs(View, { style: {
|
|
251
|
+
height: Math.max(split.dated.length * LANE + 16, 120)
|
|
252
|
+
}, children: [
|
|
253
|
+
/* @__PURE__ */ jsx(View, { style: [styles.todayLine, {
|
|
254
|
+
left: todayX,
|
|
255
|
+
backgroundColor: palette.primary
|
|
256
|
+
}] }),
|
|
257
|
+
split.dated.map(({
|
|
258
|
+
row,
|
|
259
|
+
span
|
|
260
|
+
}, i) => {
|
|
261
|
+
const g = barGeometry(range, span, dw);
|
|
262
|
+
const title = rowTitle(row) || "Untitled";
|
|
263
|
+
const inside = g.width > 90;
|
|
264
|
+
return /* @__PURE__ */ jsxs(Pressable, { accessibilityRole: "button", accessibilityLabel: `Open ${title}`, onPress: () => p.onOpenRow(row), onLongPress: () => p.onRowMenu(row), style: [styles.barLane, {
|
|
265
|
+
top: 8 + i * LANE,
|
|
266
|
+
left: g.left
|
|
267
|
+
}], children: [
|
|
268
|
+
/* @__PURE__ */ jsx(View, { style: [styles.bar, {
|
|
269
|
+
width: Math.max(g.width, 8),
|
|
270
|
+
backgroundColor: palette.primarySoft,
|
|
271
|
+
borderColor: palette.primary
|
|
272
|
+
}], children: inside ? /* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles.barText, {
|
|
273
|
+
color: palette.text
|
|
274
|
+
}], children: title }) : null }),
|
|
275
|
+
!inside ? /* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles.barOutside, {
|
|
276
|
+
color: palette.text
|
|
277
|
+
}], children: title }) : null
|
|
278
|
+
] }, row.id);
|
|
279
|
+
})
|
|
280
|
+
] })
|
|
281
|
+
] }) }),
|
|
282
|
+
split.undated.length ? /* @__PURE__ */ jsxs(View, { style: styles.undated, children: [
|
|
283
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.section, {
|
|
284
|
+
color: palette.textMuted
|
|
285
|
+
}], children: `No ${column.name} \xB7 ${split.undated.length}` }),
|
|
286
|
+
split.undated.map((r) => /* @__PURE__ */ jsx(RowLine, { p, row: r }, r.id))
|
|
287
|
+
] }) : null
|
|
288
|
+
] });
|
|
289
|
+
}
|
|
290
|
+
function chartColor(color, index, isDark) {
|
|
291
|
+
if (color && color.startsWith("#")) return color;
|
|
292
|
+
return color && textColorOf(color, isDark) || defaultChartColor(index);
|
|
293
|
+
}
|
|
294
|
+
function ChartLayout(p) {
|
|
295
|
+
var _a, _b, _c, _d;
|
|
296
|
+
const {
|
|
297
|
+
palette
|
|
298
|
+
} = p;
|
|
299
|
+
const {
|
|
300
|
+
width
|
|
301
|
+
} = useWindowDimensions();
|
|
302
|
+
const s = readChartViewSettings(p.settings, p.allColumns);
|
|
303
|
+
const items = useMemo(() => chartViewItems(p.rows, p.allColumns, p.getValue, s), [p.allColumns, p.getValue, p.rows, s]);
|
|
304
|
+
const groups = chartGroupColumns(p.allColumns);
|
|
305
|
+
const values = chartValueColumns(p.allColumns);
|
|
306
|
+
const [picker, setPicker] = useState(null);
|
|
307
|
+
const set = (patch) => {
|
|
308
|
+
var _a2;
|
|
309
|
+
return p.onChangeSettings({
|
|
310
|
+
chart: __spreadValues(__spreadValues(__spreadValues({}, (_a2 = p.settings.chart) != null ? _a2 : {}), s), patch)
|
|
311
|
+
});
|
|
312
|
+
};
|
|
313
|
+
const max = Math.max(1, ...items.map((i) => i.value));
|
|
314
|
+
const total = items.reduce((n, i) => n + i.value, 0);
|
|
315
|
+
const control = (label, value, which) => /* @__PURE__ */ jsxs(Pressable, { accessibilityRole: "button", onPress: () => setPicker(which), style: [styles.control, {
|
|
316
|
+
backgroundColor: palette.fill
|
|
317
|
+
}], children: [
|
|
318
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.controlLabel, {
|
|
319
|
+
color: palette.textMuted
|
|
320
|
+
}], children: label }),
|
|
321
|
+
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles.controlValue, {
|
|
322
|
+
color: palette.text
|
|
323
|
+
}], children: value }),
|
|
324
|
+
/* @__PURE__ */ jsx(Ionicons, { name: "chevron-down", size: 13, color: palette.textMuted })
|
|
325
|
+
] });
|
|
326
|
+
if (!groups.length) {
|
|
327
|
+
return /* @__PURE__ */ jsxs(View, { style: styles.emptyLayout, children: [
|
|
328
|
+
/* @__PURE__ */ jsx(Ionicons, { name: "bar-chart-outline", size: 34, color: palette.textFaint }),
|
|
329
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.emptyTitle, {
|
|
330
|
+
color: palette.text
|
|
331
|
+
}], children: "Nothing to chart yet" }),
|
|
332
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.emptyText, {
|
|
333
|
+
color: palette.textMuted
|
|
334
|
+
}], children: "A chart groups rows by a Select, Status, Person, Date or Checkbox property." })
|
|
335
|
+
] });
|
|
336
|
+
}
|
|
337
|
+
const plotWidth = width - 32;
|
|
338
|
+
const donut = 180;
|
|
339
|
+
const r = 70;
|
|
340
|
+
const circ = 2 * Math.PI * r;
|
|
341
|
+
let acc = 0;
|
|
342
|
+
return /* @__PURE__ */ jsxs(ScrollView, { contentContainerStyle: styles.chart, children: [
|
|
343
|
+
/* @__PURE__ */ jsxs(ScrollView, { horizontal: true, showsHorizontalScrollIndicator: false, contentContainerStyle: styles.controls, children: [
|
|
344
|
+
control("Chart", (_b = (_a = CHART_VIEW_KINDS.find((k) => k.kind === s.kind)) == null ? void 0 : _a.label) != null ? _b : s.kind, "kind"),
|
|
345
|
+
control("Group by", s.groupBy || "None", "group"),
|
|
346
|
+
control("Value", s.aggregate === "sum" && s.valueProperty ? `Sum of ${s.valueProperty}` : "Count", "measure"),
|
|
347
|
+
control("Sort", (_d = (_c = CHART_VIEW_SORTS.find((x) => x.sort === s.sort)) == null ? void 0 : _c.label) != null ? _d : "", "sort")
|
|
348
|
+
] }),
|
|
349
|
+
!items.length ? /* @__PURE__ */ jsx(Text, { style: [styles.none, {
|
|
350
|
+
color: palette.textMuted
|
|
351
|
+
}], children: "No rows to chart." }) : s.kind === "donut" ? /* @__PURE__ */ jsxs(View, { style: styles.donutWrap, children: [
|
|
352
|
+
/* @__PURE__ */ jsxs(View, { children: [
|
|
353
|
+
/* @__PURE__ */ jsxs(Svg, { width: donut, height: donut, children: [
|
|
354
|
+
/* @__PURE__ */ jsx(Circle, { cx: donut / 2, cy: donut / 2, r, stroke: palette.fill, strokeWidth: 26, fill: "none" }),
|
|
355
|
+
items.map((it, i) => {
|
|
356
|
+
const len = total ? it.value / total * circ : 0;
|
|
357
|
+
const el = /* @__PURE__ */ jsx(Circle, { cx: donut / 2, cy: donut / 2, r, stroke: chartColor(it.color, i, p.isDark), strokeWidth: 26, fill: "none", strokeDasharray: `${len} ${circ - len}`, strokeDashoffset: -acc, rotation: -90, origin: `${donut / 2}, ${donut / 2}` }, it.label);
|
|
358
|
+
acc += len;
|
|
359
|
+
return el;
|
|
360
|
+
})
|
|
361
|
+
] }),
|
|
362
|
+
/* @__PURE__ */ jsxs(View, { style: styles.donutCenter, pointerEvents: "none", children: [
|
|
363
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.donutTotal, {
|
|
364
|
+
color: palette.text
|
|
365
|
+
}], children: fmt(total) }),
|
|
366
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.donutLabel, {
|
|
367
|
+
color: palette.textMuted
|
|
368
|
+
}], children: s.aggregate === "sum" ? "Total" : "Rows" })
|
|
369
|
+
] })
|
|
370
|
+
] }),
|
|
371
|
+
/* @__PURE__ */ jsx(View, { style: styles.legend, children: items.map((it, i) => /* @__PURE__ */ jsxs(View, { style: styles.legendRow, children: [
|
|
372
|
+
/* @__PURE__ */ jsx(View, { style: [styles.swatch, {
|
|
373
|
+
backgroundColor: chartColor(it.color, i, p.isDark)
|
|
374
|
+
}] }),
|
|
375
|
+
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles.legendLabel, {
|
|
376
|
+
color: palette.text
|
|
377
|
+
}], children: it.label }),
|
|
378
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.legendValue, {
|
|
379
|
+
color: palette.textMuted
|
|
380
|
+
}], children: fmt(it.value) })
|
|
381
|
+
] }, it.label)) })
|
|
382
|
+
] }) : s.kind === "bar" ? /* @__PURE__ */ jsx(View, { style: styles.bars, children: items.map((it, i) => /* @__PURE__ */ jsxs(View, { style: styles.hBarRow, children: [
|
|
383
|
+
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles.hBarLabel, {
|
|
384
|
+
color: palette.text
|
|
385
|
+
}], children: it.label }),
|
|
386
|
+
/* @__PURE__ */ jsx(View, { style: [styles.hBarTrack, {
|
|
387
|
+
backgroundColor: palette.fill
|
|
388
|
+
}], children: /* @__PURE__ */ jsx(View, { style: [styles.hBarFill, {
|
|
389
|
+
width: `${it.value / max * 100}%`,
|
|
390
|
+
backgroundColor: chartColor(it.color, i, p.isDark)
|
|
391
|
+
}] }) }),
|
|
392
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.hBarValue, {
|
|
393
|
+
color: palette.textMuted
|
|
394
|
+
}], children: fmt(it.value) })
|
|
395
|
+
] }, it.label)) }) : /* @__PURE__ */ jsx(ScrollView, { horizontal: true, showsHorizontalScrollIndicator: false, children: /* @__PURE__ */ jsx(View, { style: [styles.columns, {
|
|
396
|
+
minWidth: plotWidth
|
|
397
|
+
}], children: items.map((it, i) => /* @__PURE__ */ jsxs(View, { style: styles.column, children: [
|
|
398
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.colValue, {
|
|
399
|
+
color: palette.textMuted
|
|
400
|
+
}], children: fmt(it.value) }),
|
|
401
|
+
/* @__PURE__ */ jsx(View, { style: [styles.colBar, {
|
|
402
|
+
height: Math.max(4, it.value / max * 200),
|
|
403
|
+
backgroundColor: chartColor(it.color, i, p.isDark)
|
|
404
|
+
}] }),
|
|
405
|
+
/* @__PURE__ */ jsx(Text, { numberOfLines: 2, style: [styles.colLabel, {
|
|
406
|
+
color: palette.text
|
|
407
|
+
}], children: it.label })
|
|
408
|
+
] }, it.label)) }) }),
|
|
409
|
+
/* @__PURE__ */ jsx(ChoiceSheet, { visible: picker === "kind", title: "Chart", palette, value: s.kind, choices: CHART_VIEW_KINDS.map((k) => ({
|
|
410
|
+
value: k.kind,
|
|
411
|
+
label: k.label
|
|
412
|
+
})), onClose: () => setPicker(null), onPick: (kind) => {
|
|
413
|
+
setPicker(null);
|
|
414
|
+
set({
|
|
415
|
+
kind
|
|
416
|
+
});
|
|
417
|
+
} }),
|
|
418
|
+
/* @__PURE__ */ jsx(ChoiceSheet, { visible: picker === "group", title: "Group by", palette, value: s.groupBy, choices: groups.map((c) => ({
|
|
419
|
+
value: c.name,
|
|
420
|
+
label: c.name
|
|
421
|
+
})), onClose: () => setPicker(null), onPick: (groupBy) => {
|
|
422
|
+
setPicker(null);
|
|
423
|
+
set({
|
|
424
|
+
groupBy
|
|
425
|
+
});
|
|
426
|
+
} }),
|
|
427
|
+
/* @__PURE__ */ jsx(ChoiceSheet, { visible: picker === "measure", title: "Value", palette, value: s.aggregate === "sum" && s.valueProperty ? `sum:${s.valueProperty}` : "count", choices: [{
|
|
428
|
+
value: "count",
|
|
429
|
+
label: "Count rows"
|
|
430
|
+
}, ...values.map((c) => ({
|
|
431
|
+
value: `sum:${c.name}`,
|
|
432
|
+
label: `Sum of ${c.name}`
|
|
433
|
+
}))], onClose: () => setPicker(null), onPick: (v) => {
|
|
434
|
+
setPicker(null);
|
|
435
|
+
if (v === "count") set({
|
|
436
|
+
aggregate: "count"
|
|
437
|
+
});
|
|
438
|
+
else set({
|
|
439
|
+
aggregate: "sum",
|
|
440
|
+
valueProperty: v.slice(4)
|
|
441
|
+
});
|
|
442
|
+
} }),
|
|
443
|
+
/* @__PURE__ */ jsx(ChoiceSheet, { visible: picker === "sort", title: "Sort", palette, value: s.sort, choices: CHART_VIEW_SORTS.map((x) => ({
|
|
444
|
+
value: x.sort,
|
|
445
|
+
label: x.label
|
|
446
|
+
})), onClose: () => setPicker(null), onPick: (sort) => {
|
|
447
|
+
setPicker(null);
|
|
448
|
+
set({
|
|
449
|
+
sort
|
|
450
|
+
});
|
|
451
|
+
} })
|
|
452
|
+
] });
|
|
453
|
+
}
|
|
454
|
+
const styles = StyleSheet.create({
|
|
455
|
+
segmented: {
|
|
456
|
+
flexDirection: "row",
|
|
457
|
+
borderRadius: 10,
|
|
458
|
+
padding: 2
|
|
459
|
+
},
|
|
460
|
+
segment: {
|
|
461
|
+
paddingHorizontal: 12,
|
|
462
|
+
height: 30,
|
|
463
|
+
borderRadius: 8,
|
|
464
|
+
alignItems: "center",
|
|
465
|
+
justifyContent: "center"
|
|
466
|
+
},
|
|
467
|
+
segmentText: {
|
|
468
|
+
fontSize: 13,
|
|
469
|
+
fontWeight: "600"
|
|
470
|
+
},
|
|
471
|
+
calendar: {
|
|
472
|
+
padding: 12,
|
|
473
|
+
paddingBottom: 48
|
|
474
|
+
},
|
|
475
|
+
calHead: {
|
|
476
|
+
flexDirection: "row",
|
|
477
|
+
alignItems: "center",
|
|
478
|
+
gap: 6,
|
|
479
|
+
marginBottom: 8
|
|
480
|
+
},
|
|
481
|
+
calTitle: {
|
|
482
|
+
fontSize: 19,
|
|
483
|
+
fontWeight: "800"
|
|
484
|
+
},
|
|
485
|
+
navBtn: {
|
|
486
|
+
padding: 6
|
|
487
|
+
},
|
|
488
|
+
todayBtn: {
|
|
489
|
+
paddingHorizontal: 12,
|
|
490
|
+
height: 32,
|
|
491
|
+
borderRadius: 10,
|
|
492
|
+
justifyContent: "center"
|
|
493
|
+
},
|
|
494
|
+
todayText: {
|
|
495
|
+
fontSize: 14,
|
|
496
|
+
fontWeight: "600"
|
|
497
|
+
},
|
|
498
|
+
modeRow: {
|
|
499
|
+
flexDirection: "row",
|
|
500
|
+
alignItems: "center",
|
|
501
|
+
marginBottom: 10
|
|
502
|
+
},
|
|
503
|
+
weekRow: {
|
|
504
|
+
flexDirection: "row"
|
|
505
|
+
},
|
|
506
|
+
weekday: {
|
|
507
|
+
flex: 1,
|
|
508
|
+
textAlign: "center",
|
|
509
|
+
fontSize: 12,
|
|
510
|
+
fontWeight: "600",
|
|
511
|
+
paddingVertical: 4
|
|
512
|
+
},
|
|
513
|
+
dayCell: {
|
|
514
|
+
flex: 1,
|
|
515
|
+
alignItems: "center",
|
|
516
|
+
paddingVertical: 6,
|
|
517
|
+
minHeight: 56,
|
|
518
|
+
borderRadius: 10
|
|
519
|
+
},
|
|
520
|
+
dayNum: {
|
|
521
|
+
width: 28,
|
|
522
|
+
height: 28,
|
|
523
|
+
borderRadius: 14,
|
|
524
|
+
alignItems: "center",
|
|
525
|
+
justifyContent: "center"
|
|
526
|
+
},
|
|
527
|
+
dayNumText: {
|
|
528
|
+
fontSize: 15,
|
|
529
|
+
fontWeight: "600"
|
|
530
|
+
},
|
|
531
|
+
dots: {
|
|
532
|
+
flexDirection: "row",
|
|
533
|
+
gap: 3,
|
|
534
|
+
marginTop: 4,
|
|
535
|
+
height: 6
|
|
536
|
+
},
|
|
537
|
+
dot: {
|
|
538
|
+
width: 6,
|
|
539
|
+
height: 6,
|
|
540
|
+
borderRadius: 3
|
|
541
|
+
},
|
|
542
|
+
more: {
|
|
543
|
+
fontSize: 10,
|
|
544
|
+
marginTop: 1
|
|
545
|
+
},
|
|
546
|
+
dayHead: {
|
|
547
|
+
flexDirection: "row",
|
|
548
|
+
alignItems: "center",
|
|
549
|
+
justifyContent: "space-between",
|
|
550
|
+
marginTop: 16,
|
|
551
|
+
marginBottom: 8
|
|
552
|
+
},
|
|
553
|
+
dayTitle: {
|
|
554
|
+
fontSize: 16,
|
|
555
|
+
fontWeight: "700"
|
|
556
|
+
},
|
|
557
|
+
addSmall: {
|
|
558
|
+
flexDirection: "row",
|
|
559
|
+
alignItems: "center",
|
|
560
|
+
gap: 4,
|
|
561
|
+
paddingHorizontal: 10,
|
|
562
|
+
height: 30,
|
|
563
|
+
borderRadius: 9
|
|
564
|
+
},
|
|
565
|
+
addSmallText: {
|
|
566
|
+
fontSize: 14,
|
|
567
|
+
fontWeight: "700"
|
|
568
|
+
},
|
|
569
|
+
none: {
|
|
570
|
+
fontSize: 14,
|
|
571
|
+
paddingVertical: 12,
|
|
572
|
+
textAlign: "center"
|
|
573
|
+
},
|
|
574
|
+
section: {
|
|
575
|
+
fontSize: 13,
|
|
576
|
+
fontWeight: "700",
|
|
577
|
+
marginTop: 18,
|
|
578
|
+
marginBottom: 8,
|
|
579
|
+
textTransform: "uppercase",
|
|
580
|
+
letterSpacing: 0.4
|
|
581
|
+
},
|
|
582
|
+
rowLine: {
|
|
583
|
+
flexDirection: "row",
|
|
584
|
+
alignItems: "center",
|
|
585
|
+
gap: 10,
|
|
586
|
+
padding: 12,
|
|
587
|
+
borderRadius: 12,
|
|
588
|
+
borderWidth: StyleSheet.hairlineWidth,
|
|
589
|
+
marginBottom: 8
|
|
590
|
+
},
|
|
591
|
+
rowTitle: {
|
|
592
|
+
fontSize: 15,
|
|
593
|
+
fontWeight: "600"
|
|
594
|
+
},
|
|
595
|
+
rowProps: {
|
|
596
|
+
flexDirection: "row",
|
|
597
|
+
flexWrap: "wrap",
|
|
598
|
+
gap: 6,
|
|
599
|
+
marginTop: 4
|
|
600
|
+
},
|
|
601
|
+
emptyLayout: {
|
|
602
|
+
flex: 1,
|
|
603
|
+
alignItems: "center",
|
|
604
|
+
justifyContent: "center",
|
|
605
|
+
padding: 32,
|
|
606
|
+
gap: 8
|
|
607
|
+
},
|
|
608
|
+
emptyTitle: {
|
|
609
|
+
fontSize: 17,
|
|
610
|
+
fontWeight: "700",
|
|
611
|
+
textAlign: "center"
|
|
612
|
+
},
|
|
613
|
+
emptyText: {
|
|
614
|
+
fontSize: 14,
|
|
615
|
+
textAlign: "center",
|
|
616
|
+
lineHeight: 20
|
|
617
|
+
},
|
|
618
|
+
timelineWrap: {
|
|
619
|
+
paddingVertical: 12,
|
|
620
|
+
paddingBottom: 48
|
|
621
|
+
},
|
|
622
|
+
axis: {
|
|
623
|
+
height: 44,
|
|
624
|
+
borderBottomWidth: StyleSheet.hairlineWidth
|
|
625
|
+
},
|
|
626
|
+
tick: {
|
|
627
|
+
position: "absolute",
|
|
628
|
+
top: 2
|
|
629
|
+
},
|
|
630
|
+
tickMajor: {
|
|
631
|
+
fontSize: 12,
|
|
632
|
+
fontWeight: "700",
|
|
633
|
+
width: 120
|
|
634
|
+
},
|
|
635
|
+
tickSpacer: {
|
|
636
|
+
height: 16
|
|
637
|
+
},
|
|
638
|
+
tickLabel: {
|
|
639
|
+
fontSize: 11,
|
|
640
|
+
marginTop: 2
|
|
641
|
+
},
|
|
642
|
+
todayLine: {
|
|
643
|
+
position: "absolute",
|
|
644
|
+
top: 0,
|
|
645
|
+
bottom: 0,
|
|
646
|
+
width: 2,
|
|
647
|
+
opacity: 0.6
|
|
648
|
+
},
|
|
649
|
+
barLane: {
|
|
650
|
+
position: "absolute",
|
|
651
|
+
flexDirection: "row",
|
|
652
|
+
alignItems: "center",
|
|
653
|
+
height: BAR_HEIGHT
|
|
654
|
+
},
|
|
655
|
+
bar: {
|
|
656
|
+
height: BAR_HEIGHT,
|
|
657
|
+
borderRadius: 8,
|
|
658
|
+
borderWidth: 1,
|
|
659
|
+
justifyContent: "center",
|
|
660
|
+
paddingHorizontal: 8
|
|
661
|
+
},
|
|
662
|
+
barText: {
|
|
663
|
+
fontSize: 13,
|
|
664
|
+
fontWeight: "600"
|
|
665
|
+
},
|
|
666
|
+
barOutside: {
|
|
667
|
+
fontSize: 13,
|
|
668
|
+
fontWeight: "600",
|
|
669
|
+
marginLeft: 6,
|
|
670
|
+
maxWidth: 220
|
|
671
|
+
},
|
|
672
|
+
undated: {
|
|
673
|
+
paddingHorizontal: 12
|
|
674
|
+
},
|
|
675
|
+
chart: {
|
|
676
|
+
padding: 16,
|
|
677
|
+
paddingBottom: 48,
|
|
678
|
+
gap: 16
|
|
679
|
+
},
|
|
680
|
+
controls: {
|
|
681
|
+
gap: 8
|
|
682
|
+
},
|
|
683
|
+
control: {
|
|
684
|
+
flexDirection: "row",
|
|
685
|
+
alignItems: "center",
|
|
686
|
+
gap: 6,
|
|
687
|
+
paddingHorizontal: 10,
|
|
688
|
+
height: 34,
|
|
689
|
+
borderRadius: 10
|
|
690
|
+
},
|
|
691
|
+
controlLabel: {
|
|
692
|
+
fontSize: 12,
|
|
693
|
+
fontWeight: "600"
|
|
694
|
+
},
|
|
695
|
+
controlValue: {
|
|
696
|
+
fontSize: 14,
|
|
697
|
+
fontWeight: "600",
|
|
698
|
+
maxWidth: 160
|
|
699
|
+
},
|
|
700
|
+
donutWrap: {
|
|
701
|
+
alignItems: "center",
|
|
702
|
+
gap: 16
|
|
703
|
+
},
|
|
704
|
+
donutCenter: __spreadProps(__spreadValues({}, StyleSheet.absoluteFillObject), {
|
|
705
|
+
alignItems: "center",
|
|
706
|
+
justifyContent: "center"
|
|
707
|
+
}),
|
|
708
|
+
donutTotal: {
|
|
709
|
+
fontSize: 24,
|
|
710
|
+
fontWeight: "800"
|
|
711
|
+
},
|
|
712
|
+
donutLabel: {
|
|
713
|
+
fontSize: 12
|
|
714
|
+
},
|
|
715
|
+
legend: {
|
|
716
|
+
alignSelf: "stretch",
|
|
717
|
+
gap: 8
|
|
718
|
+
},
|
|
719
|
+
legendRow: {
|
|
720
|
+
flexDirection: "row",
|
|
721
|
+
alignItems: "center",
|
|
722
|
+
gap: 10
|
|
723
|
+
},
|
|
724
|
+
swatch: {
|
|
725
|
+
width: 12,
|
|
726
|
+
height: 12,
|
|
727
|
+
borderRadius: 3
|
|
728
|
+
},
|
|
729
|
+
legendLabel: {
|
|
730
|
+
flex: 1,
|
|
731
|
+
fontSize: 15
|
|
732
|
+
},
|
|
733
|
+
legendValue: {
|
|
734
|
+
fontSize: 14,
|
|
735
|
+
fontVariant: ["tabular-nums"]
|
|
736
|
+
},
|
|
737
|
+
bars: {
|
|
738
|
+
gap: 12
|
|
739
|
+
},
|
|
740
|
+
hBarRow: {
|
|
741
|
+
flexDirection: "row",
|
|
742
|
+
alignItems: "center",
|
|
743
|
+
gap: 10
|
|
744
|
+
},
|
|
745
|
+
hBarLabel: {
|
|
746
|
+
width: 96,
|
|
747
|
+
fontSize: 14
|
|
748
|
+
},
|
|
749
|
+
hBarTrack: {
|
|
750
|
+
flex: 1,
|
|
751
|
+
height: 22,
|
|
752
|
+
borderRadius: 6,
|
|
753
|
+
overflow: "hidden"
|
|
754
|
+
},
|
|
755
|
+
hBarFill: {
|
|
756
|
+
height: "100%",
|
|
757
|
+
borderRadius: 6
|
|
758
|
+
},
|
|
759
|
+
hBarValue: {
|
|
760
|
+
width: 48,
|
|
761
|
+
textAlign: "right",
|
|
762
|
+
fontSize: 13,
|
|
763
|
+
fontVariant: ["tabular-nums"]
|
|
764
|
+
},
|
|
765
|
+
columns: {
|
|
766
|
+
flexDirection: "row",
|
|
767
|
+
alignItems: "flex-end",
|
|
768
|
+
gap: 14,
|
|
769
|
+
height: 260,
|
|
770
|
+
paddingTop: 12
|
|
771
|
+
},
|
|
772
|
+
column: {
|
|
773
|
+
width: 56,
|
|
774
|
+
alignItems: "center",
|
|
775
|
+
justifyContent: "flex-end"
|
|
776
|
+
},
|
|
777
|
+
colValue: {
|
|
778
|
+
fontSize: 12,
|
|
779
|
+
marginBottom: 4,
|
|
780
|
+
fontVariant: ["tabular-nums"]
|
|
781
|
+
},
|
|
782
|
+
colBar: {
|
|
783
|
+
width: 36,
|
|
784
|
+
borderTopLeftRadius: 8,
|
|
785
|
+
borderTopRightRadius: 8
|
|
786
|
+
},
|
|
787
|
+
colLabel: {
|
|
788
|
+
fontSize: 12,
|
|
789
|
+
marginTop: 6,
|
|
790
|
+
textAlign: "center"
|
|
791
|
+
}
|
|
792
|
+
});export{CalendarLayout,ChartLayout,TimelineLayout};//# sourceMappingURL=DatabaseDateLayouts.js.map
|