@multiplatform.one/frappe-ui 7.23.1 → 7.24.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 (698) hide show
  1. package/dist/cjs/FrappeCalendar.cjs +1 -1
  2. package/dist/cjs/FrappeCalendar.native.js +1 -1
  3. package/dist/cjs/FrappeCalendar.native.js.map +1 -1
  4. package/dist/cjs/FrappeDashboard.cjs +1 -1
  5. package/dist/cjs/FrappeDashboard.native.js +1 -1
  6. package/dist/cjs/FrappeDashboard.native.js.map +1 -1
  7. package/dist/cjs/FrappeForm.cjs +8 -0
  8. package/dist/cjs/FrappeForm.native.js +9 -0
  9. package/dist/cjs/FrappeForm.native.js.map +1 -1
  10. package/dist/cjs/FrappeImageView.cjs +1 -1
  11. package/dist/cjs/FrappeImageView.native.js +1 -1
  12. package/dist/cjs/FrappeImageView.native.js.map +1 -1
  13. package/dist/cjs/FrappeInsights.cjs +380 -0
  14. package/dist/cjs/FrappeInsights.native.js +447 -0
  15. package/dist/cjs/FrappeInsights.native.js.map +1 -0
  16. package/dist/cjs/FrappeLikedBy.cjs +5 -2
  17. package/dist/cjs/FrappeLikedBy.native.js +5 -2
  18. package/dist/cjs/FrappeLikedBy.native.js.map +1 -1
  19. package/dist/cjs/FrappeListView.cjs +406 -39
  20. package/dist/cjs/FrappeListView.native.js +469 -42
  21. package/dist/cjs/FrappeListView.native.js.map +1 -1
  22. package/dist/cjs/FrappeNotConfigured.cjs +54 -0
  23. package/dist/cjs/FrappeNotConfigured.native.js +58 -0
  24. package/dist/cjs/FrappeNotConfigured.native.js.map +1 -0
  25. package/dist/cjs/FrappeRecordView.cjs +199 -0
  26. package/dist/cjs/FrappeRecordView.native.js +218 -0
  27. package/dist/cjs/FrappeRecordView.native.js.map +1 -0
  28. package/dist/cjs/FrappeReportBuilder.cjs +2 -2
  29. package/dist/cjs/FrappeReportBuilder.native.js +2 -2
  30. package/dist/cjs/FrappeReportBuilder.native.js.map +1 -1
  31. package/dist/cjs/FrappeReportView.cjs +1 -1
  32. package/dist/cjs/FrappeReportView.native.js +2 -2
  33. package/dist/cjs/FrappeReportView.native.js.map +1 -1
  34. package/dist/cjs/FrappeTreeView.cjs +1 -1
  35. package/dist/cjs/FrappeTreeView.native.js +1 -1
  36. package/dist/cjs/desk/awesomebar.cjs +1 -1
  37. package/dist/cjs/desk/awesomebar.native.js +3 -3
  38. package/dist/cjs/desk/awesomebar.native.js.map +1 -1
  39. package/dist/cjs/fields/CodeEditor/index.cjs +1 -1
  40. package/dist/cjs/fields/CodeEditor/index.native.js +1 -1
  41. package/dist/cjs/fields/CodeEditor/index.native.js.map +1 -1
  42. package/dist/cjs/fields/Color/index.cjs +1 -0
  43. package/dist/cjs/fields/Color/index.native.js +1 -0
  44. package/dist/cjs/fields/Color/index.native.js.map +1 -1
  45. package/dist/cjs/fields/FileUpload.cjs +1 -1
  46. package/dist/cjs/fields/FileUpload.native.js +1 -1
  47. package/dist/cjs/fields/FileUpload.native.js.map +1 -1
  48. package/dist/cjs/fields/Heading/index.cjs +19 -12
  49. package/dist/cjs/fields/Heading/index.native.js +22 -13
  50. package/dist/cjs/fields/Heading/index.native.js.map +1 -1
  51. package/dist/cjs/fields/MarkdownEditor/index.cjs +2 -1
  52. package/dist/cjs/fields/MarkdownEditor/index.native.js +1 -1
  53. package/dist/cjs/fields/MarkdownEditor/index.native.js.map +1 -1
  54. package/dist/cjs/frappeNavigation.cjs +12 -2
  55. package/dist/cjs/frappeNavigation.native.js +13 -2
  56. package/dist/cjs/frappeNavigation.native.js.map +1 -1
  57. package/dist/cjs/index.cjs +34 -0
  58. package/dist/cjs/index.native.js +34 -0
  59. package/dist/cjs/index.native.js.map +1 -1
  60. package/dist/cjs/insights/InsightsFacetTags.cjs +147 -0
  61. package/dist/cjs/insights/InsightsFacetTags.native.js +165 -0
  62. package/dist/cjs/insights/InsightsFacetTags.native.js.map +1 -0
  63. package/dist/cjs/insights/InsightsKpiBand.cjs +124 -0
  64. package/dist/cjs/insights/InsightsKpiBand.native.js +133 -0
  65. package/dist/cjs/insights/InsightsKpiBand.native.js.map +1 -0
  66. package/dist/cjs/insights/InsightsLeaders.cjs +150 -0
  67. package/dist/cjs/insights/InsightsLeaders.native.js +178 -0
  68. package/dist/cjs/insights/InsightsLeaders.native.js.map +1 -0
  69. package/dist/cjs/insights/InsightsRecords.cjs +105 -0
  70. package/dist/cjs/insights/InsightsRecords.native.js +109 -0
  71. package/dist/cjs/insights/InsightsRecords.native.js.map +1 -0
  72. package/dist/cjs/insights/InsightsTable.cjs +157 -0
  73. package/dist/cjs/insights/InsightsTable.native.js +194 -0
  74. package/dist/cjs/insights/InsightsTable.native.js.map +1 -0
  75. package/dist/cjs/insights/insightsData.cjs +114 -0
  76. package/dist/cjs/insights/insightsData.native.js +220 -0
  77. package/dist/cjs/insights/insightsData.native.js.map +1 -0
  78. package/dist/cjs/insights/insightsRecord.cjs +35 -0
  79. package/dist/cjs/insights/insightsRecord.native.js +38 -0
  80. package/dist/cjs/insights/insightsRecord.native.js.map +1 -0
  81. package/dist/cjs/list/FacetBadge.cjs +62 -0
  82. package/dist/cjs/list/FacetBadge.native.js +66 -0
  83. package/dist/cjs/list/FacetBadge.native.js.map +1 -0
  84. package/dist/cjs/list/FacetRail.cjs +199 -0
  85. package/dist/cjs/list/FacetRail.native.js +223 -0
  86. package/dist/cjs/list/FacetRail.native.js.map +1 -0
  87. package/dist/cjs/list/ImageWell.cjs +111 -0
  88. package/dist/cjs/list/ImageWell.native.js +126 -0
  89. package/dist/cjs/list/ImageWell.native.js.map +1 -0
  90. package/dist/cjs/list/ListControls.cjs +226 -0
  91. package/dist/cjs/list/ListControls.native.js +252 -0
  92. package/dist/cjs/list/ListControls.native.js.map +1 -0
  93. package/dist/cjs/list/ListToastHost.cjs +54 -0
  94. package/dist/cjs/list/ListToastHost.native.js +59 -0
  95. package/dist/cjs/list/ListToastHost.native.js.map +1 -0
  96. package/dist/cjs/list/RangeFilter.cjs +122 -0
  97. package/dist/cjs/list/RangeFilter.native.js +135 -0
  98. package/dist/cjs/list/RangeFilter.native.js.map +1 -0
  99. package/dist/cjs/list/RecordCard.cjs +233 -0
  100. package/dist/cjs/list/RecordCard.native.js +173 -0
  101. package/dist/cjs/list/RecordCard.native.js.map +1 -0
  102. package/dist/cjs/list/ShufflePanel.cjs +112 -0
  103. package/dist/cjs/list/ShufflePanel.native.js +139 -0
  104. package/dist/cjs/list/ShufflePanel.native.js.map +1 -0
  105. package/dist/cjs/list/facetReading.cjs +71 -0
  106. package/dist/cjs/list/facetReading.native.js +163 -0
  107. package/dist/cjs/list/facetReading.native.js.map +1 -0
  108. package/dist/cjs/list/favorites.cjs +79 -0
  109. package/dist/cjs/list/favorites.native.js +91 -0
  110. package/dist/cjs/list/favorites.native.js.map +1 -0
  111. package/dist/cjs/list/listState.cjs +100 -0
  112. package/dist/cjs/list/listState.native.js +234 -0
  113. package/dist/cjs/list/listState.native.js.map +1 -0
  114. package/dist/cjs/list/recordLook.cjs +35 -0
  115. package/dist/cjs/list/recordLook.native.js +39 -0
  116. package/dist/cjs/list/recordLook.native.js.map +1 -0
  117. package/dist/cjs/list/useListControls.cjs +189 -0
  118. package/dist/cjs/list/useListControls.native.js +272 -0
  119. package/dist/cjs/list/useListControls.native.js.map +1 -0
  120. package/dist/cjs/record/RecordBars.cjs +200 -0
  121. package/dist/cjs/record/RecordBars.native.js +225 -0
  122. package/dist/cjs/record/RecordBars.native.js.map +1 -0
  123. package/dist/cjs/record/RecordGallery.cjs +67 -0
  124. package/dist/cjs/record/RecordGallery.native.js +75 -0
  125. package/dist/cjs/record/RecordGallery.native.js.map +1 -0
  126. package/dist/cjs/record/RecordHero.cjs +239 -0
  127. package/dist/cjs/record/RecordHero.native.js +250 -0
  128. package/dist/cjs/record/RecordHero.native.js.map +1 -0
  129. package/dist/cjs/record/RecordPage.cjs +330 -0
  130. package/dist/cjs/record/RecordPage.native.js +364 -0
  131. package/dist/cjs/record/RecordPage.native.js.map +1 -0
  132. package/dist/cjs/record/RecordPager.cjs +125 -0
  133. package/dist/cjs/record/RecordPager.native.js +130 -0
  134. package/dist/cjs/record/RecordPager.native.js.map +1 -0
  135. package/dist/cjs/record/RecordRows.cjs +126 -0
  136. package/dist/cjs/record/RecordRows.native.js +140 -0
  137. package/dist/cjs/record/RecordRows.native.js.map +1 -0
  138. package/dist/cjs/record/recordData.cjs +122 -0
  139. package/dist/cjs/record/recordData.native.js +189 -0
  140. package/dist/cjs/record/recordData.native.js.map +1 -0
  141. package/dist/cjs/record/recordSections.cjs +30 -0
  142. package/dist/cjs/record/recordSections.native.js +33 -0
  143. package/dist/cjs/record/recordSections.native.js.map +1 -0
  144. package/dist/cjs/useFrappeFacets.cjs +1 -1
  145. package/dist/cjs/useFrappeFacets.native.js +1 -1
  146. package/dist/cjs/useFrappeFacets.native.js.map +1 -1
  147. package/dist/esm/FrappeCalendar.mjs +1 -1
  148. package/dist/esm/FrappeCalendar.mjs.map +1 -1
  149. package/dist/esm/FrappeCalendar.native.js +1 -1
  150. package/dist/esm/FrappeCalendar.native.js.map +1 -1
  151. package/dist/esm/FrappeDashboard.mjs +1 -1
  152. package/dist/esm/FrappeDashboard.mjs.map +1 -1
  153. package/dist/esm/FrappeDashboard.native.js +1 -1
  154. package/dist/esm/FrappeDashboard.native.js.map +1 -1
  155. package/dist/esm/FrappeForm.mjs +8 -0
  156. package/dist/esm/FrappeForm.mjs.map +1 -1
  157. package/dist/esm/FrappeForm.native.js +9 -0
  158. package/dist/esm/FrappeForm.native.js.map +1 -1
  159. package/dist/esm/FrappeImageView.mjs +1 -1
  160. package/dist/esm/FrappeImageView.mjs.map +1 -1
  161. package/dist/esm/FrappeImageView.native.js +1 -1
  162. package/dist/esm/FrappeImageView.native.js.map +1 -1
  163. package/dist/esm/FrappeInsights.mjs +355 -0
  164. package/dist/esm/FrappeInsights.mjs.map +1 -0
  165. package/dist/esm/FrappeInsights.native.js +419 -0
  166. package/dist/esm/FrappeInsights.native.js.map +1 -0
  167. package/dist/esm/FrappeLikedBy.mjs +6 -3
  168. package/dist/esm/FrappeLikedBy.mjs.map +1 -1
  169. package/dist/esm/FrappeLikedBy.native.js +6 -3
  170. package/dist/esm/FrappeLikedBy.native.js.map +1 -1
  171. package/dist/esm/FrappeListView.mjs +410 -43
  172. package/dist/esm/FrappeListView.mjs.map +1 -1
  173. package/dist/esm/FrappeListView.native.js +473 -46
  174. package/dist/esm/FrappeListView.native.js.map +1 -1
  175. package/dist/esm/FrappeNotConfigured.mjs +29 -0
  176. package/dist/esm/FrappeNotConfigured.mjs.map +1 -0
  177. package/dist/esm/FrappeNotConfigured.native.js +30 -0
  178. package/dist/esm/FrappeNotConfigured.native.js.map +1 -0
  179. package/dist/esm/FrappeRecordView.mjs +174 -0
  180. package/dist/esm/FrappeRecordView.mjs.map +1 -0
  181. package/dist/esm/FrappeRecordView.native.js +190 -0
  182. package/dist/esm/FrappeRecordView.native.js.map +1 -0
  183. package/dist/esm/FrappeReportBuilder.mjs +2 -2
  184. package/dist/esm/FrappeReportBuilder.mjs.map +1 -1
  185. package/dist/esm/FrappeReportBuilder.native.js +2 -2
  186. package/dist/esm/FrappeReportBuilder.native.js.map +1 -1
  187. package/dist/esm/FrappeReportView.mjs +1 -1
  188. package/dist/esm/FrappeReportView.mjs.map +1 -1
  189. package/dist/esm/FrappeReportView.native.js +2 -2
  190. package/dist/esm/FrappeReportView.native.js.map +1 -1
  191. package/dist/esm/FrappeTreeView.mjs +1 -1
  192. package/dist/esm/FrappeTreeView.mjs.map +1 -1
  193. package/dist/esm/FrappeTreeView.native.js +1 -1
  194. package/dist/esm/desk/awesomebar.mjs +1 -1
  195. package/dist/esm/desk/awesomebar.mjs.map +1 -1
  196. package/dist/esm/desk/awesomebar.native.js +3 -3
  197. package/dist/esm/desk/awesomebar.native.js.map +1 -1
  198. package/dist/esm/fields/CodeEditor/index.mjs +2 -2
  199. package/dist/esm/fields/CodeEditor/index.mjs.map +1 -1
  200. package/dist/esm/fields/CodeEditor/index.native.js +2 -2
  201. package/dist/esm/fields/CodeEditor/index.native.js.map +1 -1
  202. package/dist/esm/fields/Color/index.mjs +1 -0
  203. package/dist/esm/fields/Color/index.mjs.map +1 -1
  204. package/dist/esm/fields/Color/index.native.js +1 -0
  205. package/dist/esm/fields/Color/index.native.js.map +1 -1
  206. package/dist/esm/fields/FileUpload.mjs +2 -2
  207. package/dist/esm/fields/FileUpload.mjs.map +1 -1
  208. package/dist/esm/fields/FileUpload.native.js +2 -2
  209. package/dist/esm/fields/FileUpload.native.js.map +1 -1
  210. package/dist/esm/fields/Heading/index.mjs +21 -14
  211. package/dist/esm/fields/Heading/index.mjs.map +1 -1
  212. package/dist/esm/fields/Heading/index.native.js +24 -15
  213. package/dist/esm/fields/Heading/index.native.js.map +1 -1
  214. package/dist/esm/fields/MarkdownEditor/index.mjs +2 -1
  215. package/dist/esm/fields/MarkdownEditor/index.mjs.map +1 -1
  216. package/dist/esm/fields/MarkdownEditor/index.native.js +2 -2
  217. package/dist/esm/fields/MarkdownEditor/index.native.js.map +1 -1
  218. package/dist/esm/frappeNavigation.mjs +11 -2
  219. package/dist/esm/frappeNavigation.mjs.map +1 -1
  220. package/dist/esm/frappeNavigation.native.js +12 -2
  221. package/dist/esm/frappeNavigation.native.js.map +1 -1
  222. package/dist/esm/index.mjs +14 -2
  223. package/dist/esm/index.mjs.map +1 -1
  224. package/dist/esm/index.native.js +14 -2
  225. package/dist/esm/index.native.js.map +1 -1
  226. package/dist/esm/insights/InsightsFacetTags.mjs +122 -0
  227. package/dist/esm/insights/InsightsFacetTags.mjs.map +1 -0
  228. package/dist/esm/insights/InsightsFacetTags.native.js +137 -0
  229. package/dist/esm/insights/InsightsFacetTags.native.js.map +1 -0
  230. package/dist/esm/insights/InsightsKpiBand.mjs +99 -0
  231. package/dist/esm/insights/InsightsKpiBand.mjs.map +1 -0
  232. package/dist/esm/insights/InsightsKpiBand.native.js +105 -0
  233. package/dist/esm/insights/InsightsKpiBand.native.js.map +1 -0
  234. package/dist/esm/insights/InsightsLeaders.mjs +125 -0
  235. package/dist/esm/insights/InsightsLeaders.mjs.map +1 -0
  236. package/dist/esm/insights/InsightsLeaders.native.js +150 -0
  237. package/dist/esm/insights/InsightsLeaders.native.js.map +1 -0
  238. package/dist/esm/insights/InsightsRecords.mjs +80 -0
  239. package/dist/esm/insights/InsightsRecords.mjs.map +1 -0
  240. package/dist/esm/insights/InsightsRecords.native.js +81 -0
  241. package/dist/esm/insights/InsightsRecords.native.js.map +1 -0
  242. package/dist/esm/insights/InsightsTable.mjs +132 -0
  243. package/dist/esm/insights/InsightsTable.mjs.map +1 -0
  244. package/dist/esm/insights/InsightsTable.native.js +166 -0
  245. package/dist/esm/insights/InsightsTable.native.js.map +1 -0
  246. package/dist/esm/insights/insightsData.mjs +82 -0
  247. package/dist/esm/insights/insightsData.mjs.map +1 -0
  248. package/dist/esm/insights/insightsData.native.js +185 -0
  249. package/dist/esm/insights/insightsData.native.js.map +1 -0
  250. package/dist/esm/insights/insightsRecord.mjs +9 -0
  251. package/dist/esm/insights/insightsRecord.mjs.map +1 -0
  252. package/dist/esm/insights/insightsRecord.native.js +9 -0
  253. package/dist/esm/insights/insightsRecord.native.js.map +1 -0
  254. package/dist/esm/list/FacetBadge.mjs +37 -0
  255. package/dist/esm/list/FacetBadge.mjs.map +1 -0
  256. package/dist/esm/list/FacetBadge.native.js +38 -0
  257. package/dist/esm/list/FacetBadge.native.js.map +1 -0
  258. package/dist/esm/list/FacetRail.mjs +174 -0
  259. package/dist/esm/list/FacetRail.mjs.map +1 -0
  260. package/dist/esm/list/FacetRail.native.js +195 -0
  261. package/dist/esm/list/FacetRail.native.js.map +1 -0
  262. package/dist/esm/list/ImageWell.mjs +86 -0
  263. package/dist/esm/list/ImageWell.mjs.map +1 -0
  264. package/dist/esm/list/ImageWell.native.js +98 -0
  265. package/dist/esm/list/ImageWell.native.js.map +1 -0
  266. package/dist/esm/list/ListControls.mjs +201 -0
  267. package/dist/esm/list/ListControls.mjs.map +1 -0
  268. package/dist/esm/list/ListControls.native.js +224 -0
  269. package/dist/esm/list/ListControls.native.js.map +1 -0
  270. package/dist/esm/list/ListToastHost.mjs +18 -0
  271. package/dist/esm/list/ListToastHost.mjs.map +1 -0
  272. package/dist/esm/list/ListToastHost.native.js +20 -0
  273. package/dist/esm/list/ListToastHost.native.js.map +1 -0
  274. package/dist/esm/list/RangeFilter.mjs +85 -0
  275. package/dist/esm/list/RangeFilter.mjs.map +1 -0
  276. package/dist/esm/list/RangeFilter.native.js +95 -0
  277. package/dist/esm/list/RangeFilter.native.js.map +1 -0
  278. package/dist/esm/list/RecordCard.mjs +208 -0
  279. package/dist/esm/list/RecordCard.mjs.map +1 -0
  280. package/dist/esm/list/RecordCard.native.js +145 -0
  281. package/dist/esm/list/RecordCard.native.js.map +1 -0
  282. package/dist/esm/list/ShufflePanel.mjs +87 -0
  283. package/dist/esm/list/ShufflePanel.mjs.map +1 -0
  284. package/dist/esm/list/ShufflePanel.native.js +111 -0
  285. package/dist/esm/list/ShufflePanel.native.js.map +1 -0
  286. package/dist/esm/list/facetReading.mjs +45 -0
  287. package/dist/esm/list/facetReading.mjs.map +1 -0
  288. package/dist/esm/list/facetReading.native.js +134 -0
  289. package/dist/esm/list/facetReading.native.js.map +1 -0
  290. package/dist/esm/list/favorites.mjs +50 -0
  291. package/dist/esm/list/favorites.mjs.map +1 -0
  292. package/dist/esm/list/favorites.native.js +59 -0
  293. package/dist/esm/list/favorites.native.js.map +1 -0
  294. package/dist/esm/list/listState.mjs +71 -0
  295. package/dist/esm/list/listState.mjs.map +1 -0
  296. package/dist/esm/list/listState.native.js +202 -0
  297. package/dist/esm/list/listState.native.js.map +1 -0
  298. package/dist/esm/list/recordLook.mjs +10 -0
  299. package/dist/esm/list/recordLook.mjs.map +1 -0
  300. package/dist/esm/list/recordLook.native.js +11 -0
  301. package/dist/esm/list/recordLook.native.js.map +1 -0
  302. package/dist/esm/list/useListControls.mjs +164 -0
  303. package/dist/esm/list/useListControls.mjs.map +1 -0
  304. package/dist/esm/list/useListControls.native.js +244 -0
  305. package/dist/esm/list/useListControls.native.js.map +1 -0
  306. package/dist/esm/record/RecordBars.mjs +175 -0
  307. package/dist/esm/record/RecordBars.mjs.map +1 -0
  308. package/dist/esm/record/RecordBars.native.js +197 -0
  309. package/dist/esm/record/RecordBars.native.js.map +1 -0
  310. package/dist/esm/record/RecordGallery.mjs +42 -0
  311. package/dist/esm/record/RecordGallery.mjs.map +1 -0
  312. package/dist/esm/record/RecordGallery.native.js +47 -0
  313. package/dist/esm/record/RecordGallery.native.js.map +1 -0
  314. package/dist/esm/record/RecordHero.mjs +205 -0
  315. package/dist/esm/record/RecordHero.mjs.map +1 -0
  316. package/dist/esm/record/RecordHero.native.js +213 -0
  317. package/dist/esm/record/RecordHero.native.js.map +1 -0
  318. package/dist/esm/record/RecordPage.mjs +305 -0
  319. package/dist/esm/record/RecordPage.mjs.map +1 -0
  320. package/dist/esm/record/RecordPage.native.js +336 -0
  321. package/dist/esm/record/RecordPage.native.js.map +1 -0
  322. package/dist/esm/record/RecordPager.mjs +100 -0
  323. package/dist/esm/record/RecordPager.mjs.map +1 -0
  324. package/dist/esm/record/RecordPager.native.js +102 -0
  325. package/dist/esm/record/RecordPager.native.js.map +1 -0
  326. package/dist/esm/record/RecordRows.mjs +101 -0
  327. package/dist/esm/record/RecordRows.mjs.map +1 -0
  328. package/dist/esm/record/RecordRows.native.js +112 -0
  329. package/dist/esm/record/RecordRows.native.js.map +1 -0
  330. package/dist/esm/record/recordData.mjs +92 -0
  331. package/dist/esm/record/recordData.mjs.map +1 -0
  332. package/dist/esm/record/recordData.native.js +156 -0
  333. package/dist/esm/record/recordData.native.js.map +1 -0
  334. package/dist/esm/record/recordSections.mjs +5 -0
  335. package/dist/esm/record/recordSections.mjs.map +1 -0
  336. package/dist/esm/record/recordSections.native.js +5 -0
  337. package/dist/esm/record/recordSections.native.js.map +1 -0
  338. package/dist/esm/useFrappeFacets.mjs +1 -1
  339. package/dist/esm/useFrappeFacets.mjs.map +1 -1
  340. package/dist/esm/useFrappeFacets.native.js +1 -1
  341. package/dist/esm/useFrappeFacets.native.js.map +1 -1
  342. package/dist/jsx/FrappeCalendar.mjs +1 -1
  343. package/dist/jsx/FrappeCalendar.mjs.map +1 -1
  344. package/dist/jsx/FrappeCalendar.native.js +1 -1
  345. package/dist/jsx/FrappeCalendar.native.js.map +1 -1
  346. package/dist/jsx/FrappeDashboard.mjs +1 -1
  347. package/dist/jsx/FrappeDashboard.mjs.map +1 -1
  348. package/dist/jsx/FrappeDashboard.native.js +1 -1
  349. package/dist/jsx/FrappeDashboard.native.js.map +1 -1
  350. package/dist/jsx/FrappeForm.mjs +8 -0
  351. package/dist/jsx/FrappeForm.mjs.map +1 -1
  352. package/dist/jsx/FrappeForm.native.js +9 -0
  353. package/dist/jsx/FrappeForm.native.js.map +1 -1
  354. package/dist/jsx/FrappeImageView.mjs +1 -1
  355. package/dist/jsx/FrappeImageView.mjs.map +1 -1
  356. package/dist/jsx/FrappeImageView.native.js +1 -1
  357. package/dist/jsx/FrappeImageView.native.js.map +1 -1
  358. package/dist/jsx/FrappeInsights.mjs +355 -0
  359. package/dist/jsx/FrappeInsights.mjs.map +1 -0
  360. package/dist/jsx/FrappeInsights.native.js +447 -0
  361. package/dist/jsx/FrappeInsights.native.js.map +1 -0
  362. package/dist/jsx/FrappeLikedBy.mjs +6 -3
  363. package/dist/jsx/FrappeLikedBy.mjs.map +1 -1
  364. package/dist/jsx/FrappeLikedBy.native.js +5 -2
  365. package/dist/jsx/FrappeLikedBy.native.js.map +1 -1
  366. package/dist/jsx/FrappeListView.mjs +410 -43
  367. package/dist/jsx/FrappeListView.mjs.map +1 -1
  368. package/dist/jsx/FrappeListView.native.js +469 -42
  369. package/dist/jsx/FrappeListView.native.js.map +1 -1
  370. package/dist/jsx/FrappeNotConfigured.mjs +29 -0
  371. package/dist/jsx/FrappeNotConfigured.mjs.map +1 -0
  372. package/dist/jsx/FrappeNotConfigured.native.js +58 -0
  373. package/dist/jsx/FrappeNotConfigured.native.js.map +1 -0
  374. package/dist/jsx/FrappeRecordView.mjs +174 -0
  375. package/dist/jsx/FrappeRecordView.mjs.map +1 -0
  376. package/dist/jsx/FrappeRecordView.native.js +218 -0
  377. package/dist/jsx/FrappeRecordView.native.js.map +1 -0
  378. package/dist/jsx/FrappeReportBuilder.mjs +2 -2
  379. package/dist/jsx/FrappeReportBuilder.mjs.map +1 -1
  380. package/dist/jsx/FrappeReportBuilder.native.js +2 -2
  381. package/dist/jsx/FrappeReportBuilder.native.js.map +1 -1
  382. package/dist/jsx/FrappeReportView.mjs +1 -1
  383. package/dist/jsx/FrappeReportView.mjs.map +1 -1
  384. package/dist/jsx/FrappeReportView.native.js +2 -2
  385. package/dist/jsx/FrappeReportView.native.js.map +1 -1
  386. package/dist/jsx/FrappeTreeView.mjs +1 -1
  387. package/dist/jsx/FrappeTreeView.mjs.map +1 -1
  388. package/dist/jsx/FrappeTreeView.native.js +1 -1
  389. package/dist/jsx/desk/awesomebar.mjs +1 -1
  390. package/dist/jsx/desk/awesomebar.mjs.map +1 -1
  391. package/dist/jsx/desk/awesomebar.native.js +3 -3
  392. package/dist/jsx/desk/awesomebar.native.js.map +1 -1
  393. package/dist/jsx/fields/CodeEditor/index.mjs +2 -2
  394. package/dist/jsx/fields/CodeEditor/index.mjs.map +1 -1
  395. package/dist/jsx/fields/CodeEditor/index.native.js +1 -1
  396. package/dist/jsx/fields/CodeEditor/index.native.js.map +1 -1
  397. package/dist/jsx/fields/Color/index.mjs +1 -0
  398. package/dist/jsx/fields/Color/index.mjs.map +1 -1
  399. package/dist/jsx/fields/Color/index.native.js +1 -0
  400. package/dist/jsx/fields/Color/index.native.js.map +1 -1
  401. package/dist/jsx/fields/FileUpload.mjs +2 -2
  402. package/dist/jsx/fields/FileUpload.mjs.map +1 -1
  403. package/dist/jsx/fields/FileUpload.native.js +1 -1
  404. package/dist/jsx/fields/FileUpload.native.js.map +1 -1
  405. package/dist/jsx/fields/Heading/index.mjs +21 -14
  406. package/dist/jsx/fields/Heading/index.mjs.map +1 -1
  407. package/dist/jsx/fields/Heading/index.native.js +22 -13
  408. package/dist/jsx/fields/Heading/index.native.js.map +1 -1
  409. package/dist/jsx/fields/MarkdownEditor/index.mjs +2 -1
  410. package/dist/jsx/fields/MarkdownEditor/index.mjs.map +1 -1
  411. package/dist/jsx/fields/MarkdownEditor/index.native.js +1 -1
  412. package/dist/jsx/fields/MarkdownEditor/index.native.js.map +1 -1
  413. package/dist/jsx/frappeNavigation.mjs +11 -2
  414. package/dist/jsx/frappeNavigation.mjs.map +1 -1
  415. package/dist/jsx/frappeNavigation.native.js +13 -2
  416. package/dist/jsx/frappeNavigation.native.js.map +1 -1
  417. package/dist/jsx/index.js +14 -2
  418. package/dist/jsx/index.js.map +1 -1
  419. package/dist/jsx/index.mjs +14 -2
  420. package/dist/jsx/index.mjs.map +1 -1
  421. package/dist/jsx/index.native.js +34 -0
  422. package/dist/jsx/index.native.js.map +1 -1
  423. package/dist/jsx/insights/InsightsFacetTags.mjs +122 -0
  424. package/dist/jsx/insights/InsightsFacetTags.mjs.map +1 -0
  425. package/dist/jsx/insights/InsightsFacetTags.native.js +165 -0
  426. package/dist/jsx/insights/InsightsFacetTags.native.js.map +1 -0
  427. package/dist/jsx/insights/InsightsKpiBand.mjs +99 -0
  428. package/dist/jsx/insights/InsightsKpiBand.mjs.map +1 -0
  429. package/dist/jsx/insights/InsightsKpiBand.native.js +133 -0
  430. package/dist/jsx/insights/InsightsKpiBand.native.js.map +1 -0
  431. package/dist/jsx/insights/InsightsLeaders.mjs +125 -0
  432. package/dist/jsx/insights/InsightsLeaders.mjs.map +1 -0
  433. package/dist/jsx/insights/InsightsLeaders.native.js +178 -0
  434. package/dist/jsx/insights/InsightsLeaders.native.js.map +1 -0
  435. package/dist/jsx/insights/InsightsRecords.mjs +80 -0
  436. package/dist/jsx/insights/InsightsRecords.mjs.map +1 -0
  437. package/dist/jsx/insights/InsightsRecords.native.js +109 -0
  438. package/dist/jsx/insights/InsightsRecords.native.js.map +1 -0
  439. package/dist/jsx/insights/InsightsTable.mjs +132 -0
  440. package/dist/jsx/insights/InsightsTable.mjs.map +1 -0
  441. package/dist/jsx/insights/InsightsTable.native.js +194 -0
  442. package/dist/jsx/insights/InsightsTable.native.js.map +1 -0
  443. package/dist/jsx/insights/insightsData.mjs +82 -0
  444. package/dist/jsx/insights/insightsData.mjs.map +1 -0
  445. package/dist/jsx/insights/insightsData.native.js +220 -0
  446. package/dist/jsx/insights/insightsData.native.js.map +1 -0
  447. package/dist/jsx/insights/insightsRecord.mjs +9 -0
  448. package/dist/jsx/insights/insightsRecord.mjs.map +1 -0
  449. package/dist/jsx/insights/insightsRecord.native.js +38 -0
  450. package/dist/jsx/insights/insightsRecord.native.js.map +1 -0
  451. package/dist/jsx/list/FacetBadge.mjs +37 -0
  452. package/dist/jsx/list/FacetBadge.mjs.map +1 -0
  453. package/dist/jsx/list/FacetBadge.native.js +66 -0
  454. package/dist/jsx/list/FacetBadge.native.js.map +1 -0
  455. package/dist/jsx/list/FacetRail.mjs +174 -0
  456. package/dist/jsx/list/FacetRail.mjs.map +1 -0
  457. package/dist/jsx/list/FacetRail.native.js +223 -0
  458. package/dist/jsx/list/FacetRail.native.js.map +1 -0
  459. package/dist/jsx/list/ImageWell.mjs +86 -0
  460. package/dist/jsx/list/ImageWell.mjs.map +1 -0
  461. package/dist/jsx/list/ImageWell.native.js +126 -0
  462. package/dist/jsx/list/ImageWell.native.js.map +1 -0
  463. package/dist/jsx/list/ListControls.mjs +201 -0
  464. package/dist/jsx/list/ListControls.mjs.map +1 -0
  465. package/dist/jsx/list/ListControls.native.js +252 -0
  466. package/dist/jsx/list/ListControls.native.js.map +1 -0
  467. package/dist/jsx/list/ListToastHost.mjs +18 -0
  468. package/dist/jsx/list/ListToastHost.mjs.map +1 -0
  469. package/dist/jsx/list/ListToastHost.native.js +59 -0
  470. package/dist/jsx/list/ListToastHost.native.js.map +1 -0
  471. package/dist/jsx/list/RangeFilter.mjs +85 -0
  472. package/dist/jsx/list/RangeFilter.mjs.map +1 -0
  473. package/dist/jsx/list/RangeFilter.native.js +135 -0
  474. package/dist/jsx/list/RangeFilter.native.js.map +1 -0
  475. package/dist/jsx/list/RecordCard.mjs +208 -0
  476. package/dist/jsx/list/RecordCard.mjs.map +1 -0
  477. package/dist/jsx/list/RecordCard.native.js +173 -0
  478. package/dist/jsx/list/RecordCard.native.js.map +1 -0
  479. package/dist/jsx/list/ShufflePanel.mjs +87 -0
  480. package/dist/jsx/list/ShufflePanel.mjs.map +1 -0
  481. package/dist/jsx/list/ShufflePanel.native.js +139 -0
  482. package/dist/jsx/list/ShufflePanel.native.js.map +1 -0
  483. package/dist/jsx/list/facetReading.mjs +45 -0
  484. package/dist/jsx/list/facetReading.mjs.map +1 -0
  485. package/dist/jsx/list/facetReading.native.js +163 -0
  486. package/dist/jsx/list/facetReading.native.js.map +1 -0
  487. package/dist/jsx/list/favorites.mjs +50 -0
  488. package/dist/jsx/list/favorites.mjs.map +1 -0
  489. package/dist/jsx/list/favorites.native.js +91 -0
  490. package/dist/jsx/list/favorites.native.js.map +1 -0
  491. package/dist/jsx/list/listState.mjs +71 -0
  492. package/dist/jsx/list/listState.mjs.map +1 -0
  493. package/dist/jsx/list/listState.native.js +234 -0
  494. package/dist/jsx/list/listState.native.js.map +1 -0
  495. package/dist/jsx/list/recordLook.mjs +10 -0
  496. package/dist/jsx/list/recordLook.mjs.map +1 -0
  497. package/dist/jsx/list/recordLook.native.js +39 -0
  498. package/dist/jsx/list/recordLook.native.js.map +1 -0
  499. package/dist/jsx/list/useListControls.mjs +164 -0
  500. package/dist/jsx/list/useListControls.mjs.map +1 -0
  501. package/dist/jsx/list/useListControls.native.js +272 -0
  502. package/dist/jsx/list/useListControls.native.js.map +1 -0
  503. package/dist/jsx/record/RecordBars.mjs +175 -0
  504. package/dist/jsx/record/RecordBars.mjs.map +1 -0
  505. package/dist/jsx/record/RecordBars.native.js +225 -0
  506. package/dist/jsx/record/RecordBars.native.js.map +1 -0
  507. package/dist/jsx/record/RecordGallery.mjs +42 -0
  508. package/dist/jsx/record/RecordGallery.mjs.map +1 -0
  509. package/dist/jsx/record/RecordGallery.native.js +75 -0
  510. package/dist/jsx/record/RecordGallery.native.js.map +1 -0
  511. package/dist/jsx/record/RecordHero.mjs +205 -0
  512. package/dist/jsx/record/RecordHero.mjs.map +1 -0
  513. package/dist/jsx/record/RecordHero.native.js +250 -0
  514. package/dist/jsx/record/RecordHero.native.js.map +1 -0
  515. package/dist/jsx/record/RecordPage.mjs +305 -0
  516. package/dist/jsx/record/RecordPage.mjs.map +1 -0
  517. package/dist/jsx/record/RecordPage.native.js +364 -0
  518. package/dist/jsx/record/RecordPage.native.js.map +1 -0
  519. package/dist/jsx/record/RecordPager.mjs +100 -0
  520. package/dist/jsx/record/RecordPager.mjs.map +1 -0
  521. package/dist/jsx/record/RecordPager.native.js +130 -0
  522. package/dist/jsx/record/RecordPager.native.js.map +1 -0
  523. package/dist/jsx/record/RecordRows.mjs +101 -0
  524. package/dist/jsx/record/RecordRows.mjs.map +1 -0
  525. package/dist/jsx/record/RecordRows.native.js +140 -0
  526. package/dist/jsx/record/RecordRows.native.js.map +1 -0
  527. package/dist/jsx/record/recordData.mjs +92 -0
  528. package/dist/jsx/record/recordData.mjs.map +1 -0
  529. package/dist/jsx/record/recordData.native.js +189 -0
  530. package/dist/jsx/record/recordData.native.js.map +1 -0
  531. package/dist/jsx/record/recordSections.mjs +5 -0
  532. package/dist/jsx/record/recordSections.mjs.map +1 -0
  533. package/dist/jsx/record/recordSections.native.js +33 -0
  534. package/dist/jsx/record/recordSections.native.js.map +1 -0
  535. package/dist/jsx/useFrappeFacets.mjs +1 -1
  536. package/dist/jsx/useFrappeFacets.mjs.map +1 -1
  537. package/dist/jsx/useFrappeFacets.native.js +1 -1
  538. package/dist/jsx/useFrappeFacets.native.js.map +1 -1
  539. package/package.json +16 -16
  540. package/src/FormSidebar.stories.tsx +2 -0
  541. package/src/FrappeCalendar.stories.tsx +2 -0
  542. package/src/FrappeCalendar.tsx +2 -2
  543. package/src/FrappeChartCard.stories.tsx +2 -0
  544. package/src/FrappeDashboard.stories.tsx +2 -0
  545. package/src/FrappeDashboard.tsx +2 -2
  546. package/src/FrappeForm.tsx +7 -1
  547. package/src/FrappeImageView.stories.tsx +2 -0
  548. package/src/FrappeImageView.tsx +2 -1
  549. package/src/FrappeInsights.spec.tsx +171 -0
  550. package/src/FrappeInsights.tsx +422 -0
  551. package/src/FrappeKPICard.stories.tsx +3 -3
  552. package/src/FrappeKanban.stories.tsx +4 -8
  553. package/src/FrappeLikedBy.tsx +7 -5
  554. package/src/FrappeListView.card.spec.tsx +157 -0
  555. package/src/FrappeListView.controls.spec.tsx +225 -0
  556. package/src/FrappeListView.seed.spec.tsx +30 -0
  557. package/src/FrappeListView.stories.tsx +2 -0
  558. package/src/FrappeListView.tsx +589 -45
  559. package/src/FrappeNotConfigured.tsx +29 -0
  560. package/src/FrappeRecordView.spec.tsx +276 -0
  561. package/src/FrappeRecordView.tsx +231 -0
  562. package/src/FrappeReportBuilder.tsx +4 -5
  563. package/src/FrappeReportView.tsx +1 -1
  564. package/src/FrappeTreeView.tsx +1 -1
  565. package/src/clientCache.auth.spec.tsx +94 -0
  566. package/src/desk/DeskFormSidebar.stories.tsx +2 -0
  567. package/src/desk/DeskShell.stories.tsx +12 -6
  568. package/src/desk/awesomebar.auth.spec.tsx +77 -0
  569. package/src/desk/awesomebar.tsx +1 -1
  570. package/src/fields/CodeEditor/index.tsx +8 -2
  571. package/src/fields/Color/Color.stories.tsx +2 -0
  572. package/src/fields/Color/index.tsx +1 -0
  573. package/src/fields/FileUpload.tsx +8 -2
  574. package/src/fields/Heading/index.tsx +41 -17
  575. package/src/fields/MarkdownEditor/index.native.tsx +8 -2
  576. package/src/fields/MarkdownEditor/index.tsx +8 -1
  577. package/src/fields/ReadOnly/ReadOnly.stories.tsx +2 -0
  578. package/src/frappeNavigation.loader.spec.tsx +45 -0
  579. package/src/frappeNavigation.tsx +32 -1
  580. package/src/frappeRoutes.notConfigured.spec.tsx +77 -0
  581. package/src/index.ts +53 -1
  582. package/src/insights/InsightsFacetTags.tsx +131 -0
  583. package/src/insights/InsightsKpiBand.tsx +114 -0
  584. package/src/insights/InsightsLeaders.tsx +146 -0
  585. package/src/insights/InsightsRecords.tsx +71 -0
  586. package/src/insights/InsightsTable.tsx +169 -0
  587. package/src/insights/insightsData.spec.ts +143 -0
  588. package/src/insights/insightsData.ts +122 -0
  589. package/src/insights/insightsRecord.ts +36 -0
  590. package/src/list/FacetBadge.tsx +41 -0
  591. package/src/list/FacetRail.tsx +235 -0
  592. package/src/list/ImageWell.tsx +110 -0
  593. package/src/list/ListControls.tsx +208 -0
  594. package/src/list/ListToastHost.tsx +27 -0
  595. package/src/list/RangeFilter.tsx +83 -0
  596. package/src/list/RecordCard.native.tsx +126 -0
  597. package/src/list/RecordCard.tsx +260 -0
  598. package/src/list/ShufflePanel.tsx +107 -0
  599. package/src/list/facetReading.ts +79 -0
  600. package/src/list/favorites.spec.ts +80 -0
  601. package/src/list/favorites.ts +79 -0
  602. package/src/list/listState.spec.ts +156 -0
  603. package/src/list/listState.ts +184 -0
  604. package/src/list/recordLook.ts +37 -0
  605. package/src/list/useListControls.tsx +223 -0
  606. package/src/record/RecordBars.tsx +187 -0
  607. package/src/record/RecordGallery.tsx +47 -0
  608. package/src/record/RecordHero.tsx +186 -0
  609. package/src/record/RecordPage.tsx +358 -0
  610. package/src/record/RecordPager.tsx +97 -0
  611. package/src/record/RecordRows.tsx +90 -0
  612. package/src/record/recordData.spec.ts +148 -0
  613. package/src/record/recordData.ts +124 -0
  614. package/src/record/recordSections.ts +62 -0
  615. package/src/schemaForm/SchemaForm.stories.tsx +2 -2
  616. package/src/useFrappeFacets.ts +14 -7
  617. package/types/FrappeForm.d.ts +2 -1
  618. package/types/FrappeForm.d.ts.map +1 -1
  619. package/types/FrappeImageView.d.ts.map +1 -1
  620. package/types/FrappeInsights.d.ts +55 -0
  621. package/types/FrappeInsights.d.ts.map +1 -0
  622. package/types/FrappeLikedBy.d.ts.map +1 -1
  623. package/types/FrappeListView.d.ts +85 -3
  624. package/types/FrappeListView.d.ts.map +1 -1
  625. package/types/FrappeNotConfigured.d.ts +11 -0
  626. package/types/FrappeNotConfigured.d.ts.map +1 -0
  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/CodeEditor/index.d.ts.map +1 -1
  631. package/types/fields/Color/index.d.ts.map +1 -1
  632. package/types/fields/FileUpload.d.ts.map +1 -1
  633. package/types/fields/Heading/index.d.ts.map +1 -1
  634. package/types/fields/MarkdownEditor/index.d.ts.map +1 -1
  635. package/types/fields/MarkdownEditor/index.native.d.ts.map +1 -1
  636. package/types/frappeNavigation.d.ts +21 -0
  637. package/types/frappeNavigation.d.ts.map +1 -1
  638. package/types/index.d.ts +14 -2
  639. package/types/index.d.ts.map +1 -1
  640. package/types/insights/InsightsFacetTags.d.ts +11 -0
  641. package/types/insights/InsightsFacetTags.d.ts.map +1 -0
  642. package/types/insights/InsightsKpiBand.d.ts +22 -0
  643. package/types/insights/InsightsKpiBand.d.ts.map +1 -0
  644. package/types/insights/InsightsLeaders.d.ts +16 -0
  645. package/types/insights/InsightsLeaders.d.ts.map +1 -0
  646. package/types/insights/InsightsRecords.d.ts +19 -0
  647. package/types/insights/InsightsRecords.d.ts.map +1 -0
  648. package/types/insights/InsightsTable.d.ts +17 -0
  649. package/types/insights/InsightsTable.d.ts.map +1 -0
  650. package/types/insights/insightsData.d.ts +45 -0
  651. package/types/insights/insightsData.d.ts.map +1 -0
  652. package/types/insights/insightsRecord.d.ts +29 -0
  653. package/types/insights/insightsRecord.d.ts.map +1 -0
  654. package/types/list/FacetBadge.d.ts +13 -0
  655. package/types/list/FacetBadge.d.ts.map +1 -0
  656. package/types/list/FacetRail.d.ts +26 -0
  657. package/types/list/FacetRail.d.ts.map +1 -0
  658. package/types/list/ImageWell.d.ts +24 -0
  659. package/types/list/ImageWell.d.ts.map +1 -0
  660. package/types/list/ListControls.d.ts +30 -0
  661. package/types/list/ListControls.d.ts.map +1 -0
  662. package/types/list/ListToastHost.d.ts +7 -0
  663. package/types/list/ListToastHost.d.ts.map +1 -0
  664. package/types/list/RangeFilter.d.ts +14 -0
  665. package/types/list/RangeFilter.d.ts.map +1 -0
  666. package/types/list/RecordCard.d.ts +38 -0
  667. package/types/list/RecordCard.d.ts.map +1 -0
  668. package/types/list/RecordCard.native.d.ts +9 -0
  669. package/types/list/RecordCard.native.d.ts.map +1 -0
  670. package/types/list/ShufflePanel.d.ts +24 -0
  671. package/types/list/ShufflePanel.d.ts.map +1 -0
  672. package/types/list/facetReading.d.ts +33 -0
  673. package/types/list/facetReading.d.ts.map +1 -0
  674. package/types/list/favorites.d.ts +26 -0
  675. package/types/list/favorites.d.ts.map +1 -0
  676. package/types/list/listState.d.ts +94 -0
  677. package/types/list/listState.d.ts.map +1 -0
  678. package/types/list/recordLook.d.ts +25 -0
  679. package/types/list/recordLook.d.ts.map +1 -0
  680. package/types/list/useListControls.d.ts +48 -0
  681. package/types/list/useListControls.d.ts.map +1 -0
  682. package/types/record/RecordBars.d.ts +11 -0
  683. package/types/record/RecordBars.d.ts.map +1 -0
  684. package/types/record/RecordGallery.d.ts +17 -0
  685. package/types/record/RecordGallery.d.ts.map +1 -0
  686. package/types/record/RecordHero.d.ts +42 -0
  687. package/types/record/RecordHero.d.ts.map +1 -0
  688. package/types/record/RecordPage.d.ts +54 -0
  689. package/types/record/RecordPage.d.ts.map +1 -0
  690. package/types/record/RecordPager.d.ts +13 -0
  691. package/types/record/RecordPager.d.ts.map +1 -0
  692. package/types/record/RecordRows.d.ts +13 -0
  693. package/types/record/RecordRows.d.ts.map +1 -0
  694. package/types/record/recordData.d.ts +46 -0
  695. package/types/record/recordData.d.ts.map +1 -0
  696. package/types/record/recordSections.d.ts +67 -0
  697. package/types/record/recordSections.d.ts.map +1 -0
  698. package/types/useFrappeFacets.d.ts.map +1 -1
