@multiplatform.one/frappe-ui 7.23.2 → 7.25.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.
Files changed (692) hide show
  1. package/dist/cjs/ChartCard.native.js.map +1 -1
  2. package/dist/cjs/FileBrowser/AttachLibrary.native.js.map +1 -1
  3. package/dist/cjs/FileBrowser/folderTree.native.js.map +1 -1
  4. package/dist/cjs/FileBrowser/index.native.js.map +1 -1
  5. package/dist/cjs/FileBrowser/types.native.js.map +1 -1
  6. package/dist/cjs/FileBrowser/viewPersistence.native.js.map +1 -1
  7. package/dist/cjs/FormSidebar.native.js.map +1 -1
  8. package/dist/cjs/FrappeAssignment.native.js.map +1 -1
  9. package/dist/cjs/FrappeCalendar.cjs +1 -1
  10. package/dist/cjs/FrappeCalendar.native.js +1 -1
  11. package/dist/cjs/FrappeCalendar.native.js.map +1 -1
  12. package/dist/cjs/FrappeChartCard.native.js.map +1 -1
  13. package/dist/cjs/FrappeConnectionIndicator.native.js.map +1 -1
  14. package/dist/cjs/FrappeDashboard.cjs +1 -1
  15. package/dist/cjs/FrappeDashboard.native.js +1 -1
  16. package/dist/cjs/FrappeDashboard.native.js.map +1 -1
  17. package/dist/cjs/FrappeForm.native.js +1 -1
  18. package/dist/cjs/FrappeForm.native.js.map +1 -1
  19. package/dist/cjs/FrappeFormActions.native.js.map +1 -1
  20. package/dist/cjs/FrappeFormConnections.native.js.map +1 -1
  21. package/dist/cjs/FrappeGantt.native.js.map +1 -1
  22. package/dist/cjs/FrappeImageView.cjs +1 -1
  23. package/dist/cjs/FrappeImageView.native.js +1 -1
  24. package/dist/cjs/FrappeImageView.native.js.map +1 -1
  25. package/dist/cjs/FrappeInsights.cjs +380 -0
  26. package/dist/cjs/FrappeInsights.native.js +447 -0
  27. package/dist/cjs/FrappeInsights.native.js.map +1 -0
  28. package/dist/cjs/FrappeKPICard.native.js.map +1 -1
  29. package/dist/cjs/FrappeKanban.native.js.map +1 -1
  30. package/dist/cjs/FrappeLikedBy.cjs +5 -2
  31. package/dist/cjs/FrappeLikedBy.native.js +5 -2
  32. package/dist/cjs/FrappeLikedBy.native.js.map +1 -1
  33. package/dist/cjs/FrappeList.native.js.map +1 -1
  34. package/dist/cjs/FrappeListView.cjs +392 -38
  35. package/dist/cjs/FrappeListView.native.js +454 -41
  36. package/dist/cjs/FrappeListView.native.js.map +1 -1
  37. package/dist/cjs/FrappeNotConfigured.native.js.map +1 -1
  38. package/dist/cjs/FrappeProvider.native.js.map +1 -1
  39. package/dist/cjs/FrappeReconnectIndicator.native.js.map +1 -1
  40. package/dist/cjs/FrappeRecordView.cjs +199 -0
  41. package/dist/cjs/FrappeRecordView.native.js +218 -0
  42. package/dist/cjs/FrappeRecordView.native.js.map +1 -0
  43. package/dist/cjs/FrappeReportBuilder.cjs +2 -2
  44. package/dist/cjs/FrappeReportBuilder.native.js +2 -2
  45. package/dist/cjs/FrappeReportBuilder.native.js.map +1 -1
  46. package/dist/cjs/FrappeReportView.native.js +3 -3
  47. package/dist/cjs/FrappeReportView.native.js.map +1 -1
  48. package/dist/cjs/FrappeRowsReader.native.js.map +1 -1
  49. package/dist/cjs/FrappeTable.native.js.map +1 -1
  50. package/dist/cjs/FrappeTreeView.cjs +1 -1
  51. package/dist/cjs/FrappeTreeView.native.js +1 -1
  52. package/dist/cjs/FrappeTreeView.native.js.map +1 -1
  53. package/dist/cjs/SyncErrorNotice.native.js.map +1 -1
  54. package/dist/cjs/commentActions.native.js.map +1 -1
  55. package/dist/cjs/components/attachments.native.js.map +1 -1
  56. package/dist/cjs/components/tags.native.js.map +1 -1
  57. package/dist/cjs/components/timeline.native.js.map +1 -1
  58. package/dist/cjs/dependsOn.native.js.map +1 -1
  59. package/dist/cjs/desk/DeskFormPage.native.js.map +1 -1
  60. package/dist/cjs/desk/DeskFormSidebar.native.js.map +1 -1
  61. package/dist/cjs/desk/DeskListPage.native.js.map +1 -1
  62. package/dist/cjs/desk/DeskShell.native.js.map +1 -1
  63. package/dist/cjs/desk/DeskSidebar.native.js.map +1 -1
  64. package/dist/cjs/desk/awesomebar.cjs +1 -1
  65. package/dist/cjs/desk/awesomebar.native.js +3 -3
  66. package/dist/cjs/desk/awesomebar.native.js.map +1 -1
  67. package/dist/cjs/fieldOverrides.native.js.map +1 -1
  68. package/dist/cjs/fieldRegistry.native.js +31 -31
  69. package/dist/cjs/fieldRegistry.native.js.map +1 -1
  70. package/dist/cjs/fields/Barcode/index.native.js.map +1 -1
  71. package/dist/cjs/fields/Check/index.native.js.map +1 -1
  72. package/dist/cjs/fields/CodeEditor/index.native.js.map +1 -1
  73. package/dist/cjs/fields/Color/index.native.js.map +1 -1
  74. package/dist/cjs/fields/Data/index.native.js.map +1 -1
  75. package/dist/cjs/fields/Date/sheetKeyboard.native.js.map +1 -1
  76. package/dist/cjs/fields/Date/types.native.js.map +1 -1
  77. package/dist/cjs/fields/Date/wire.native.js.map +1 -1
  78. package/dist/cjs/fields/DateRange/index.native.js.map +1 -1
  79. package/dist/cjs/fields/Duration/index.native.js.map +1 -1
  80. package/dist/cjs/fields/DynamicLink.native.js.map +1 -1
  81. package/dist/cjs/fields/FileUpload.native.js.map +1 -1
  82. package/dist/cjs/fields/FileUploadField/index.native.js.map +1 -1
  83. package/dist/cjs/fields/Geolocation/index.native.js.map +1 -1
  84. package/dist/cjs/fields/HTML/index.native.js.map +1 -1
  85. package/dist/cjs/fields/Heading/index.cjs +18 -11
  86. package/dist/cjs/fields/Heading/index.native.js +21 -12
  87. package/dist/cjs/fields/Heading/index.native.js.map +1 -1
  88. package/dist/cjs/fields/Icon/index.native.js.map +1 -1
  89. package/dist/cjs/fields/Link.native.js.map +1 -1
  90. package/dist/cjs/fields/LinkTree.native.js.map +1 -1
  91. package/dist/cjs/fields/LongText/index.native.js.map +1 -1
  92. package/dist/cjs/fields/MentionInput/index.native.js.map +1 -1
  93. package/dist/cjs/fields/Numeric/index.native.js.map +1 -1
  94. package/dist/cjs/fields/OTPInput/index.native.js.map +1 -1
  95. package/dist/cjs/fields/Password/index.native.js.map +1 -1
  96. package/dist/cjs/fields/Phone/index.native.js.map +1 -1
  97. package/dist/cjs/fields/Progress/index.native.js.map +1 -1
  98. package/dist/cjs/fields/RadioGroup/index.native.js.map +1 -1
  99. package/dist/cjs/fields/Rating/index.native.js.map +1 -1
  100. package/dist/cjs/fields/ReadOnly/index.native.js.map +1 -1
  101. package/dist/cjs/fields/Select/index.native.js.map +1 -1
  102. package/dist/cjs/fields/Signature/index.native.js.map +1 -1
  103. package/dist/cjs/fields/Slider/index.native.js.map +1 -1
  104. package/dist/cjs/fields/SmallText/index.native.js.map +1 -1
  105. package/dist/cjs/fields/Switch/index.native.js.map +1 -1
  106. package/dist/cjs/fields/TableMultiSelect.native.js.map +1 -1
  107. package/dist/cjs/fields/TextEditor/types.native.js.map +1 -1
  108. package/dist/cjs/fields/TimePicker/index.native.js.map +1 -1
  109. package/dist/cjs/fields/ToggleGroup/index.native.js.map +1 -1
  110. package/dist/cjs/fields/shared/EditorPreviewPanes.native.js.map +1 -1
  111. package/dist/cjs/filterFields.native.js.map +1 -1
  112. package/dist/cjs/formEngine/createPrefill.native.js.map +1 -1
  113. package/dist/cjs/formEngine/dirtyTracking.native.js.map +1 -1
  114. package/dist/cjs/formEngine/docLifecycle.native.js.map +1 -1
  115. package/dist/cjs/formEngine/docPermissions.native.js.map +1 -1
  116. package/dist/cjs/formEngine/doctypeMeta.native.js.map +1 -1
  117. package/dist/cjs/formEngine/fetchFrom.native.js.map +1 -1
  118. package/dist/cjs/formEngine/fieldPermissions.native.js.map +1 -1
  119. package/dist/cjs/formEngine/formActions.native.js.map +1 -1
  120. package/dist/cjs/formEngine/formLayout.native.js.map +1 -1
  121. package/dist/cjs/formEngine/index.native.js.map +1 -1
  122. package/dist/cjs/formEngine/useAmendedAs.native.js.map +1 -1
  123. package/dist/cjs/formEngine/useDocRights.native.js.map +1 -1
  124. package/dist/cjs/formEngine/useFormEngine.native.js.map +1 -1
  125. package/dist/cjs/formEngine/useSessionRoles.native.js.map +1 -1
  126. package/dist/cjs/frappeConnections.native.js.map +1 -1
  127. package/dist/cjs/frappeEventColor.native.js.map +1 -1
  128. package/dist/cjs/frappeNavigation.cjs +12 -2
  129. package/dist/cjs/frappeNavigation.native.js +13 -2
  130. package/dist/cjs/frappeNavigation.native.js.map +1 -1
  131. package/dist/cjs/frappeStoryTarget.native.js.map +1 -1
  132. package/dist/cjs/frappeUsers.native.js.map +1 -1
  133. package/dist/cjs/index.cjs +34 -0
  134. package/dist/cjs/index.native.js +68 -34
  135. package/dist/cjs/index.native.js.map +1 -1
  136. package/dist/cjs/insights/InsightsFacetTags.cjs +147 -0
  137. package/dist/cjs/insights/InsightsFacetTags.native.js +165 -0
  138. package/dist/cjs/insights/InsightsFacetTags.native.js.map +1 -0
  139. package/dist/cjs/insights/InsightsKpiBand.cjs +124 -0
  140. package/dist/cjs/insights/InsightsKpiBand.native.js +133 -0
  141. package/dist/cjs/insights/InsightsKpiBand.native.js.map +1 -0
  142. package/dist/cjs/insights/InsightsLeaders.cjs +150 -0
  143. package/dist/cjs/insights/InsightsLeaders.native.js +178 -0
  144. package/dist/cjs/insights/InsightsLeaders.native.js.map +1 -0
  145. package/dist/cjs/insights/InsightsRecords.cjs +105 -0
  146. package/dist/cjs/insights/InsightsRecords.native.js +109 -0
  147. package/dist/cjs/insights/InsightsRecords.native.js.map +1 -0
  148. package/dist/cjs/insights/InsightsTable.cjs +157 -0
  149. package/dist/cjs/insights/InsightsTable.native.js +194 -0
  150. package/dist/cjs/insights/InsightsTable.native.js.map +1 -0
  151. package/dist/cjs/insights/insightsData.cjs +114 -0
  152. package/dist/cjs/insights/insightsData.native.js +220 -0
  153. package/dist/cjs/insights/insightsData.native.js.map +1 -0
  154. package/dist/cjs/insights/insightsRecord.cjs +35 -0
  155. package/dist/cjs/insights/insightsRecord.native.js +38 -0
  156. package/dist/cjs/insights/insightsRecord.native.js.map +1 -0
  157. package/dist/cjs/list/FacetBadge.cjs +62 -0
  158. package/dist/cjs/list/FacetBadge.native.js +66 -0
  159. package/dist/cjs/list/FacetBadge.native.js.map +1 -0
  160. package/dist/cjs/list/FacetRail.cjs +199 -0
  161. package/dist/cjs/list/FacetRail.native.js +223 -0
  162. package/dist/cjs/list/FacetRail.native.js.map +1 -0
  163. package/dist/cjs/list/ImageWell.cjs +111 -0
  164. package/dist/cjs/list/ImageWell.native.js +126 -0
  165. package/dist/cjs/list/ImageWell.native.js.map +1 -0
  166. package/dist/cjs/list/ListControls.cjs +226 -0
  167. package/dist/cjs/list/ListControls.native.js +252 -0
  168. package/dist/cjs/list/ListControls.native.js.map +1 -0
  169. package/dist/cjs/list/ListToastHost.cjs +54 -0
  170. package/dist/cjs/list/ListToastHost.native.js +59 -0
  171. package/dist/cjs/list/ListToastHost.native.js.map +1 -0
  172. package/dist/cjs/list/RangeFilter.cjs +122 -0
  173. package/dist/cjs/list/RangeFilter.native.js +135 -0
  174. package/dist/cjs/list/RangeFilter.native.js.map +1 -0
  175. package/dist/cjs/list/RecordCard.cjs +233 -0
  176. package/dist/cjs/list/RecordCard.native.js +173 -0
  177. package/dist/cjs/list/RecordCard.native.js.map +1 -0
  178. package/dist/cjs/list/ShufflePanel.cjs +112 -0
  179. package/dist/cjs/list/ShufflePanel.native.js +139 -0
  180. package/dist/cjs/list/ShufflePanel.native.js.map +1 -0
  181. package/dist/cjs/list/facetReading.cjs +71 -0
  182. package/dist/cjs/list/facetReading.native.js +163 -0
  183. package/dist/cjs/list/facetReading.native.js.map +1 -0
  184. package/dist/cjs/list/favorites.cjs +79 -0
  185. package/dist/cjs/list/favorites.native.js +91 -0
  186. package/dist/cjs/list/favorites.native.js.map +1 -0
  187. package/dist/cjs/list/listColumns.native.js.map +1 -1
  188. package/dist/cjs/list/listFields.native.js.map +1 -1
  189. package/dist/cjs/list/listFormat.native.js.map +1 -1
  190. package/dist/cjs/list/listState.cjs +100 -0
  191. package/dist/cjs/list/listState.native.js +234 -0
  192. package/dist/cjs/list/listState.native.js.map +1 -0
  193. package/dist/cjs/list/recordLook.cjs +35 -0
  194. package/dist/cjs/list/recordLook.native.js +39 -0
  195. package/dist/cjs/list/recordLook.native.js.map +1 -0
  196. package/dist/cjs/list/statusColors.native.js.map +1 -1
  197. package/dist/cjs/list/useListControls.cjs +189 -0
  198. package/dist/cjs/list/useListControls.native.js +272 -0
  199. package/dist/cjs/list/useListControls.native.js.map +1 -0
  200. package/dist/cjs/liveErrors.native.js.map +1 -1
  201. package/dist/cjs/record/RecordBars.cjs +200 -0
  202. package/dist/cjs/record/RecordBars.native.js +225 -0
  203. package/dist/cjs/record/RecordBars.native.js.map +1 -0
  204. package/dist/cjs/record/RecordGallery.cjs +67 -0
  205. package/dist/cjs/record/RecordGallery.native.js +75 -0
  206. package/dist/cjs/record/RecordGallery.native.js.map +1 -0
  207. package/dist/cjs/record/RecordHero.cjs +239 -0
  208. package/dist/cjs/record/RecordHero.native.js +250 -0
  209. package/dist/cjs/record/RecordHero.native.js.map +1 -0
  210. package/dist/cjs/record/RecordPage.cjs +330 -0
  211. package/dist/cjs/record/RecordPage.native.js +364 -0
  212. package/dist/cjs/record/RecordPage.native.js.map +1 -0
  213. package/dist/cjs/record/RecordPager.cjs +125 -0
  214. package/dist/cjs/record/RecordPager.native.js +130 -0
  215. package/dist/cjs/record/RecordPager.native.js.map +1 -0
  216. package/dist/cjs/record/RecordRows.cjs +126 -0
  217. package/dist/cjs/record/RecordRows.native.js +140 -0
  218. package/dist/cjs/record/RecordRows.native.js.map +1 -0
  219. package/dist/cjs/record/recordData.cjs +122 -0
  220. package/dist/cjs/record/recordData.native.js +189 -0
  221. package/dist/cjs/record/recordData.native.js.map +1 -0
  222. package/dist/cjs/record/recordSections.cjs +30 -0
  223. package/dist/cjs/record/recordSections.native.js +33 -0
  224. package/dist/cjs/record/recordSections.native.js.map +1 -0
  225. package/dist/cjs/resolveControl.native.js.map +1 -1
  226. package/dist/cjs/schemaForm/SchemaWizard.native.js.map +1 -1
  227. package/dist/cjs/schemaForm/applyFieldOrder.native.js.map +1 -1
  228. package/dist/cjs/schemaForm/index.native.js +1 -1
  229. package/dist/cjs/schemaForm/index.native.js.map +1 -1
  230. package/dist/cjs/shared/devWarn.native.js.map +1 -1
  231. package/dist/cjs/shared/useKeyboardInset.native.js.map +1 -1
  232. package/dist/cjs/syncError.native.js.map +1 -1
  233. package/dist/cjs/useConnectionFilters.native.js.map +1 -1
  234. package/dist/cjs/useFrappeAggregate.native.js.map +1 -1
  235. package/dist/cjs/useFrappeFacets.native.js.map +1 -1
  236. package/dist/cjs/useFrappePagination.native.js.map +1 -1
  237. package/dist/cjs/useFrappeRows.native.js.map +1 -1
  238. package/dist/esm/FrappeCalendar.mjs +1 -1
  239. package/dist/esm/FrappeCalendar.mjs.map +1 -1
  240. package/dist/esm/FrappeCalendar.native.js +1 -1
  241. package/dist/esm/FrappeCalendar.native.js.map +1 -1
  242. package/dist/esm/FrappeDashboard.mjs +1 -1
  243. package/dist/esm/FrappeDashboard.mjs.map +1 -1
  244. package/dist/esm/FrappeDashboard.native.js +1 -1
  245. package/dist/esm/FrappeDashboard.native.js.map +1 -1
  246. package/dist/esm/FrappeImageView.mjs +1 -1
  247. package/dist/esm/FrappeImageView.mjs.map +1 -1
  248. package/dist/esm/FrappeImageView.native.js +1 -1
  249. package/dist/esm/FrappeImageView.native.js.map +1 -1
  250. package/dist/esm/FrappeInsights.mjs +355 -0
  251. package/dist/esm/FrappeInsights.mjs.map +1 -0
  252. package/dist/esm/FrappeInsights.native.js +419 -0
  253. package/dist/esm/FrappeInsights.native.js.map +1 -0
  254. package/dist/esm/FrappeLikedBy.mjs +6 -3
  255. package/dist/esm/FrappeLikedBy.mjs.map +1 -1
  256. package/dist/esm/FrappeLikedBy.native.js +6 -3
  257. package/dist/esm/FrappeLikedBy.native.js.map +1 -1
  258. package/dist/esm/FrappeListView.mjs +396 -42
  259. package/dist/esm/FrappeListView.mjs.map +1 -1
  260. package/dist/esm/FrappeListView.native.js +458 -45
  261. package/dist/esm/FrappeListView.native.js.map +1 -1
  262. package/dist/esm/FrappeRecordView.mjs +174 -0
  263. package/dist/esm/FrappeRecordView.mjs.map +1 -0
  264. package/dist/esm/FrappeRecordView.native.js +190 -0
  265. package/dist/esm/FrappeRecordView.native.js.map +1 -0
  266. package/dist/esm/FrappeReportBuilder.mjs +2 -2
  267. package/dist/esm/FrappeReportBuilder.mjs.map +1 -1
  268. package/dist/esm/FrappeReportBuilder.native.js +2 -2
  269. package/dist/esm/FrappeReportBuilder.native.js.map +1 -1
  270. package/dist/esm/FrappeTreeView.mjs +1 -1
  271. package/dist/esm/FrappeTreeView.mjs.map +1 -1
  272. package/dist/esm/FrappeTreeView.native.js +1 -1
  273. package/dist/esm/desk/awesomebar.mjs +1 -1
  274. package/dist/esm/desk/awesomebar.mjs.map +1 -1
  275. package/dist/esm/desk/awesomebar.native.js +3 -3
  276. package/dist/esm/desk/awesomebar.native.js.map +1 -1
  277. package/dist/esm/fields/Heading/index.mjs +19 -12
  278. package/dist/esm/fields/Heading/index.mjs.map +1 -1
  279. package/dist/esm/fields/Heading/index.native.js +22 -13
  280. package/dist/esm/fields/Heading/index.native.js.map +1 -1
  281. package/dist/esm/frappeNavigation.mjs +11 -2
  282. package/dist/esm/frappeNavigation.mjs.map +1 -1
  283. package/dist/esm/frappeNavigation.native.js +12 -2
  284. package/dist/esm/frappeNavigation.native.js.map +1 -1
  285. package/dist/esm/index.mjs +14 -2
  286. package/dist/esm/index.mjs.map +1 -1
  287. package/dist/esm/index.native.js +14 -2
  288. package/dist/esm/index.native.js.map +1 -1
  289. package/dist/esm/insights/InsightsFacetTags.mjs +122 -0
  290. package/dist/esm/insights/InsightsFacetTags.mjs.map +1 -0
  291. package/dist/esm/insights/InsightsFacetTags.native.js +137 -0
  292. package/dist/esm/insights/InsightsFacetTags.native.js.map +1 -0
  293. package/dist/esm/insights/InsightsKpiBand.mjs +99 -0
  294. package/dist/esm/insights/InsightsKpiBand.mjs.map +1 -0
  295. package/dist/esm/insights/InsightsKpiBand.native.js +105 -0
  296. package/dist/esm/insights/InsightsKpiBand.native.js.map +1 -0
  297. package/dist/esm/insights/InsightsLeaders.mjs +125 -0
  298. package/dist/esm/insights/InsightsLeaders.mjs.map +1 -0
  299. package/dist/esm/insights/InsightsLeaders.native.js +150 -0
  300. package/dist/esm/insights/InsightsLeaders.native.js.map +1 -0
  301. package/dist/esm/insights/InsightsRecords.mjs +80 -0
  302. package/dist/esm/insights/InsightsRecords.mjs.map +1 -0
  303. package/dist/esm/insights/InsightsRecords.native.js +81 -0
  304. package/dist/esm/insights/InsightsRecords.native.js.map +1 -0
  305. package/dist/esm/insights/InsightsTable.mjs +132 -0
  306. package/dist/esm/insights/InsightsTable.mjs.map +1 -0
  307. package/dist/esm/insights/InsightsTable.native.js +166 -0
  308. package/dist/esm/insights/InsightsTable.native.js.map +1 -0
  309. package/dist/esm/insights/insightsData.mjs +82 -0
  310. package/dist/esm/insights/insightsData.mjs.map +1 -0
  311. package/dist/esm/insights/insightsData.native.js +185 -0
  312. package/dist/esm/insights/insightsData.native.js.map +1 -0
  313. package/dist/esm/insights/insightsRecord.mjs +9 -0
  314. package/dist/esm/insights/insightsRecord.mjs.map +1 -0
  315. package/dist/esm/insights/insightsRecord.native.js +9 -0
  316. package/dist/esm/insights/insightsRecord.native.js.map +1 -0
  317. package/dist/esm/list/FacetBadge.mjs +37 -0
  318. package/dist/esm/list/FacetBadge.mjs.map +1 -0
  319. package/dist/esm/list/FacetBadge.native.js +38 -0
  320. package/dist/esm/list/FacetBadge.native.js.map +1 -0
  321. package/dist/esm/list/FacetRail.mjs +174 -0
  322. package/dist/esm/list/FacetRail.mjs.map +1 -0
  323. package/dist/esm/list/FacetRail.native.js +195 -0
  324. package/dist/esm/list/FacetRail.native.js.map +1 -0
  325. package/dist/esm/list/ImageWell.mjs +86 -0
  326. package/dist/esm/list/ImageWell.mjs.map +1 -0
  327. package/dist/esm/list/ImageWell.native.js +98 -0
  328. package/dist/esm/list/ImageWell.native.js.map +1 -0
  329. package/dist/esm/list/ListControls.mjs +201 -0
  330. package/dist/esm/list/ListControls.mjs.map +1 -0
  331. package/dist/esm/list/ListControls.native.js +224 -0
  332. package/dist/esm/list/ListControls.native.js.map +1 -0
  333. package/dist/esm/list/ListToastHost.mjs +18 -0
  334. package/dist/esm/list/ListToastHost.mjs.map +1 -0
  335. package/dist/esm/list/ListToastHost.native.js +20 -0
  336. package/dist/esm/list/ListToastHost.native.js.map +1 -0
  337. package/dist/esm/list/RangeFilter.mjs +85 -0
  338. package/dist/esm/list/RangeFilter.mjs.map +1 -0
  339. package/dist/esm/list/RangeFilter.native.js +95 -0
  340. package/dist/esm/list/RangeFilter.native.js.map +1 -0
  341. package/dist/esm/list/RecordCard.mjs +208 -0
  342. package/dist/esm/list/RecordCard.mjs.map +1 -0
  343. package/dist/esm/list/RecordCard.native.js +145 -0
  344. package/dist/esm/list/RecordCard.native.js.map +1 -0
  345. package/dist/esm/list/ShufflePanel.mjs +87 -0
  346. package/dist/esm/list/ShufflePanel.mjs.map +1 -0
  347. package/dist/esm/list/ShufflePanel.native.js +111 -0
  348. package/dist/esm/list/ShufflePanel.native.js.map +1 -0
  349. package/dist/esm/list/facetReading.mjs +45 -0
  350. package/dist/esm/list/facetReading.mjs.map +1 -0
  351. package/dist/esm/list/facetReading.native.js +134 -0
  352. package/dist/esm/list/facetReading.native.js.map +1 -0
  353. package/dist/esm/list/favorites.mjs +50 -0
  354. package/dist/esm/list/favorites.mjs.map +1 -0
  355. package/dist/esm/list/favorites.native.js +59 -0
  356. package/dist/esm/list/favorites.native.js.map +1 -0
  357. package/dist/esm/list/listState.mjs +71 -0
  358. package/dist/esm/list/listState.mjs.map +1 -0
  359. package/dist/esm/list/listState.native.js +202 -0
  360. package/dist/esm/list/listState.native.js.map +1 -0
  361. package/dist/esm/list/recordLook.mjs +10 -0
  362. package/dist/esm/list/recordLook.mjs.map +1 -0
  363. package/dist/esm/list/recordLook.native.js +11 -0
  364. package/dist/esm/list/recordLook.native.js.map +1 -0
  365. package/dist/esm/list/useListControls.mjs +164 -0
  366. package/dist/esm/list/useListControls.mjs.map +1 -0
  367. package/dist/esm/list/useListControls.native.js +244 -0
  368. package/dist/esm/list/useListControls.native.js.map +1 -0
  369. package/dist/esm/record/RecordBars.mjs +175 -0
  370. package/dist/esm/record/RecordBars.mjs.map +1 -0
  371. package/dist/esm/record/RecordBars.native.js +197 -0
  372. package/dist/esm/record/RecordBars.native.js.map +1 -0
  373. package/dist/esm/record/RecordGallery.mjs +42 -0
  374. package/dist/esm/record/RecordGallery.mjs.map +1 -0
  375. package/dist/esm/record/RecordGallery.native.js +47 -0
  376. package/dist/esm/record/RecordGallery.native.js.map +1 -0
  377. package/dist/esm/record/RecordHero.mjs +205 -0
  378. package/dist/esm/record/RecordHero.mjs.map +1 -0
  379. package/dist/esm/record/RecordHero.native.js +213 -0
  380. package/dist/esm/record/RecordHero.native.js.map +1 -0
  381. package/dist/esm/record/RecordPage.mjs +305 -0
  382. package/dist/esm/record/RecordPage.mjs.map +1 -0
  383. package/dist/esm/record/RecordPage.native.js +336 -0
  384. package/dist/esm/record/RecordPage.native.js.map +1 -0
  385. package/dist/esm/record/RecordPager.mjs +100 -0
  386. package/dist/esm/record/RecordPager.mjs.map +1 -0
  387. package/dist/esm/record/RecordPager.native.js +102 -0
  388. package/dist/esm/record/RecordPager.native.js.map +1 -0
  389. package/dist/esm/record/RecordRows.mjs +101 -0
  390. package/dist/esm/record/RecordRows.mjs.map +1 -0
  391. package/dist/esm/record/RecordRows.native.js +112 -0
  392. package/dist/esm/record/RecordRows.native.js.map +1 -0
  393. package/dist/esm/record/recordData.mjs +92 -0
  394. package/dist/esm/record/recordData.mjs.map +1 -0
  395. package/dist/esm/record/recordData.native.js +156 -0
  396. package/dist/esm/record/recordData.native.js.map +1 -0
  397. package/dist/esm/record/recordSections.mjs +5 -0
  398. package/dist/esm/record/recordSections.mjs.map +1 -0
  399. package/dist/esm/record/recordSections.native.js +5 -0
  400. package/dist/esm/record/recordSections.native.js.map +1 -0
  401. package/dist/jsx/FrappeCalendar.mjs +1 -1
  402. package/dist/jsx/FrappeCalendar.mjs.map +1 -1
  403. package/dist/jsx/FrappeCalendar.native.js +1 -1
  404. package/dist/jsx/FrappeCalendar.native.js.map +1 -1
  405. package/dist/jsx/FrappeDashboard.mjs +1 -1
  406. package/dist/jsx/FrappeDashboard.mjs.map +1 -1
  407. package/dist/jsx/FrappeDashboard.native.js +1 -1
  408. package/dist/jsx/FrappeDashboard.native.js.map +1 -1
  409. package/dist/jsx/FrappeImageView.mjs +1 -1
  410. package/dist/jsx/FrappeImageView.mjs.map +1 -1
  411. package/dist/jsx/FrappeImageView.native.js +1 -1
  412. package/dist/jsx/FrappeImageView.native.js.map +1 -1
  413. package/dist/jsx/FrappeInsights.mjs +355 -0
  414. package/dist/jsx/FrappeInsights.mjs.map +1 -0
  415. package/dist/jsx/FrappeInsights.native.js +447 -0
  416. package/dist/jsx/FrappeInsights.native.js.map +1 -0
  417. package/dist/jsx/FrappeLikedBy.mjs +6 -3
  418. package/dist/jsx/FrappeLikedBy.mjs.map +1 -1
  419. package/dist/jsx/FrappeLikedBy.native.js +5 -2
  420. package/dist/jsx/FrappeLikedBy.native.js.map +1 -1
  421. package/dist/jsx/FrappeListView.mjs +396 -42
  422. package/dist/jsx/FrappeListView.mjs.map +1 -1
  423. package/dist/jsx/FrappeListView.native.js +454 -41
  424. package/dist/jsx/FrappeListView.native.js.map +1 -1
  425. package/dist/jsx/FrappeRecordView.mjs +174 -0
  426. package/dist/jsx/FrappeRecordView.mjs.map +1 -0
  427. package/dist/jsx/FrappeRecordView.native.js +218 -0
  428. package/dist/jsx/FrappeRecordView.native.js.map +1 -0
  429. package/dist/jsx/FrappeReportBuilder.mjs +2 -2
  430. package/dist/jsx/FrappeReportBuilder.mjs.map +1 -1
  431. package/dist/jsx/FrappeReportBuilder.native.js +2 -2
  432. package/dist/jsx/FrappeReportBuilder.native.js.map +1 -1
  433. package/dist/jsx/FrappeTreeView.mjs +1 -1
  434. package/dist/jsx/FrappeTreeView.mjs.map +1 -1
  435. package/dist/jsx/FrappeTreeView.native.js +1 -1
  436. package/dist/jsx/desk/awesomebar.mjs +1 -1
  437. package/dist/jsx/desk/awesomebar.mjs.map +1 -1
  438. package/dist/jsx/desk/awesomebar.native.js +3 -3
  439. package/dist/jsx/desk/awesomebar.native.js.map +1 -1
  440. package/dist/jsx/fields/Heading/index.mjs +19 -12
  441. package/dist/jsx/fields/Heading/index.mjs.map +1 -1
  442. package/dist/jsx/fields/Heading/index.native.js +21 -12
  443. package/dist/jsx/fields/Heading/index.native.js.map +1 -1
  444. package/dist/jsx/frappeNavigation.mjs +11 -2
  445. package/dist/jsx/frappeNavigation.mjs.map +1 -1
  446. package/dist/jsx/frappeNavigation.native.js +13 -2
  447. package/dist/jsx/frappeNavigation.native.js.map +1 -1
  448. package/dist/jsx/index.js +14 -2
  449. package/dist/jsx/index.js.map +1 -1
  450. package/dist/jsx/index.mjs +14 -2
  451. package/dist/jsx/index.mjs.map +1 -1
  452. package/dist/jsx/index.native.js +34 -0
  453. package/dist/jsx/index.native.js.map +1 -1
  454. package/dist/jsx/insights/InsightsFacetTags.mjs +122 -0
  455. package/dist/jsx/insights/InsightsFacetTags.mjs.map +1 -0
  456. package/dist/jsx/insights/InsightsFacetTags.native.js +165 -0
  457. package/dist/jsx/insights/InsightsFacetTags.native.js.map +1 -0
  458. package/dist/jsx/insights/InsightsKpiBand.mjs +99 -0
  459. package/dist/jsx/insights/InsightsKpiBand.mjs.map +1 -0
  460. package/dist/jsx/insights/InsightsKpiBand.native.js +133 -0
  461. package/dist/jsx/insights/InsightsKpiBand.native.js.map +1 -0
  462. package/dist/jsx/insights/InsightsLeaders.mjs +125 -0
  463. package/dist/jsx/insights/InsightsLeaders.mjs.map +1 -0
  464. package/dist/jsx/insights/InsightsLeaders.native.js +178 -0
  465. package/dist/jsx/insights/InsightsLeaders.native.js.map +1 -0
  466. package/dist/jsx/insights/InsightsRecords.mjs +80 -0
  467. package/dist/jsx/insights/InsightsRecords.mjs.map +1 -0
  468. package/dist/jsx/insights/InsightsRecords.native.js +109 -0
  469. package/dist/jsx/insights/InsightsRecords.native.js.map +1 -0
  470. package/dist/jsx/insights/InsightsTable.mjs +132 -0
  471. package/dist/jsx/insights/InsightsTable.mjs.map +1 -0
  472. package/dist/jsx/insights/InsightsTable.native.js +194 -0
  473. package/dist/jsx/insights/InsightsTable.native.js.map +1 -0
  474. package/dist/jsx/insights/insightsData.mjs +82 -0
  475. package/dist/jsx/insights/insightsData.mjs.map +1 -0
  476. package/dist/jsx/insights/insightsData.native.js +220 -0
  477. package/dist/jsx/insights/insightsData.native.js.map +1 -0
  478. package/dist/jsx/insights/insightsRecord.mjs +9 -0
  479. package/dist/jsx/insights/insightsRecord.mjs.map +1 -0
  480. package/dist/jsx/insights/insightsRecord.native.js +38 -0
  481. package/dist/jsx/insights/insightsRecord.native.js.map +1 -0
  482. package/dist/jsx/list/FacetBadge.mjs +37 -0
  483. package/dist/jsx/list/FacetBadge.mjs.map +1 -0
  484. package/dist/jsx/list/FacetBadge.native.js +66 -0
  485. package/dist/jsx/list/FacetBadge.native.js.map +1 -0
  486. package/dist/jsx/list/FacetRail.mjs +174 -0
  487. package/dist/jsx/list/FacetRail.mjs.map +1 -0
  488. package/dist/jsx/list/FacetRail.native.js +223 -0
  489. package/dist/jsx/list/FacetRail.native.js.map +1 -0
  490. package/dist/jsx/list/ImageWell.mjs +86 -0
  491. package/dist/jsx/list/ImageWell.mjs.map +1 -0
  492. package/dist/jsx/list/ImageWell.native.js +126 -0
  493. package/dist/jsx/list/ImageWell.native.js.map +1 -0
  494. package/dist/jsx/list/ListControls.mjs +201 -0
  495. package/dist/jsx/list/ListControls.mjs.map +1 -0
  496. package/dist/jsx/list/ListControls.native.js +252 -0
  497. package/dist/jsx/list/ListControls.native.js.map +1 -0
  498. package/dist/jsx/list/ListToastHost.mjs +18 -0
  499. package/dist/jsx/list/ListToastHost.mjs.map +1 -0
  500. package/dist/jsx/list/ListToastHost.native.js +59 -0
  501. package/dist/jsx/list/ListToastHost.native.js.map +1 -0
  502. package/dist/jsx/list/RangeFilter.mjs +85 -0
  503. package/dist/jsx/list/RangeFilter.mjs.map +1 -0
  504. package/dist/jsx/list/RangeFilter.native.js +135 -0
  505. package/dist/jsx/list/RangeFilter.native.js.map +1 -0
  506. package/dist/jsx/list/RecordCard.mjs +208 -0
  507. package/dist/jsx/list/RecordCard.mjs.map +1 -0
  508. package/dist/jsx/list/RecordCard.native.js +173 -0
  509. package/dist/jsx/list/RecordCard.native.js.map +1 -0
  510. package/dist/jsx/list/ShufflePanel.mjs +87 -0
  511. package/dist/jsx/list/ShufflePanel.mjs.map +1 -0
  512. package/dist/jsx/list/ShufflePanel.native.js +139 -0
  513. package/dist/jsx/list/ShufflePanel.native.js.map +1 -0
  514. package/dist/jsx/list/facetReading.mjs +45 -0
  515. package/dist/jsx/list/facetReading.mjs.map +1 -0
  516. package/dist/jsx/list/facetReading.native.js +163 -0
  517. package/dist/jsx/list/facetReading.native.js.map +1 -0
  518. package/dist/jsx/list/favorites.mjs +50 -0
  519. package/dist/jsx/list/favorites.mjs.map +1 -0
  520. package/dist/jsx/list/favorites.native.js +91 -0
  521. package/dist/jsx/list/favorites.native.js.map +1 -0
  522. package/dist/jsx/list/listState.mjs +71 -0
  523. package/dist/jsx/list/listState.mjs.map +1 -0
  524. package/dist/jsx/list/listState.native.js +234 -0
  525. package/dist/jsx/list/listState.native.js.map +1 -0
  526. package/dist/jsx/list/recordLook.mjs +10 -0
  527. package/dist/jsx/list/recordLook.mjs.map +1 -0
  528. package/dist/jsx/list/recordLook.native.js +39 -0
  529. package/dist/jsx/list/recordLook.native.js.map +1 -0
  530. package/dist/jsx/list/useListControls.mjs +164 -0
  531. package/dist/jsx/list/useListControls.mjs.map +1 -0
  532. package/dist/jsx/list/useListControls.native.js +272 -0
  533. package/dist/jsx/list/useListControls.native.js.map +1 -0
  534. package/dist/jsx/record/RecordBars.mjs +175 -0
  535. package/dist/jsx/record/RecordBars.mjs.map +1 -0
  536. package/dist/jsx/record/RecordBars.native.js +225 -0
  537. package/dist/jsx/record/RecordBars.native.js.map +1 -0
  538. package/dist/jsx/record/RecordGallery.mjs +42 -0
  539. package/dist/jsx/record/RecordGallery.mjs.map +1 -0
  540. package/dist/jsx/record/RecordGallery.native.js +75 -0
  541. package/dist/jsx/record/RecordGallery.native.js.map +1 -0
  542. package/dist/jsx/record/RecordHero.mjs +205 -0
  543. package/dist/jsx/record/RecordHero.mjs.map +1 -0
  544. package/dist/jsx/record/RecordHero.native.js +250 -0
  545. package/dist/jsx/record/RecordHero.native.js.map +1 -0
  546. package/dist/jsx/record/RecordPage.mjs +305 -0
  547. package/dist/jsx/record/RecordPage.mjs.map +1 -0
  548. package/dist/jsx/record/RecordPage.native.js +364 -0
  549. package/dist/jsx/record/RecordPage.native.js.map +1 -0
  550. package/dist/jsx/record/RecordPager.mjs +100 -0
  551. package/dist/jsx/record/RecordPager.mjs.map +1 -0
  552. package/dist/jsx/record/RecordPager.native.js +130 -0
  553. package/dist/jsx/record/RecordPager.native.js.map +1 -0
  554. package/dist/jsx/record/RecordRows.mjs +101 -0
  555. package/dist/jsx/record/RecordRows.mjs.map +1 -0
  556. package/dist/jsx/record/RecordRows.native.js +140 -0
  557. package/dist/jsx/record/RecordRows.native.js.map +1 -0
  558. package/dist/jsx/record/recordData.mjs +92 -0
  559. package/dist/jsx/record/recordData.mjs.map +1 -0
  560. package/dist/jsx/record/recordData.native.js +189 -0
  561. package/dist/jsx/record/recordData.native.js.map +1 -0
  562. package/dist/jsx/record/recordSections.mjs +5 -0
  563. package/dist/jsx/record/recordSections.mjs.map +1 -0
  564. package/dist/jsx/record/recordSections.native.js +33 -0
  565. package/dist/jsx/record/recordSections.native.js.map +1 -0
  566. package/package.json +16 -16
  567. package/src/FrappeCalendar.tsx +2 -2
  568. package/src/FrappeDashboard.tsx +2 -2
  569. package/src/FrappeImageView.tsx +2 -1
  570. package/src/FrappeInsights.spec.tsx +171 -0
  571. package/src/FrappeInsights.tsx +422 -0
  572. package/src/FrappeLikedBy.tsx +7 -5
  573. package/src/FrappeListView.card.spec.tsx +157 -0
  574. package/src/FrappeListView.controls.spec.tsx +225 -0
  575. package/src/FrappeListView.seed.spec.tsx +30 -0
  576. package/src/FrappeListView.tsx +575 -44
  577. package/src/FrappeRecordView.spec.tsx +276 -0
  578. package/src/FrappeRecordView.tsx +231 -0
  579. package/src/FrappeReportBuilder.tsx +4 -5
  580. package/src/FrappeTreeView.tsx +1 -1
  581. package/src/desk/awesomebar.auth.spec.tsx +77 -0
  582. package/src/desk/awesomebar.tsx +1 -1
  583. package/src/fields/Heading/index.tsx +33 -15
  584. package/src/frappeNavigation.loader.spec.tsx +45 -0
  585. package/src/frappeNavigation.tsx +32 -1
  586. package/src/index.ts +53 -1
  587. package/src/insights/InsightsFacetTags.tsx +131 -0
  588. package/src/insights/InsightsKpiBand.tsx +114 -0
  589. package/src/insights/InsightsLeaders.tsx +146 -0
  590. package/src/insights/InsightsRecords.tsx +71 -0
  591. package/src/insights/InsightsTable.tsx +169 -0
  592. package/src/insights/insightsData.spec.ts +143 -0
  593. package/src/insights/insightsData.ts +122 -0
  594. package/src/insights/insightsRecord.ts +36 -0
  595. package/src/list/FacetBadge.tsx +41 -0
  596. package/src/list/FacetRail.tsx +235 -0
  597. package/src/list/ImageWell.tsx +110 -0
  598. package/src/list/ListControls.tsx +208 -0
  599. package/src/list/ListToastHost.tsx +27 -0
  600. package/src/list/RangeFilter.tsx +83 -0
  601. package/src/list/RecordCard.native.tsx +126 -0
  602. package/src/list/RecordCard.tsx +260 -0
  603. package/src/list/ShufflePanel.tsx +107 -0
  604. package/src/list/facetReading.ts +79 -0
  605. package/src/list/favorites.spec.ts +80 -0
  606. package/src/list/favorites.ts +79 -0
  607. package/src/list/listState.spec.ts +156 -0
  608. package/src/list/listState.ts +184 -0
  609. package/src/list/recordLook.ts +37 -0
  610. package/src/list/useListControls.tsx +223 -0
  611. package/src/record/RecordBars.tsx +187 -0
  612. package/src/record/RecordGallery.tsx +47 -0
  613. package/src/record/RecordHero.tsx +186 -0
  614. package/src/record/RecordPage.tsx +358 -0
  615. package/src/record/RecordPager.tsx +97 -0
  616. package/src/record/RecordRows.tsx +90 -0
  617. package/src/record/recordData.spec.ts +148 -0
  618. package/src/record/recordData.ts +124 -0
  619. package/src/record/recordSections.ts +62 -0
  620. package/src/schemaForm/SchemaForm.stories.tsx +2 -2
  621. package/types/FrappeImageView.d.ts.map +1 -1
  622. package/types/FrappeInsights.d.ts +55 -0
  623. package/types/FrappeInsights.d.ts.map +1 -0
  624. package/types/FrappeLikedBy.d.ts.map +1 -1
  625. package/types/FrappeListView.d.ts +82 -2
  626. package/types/FrappeListView.d.ts.map +1 -1
  627. package/types/FrappeRecordView.d.ts +69 -0
  628. package/types/FrappeRecordView.d.ts.map +1 -0
  629. package/types/FrappeReportBuilder.d.ts.map +1 -1
  630. package/types/fields/Heading/index.d.ts.map +1 -1
  631. package/types/frappeNavigation.d.ts +21 -0
  632. package/types/frappeNavigation.d.ts.map +1 -1
  633. package/types/index.d.ts +14 -2
  634. package/types/index.d.ts.map +1 -1
  635. package/types/insights/InsightsFacetTags.d.ts +11 -0
  636. package/types/insights/InsightsFacetTags.d.ts.map +1 -0
  637. package/types/insights/InsightsKpiBand.d.ts +22 -0
  638. package/types/insights/InsightsKpiBand.d.ts.map +1 -0
  639. package/types/insights/InsightsLeaders.d.ts +16 -0
  640. package/types/insights/InsightsLeaders.d.ts.map +1 -0
  641. package/types/insights/InsightsRecords.d.ts +19 -0
  642. package/types/insights/InsightsRecords.d.ts.map +1 -0
  643. package/types/insights/InsightsTable.d.ts +17 -0
  644. package/types/insights/InsightsTable.d.ts.map +1 -0
  645. package/types/insights/insightsData.d.ts +45 -0
  646. package/types/insights/insightsData.d.ts.map +1 -0
  647. package/types/insights/insightsRecord.d.ts +29 -0
  648. package/types/insights/insightsRecord.d.ts.map +1 -0
  649. package/types/list/FacetBadge.d.ts +13 -0
  650. package/types/list/FacetBadge.d.ts.map +1 -0
  651. package/types/list/FacetRail.d.ts +26 -0
  652. package/types/list/FacetRail.d.ts.map +1 -0
  653. package/types/list/ImageWell.d.ts +24 -0
  654. package/types/list/ImageWell.d.ts.map +1 -0
  655. package/types/list/ListControls.d.ts +30 -0
  656. package/types/list/ListControls.d.ts.map +1 -0
  657. package/types/list/ListToastHost.d.ts +7 -0
  658. package/types/list/ListToastHost.d.ts.map +1 -0
  659. package/types/list/RangeFilter.d.ts +14 -0
  660. package/types/list/RangeFilter.d.ts.map +1 -0
  661. package/types/list/RecordCard.d.ts +38 -0
  662. package/types/list/RecordCard.d.ts.map +1 -0
  663. package/types/list/RecordCard.native.d.ts +9 -0
  664. package/types/list/RecordCard.native.d.ts.map +1 -0
  665. package/types/list/ShufflePanel.d.ts +24 -0
  666. package/types/list/ShufflePanel.d.ts.map +1 -0
  667. package/types/list/facetReading.d.ts +33 -0
  668. package/types/list/facetReading.d.ts.map +1 -0
  669. package/types/list/favorites.d.ts +26 -0
  670. package/types/list/favorites.d.ts.map +1 -0
  671. package/types/list/listState.d.ts +94 -0
  672. package/types/list/listState.d.ts.map +1 -0
  673. package/types/list/recordLook.d.ts +25 -0
  674. package/types/list/recordLook.d.ts.map +1 -0
  675. package/types/list/useListControls.d.ts +48 -0
  676. package/types/list/useListControls.d.ts.map +1 -0
  677. package/types/record/RecordBars.d.ts +11 -0
  678. package/types/record/RecordBars.d.ts.map +1 -0
  679. package/types/record/RecordGallery.d.ts +17 -0
  680. package/types/record/RecordGallery.d.ts.map +1 -0
  681. package/types/record/RecordHero.d.ts +42 -0
  682. package/types/record/RecordHero.d.ts.map +1 -0
  683. package/types/record/RecordPage.d.ts +54 -0
  684. package/types/record/RecordPage.d.ts.map +1 -0
  685. package/types/record/RecordPager.d.ts +13 -0
  686. package/types/record/RecordPager.d.ts.map +1 -0
  687. package/types/record/RecordRows.d.ts +13 -0
  688. package/types/record/RecordRows.d.ts.map +1 -0
  689. package/types/record/recordData.d.ts +46 -0
  690. package/types/record/recordData.d.ts.map +1 -0
  691. package/types/record/recordSections.d.ts +67 -0
  692. package/types/record/recordSections.d.ts.map +1 -0