@@ -0,0 +1,422 @@
1
+ import {
2
+ AsyncSkeleton,
3
+ Breadcrumbs,
4
+ Button,
5
+ EmptyState,
6
+ PageHeader,
7
+ PageSection,
8
+ Screen,
9
+ XStack,
10
+ YStack,
11
+ useTheme,
12
+ type ChartConfig,
13
+ } from "@multiplatform.one/components";
14
+ import { useDocTypeMeta, type Order } from "@multiplatform.one/frappe";
15
+ import { useResolvedKnobs } from "@multiplatform.one/theme";
16
+ import { ArrowLeftIcon, SparkleIcon } from "@phosphor-icons/react";
17
+ import { useMemo, useRef } from "react";
18
+ import { useTranslation } from "react-i18next";
19
+ import { connectionsFromMeta, type FrappeConnection } from "./frappeConnections";
20
+ import { frappeRouteHref, useFrappeRouter } from "./frappeNavigation";
21
+ import { FrappeNotConfigured } from "./FrappeNotConfigured";
22
+ import { useFrappeConfig } from "./FrappeProvider";
23
+ import { FrappeReconnectIndicator } from "./FrappeReconnectIndicator";
24
+ import { useDocRights } from "./formEngine/useDocRights";
25
+ import {
26
+ average,
27
+ facetDistribution,
28
+ foldDistribution,
29
+ histogram,
30
+ multiValued,
31
+ orderRows,
32
+ topBy,
33
+ } from "./insights/insightsData";
34
+ import { InsightsFacetTags } from "./insights/InsightsFacetTags";
35
+ import { InsightsKpiBand, type InsightsTile } from "./insights/InsightsKpiBand";
36
+ import { InsightsLeaders } from "./insights/InsightsLeaders";
37
+ import {
38
+ formatMetric,
39
+ type FrappeInsightsMetric,
40
+ type InsightsRecordView,
41
+ } from "./insights/insightsRecord";
42
+ import { InsightsRecords } from "./insights/InsightsRecords";
43
+ import { InsightsTable } from "./insights/InsightsTable";
44
+ import { facetRead, readFacet } from "./list/facetReading";
45
+ import { favoritesKey, useFavorites } from "./list/favorites";
46
+ import type { FrappeListFacet } from "./list/listState";
47
+ import { recordTitle, type FrappeRecordLook } from "./list/recordLook";
48
+ import { useFrappeConnection, useFrappeRows } from "./useFrappeRows";
49
+
50
+ export type { FrappeInsightsMetric };
51
+
52
+ /** Slices of the facet pie before the tail folds into "Other". */
53
+ const pieSlices = 7;
54
+
55
+ const noMetrics: readonly FrappeInsightsMetric[] = [];
56
+
57
+ export interface FrappeInsightsProps<TDoc extends { name: string; doctype: string }> {
58
+ doctype: string;
59
+ /** The doctype's list route: the breadcrumb, Back, record pages and facet links hang off it. */
60
+ route: string;
61
+ /** The list's title; defaults to the doctype. */
62
+ listTitle?: string;
63
+ /** Defaults to "Insights". */
64
+ title?: string;
65
+ subtitle?: (count: number) => string;
66
+ /** The list's fields and ceiling, so both pages share one read. */
67
+ fields?: readonly (keyof TDoc & string)[];
68
+ limit?: number;
69
+ orderBy?: Array<{ field: keyof TDoc & string; order: Order }>;
70
+ /** Declared connections; defaults to the meta's (a Guest cannot read meta). */
71
+ connections?: readonly FrappeConnection[];
72
+ /** Its values chart as a pie, count distinct, tag the table and link to the narrowed list. */
73
+ facet?: FrappeListFacet;
74
+ /** The collective name of the facet's values ("Types"); defaults to its label. */
75
+ facetPlural?: string;
76
+ /** Numeric fields: the first charts and averages, each ranks and columns, `record` ones crown a holder. */
77
+ metrics?: readonly FrappeInsightsMetric[];
78
+ /** Count the list's favorites: true keys them by doctype, a string names the key. */
79
+ favorites?: boolean | string;
80
+ look?: FrappeRecordLook<TDoc>;
81
+ titleField?: string;
82
+ /** Rows per page of the full table. */
83
+ pageSize?: number;
84
+ /** Prefix of the sections' test ids. */
85
+ testID?: string;
86
+ }
87
+
88
+ /**
89
+ * A doctype's analytics page over the rows its list reads: the count, the
90
+ * favorites, the facet's spread and the first metric's average, a facet pie
91
+ * and a metric histogram, record holders, leaders per metric, every record
92
+ * in a table, and the facet's values linking back to the narrowed list.
93
+ * Not configured, error, loading and empty are four honest states under
94
+ * the same wayfinding header.
95
+ */
96
+ export function FrappeInsights<TDoc extends { name: string; doctype: string }>({
97
+ doctype,
98
+ route,
99
+ listTitle,
100
+ title,
101
+ subtitle,
102
+ fields,
103
+ limit,
104
+ orderBy,
105
+ connections,
106
+ facet: facetProp,
107
+ facetPlural,
108
+ metrics: metricsProp = noMetrics,
109
+ favorites,
110
+ look,
111
+ titleField,
112
+ pageSize = 5,
113
+ testID,
114
+ }: FrappeInsightsProps<TDoc>) {
115
+ const { t } = useTranslation();
116
+ const { knobProps } = useResolvedKnobs();
117
+ const theme = useTheme() as unknown as Record<string, { val?: string } | undefined>;
118
+ const config = useFrappeConfig();
119
+ const connection = useFrappeConnection();
120
+ const navigate = useFrappeRouter()?.navigate;
121
+ const { meta } = useDocTypeMeta(connection, doctype);
122
+ const { rights } = useDocRights(connection, meta);
123
+ const listName = listTitle ?? doctype;
124
+ const pageTitle = title ?? t("Insights");
125
+
126
+ // Declarations arrive as fresh objects every render. The sections' tables
127
+ // keep their page only while their data keeps its identity, so the facet
128
+ // and metrics settle on what they declare and the functions ride refs.
129
+ const latest = useRef({ facet: facetProp, metrics: metricsProp, look, navigate });
130
+ latest.current = { facet: facetProp, metrics: metricsProp, look, navigate };
131
+ const facetKey = JSON.stringify(facetProp ?? null);
132
+ const metricsKey = JSON.stringify(metricsProp);
133
+ const facet = useMemo(() => latest.current.facet, [facetKey]);
134
+ const metrics = useMemo(() => latest.current.metrics, [metricsKey]);
135
+
136
+ const {
137
+ rows: readRows,
138
+ isLoading,
139
+ error,
140
+ } = useFrappeRows<TDoc>(connection, doctype, { fields, limit, orderBy });
141
+ const orderKey = JSON.stringify(orderBy ?? null);
142
+ const rows = useMemo(
143
+ () => orderRows(readRows as never[], JSON.parse(orderKey)) as TDoc[],
144
+ [readRows, orderKey],
145
+ );
146
+ const read = facet
147
+ ? facetRead(facet, doctype, connections ?? connectionsFromMeta(meta), limit)
148
+ : undefined;
149
+ const readKey = JSON.stringify(read ?? null);
150
+ const facetQuery = useMemo(() => JSON.parse(readKey) as typeof read | null, [readKey]);
151
+ const facetOptions = useMemo(
152
+ () => ({ ...facetQuery?.options, enabled: Boolean(facetQuery?.ready) }),
153
+ [facetQuery],
154
+ );
155
+ const { rows: facetRows } = useFrappeRows<TDoc>(
156
+ connection,
157
+ facetQuery?.doctype ?? "",
158
+ facetOptions as never,
159
+ );
160
+ const values = useMemo(
161
+ () =>
162
+ facet && facetQuery
163
+ ? readFacet(facet, facetQuery.linkField, facetRows as never).values
164
+ : new Map<string, string[]>(),
165
+ [facet, facetQuery, facetRows],
166
+ );
167
+ const { count: favoritesCount } = useFavorites(
168
+ favorites ? (typeof favorites === "string" ? favorites : favoritesKey(doctype)) : undefined,
169
+ );
170
+
171
+ const nameField = titleField ?? meta?.title_field;
172
+ const baseURL = config?.baseURL;
173
+ const record = useMemo<InsightsRecordView<TDoc>>(
174
+ () => ({
175
+ title: (doc) => recordTitle(doc, latest.current.look, nameField),
176
+ code: (doc) => latest.current.look?.code?.(doc) || undefined,
177
+ images: (doc) => latest.current.look?.images?.(doc, baseURL) ?? [],
178
+ values: (doc) => values.get(doc.name) ?? [],
179
+ tints: (doc) => (values.get(doc.name) ?? []).map((value) => facet?.tint?.(value)),
180
+ valueLabel: (value) => facet?.optionLabel?.(value) ?? value,
181
+ valueTint: (value) => facet?.tint?.(value),
182
+ open: (doc) =>
183
+ latest.current.navigate?.(frappeRouteHref(route, { mode: "view", name: doc.name })),
184
+ }),
185
+ [nameField, baseURL, values, facet, route],
186
+ );
187
+
188
+ const distribution = useMemo(() => facetDistribution(values, rows), [values, rows]);
189
+ const lead = metrics[0];
190
+ const plural = facetPlural ?? facet?.label ?? "";
191
+
192
+ const tiles: InsightsTile[] = [];
193
+ if (favorites) {
194
+ tiles.push({
195
+ id: "favorites",
196
+ title: t("Favorites"),
197
+ value: favoritesCount,
198
+ hint: t("{{count}} of {{total}}", { count: favoritesCount, total: rows.length }),
199
+ });
200
+ }
201
+ if (facet) {
202
+ const several = multiValued(values, rows);
203
+ tiles.push({
204
+ id: "facet",
205
+ title: t("Distinct {{facets}}", { facets: plural }),
206
+ value: distribution.length,
207
+ hint:
208
+ several > 0
209
+ ? t("{{count}} with 2+", { count: several })
210
+ : distribution[0]
211
+ ? record.valueLabel(distribution[0].value)
212
+ : undefined,
213
+ });
214
+ }
215
+ const buckets = lead ? histogram(rows as never[], lead.field, lead.bucket) : [];
216
+ if (lead) {
217
+ tiles.push({
218
+ id: "average",
219
+ title: t("Average {{metric}}", { metric: lead.label }),
220
+ value: formatMetric(lead, Math.round(average(rows as never[], lead.field))),
221
+ spark: buckets.map((bucket) => bucket.value),
222
+ });
223
+ }
224
+ const charts: ChartConfig[] = [];
225
+ if (facet) {
226
+ charts.push({
227
+ id: "facet-distribution",
228
+ title: t("{{facet}} distribution", { facet: facet.label }),
229
+ type: "pie",
230
+ data: foldDistribution(distribution, pieSlices).map((entry) => ({
231
+ label: entry.other ? t("Other") : record.valueLabel(entry.value),
232
+ value: entry.count,
233
+ color: theme[`${(!entry.other && facet.tint?.(entry.value)) || "gray"}9`]?.val,
234
+ })),
235
+ });
236
+ }
237
+ if (lead) {
238
+ charts.push({
239
+ id: "metric-histogram",
240
+ title: t("{{metric}} distribution", { metric: lead.label }),
241
+ type: "bar",
242
+ data: buckets,
243
+ });
244
+ }
245
+ const holders = metrics
246
+ .filter((metric) => metric.record)
247
+ .flatMap((metric) => {
248
+ const doc = topBy(rows as never[], metric.field, 1)[0] as TDoc | undefined;
249
+ return doc
250
+ ? [
251
+ {
252
+ id: metric.field,
253
+ label: metric.record as string,
254
+ doc,
255
+ value: formatMetric(metric, Number(doc[metric.field as keyof TDoc]) || 0),
256
+ },
257
+ ]
258
+ : [];
259
+ });
260
+
261
+ const onAdd =
262
+ rights.create && navigate
263
+ ? () => navigate(frappeRouteHref(route, { mode: "create" }))
264
+ : undefined;
265
+ const sectionId = (name: string) => (testID ? `${testID}-${name}` : undefined);
266
+
267
+ if (!config?.baseURL && !config?.fixtures) {
268
+ return <FrappeNotConfigured doctype={doctype} page />;
269
+ }
270
+
271
+ const header = (
272
+ <YStack {...knobProps.gap}>
273
+ <Breadcrumbs
274
+ items={[{ label: listName, href: route }, { label: pageTitle }]}
275
+ onNavigate={(href) => navigate?.(href)}
276
+ />
277
+ <PageHeader
278
+ title={pageTitle}
279
+ subtitle={
280
+ subtitle && !isLoading && !error && rows.length > 0 ? subtitle(rows.length) : undefined
281
+ }
282
+ actions={
283
+ <Button
284
+ variant="outlined"
285
+ minHeight={knobProps.sizeToken}
286
+ onPress={() => navigate?.(route)}
287
+ icon={<ArrowLeftIcon size={16} />}
288
+ testID={sectionId("back")}
289
+ >
290
+ {t("Back to {{title}}", { title: listName })}
291
+ </Button>
292
+ }
293
+ />
294
+ </YStack>
295
+ );
296
+
297
+ if (error) {
298
+ return (
299
+ <Screen scroll={false}>
300
+ {header}
301
+ <EmptyState
302
+ intent="error"
303
+ title={t("Couldn't load {{title}}", { title: listName })}
304
+ description={t("Check the connection and try again.")}
305
+ />
306
+ </Screen>
307
+ );
308
+ }
309
+
310
+ if (isLoading) {
311
+ return (
312
+ <Screen>
313
+ {header}
314
+ <YStack testID={sectionId("skeleton")}>
315
+ <AsyncSkeleton layout="dashboard" />
316
+ </YStack>
317
+ </Screen>
318
+ );
319
+ }
320
+
321
+ if (rows.length === 0) {
322
+ return (
323
+ <Screen scroll={false}>
324
+ {header}
325
+ <EmptyState
326
+ icon={<SparkleIcon size={28} />}
327
+ title={t("No {{title}} to analyze", { title: listName })}
328
+ description={t("Add a record and the analytics will light up.")}
329
+ action={
330
+ onAdd ? (
331
+ <Button theme="accent" onPress={onAdd}>
332
+ {t("Add your first {{doctype}}", { doctype })}
333
+ </Button>
334
+ ) : undefined
335
+ }
336
+ />
337
+ </Screen>
338
+ );
339
+ }
340
+
341
+ return (
342
+ <Screen>
343
+ <FrappeReconnectIndicator config={connection} />
344
+ {header}
345
+
346
+ <InsightsKpiBand
347
+ hero={{ id: "total", title: t("Total {{title}}", { title: listName }), value: rows.length }}
348
+ tiles={tiles}
349
+ charts={charts}
350
+ testID={sectionId("dashboard")}
351
+ />
352
+
353
+ {holders.length > 0 || metrics.length > 0 ? (
354
+ <XStack flexWrap="wrap" alignItems="flex-start" {...knobProps.gapLg}>
355
+ {holders.length > 0 ? (
356
+ <PageSection
357
+ title={t("Record holders")}
358
+ divider={false}
359
+ flexGrow={1}
360
+ flexShrink={1}
361
+ flexBasis={280}
362
+ minWidth={0}
363
+ >
364
+ <InsightsRecords tiles={holders} record={record} testID={sectionId("records")} />
365
+ </PageSection>
366
+ ) : null}
367
+ {metrics.length > 0 ? (
368
+ <PageSection
369
+ title={t("Leaders")}
370
+ description={t("The top five by the field you pick; open any row.")}
371
+ divider={false}
372
+ flexGrow={2}
373
+ flexShrink={1}
374
+ flexBasis={420}
375
+ minWidth={0}
376
+ >
377
+ <InsightsLeaders
378
+ rows={rows}
379
+ metrics={metrics}
380
+ record={record}
381
+ testID={sectionId("leaderboard")}
382
+ />
383
+ </PageSection>
384
+ ) : null}
385
+ </XStack>
386
+ ) : null}
387
+
388
+ <PageSection
389
+ title={t("All {{title}}", { title: listName })}
390
+ description={t("Every record, {{count}} per page; sort any column.", { count: pageSize })}
391
+ divider={false}
392
+ >
393
+ <InsightsTable
394
+ rows={rows}
395
+ metrics={metrics}
396
+ record={record}
397
+ facetLabel={facet ? plural : undefined}
398
+ pageSize={pageSize}
399
+ label={t("All {{title}}", { title: listName })}
400
+ testID={sectionId("roster")}
401
+ />
402
+ </PageSection>
403
+
404
+ {facet ? (
405
+ <PageSection
406
+ title={t("Browse by {{facet}}", { facet: facet.label })}
407
+ description={t("Open the list narrowed to one value.")}
408
+ divider={false}
409
+ paddingBottom="$6"
410
+ >
411
+ <InsightsFacetTags
412
+ distribution={distribution}
413
+ label={record.valueLabel}
414
+ tint={facet.tint}
415
+ onSelect={(value) => navigate?.(`${route}?${facet.param}=${encodeURIComponent(value)}`)}
416
+ testID={sectionId("tag")}
417
+ />
418
+ </PageSection>
419
+ ) : null}
420
+ </Screen>
421
+ );
422
+ }
@@ -4,6 +4,7 @@ import { InMemoryFixtureProvider } from "@multiplatform.one/frappe";
4
4
  // catalog names it does not define).
5
5
  import { KPICard } from "@multiplatform.one/components";
6
6
  import { action } from "@multiplatform.one/storybook";
7
+ import { sizeRecipeEscape } from "@multiplatform.one/theme";
7
8
  import { CurrencyDollarIcon } from "@phosphor-icons/react";
8
9
  import { XStack } from "tamagui";
9
10
  import { FrappeKPICard } from "./FrappeKPICard";
@@ -81,8 +82,7 @@ function jsonResponse(body: unknown, status = 200): Response {
81
82
  return jsonResponse({ docs: [todoMetaRaw(decodeURIComponent(doctype))] });
82
83
  }
83
84
  const metaMatch = url.pathname.match(/^\/api\/resource\/DocType\/(.+)$/);
84
- if (metaMatch)
85
- return jsonResponse({ data: todoMetaRaw(decodeURIComponent(metaMatch[1])) });
85
+ if (metaMatch) return jsonResponse({ data: todoMetaRaw(decodeURIComponent(metaMatch[1])) });
86
86
  if (url.pathname === "/api/resource/DocType") {
87
87
  return jsonResponse({ data: [{ name: "ToDo", module: "Desk" }] });
88
88
  }
@@ -201,7 +201,7 @@ export const Clickable = () => (
201
201
 
202
202
  export const LongTitle = () => (
203
203
  <KPICard
204
- width={220}
204
+ width={sizeRecipeEscape(220, "story fixture: a card narrow enough to truncate the long title")}
205
205
  config={{
206
206
  id: "long",
207
207
  title:
@@ -5,6 +5,8 @@ import { FrappeKanban, type KanbanColumn } from "./FrappeKanban";
5
5
  import { FrappeProvider } from "./FrappeProvider";
6
6
  import { FrappeStoryProvider } from "./frappeStoryTarget";
7
7
 
8
+ // hex-escape: Frappe sends column, event and series colours as hex: fixture data, not paint
9
+
8
10
  export default {
9
11
  title: "FrappeUI/FrappeKanban",
10
12
  component: FrappeKanban,
@@ -310,10 +312,7 @@ const bugColumns: KanbanColumn[] = [
310
312
  ];
311
313
 
312
314
  export const BugTracker = () => (
313
- <FrappeProvider
314
- baseURL={MOCK_HOST}
315
- fixtures={new InMemoryFixtureProvider({ Bug: bugFixtures })}
316
- >
315
+ <FrappeProvider baseURL={MOCK_HOST} fixtures={new InMemoryFixtureProvider({ Bug: bugFixtures })}>
317
316
  <FrappeKanban<Bug>
318
317
  doctype="Bug"
319
318
  columns={bugColumns}
@@ -360,10 +359,7 @@ export const Loading = () => (
360
359
 
361
360
  /** Zero documents, no failure — configured columns render with per-column "No items" (empty ≠ error). */
362
361
  export const Empty = () => (
363
- <FrappeProvider
364
- baseURL={MOCK_HOST}
365
- fixtures={new InMemoryFixtureProvider({ ToDo: [] })}
366
- >
362
+ <FrappeProvider baseURL={MOCK_HOST} fixtures={new InMemoryFixtureProvider({ ToDo: [] })}>
367
363
  <FrappeKanban<ToDo>
368
364
  doctype="ToDo"
369
365
  columns={todoColumns}
@@ -18,12 +18,14 @@ import { useResolvedKnobs } from "@multiplatform.one/theme";
18
18
  import { HeartIcon } from "@phosphor-icons/react";
19
19
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
20
20
  import { useTranslation } from "react-i18next";
21
- import { Text, XStack, YStack, isWeb, useTheme, type YStackProps } from "tamagui";
21
+ import { Text, XStack, YStack, isWeb, styled, useTheme, type YStackProps } from "tamagui";
22
22
  import { useFrappeConfig } from "./FrappeProvider";
23
23
  import { FrappeReconnectIndicator } from "./FrappeReconnectIndicator";
24
24
  import { useFrappeUsers } from "./frappeUsers";
25
25
  import { toLiveLoadError } from "./liveErrors";
26
26
 
27
+ const LikedByAvatarSlot = styled(XStack, { name: "LikedByAvatarSlot" });
28
+
27
29
  // ---------------------------------------------------------------------------
28
30
  // Pure helpers (unit-tested)
29
31
  // ---------------------------------------------------------------------------
@@ -316,19 +318,19 @@ function FrappeLikedByBody({
316
318
  {visibleAvatars.map((id, index) => {
317
319
  const info = users.get(id);
318
320
  return (
319
- <XStack key={id} marginLeft={index === 0 ? 0 : -8} zIndex={index + 1}>
321
+ <LikedByAvatarSlot key={id} marginLeft={index === 0 ? 0 : -8} zIndex={index + 1}>
320
322
  <Avatar size="$1.5" src={info?.image} name={info?.label ?? id} />
321
- </XStack>
323
+ </LikedByAvatarSlot>
322
324
  );
323
325
  })}
324
326
  {overflow > 0 ? (
325
- <XStack marginLeft={-8} zIndex={visibleAvatars.length + 1}>
327
+ <LikedByAvatarSlot marginLeft={-8} zIndex={visibleAvatars.length + 1}>
326
328
  <Avatar
327
329
  size="$1.5"
328
330
  initials={`+${overflow}`}
329
331
  alt={t("{{count}} more users", { count: overflow })}
330
332
  />
331
- </XStack>
333
+ </LikedByAvatarSlot>
332
334
  ) : null}
333
335
  </XStack>
334
336
  ) : null}
@@ -0,0 +1,157 @@
1
+ // FrappeListView's record card (MPO-411): a list whose doctype declares a
2
+ // look draws each record as a card without a card slot of its own, the way
3
+ // pokemon's roster drew its Pokedex card by hand.
4
+ import fs from "node:fs";
5
+ import path from "node:path";
6
+ import { renderWithProviders } from "@multiplatform.one/test-utils";
7
+ import { cleanup, fireEvent, screen, waitFor } from "@testing-library/react";
8
+ import i18next from "i18next";
9
+ import { initReactI18next } from "react-i18next";
10
+ import { afterAll, afterEach, beforeAll, describe, expect, it, vi } from "vitest";
11
+ import {
12
+ createRosterFixtures,
13
+ rosterPokemonFields,
14
+ rosterPokemonMeta,
15
+ type RosterPokemon,
16
+ } from "../tests/fixtures/pokemonRoster";
17
+ import type { FrappeNavigation } from "./frappeNavigation";
18
+ import { FrappeListView, type FrappeListViewProps } from "./FrappeListView";
19
+ import { FrappeProvider } from "./FrappeProvider";
20
+ import { favoritesStore } from "./list/favorites";
21
+
22
+ const host = "https://listview-card.spec.test";
23
+ const realFetch = globalThis.fetch;
24
+ const favoritesKey = "card-spec-favorites";
25
+
26
+ beforeAll(async () => {
27
+ await i18next.use(initReactI18next).init({
28
+ lng: "en",
29
+ interpolation: { escapeValue: false },
30
+ resources: { en: { translation: {} } },
31
+ });
32
+ globalThis.fetch = (async (input: RequestInfo | URL, init?: RequestInit) => {
33
+ const url = typeof input === "string" ? input : input instanceof URL ? input.href : input.url;
34
+ if (url.startsWith(host)) {
35
+ const body = /\/api\/resource\/DocType\//.test(url)
36
+ ? { data: rosterPokemonMeta }
37
+ : { data: [] };
38
+ return new Response(JSON.stringify(body), {
39
+ status: 200,
40
+ headers: { "Content-Type": "application/json" },
41
+ });
42
+ }
43
+ return realFetch(input as RequestInfo, init);
44
+ }) as typeof fetch;
45
+ });
46
+
47
+ afterAll(() => {
48
+ globalThis.fetch = realFetch;
49
+ });
50
+
51
+ afterEach(() => {
52
+ cleanup();
53
+ vi.restoreAllMocks();
54
+ favoritesStore(favoritesKey).setState(() => ({ names: [] }));
55
+ });
56
+
57
+ const look: FrappeListViewProps<RosterPokemon>["look"] = {
58
+ title: (doc) => (doc.pokemon_name ?? "").toUpperCase(),
59
+ code: (doc) => `#${String(doc.poke_id ?? 0).padStart(3, "0")}`,
60
+ subtitle: (doc) => doc.species,
61
+ images: (doc) => [`https://art.spec.test/${doc.poke_id}.png`, doc.sprite_front ?? ""],
62
+ };
63
+
64
+ function renderList(navigate = vi.fn()) {
65
+ const navigation: FrappeNavigation = {
66
+ usePathname: () => "/pokemon",
67
+ useNavigate: () => navigate,
68
+ };
69
+ return renderWithProviders(
70
+ <FrappeProvider baseURL={host} fixtures={createRosterFixtures()} navigation={navigation}>
71
+ <FrappeListView<RosterPokemon>
72
+ doctype="Pokemon"
73
+ route="/pokemon"
74
+ fields={rosterPokemonFields}
75
+ defaultViewMode="grid"
76
+ look={look}
77
+ favorites={favoritesKey}
78
+ facets={[
79
+ {
80
+ param: "type",
81
+ doctype: "Pokemon Poke Type",
82
+ field: "poke_type",
83
+ orderBy: "slot",
84
+ label: "Type",
85
+ options: ["grass", "poison", "fire", "water", "electric", "ghost", "normal"],
86
+ optionLabel: (value) => `type:${value}`,
87
+ tint: (value) => (value === "grass" ? "grass" : "purple"),
88
+ },
89
+ ]}
90
+ />
91
+ </FrappeProvider>,
92
+ );
93
+ }
94
+
95
+ describe("FrappeListView draws a record card from the doctype's look", () => {
96
+ it("offers the card grid and names each card by the doctype and the record", async () => {
97
+ renderList();
98
+ const card = await screen.findByTestId("pokemon-card-bulbasaur", {}, { timeout: 5000 });
99
+ expect(card.textContent).toContain("BULBASAUR");
100
+ expect(card.textContent).toContain("#001");
101
+ expect(card.textContent).toContain("Seed Pokémon");
102
+ expect(screen.getAllByTestId(/^pokemon-card-/)).toHaveLength(6);
103
+ });
104
+
105
+ it("draws the look's first image and the facet's values as badges in slot order", async () => {
106
+ renderList();
107
+ const card = await screen.findByTestId("pokemon-card-bulbasaur", {}, { timeout: 5000 });
108
+ expect(card.querySelector("img")?.getAttribute("src")).toBe("https://art.spec.test/1.png");
109
+ await waitFor(() => {
110
+ const text = card.textContent ?? "";
111
+ expect(text).toContain("type:grass");
112
+ expect(text.indexOf("type:grass")).toBeLessThan(text.indexOf("type:poison"));
113
+ });
114
+ });
115
+
116
+ it("links the card to the record under the list's route", async () => {
117
+ renderList();
118
+ const card = await screen.findByTestId("pokemon-card-bulbasaur", {}, { timeout: 5000 });
119
+ expect(card.querySelector("a")?.getAttribute("href")).toBe("/pokemon/bulbasaur");
120
+ });
121
+
122
+ it("keeps the heart a button beside the link that toggles the favorite and opens nothing", async () => {
123
+ const navigate = vi.fn();
124
+ renderList(navigate);
125
+ const heart = await screen.findByTestId("pokemon-favorite-bulbasaur", {}, { timeout: 5000 });
126
+ expect(heart.tagName).toBe("BUTTON");
127
+ expect(heart.getAttribute("type")).toBe("button");
128
+ expect(heart.closest("a")).toBeNull();
129
+ expect(heart.getAttribute("aria-pressed")).toBe("false");
130
+ expect(heart.getAttribute("aria-label")).toBe("Add BULBASAUR to favorites");
131
+ fireEvent.click(heart);
132
+ await waitFor(() => expect(favoritesStore(favoritesKey).state.names).toEqual(["bulbasaur"]));
133
+ await waitFor(() =>
134
+ expect(screen.getByTestId("pokemon-favorite-bulbasaur").getAttribute("aria-pressed")).toBe(
135
+ "true",
136
+ ),
137
+ );
138
+ expect(navigate).not.toHaveBeenCalled();
139
+ });
140
+ });
141
+
142
+ describe("RecordCard's native twin", () => {
143
+ const source = fs.readFileSync(path.resolve(__dirname, "list/RecordCard.native.tsx"), "utf8");
144
+
145
+ it("presses the card itself, since a native Anchor loses the tap to the Card", () => {
146
+ expect(source).not.toContain("<Anchor");
147
+ expect(source).toMatch(/onPress=\{\(\) => onPress\?\.\(\)\}/);
148
+ });
149
+
150
+ it("stops the heart's press from reaching the card", () => {
151
+ const handler = source.slice(
152
+ source.indexOf("const handleToggleFavorite"),
153
+ source.indexOf("return ("),
154
+ );
155
+ expect(handler).toContain("stopPropagation");
156
+ });
157
+ });