@@ -0,0 +1,358 @@
1
+ import {
2
+ Breadcrumbs,
3
+ Chip,
4
+ H1,
5
+ PageHeader,
6
+ PageSection,
7
+ Quote,
8
+ Screen,
9
+ ScreenToolbar,
10
+ Tabs,
11
+ Text,
12
+ Timeline,
13
+ Tooltip,
14
+ XStack,
15
+ YStack,
16
+ type TimelineEntry,
17
+ } from "@multiplatform.one/components";
18
+ import { Button } from "@multiplatform.one/forms";
19
+ import { useResolvedKnobs } from "@multiplatform.one/theme";
20
+ import { ArrowLeftIcon, HeartIcon } from "@phosphor-icons/react";
21
+ import type { ComponentType } from "react";
22
+ import { useTranslation } from "react-i18next";
23
+ import { frappeRouteHref } from "../frappeNavigation";
24
+ import { metricValue, type FrappeInsightsMetric } from "../insights/insightsRecord";
25
+ import { FacetBadge } from "../list/FacetBadge";
26
+ import { favoritesKey, useFavorites } from "../list/favorites";
27
+ import type { FrappeListFacet } from "../list/listState";
28
+ import { recordTitle, type FrappeRecordLook } from "../list/recordLook";
29
+ import { adjacentRecords, recordFacetValues, recordHistory } from "./recordData";
30
+ import { RecordBars } from "./RecordBars";
31
+ import { RecordGallery } from "./RecordGallery";
32
+ import {
33
+ RecordHeroArtColumn,
34
+ RecordHeroFrame,
35
+ RecordHeroIdentityColumn,
36
+ RecordHeroRow,
37
+ RecordVitals,
38
+ } from "./RecordHero";
39
+ import { RecordPager, type RecordPagerEntry } from "./RecordPager";
40
+ import { RecordRows } from "./RecordRows";
41
+ import type { FrappeRecordSection, FrappeRecordTab } from "./recordSections";
42
+
43
+ /** A hop from the record to another page of it (the backoffice form). */
44
+ export interface FrappeRecordAction<TDoc> {
45
+ label: string;
46
+ icon: ComponentType<{ size?: number }>;
47
+ href: (doc: Partial<TDoc>) => string;
48
+ testID?: string;
49
+ }
50
+
51
+ type Row = Record<string, unknown>;
52
+
53
+ export interface RecordPageProps<TDoc extends { name: string; doctype: string }> {
54
+ doc: Partial<TDoc>;
55
+ linked: Record<string, Row[]>;
56
+ doctype: string;
57
+ route: string;
58
+ listName: string;
59
+ listRows: Partial<TDoc>[];
60
+ look?: FrappeRecordLook<TDoc>;
61
+ titleField?: string;
62
+ facet?: FrappeListFacet;
63
+ metrics: readonly FrappeInsightsMetric[];
64
+ summary?: (doc: Partial<TDoc>) => { text: string; cite?: string } | undefined;
65
+ tabs: readonly FrappeRecordTab[];
66
+ favorites?: boolean | string;
67
+ actions: readonly FrappeRecordAction<TDoc>[];
68
+ history: boolean;
69
+ slug: string;
70
+ baseURL?: string;
71
+ navigate: (href: string) => void;
72
+ /** The session may write this record: Edit shows. */
73
+ canEdit: boolean;
74
+ }
75
+
76
+ /**
77
+ * A record page drawn from a record already read: the header with Back,
78
+ * the heart, hops and Edit; the hero; the tabs; the neighbors. The data
79
+ * wrapper (FrappeRecordView) reads the record, its rows and the rights.
80
+ */
81
+ export function RecordPage<TDoc extends { name: string; doctype: string }>({
82
+ doc,
83
+ linked,
84
+ doctype,
85
+ route,
86
+ listName,
87
+ listRows,
88
+ look,
89
+ titleField,
90
+ facet,
91
+ metrics,
92
+ summary,
93
+ tabs,
94
+ favorites,
95
+ actions,
96
+ history,
97
+ slug,
98
+ baseURL,
99
+ navigate,
100
+ canEdit,
101
+ }: RecordPageProps<TDoc>) {
102
+ const { t } = useTranslation();
103
+ const { knobProps } = useResolvedKnobs();
104
+ const { knobProps: nested } = useResolvedKnobs({ compact: true });
105
+ const row = doc as Row;
106
+ const name = String(row.name ?? "");
107
+ const { isFavorite, toggle } = useFavorites(
108
+ favorites ? (typeof favorites === "string" ? favorites : favoritesKey(doctype)) : undefined,
109
+ );
110
+
111
+ const title = recordTitle(doc, look, titleField);
112
+ const code = look?.code?.(doc);
113
+ const values = facet ? recordFacetValues(facet, row, linked) : [];
114
+ const tints = values.slice(0, 2).map((value) => facet?.tint?.(value));
115
+ const images = look?.images?.(doc, baseURL) ?? [];
116
+ const slides = (look?.gallery?.(doc, baseURL) ?? []).filter(
117
+ (slide) => slide.src && slide.src !== images[0],
118
+ );
119
+ const favorite = favorites ? isFavorite(name) : false;
120
+ const favoriteLabel = favorite
121
+ ? t("Remove {{name}} from favorites", { name: title })
122
+ : t("Add {{name}} to favorites", { name: title });
123
+
124
+ const { prev, next } = adjacentRecords(listRows, name);
125
+ const pagerEntry = (neighbor: Partial<TDoc> | null): RecordPagerEntry | null =>
126
+ neighbor?.name
127
+ ? {
128
+ title: recordTitle(neighbor, look, titleField),
129
+ code: look?.code?.(neighbor),
130
+ image: look?.images?.(neighbor, baseURL)[0],
131
+ onPress: () =>
132
+ navigate(frappeRouteHref(route, { mode: "view", name: neighbor.name as string })),
133
+ }
134
+ : null;
135
+
136
+ const entries: TimelineEntry[] = history
137
+ ? recordHistory(row).map((entry) =>
138
+ entry.kind === "modified"
139
+ ? {
140
+ id: `${name}-modified`,
141
+ type: "version",
142
+ author: entry.author,
143
+ timestamp: entry.timestamp,
144
+ }
145
+ : {
146
+ id: `${name}-created`,
147
+ type: "info",
148
+ author: entry.author,
149
+ content: t("Created this {{doctype}}", { doctype }),
150
+ timestamp: entry.timestamp,
151
+ },
152
+ )
153
+ : [];
154
+
155
+ const drawSection = (section: FrappeRecordSection, index: number) => {
156
+ if (section.kind === "bars") {
157
+ const tableRows = Array.isArray(row[section.table]) ? (row[section.table] as Row[]) : [];
158
+ return (
159
+ <RecordBars
160
+ key={`bars-${section.id}`}
161
+ rows={tableRows}
162
+ section={section}
163
+ testID={`${slug}-${section.id}-chart`}
164
+ />
165
+ );
166
+ }
167
+ const rows = <RecordRows rows={linked[section.doctype] ?? []} section={section} />;
168
+ if (!section.title) {
169
+ return (
170
+ <YStack key={`rows-${index}`} {...knobProps.gap}>
171
+ {section.description ? (
172
+ <Text {...nested.label} color="$color10">
173
+ {section.description}
174
+ </Text>
175
+ ) : null}
176
+ {rows}
177
+ </YStack>
178
+ );
179
+ }
180
+ return (
181
+ <PageSection
182
+ key={`rows-${index}`}
183
+ title={section.title}
184
+ description={section.description}
185
+ divider={false}
186
+ >
187
+ {rows}
188
+ </PageSection>
189
+ );
190
+ };
191
+
192
+ const quote = summary?.(doc);
193
+ const tabItems = tabs.map((tab, index) => {
194
+ const count = tab.count ? (linked[tab.count] ?? []).length : 0;
195
+ const Icon = tab.icon;
196
+ return {
197
+ value: tab.value,
198
+ label: tab.label,
199
+ icon: Icon ? <Icon size={16} /> : undefined,
200
+ badge: count > 0 ? <Chip size="$2">{count}</Chip> : undefined,
201
+ content: (
202
+ <YStack {...knobProps.gapLg}>
203
+ {index === 0 && quote ? (
204
+ <Quote marginVertical={0} cite={quote.cite}>
205
+ {quote.text}
206
+ </Quote>
207
+ ) : null}
208
+ {tab.sections.map(drawSection)}
209
+ {index === 0 && entries.length > 0 ? (
210
+ <PageSection title={t("Record history")} surface>
211
+ <Timeline entries={entries} labels={{ madeChanges: t("last updated this record") }} />
212
+ </PageSection>
213
+ ) : null}
214
+ </YStack>
215
+ ),
216
+ };
217
+ });
218
+
219
+ const toolbar = (
220
+ <ScreenToolbar
221
+ leading={
222
+ <Button
223
+ outlined
224
+ minHeight={knobProps.sizeToken}
225
+ onPress={() => navigate(route)}
226
+ icon={<ArrowLeftIcon size={16} />}
227
+ testID={`${slug}-detail-back`}
228
+ >
229
+ {t("Back")}
230
+ </Button>
231
+ }
232
+ trailing={
233
+ <XStack {...knobProps.gap} alignItems="center">
234
+ {favorites || actions.length > 0 ? (
235
+ <XStack {...knobProps.borderRadius} backgroundColor="$color2" alignItems="center">
236
+ {favorites ? (
237
+ <Tooltip content={favoriteLabel}>
238
+ <Button
239
+ circular
240
+ chromeless
241
+ minWidth={knobProps.sizeToken}
242
+ minHeight={knobProps.sizeToken}
243
+ onPress={() => toggle(name)}
244
+ col={(favorite ? "$red9" : "$color10") as never}
245
+ icon={<HeartIcon size={22} weight={favorite ? "fill" : "regular"} />}
246
+ aria-label={favoriteLabel}
247
+ aria-pressed={favorite}
248
+ render="button"
249
+ type="button"
250
+ testID={`${slug}-detail-favorite`}
251
+ />
252
+ </Tooltip>
253
+ ) : null}
254
+ {actions.map((action) => {
255
+ const Icon = action.icon;
256
+ return (
257
+ <Tooltip key={action.label} content={action.label}>
258
+ <Button
259
+ circular
260
+ chromeless
261
+ minWidth={knobProps.sizeToken}
262
+ minHeight={knobProps.sizeToken}
263
+ onPress={() => navigate(action.href(doc))}
264
+ col={"$color10" as never}
265
+ icon={<Icon size={20} />}
266
+ aria-label={action.label}
267
+ testID={action.testID}
268
+ />
269
+ </Tooltip>
270
+ );
271
+ })}
272
+ </XStack>
273
+ ) : null}
274
+ {canEdit ? (
275
+ <Button
276
+ theme="accent"
277
+ minHeight={knobProps.sizeToken}
278
+ onPress={() => navigate(frappeRouteHref(route, { mode: "edit", name }))}
279
+ testID={`${slug}-detail-edit`}
280
+ >
281
+ {t("Edit")}
282
+ </Button>
283
+ ) : null}
284
+ </XStack>
285
+ }
286
+ />
287
+ );
288
+
289
+ return (
290
+ <Screen>
291
+ <YStack gap="$2">
292
+ <Breadcrumbs
293
+ items={[{ label: listName, href: route }, { label: code ? `${code} ${title}` : title }]}
294
+ onNavigate={(href) => navigate(href)}
295
+ />
296
+ {toolbar}
297
+ </YStack>
298
+
299
+ <RecordHeroFrame tint={tints[0]} testID={`${slug}-detail-stage`}>
300
+ <RecordHeroRow>
301
+ <RecordHeroArtColumn testID={`${slug}-hero-art`}>
302
+ <RecordGallery images={images} slides={slides} alt={title} tints={tints} />
303
+ </RecordHeroArtColumn>
304
+ <RecordHeroIdentityColumn testID={`${slug}-hero-identity`}>
305
+ {code ? (
306
+ <Text
307
+ {...nested.label}
308
+ fontWeight="700"
309
+ color={(tints[0] ? `$${tints[0]}11` : "$color11") as never}
310
+ letterSpacing={1}
311
+ >
312
+ {code}
313
+ </Text>
314
+ ) : null}
315
+ <PageHeader
316
+ heading={
317
+ <H1 margin={0} size="$10" $max-sm={{ size: "$9" }}>
318
+ {title}
319
+ </H1>
320
+ }
321
+ subtitle={look?.subtitle?.(doc) || undefined}
322
+ divider={false}
323
+ />
324
+ {values.length > 0 ? (
325
+ <XStack gap="$2" flexWrap="wrap">
326
+ {values.map((value) => (
327
+ <FacetBadge
328
+ key={value}
329
+ label={facet?.optionLabel?.(value) ?? value}
330
+ tint={facet?.tint?.(value)}
331
+ />
332
+ ))}
333
+ </XStack>
334
+ ) : null}
335
+ <RecordVitals
336
+ tiles={metrics.map((metric) => {
337
+ const value = metricValue(doc, metric.field);
338
+ return {
339
+ id: metric.field,
340
+ label: metric.label,
341
+ value: metric.format ? metric.format(value) : String(value),
342
+ percent: metric.max ? Math.min((value / metric.max) * 100, 100) : undefined,
343
+ };
344
+ })}
345
+ />
346
+ </RecordHeroIdentityColumn>
347
+ </RecordHeroRow>
348
+ </RecordHeroFrame>
349
+
350
+ <YStack {...knobProps.gapLg} paddingBottom="$6">
351
+ {tabItems.length > 0 ? (
352
+ <Tabs defaultValue={tabItems[0]?.value} lazyMount items={tabItems} />
353
+ ) : null}
354
+ <RecordPager prev={pagerEntry(prev)} next={pagerEntry(next)} testID={slug} />
355
+ </YStack>
356
+ </Screen>
357
+ );
358
+ }
@@ -0,0 +1,97 @@
1
+ import { Avatar, Text, XStack, YStack } from "@multiplatform.one/components";
2
+ import { Button } from "@multiplatform.one/forms";
3
+ import { sizeRecipeEscape, useResolvedKnobs } from "@multiplatform.one/theme";
4
+ import { ArrowLeftIcon, ArrowRightIcon } from "@phosphor-icons/react";
5
+ import { useTranslation } from "react-i18next";
6
+
7
+ export interface RecordPagerEntry {
8
+ title: string;
9
+ code?: string;
10
+ image?: string;
11
+ onPress: () => void;
12
+ }
13
+
14
+ function PagerButton({
15
+ direction,
16
+ entry,
17
+ testID,
18
+ }: {
19
+ direction: "prev" | "next";
20
+ entry: RecordPagerEntry;
21
+ testID?: string;
22
+ }) {
23
+ const { t } = useTranslation();
24
+ const { knobProps: nested } = useResolvedKnobs({ compact: true });
25
+ const isPrev = direction === "prev";
26
+ const avatar = (
27
+ <Avatar
28
+ src={entry.image}
29
+ name={entry.title}
30
+ backgroundColor="$color4"
31
+ fallbackBackgroundColor="$color4"
32
+ />
33
+ );
34
+ return (
35
+ <Button
36
+ outlined
37
+ minHeight={sizeRecipeEscape(
38
+ 56,
39
+ "pager button: room for the neighbor's two-line label beside its avatar",
40
+ )}
41
+ flexShrink={1}
42
+ minWidth={0}
43
+ onPress={entry.onPress}
44
+ icon={isPrev ? <ArrowLeftIcon size={18} /> : undefined}
45
+ iconAfter={isPrev ? undefined : <ArrowRightIcon size={18} />}
46
+ testID={testID}
47
+ >
48
+ <XStack gap="$2" alignItems="center" flexShrink={1} minWidth={0}>
49
+ {isPrev ? avatar : null}
50
+ <YStack alignItems={isPrev ? "flex-start" : "flex-end"} flexShrink={1} minWidth={0}>
51
+ <Text {...nested.label} color="$color10" textTransform="uppercase" letterSpacing={1}>
52
+ {isPrev ? t("Previous") : t("Next")}
53
+ </Text>
54
+ <XStack gap="$1.5" alignItems="baseline" minWidth={0}>
55
+ {entry.code ? (
56
+ <Text {...nested.label} color="$color10" fontWeight="600">
57
+ {entry.code}
58
+ </Text>
59
+ ) : null}
60
+ <Text fontWeight="700" numberOfLines={1} flexShrink={1}>
61
+ {entry.title}
62
+ </Text>
63
+ </XStack>
64
+ </YStack>
65
+ {isPrev ? null : avatar}
66
+ </XStack>
67
+ </Button>
68
+ );
69
+ }
70
+
71
+ /** The records either side of this one in the list's order, by face and name. */
72
+ export function RecordPager({
73
+ prev,
74
+ next,
75
+ testID,
76
+ }: {
77
+ prev: RecordPagerEntry | null;
78
+ next: RecordPagerEntry | null;
79
+ testID?: string;
80
+ }) {
81
+ const { knobProps } = useResolvedKnobs();
82
+ if (!prev && !next) return null;
83
+ return (
84
+ <XStack justifyContent="space-between" {...knobProps.gap} marginTop="$2">
85
+ {prev ? (
86
+ <PagerButton direction="prev" entry={prev} testID={testID && `${testID}-prev`} />
87
+ ) : (
88
+ <YStack />
89
+ )}
90
+ {next ? (
91
+ <PagerButton direction="next" entry={next} testID={testID && `${testID}-next`} />
92
+ ) : (
93
+ <YStack />
94
+ )}
95
+ </XStack>
96
+ );
97
+ }
@@ -0,0 +1,90 @@
1
+ import { Accordion, Card, Chip, Text, XStack, YStack } from "@multiplatform.one/components";
2
+ import { useResolvedKnobs } from "@multiplatform.one/theme";
3
+ import { useTranslation } from "react-i18next";
4
+ import { groupRows, sortRows } from "./recordData";
5
+ import { slugWords, type FrappeRecordRowsSection } from "./recordSections";
6
+
7
+ type Row = Record<string, unknown>;
8
+
9
+ function RowTiles({ rows, section }: { rows: readonly Row[]; section: FrappeRecordRowsSection }) {
10
+ const { knobProps } = useResolvedKnobs();
11
+ return (
12
+ <XStack {...knobProps.gap} flexWrap="wrap">
13
+ {rows.map((row, index) => {
14
+ const detail = section.detail ? Number(row[section.detail.field]) : 0;
15
+ return (
16
+ <Card
17
+ key={typeof row.name === "string" ? row.name : index}
18
+ {...knobProps.cardSurface}
19
+ backgroundColor="$color2"
20
+ paddingVertical="$2"
21
+ paddingHorizontal="$3"
22
+ flexGrow={0}
23
+ >
24
+ <XStack alignItems="center" gap="$2">
25
+ <Text textTransform="capitalize" fontWeight="600">
26
+ {slugWords(String(row[section.field] ?? ""))}
27
+ </Text>
28
+ {section.flag && row[section.flag.field] ? (
29
+ <Chip size="$2" color="purple">
30
+ {section.flag.label}
31
+ </Chip>
32
+ ) : null}
33
+ {section.detail && detail > 0 ? (
34
+ <Chip size="$2" color="blue">
35
+ {section.detail.label(detail)}
36
+ </Chip>
37
+ ) : null}
38
+ </XStack>
39
+ </Card>
40
+ );
41
+ })}
42
+ </XStack>
43
+ );
44
+ }
45
+
46
+ /**
47
+ * A record's linked rows as flat tiles that wrap, in the declared order,
48
+ * flagged and detailed per row; grouped, each group is an accordion section
49
+ * with its count, the first open.
50
+ */
51
+ export function RecordRows({
52
+ rows,
53
+ section,
54
+ }: {
55
+ rows: readonly Row[];
56
+ section: FrappeRecordRowsSection;
57
+ }) {
58
+ const { t } = useTranslation();
59
+ const { knobProps } = useResolvedKnobs();
60
+ if (rows.length === 0) {
61
+ return (
62
+ <Text color="$color10" fontSize="$3">
63
+ {section.empty ?? t("None yet")}
64
+ </Text>
65
+ );
66
+ }
67
+ const sorted = sortRows(rows, section.orderBy ?? []);
68
+ if (!section.groupBy) return <RowTiles rows={sorted} section={section} />;
69
+ const groups = groupRows(sorted, section.groupBy.field);
70
+ const groupValue = (value: string) => value || "other";
71
+ return (
72
+ <YStack {...knobProps.gap}>
73
+ <Accordion type="multiple" defaultValue={[groupValue(groups[0]?.value ?? "")]}>
74
+ {groups.map((group) => (
75
+ <Accordion.Item key={groupValue(group.value)} value={groupValue(group.value)}>
76
+ <Accordion.Trigger>
77
+ <XStack alignItems="center" gap="$2" flexWrap="wrap">
78
+ <Text fontWeight="600">{section.groupBy?.label(group.value)}</Text>
79
+ <Chip size="$2">{group.rows.length}</Chip>
80
+ </XStack>
81
+ </Accordion.Trigger>
82
+ <Accordion.Content>
83
+ <RowTiles rows={group.rows} section={section} />
84
+ </Accordion.Content>
85
+ </Accordion.Item>
86
+ ))}
87
+ </Accordion>
88
+ </YStack>
89
+ );
90
+ }
@@ -0,0 +1,148 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import {
3
+ adjacentRecords,
4
+ childBars,
5
+ groupRows,
6
+ recordFacetValues,
7
+ recordHistory,
8
+ sortRows,
9
+ } from "./recordData";
10
+
11
+ const facet = {
12
+ param: "type",
13
+ doctype: "Pokemon Poke Type",
14
+ field: "poke_type",
15
+ orderBy: "slot",
16
+ options: [],
17
+ label: "Type",
18
+ };
19
+
20
+ describe("recordFacetValues", () => {
21
+ it("reads a connection facet's values off the record's linked rows in slot order", () => {
22
+ const connections = {
23
+ "Pokemon Poke Type": [
24
+ { name: "b", poke_type: "poison", slot: 2 },
25
+ { name: "a", poke_type: "grass", slot: 1 },
26
+ ],
27
+ };
28
+ expect(recordFacetValues(facet, {}, connections)).toEqual(["grass", "poison"]);
29
+ });
30
+
31
+ it("reads a field facet off the record itself", () => {
32
+ const own = { ...facet, doctype: undefined, field: "status" };
33
+ expect(recordFacetValues(own, { status: "Open" }, {})).toEqual(["Open"]);
34
+ expect(recordFacetValues(own, {}, {})).toEqual([]);
35
+ });
36
+ });
37
+
38
+ describe("sortRows", () => {
39
+ it("orders by each key in turn, numbers numerically and text alphabetically", () => {
40
+ const rows = [
41
+ { method: "machine", level: 0, move: "toxic" },
42
+ { method: "level-up", level: 13, move: "vine-whip" },
43
+ { method: "level-up", level: 1, move: "tackle" },
44
+ { method: "level-up", level: 1, move: "growl" },
45
+ ];
46
+ expect(sortRows(rows, ["method", "level", "move"]).map((row) => row.move)).toEqual([
47
+ "growl",
48
+ "tackle",
49
+ "vine-whip",
50
+ "toxic",
51
+ ]);
52
+ });
53
+
54
+ it("leaves the rows as they came without keys", () => {
55
+ const rows = [{ n: 2 }, { n: 1 }];
56
+ expect(sortRows(rows, [])).toEqual(rows);
57
+ });
58
+ });
59
+
60
+ describe("groupRows", () => {
61
+ it("groups by a field in the order the values first appear", () => {
62
+ const rows = [
63
+ { method: "level-up", move: "a" },
64
+ { method: "machine", move: "b" },
65
+ { method: "level-up", move: "c" },
66
+ ];
67
+ expect(groupRows(rows, "method")).toEqual([
68
+ { value: "level-up", rows: [rows[0], rows[2]] },
69
+ { value: "machine", rows: [rows[1]] },
70
+ ]);
71
+ });
72
+ });
73
+
74
+ describe("adjacentRecords", () => {
75
+ const rows = [{ name: "a" }, { name: "b" }, { name: "c" }];
76
+
77
+ it("names the records either side without wrapping", () => {
78
+ expect(adjacentRecords(rows, "b")).toEqual({ prev: rows[0], next: rows[2] });
79
+ expect(adjacentRecords(rows, "a")).toEqual({ prev: null, next: rows[1] });
80
+ expect(adjacentRecords(rows, "c")).toEqual({ prev: rows[1], next: null });
81
+ });
82
+
83
+ it("has no neighbors for a record the list does not hold", () => {
84
+ expect(adjacentRecords(rows, "z")).toEqual({ prev: null, next: null });
85
+ });
86
+ });
87
+
88
+ describe("recordHistory", () => {
89
+ it("lists the last edit then the creation, newest first", () => {
90
+ expect(
91
+ recordHistory({
92
+ name: "pikachu",
93
+ owner: "ash@example.com",
94
+ creation: "2026-09-01 10:00:00",
95
+ modified: "2026-09-02 11:00:00",
96
+ modified_by: "misty@example.com",
97
+ }),
98
+ ).toEqual([
99
+ { kind: "modified", author: "misty@example.com", timestamp: "2026-09-02 11:00:00" },
100
+ { kind: "created", author: "ash@example.com", timestamp: "2026-09-01 10:00:00" },
101
+ ]);
102
+ });
103
+
104
+ it("shows only the creation when the record was never edited", () => {
105
+ expect(recordHistory({ owner: "ash", creation: "2026-09-01", modified: "2026-09-01" })).toEqual(
106
+ [{ kind: "created", author: "ash", timestamp: "2026-09-01" }],
107
+ );
108
+ });
109
+
110
+ it("is empty without audit fields", () => {
111
+ expect(recordHistory({})).toEqual([]);
112
+ });
113
+ });
114
+
115
+ describe("childBars", () => {
116
+ const stats = [
117
+ { stat_name: "speed", base_stat: 90 },
118
+ { stat_name: "hp", base_stat: 35 },
119
+ { stat_name: "attack", base_stat: 55 },
120
+ ];
121
+
122
+ it("orders the child rows by the declared order and sums them", () => {
123
+ expect(
124
+ childBars(stats, {
125
+ label: "stat_name",
126
+ value: "base_stat",
127
+ order: ["hp", "attack", "speed"],
128
+ }),
129
+ ).toEqual({
130
+ bars: [
131
+ { key: "hp", value: 35 },
132
+ { key: "attack", value: 55 },
133
+ { key: "speed", value: 90 },
134
+ ],
135
+ total: 180,
136
+ });
137
+ });
138
+
139
+ it("keeps undeclared rows after the declared ones and reads a missing value as zero", () => {
140
+ expect(
141
+ childBars([{ stat_name: "luck" }, ...stats], {
142
+ label: "stat_name",
143
+ value: "base_stat",
144
+ order: ["hp"],
145
+ }).bars.map((bar) => `${bar.key}:${bar.value}`),
146
+ ).toEqual(["hp:35", "luck:0", "speed:90", "attack:55"]);
147
+ });
148
+ });