@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.
- package/dist/cjs/FrappeCalendar.cjs +1 -1
- package/dist/cjs/FrappeCalendar.native.js +1 -1
- package/dist/cjs/FrappeCalendar.native.js.map +1 -1
- package/dist/cjs/FrappeDashboard.cjs +1 -1
- package/dist/cjs/FrappeDashboard.native.js +1 -1
- package/dist/cjs/FrappeDashboard.native.js.map +1 -1
- package/dist/cjs/FrappeForm.cjs +8 -0
- package/dist/cjs/FrappeForm.native.js +9 -0
- package/dist/cjs/FrappeForm.native.js.map +1 -1
- package/dist/cjs/FrappeImageView.cjs +1 -1
- package/dist/cjs/FrappeImageView.native.js +1 -1
- package/dist/cjs/FrappeImageView.native.js.map +1 -1
- package/dist/cjs/FrappeInsights.cjs +380 -0
- package/dist/cjs/FrappeInsights.native.js +447 -0
- package/dist/cjs/FrappeInsights.native.js.map +1 -0
- package/dist/cjs/FrappeLikedBy.cjs +5 -2
- package/dist/cjs/FrappeLikedBy.native.js +5 -2
- package/dist/cjs/FrappeLikedBy.native.js.map +1 -1
- package/dist/cjs/FrappeListView.cjs +406 -39
- package/dist/cjs/FrappeListView.native.js +469 -42
- package/dist/cjs/FrappeListView.native.js.map +1 -1
- package/dist/cjs/FrappeNotConfigured.cjs +54 -0
- package/dist/cjs/FrappeNotConfigured.native.js +58 -0
- package/dist/cjs/FrappeNotConfigured.native.js.map +1 -0
- package/dist/cjs/FrappeRecordView.cjs +199 -0
- package/dist/cjs/FrappeRecordView.native.js +218 -0
- package/dist/cjs/FrappeRecordView.native.js.map +1 -0
- package/dist/cjs/FrappeReportBuilder.cjs +2 -2
- package/dist/cjs/FrappeReportBuilder.native.js +2 -2
- package/dist/cjs/FrappeReportBuilder.native.js.map +1 -1
- package/dist/cjs/FrappeReportView.cjs +1 -1
- package/dist/cjs/FrappeReportView.native.js +2 -2
- package/dist/cjs/FrappeReportView.native.js.map +1 -1
- package/dist/cjs/FrappeTreeView.cjs +1 -1
- package/dist/cjs/FrappeTreeView.native.js +1 -1
- package/dist/cjs/desk/awesomebar.cjs +1 -1
- package/dist/cjs/desk/awesomebar.native.js +3 -3
- package/dist/cjs/desk/awesomebar.native.js.map +1 -1
- package/dist/cjs/fields/CodeEditor/index.cjs +1 -1
- package/dist/cjs/fields/CodeEditor/index.native.js +1 -1
- package/dist/cjs/fields/CodeEditor/index.native.js.map +1 -1
- package/dist/cjs/fields/Color/index.cjs +1 -0
- package/dist/cjs/fields/Color/index.native.js +1 -0
- package/dist/cjs/fields/Color/index.native.js.map +1 -1
- package/dist/cjs/fields/FileUpload.cjs +1 -1
- package/dist/cjs/fields/FileUpload.native.js +1 -1
- package/dist/cjs/fields/FileUpload.native.js.map +1 -1
- package/dist/cjs/fields/Heading/index.cjs +19 -12
- package/dist/cjs/fields/Heading/index.native.js +22 -13
- package/dist/cjs/fields/Heading/index.native.js.map +1 -1
- package/dist/cjs/fields/MarkdownEditor/index.cjs +2 -1
- package/dist/cjs/fields/MarkdownEditor/index.native.js +1 -1
- package/dist/cjs/fields/MarkdownEditor/index.native.js.map +1 -1
- package/dist/cjs/frappeNavigation.cjs +12 -2
- package/dist/cjs/frappeNavigation.native.js +13 -2
- package/dist/cjs/frappeNavigation.native.js.map +1 -1
- package/dist/cjs/index.cjs +34 -0
- package/dist/cjs/index.native.js +34 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/insights/InsightsFacetTags.cjs +147 -0
- package/dist/cjs/insights/InsightsFacetTags.native.js +165 -0
- package/dist/cjs/insights/InsightsFacetTags.native.js.map +1 -0
- package/dist/cjs/insights/InsightsKpiBand.cjs +124 -0
- package/dist/cjs/insights/InsightsKpiBand.native.js +133 -0
- package/dist/cjs/insights/InsightsKpiBand.native.js.map +1 -0
- package/dist/cjs/insights/InsightsLeaders.cjs +150 -0
- package/dist/cjs/insights/InsightsLeaders.native.js +178 -0
- package/dist/cjs/insights/InsightsLeaders.native.js.map +1 -0
- package/dist/cjs/insights/InsightsRecords.cjs +105 -0
- package/dist/cjs/insights/InsightsRecords.native.js +109 -0
- package/dist/cjs/insights/InsightsRecords.native.js.map +1 -0
- package/dist/cjs/insights/InsightsTable.cjs +157 -0
- package/dist/cjs/insights/InsightsTable.native.js +194 -0
- package/dist/cjs/insights/InsightsTable.native.js.map +1 -0
- package/dist/cjs/insights/insightsData.cjs +114 -0
- package/dist/cjs/insights/insightsData.native.js +220 -0
- package/dist/cjs/insights/insightsData.native.js.map +1 -0
- package/dist/cjs/insights/insightsRecord.cjs +35 -0
- package/dist/cjs/insights/insightsRecord.native.js +38 -0
- package/dist/cjs/insights/insightsRecord.native.js.map +1 -0
- package/dist/cjs/list/FacetBadge.cjs +62 -0
- package/dist/cjs/list/FacetBadge.native.js +66 -0
- package/dist/cjs/list/FacetBadge.native.js.map +1 -0
- package/dist/cjs/list/FacetRail.cjs +199 -0
- package/dist/cjs/list/FacetRail.native.js +223 -0
- package/dist/cjs/list/FacetRail.native.js.map +1 -0
- package/dist/cjs/list/ImageWell.cjs +111 -0
- package/dist/cjs/list/ImageWell.native.js +126 -0
- package/dist/cjs/list/ImageWell.native.js.map +1 -0
- package/dist/cjs/list/ListControls.cjs +226 -0
- package/dist/cjs/list/ListControls.native.js +252 -0
- package/dist/cjs/list/ListControls.native.js.map +1 -0
- package/dist/cjs/list/ListToastHost.cjs +54 -0
- package/dist/cjs/list/ListToastHost.native.js +59 -0
- package/dist/cjs/list/ListToastHost.native.js.map +1 -0
- package/dist/cjs/list/RangeFilter.cjs +122 -0
- package/dist/cjs/list/RangeFilter.native.js +135 -0
- package/dist/cjs/list/RangeFilter.native.js.map +1 -0
- package/dist/cjs/list/RecordCard.cjs +233 -0
- package/dist/cjs/list/RecordCard.native.js +173 -0
- package/dist/cjs/list/RecordCard.native.js.map +1 -0
- package/dist/cjs/list/ShufflePanel.cjs +112 -0
- package/dist/cjs/list/ShufflePanel.native.js +139 -0
- package/dist/cjs/list/ShufflePanel.native.js.map +1 -0
- package/dist/cjs/list/facetReading.cjs +71 -0
- package/dist/cjs/list/facetReading.native.js +163 -0
- package/dist/cjs/list/facetReading.native.js.map +1 -0
- package/dist/cjs/list/favorites.cjs +79 -0
- package/dist/cjs/list/favorites.native.js +91 -0
- package/dist/cjs/list/favorites.native.js.map +1 -0
- package/dist/cjs/list/listState.cjs +100 -0
- package/dist/cjs/list/listState.native.js +234 -0
- package/dist/cjs/list/listState.native.js.map +1 -0
- package/dist/cjs/list/recordLook.cjs +35 -0
- package/dist/cjs/list/recordLook.native.js +39 -0
- package/dist/cjs/list/recordLook.native.js.map +1 -0
- package/dist/cjs/list/useListControls.cjs +189 -0
- package/dist/cjs/list/useListControls.native.js +272 -0
- package/dist/cjs/list/useListControls.native.js.map +1 -0
- package/dist/cjs/record/RecordBars.cjs +200 -0
- package/dist/cjs/record/RecordBars.native.js +225 -0
- package/dist/cjs/record/RecordBars.native.js.map +1 -0
- package/dist/cjs/record/RecordGallery.cjs +67 -0
- package/dist/cjs/record/RecordGallery.native.js +75 -0
- package/dist/cjs/record/RecordGallery.native.js.map +1 -0
- package/dist/cjs/record/RecordHero.cjs +239 -0
- package/dist/cjs/record/RecordHero.native.js +250 -0
- package/dist/cjs/record/RecordHero.native.js.map +1 -0
- package/dist/cjs/record/RecordPage.cjs +330 -0
- package/dist/cjs/record/RecordPage.native.js +364 -0
- package/dist/cjs/record/RecordPage.native.js.map +1 -0
- package/dist/cjs/record/RecordPager.cjs +125 -0
- package/dist/cjs/record/RecordPager.native.js +130 -0
- package/dist/cjs/record/RecordPager.native.js.map +1 -0
- package/dist/cjs/record/RecordRows.cjs +126 -0
- package/dist/cjs/record/RecordRows.native.js +140 -0
- package/dist/cjs/record/RecordRows.native.js.map +1 -0
- package/dist/cjs/record/recordData.cjs +122 -0
- package/dist/cjs/record/recordData.native.js +189 -0
- package/dist/cjs/record/recordData.native.js.map +1 -0
- package/dist/cjs/record/recordSections.cjs +30 -0
- package/dist/cjs/record/recordSections.native.js +33 -0
- package/dist/cjs/record/recordSections.native.js.map +1 -0
- package/dist/cjs/useFrappeFacets.cjs +1 -1
- package/dist/cjs/useFrappeFacets.native.js +1 -1
- package/dist/cjs/useFrappeFacets.native.js.map +1 -1
- package/dist/esm/FrappeCalendar.mjs +1 -1
- package/dist/esm/FrappeCalendar.mjs.map +1 -1
- package/dist/esm/FrappeCalendar.native.js +1 -1
- package/dist/esm/FrappeCalendar.native.js.map +1 -1
- package/dist/esm/FrappeDashboard.mjs +1 -1
- package/dist/esm/FrappeDashboard.mjs.map +1 -1
- package/dist/esm/FrappeDashboard.native.js +1 -1
- package/dist/esm/FrappeDashboard.native.js.map +1 -1
- package/dist/esm/FrappeForm.mjs +8 -0
- package/dist/esm/FrappeForm.mjs.map +1 -1
- package/dist/esm/FrappeForm.native.js +9 -0
- package/dist/esm/FrappeForm.native.js.map +1 -1
- package/dist/esm/FrappeImageView.mjs +1 -1
- package/dist/esm/FrappeImageView.mjs.map +1 -1
- package/dist/esm/FrappeImageView.native.js +1 -1
- package/dist/esm/FrappeImageView.native.js.map +1 -1
- package/dist/esm/FrappeInsights.mjs +355 -0
- package/dist/esm/FrappeInsights.mjs.map +1 -0
- package/dist/esm/FrappeInsights.native.js +419 -0
- package/dist/esm/FrappeInsights.native.js.map +1 -0
- package/dist/esm/FrappeLikedBy.mjs +6 -3
- package/dist/esm/FrappeLikedBy.mjs.map +1 -1
- package/dist/esm/FrappeLikedBy.native.js +6 -3
- package/dist/esm/FrappeLikedBy.native.js.map +1 -1
- package/dist/esm/FrappeListView.mjs +410 -43
- package/dist/esm/FrappeListView.mjs.map +1 -1
- package/dist/esm/FrappeListView.native.js +473 -46
- package/dist/esm/FrappeListView.native.js.map +1 -1
- package/dist/esm/FrappeNotConfigured.mjs +29 -0
- package/dist/esm/FrappeNotConfigured.mjs.map +1 -0
- package/dist/esm/FrappeNotConfigured.native.js +30 -0
- package/dist/esm/FrappeNotConfigured.native.js.map +1 -0
- package/dist/esm/FrappeRecordView.mjs +174 -0
- package/dist/esm/FrappeRecordView.mjs.map +1 -0
- package/dist/esm/FrappeRecordView.native.js +190 -0
- package/dist/esm/FrappeRecordView.native.js.map +1 -0
- package/dist/esm/FrappeReportBuilder.mjs +2 -2
- package/dist/esm/FrappeReportBuilder.mjs.map +1 -1
- package/dist/esm/FrappeReportBuilder.native.js +2 -2
- package/dist/esm/FrappeReportBuilder.native.js.map +1 -1
- package/dist/esm/FrappeReportView.mjs +1 -1
- package/dist/esm/FrappeReportView.mjs.map +1 -1
- package/dist/esm/FrappeReportView.native.js +2 -2
- package/dist/esm/FrappeReportView.native.js.map +1 -1
- package/dist/esm/FrappeTreeView.mjs +1 -1
- package/dist/esm/FrappeTreeView.mjs.map +1 -1
- package/dist/esm/FrappeTreeView.native.js +1 -1
- package/dist/esm/desk/awesomebar.mjs +1 -1
- package/dist/esm/desk/awesomebar.mjs.map +1 -1
- package/dist/esm/desk/awesomebar.native.js +3 -3
- package/dist/esm/desk/awesomebar.native.js.map +1 -1
- package/dist/esm/fields/CodeEditor/index.mjs +2 -2
- package/dist/esm/fields/CodeEditor/index.mjs.map +1 -1
- package/dist/esm/fields/CodeEditor/index.native.js +2 -2
- package/dist/esm/fields/CodeEditor/index.native.js.map +1 -1
- package/dist/esm/fields/Color/index.mjs +1 -0
- package/dist/esm/fields/Color/index.mjs.map +1 -1
- package/dist/esm/fields/Color/index.native.js +1 -0
- package/dist/esm/fields/Color/index.native.js.map +1 -1
- package/dist/esm/fields/FileUpload.mjs +2 -2
- package/dist/esm/fields/FileUpload.mjs.map +1 -1
- package/dist/esm/fields/FileUpload.native.js +2 -2
- package/dist/esm/fields/FileUpload.native.js.map +1 -1
- package/dist/esm/fields/Heading/index.mjs +21 -14
- package/dist/esm/fields/Heading/index.mjs.map +1 -1
- package/dist/esm/fields/Heading/index.native.js +24 -15
- package/dist/esm/fields/Heading/index.native.js.map +1 -1
- package/dist/esm/fields/MarkdownEditor/index.mjs +2 -1
- package/dist/esm/fields/MarkdownEditor/index.mjs.map +1 -1
- package/dist/esm/fields/MarkdownEditor/index.native.js +2 -2
- package/dist/esm/fields/MarkdownEditor/index.native.js.map +1 -1
- package/dist/esm/frappeNavigation.mjs +11 -2
- package/dist/esm/frappeNavigation.mjs.map +1 -1
- package/dist/esm/frappeNavigation.native.js +12 -2
- package/dist/esm/frappeNavigation.native.js.map +1 -1
- package/dist/esm/index.mjs +14 -2
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +14 -2
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/insights/InsightsFacetTags.mjs +122 -0
- package/dist/esm/insights/InsightsFacetTags.mjs.map +1 -0
- package/dist/esm/insights/InsightsFacetTags.native.js +137 -0
- package/dist/esm/insights/InsightsFacetTags.native.js.map +1 -0
- package/dist/esm/insights/InsightsKpiBand.mjs +99 -0
- package/dist/esm/insights/InsightsKpiBand.mjs.map +1 -0
- package/dist/esm/insights/InsightsKpiBand.native.js +105 -0
- package/dist/esm/insights/InsightsKpiBand.native.js.map +1 -0
- package/dist/esm/insights/InsightsLeaders.mjs +125 -0
- package/dist/esm/insights/InsightsLeaders.mjs.map +1 -0
- package/dist/esm/insights/InsightsLeaders.native.js +150 -0
- package/dist/esm/insights/InsightsLeaders.native.js.map +1 -0
- package/dist/esm/insights/InsightsRecords.mjs +80 -0
- package/dist/esm/insights/InsightsRecords.mjs.map +1 -0
- package/dist/esm/insights/InsightsRecords.native.js +81 -0
- package/dist/esm/insights/InsightsRecords.native.js.map +1 -0
- package/dist/esm/insights/InsightsTable.mjs +132 -0
- package/dist/esm/insights/InsightsTable.mjs.map +1 -0
- package/dist/esm/insights/InsightsTable.native.js +166 -0
- package/dist/esm/insights/InsightsTable.native.js.map +1 -0
- package/dist/esm/insights/insightsData.mjs +82 -0
- package/dist/esm/insights/insightsData.mjs.map +1 -0
- package/dist/esm/insights/insightsData.native.js +185 -0
- package/dist/esm/insights/insightsData.native.js.map +1 -0
- package/dist/esm/insights/insightsRecord.mjs +9 -0
- package/dist/esm/insights/insightsRecord.mjs.map +1 -0
- package/dist/esm/insights/insightsRecord.native.js +9 -0
- package/dist/esm/insights/insightsRecord.native.js.map +1 -0
- package/dist/esm/list/FacetBadge.mjs +37 -0
- package/dist/esm/list/FacetBadge.mjs.map +1 -0
- package/dist/esm/list/FacetBadge.native.js +38 -0
- package/dist/esm/list/FacetBadge.native.js.map +1 -0
- package/dist/esm/list/FacetRail.mjs +174 -0
- package/dist/esm/list/FacetRail.mjs.map +1 -0
- package/dist/esm/list/FacetRail.native.js +195 -0
- package/dist/esm/list/FacetRail.native.js.map +1 -0
- package/dist/esm/list/ImageWell.mjs +86 -0
- package/dist/esm/list/ImageWell.mjs.map +1 -0
- package/dist/esm/list/ImageWell.native.js +98 -0
- package/dist/esm/list/ImageWell.native.js.map +1 -0
- package/dist/esm/list/ListControls.mjs +201 -0
- package/dist/esm/list/ListControls.mjs.map +1 -0
- package/dist/esm/list/ListControls.native.js +224 -0
- package/dist/esm/list/ListControls.native.js.map +1 -0
- package/dist/esm/list/ListToastHost.mjs +18 -0
- package/dist/esm/list/ListToastHost.mjs.map +1 -0
- package/dist/esm/list/ListToastHost.native.js +20 -0
- package/dist/esm/list/ListToastHost.native.js.map +1 -0
- package/dist/esm/list/RangeFilter.mjs +85 -0
- package/dist/esm/list/RangeFilter.mjs.map +1 -0
- package/dist/esm/list/RangeFilter.native.js +95 -0
- package/dist/esm/list/RangeFilter.native.js.map +1 -0
- package/dist/esm/list/RecordCard.mjs +208 -0
- package/dist/esm/list/RecordCard.mjs.map +1 -0
- package/dist/esm/list/RecordCard.native.js +145 -0
- package/dist/esm/list/RecordCard.native.js.map +1 -0
- package/dist/esm/list/ShufflePanel.mjs +87 -0
- package/dist/esm/list/ShufflePanel.mjs.map +1 -0
- package/dist/esm/list/ShufflePanel.native.js +111 -0
- package/dist/esm/list/ShufflePanel.native.js.map +1 -0
- package/dist/esm/list/facetReading.mjs +45 -0
- package/dist/esm/list/facetReading.mjs.map +1 -0
- package/dist/esm/list/facetReading.native.js +134 -0
- package/dist/esm/list/facetReading.native.js.map +1 -0
- package/dist/esm/list/favorites.mjs +50 -0
- package/dist/esm/list/favorites.mjs.map +1 -0
- package/dist/esm/list/favorites.native.js +59 -0
- package/dist/esm/list/favorites.native.js.map +1 -0
- package/dist/esm/list/listState.mjs +71 -0
- package/dist/esm/list/listState.mjs.map +1 -0
- package/dist/esm/list/listState.native.js +202 -0
- package/dist/esm/list/listState.native.js.map +1 -0
- package/dist/esm/list/recordLook.mjs +10 -0
- package/dist/esm/list/recordLook.mjs.map +1 -0
- package/dist/esm/list/recordLook.native.js +11 -0
- package/dist/esm/list/recordLook.native.js.map +1 -0
- package/dist/esm/list/useListControls.mjs +164 -0
- package/dist/esm/list/useListControls.mjs.map +1 -0
- package/dist/esm/list/useListControls.native.js +244 -0
- package/dist/esm/list/useListControls.native.js.map +1 -0
- package/dist/esm/record/RecordBars.mjs +175 -0
- package/dist/esm/record/RecordBars.mjs.map +1 -0
- package/dist/esm/record/RecordBars.native.js +197 -0
- package/dist/esm/record/RecordBars.native.js.map +1 -0
- package/dist/esm/record/RecordGallery.mjs +42 -0
- package/dist/esm/record/RecordGallery.mjs.map +1 -0
- package/dist/esm/record/RecordGallery.native.js +47 -0
- package/dist/esm/record/RecordGallery.native.js.map +1 -0
- package/dist/esm/record/RecordHero.mjs +205 -0
- package/dist/esm/record/RecordHero.mjs.map +1 -0
- package/dist/esm/record/RecordHero.native.js +213 -0
- package/dist/esm/record/RecordHero.native.js.map +1 -0
- package/dist/esm/record/RecordPage.mjs +305 -0
- package/dist/esm/record/RecordPage.mjs.map +1 -0
- package/dist/esm/record/RecordPage.native.js +336 -0
- package/dist/esm/record/RecordPage.native.js.map +1 -0
- package/dist/esm/record/RecordPager.mjs +100 -0
- package/dist/esm/record/RecordPager.mjs.map +1 -0
- package/dist/esm/record/RecordPager.native.js +102 -0
- package/dist/esm/record/RecordPager.native.js.map +1 -0
- package/dist/esm/record/RecordRows.mjs +101 -0
- package/dist/esm/record/RecordRows.mjs.map +1 -0
- package/dist/esm/record/RecordRows.native.js +112 -0
- package/dist/esm/record/RecordRows.native.js.map +1 -0
- package/dist/esm/record/recordData.mjs +92 -0
- package/dist/esm/record/recordData.mjs.map +1 -0
- package/dist/esm/record/recordData.native.js +156 -0
- package/dist/esm/record/recordData.native.js.map +1 -0
- package/dist/esm/record/recordSections.mjs +5 -0
- package/dist/esm/record/recordSections.mjs.map +1 -0
- package/dist/esm/record/recordSections.native.js +5 -0
- package/dist/esm/record/recordSections.native.js.map +1 -0
- package/dist/esm/useFrappeFacets.mjs +1 -1
- package/dist/esm/useFrappeFacets.mjs.map +1 -1
- package/dist/esm/useFrappeFacets.native.js +1 -1
- package/dist/esm/useFrappeFacets.native.js.map +1 -1
- package/dist/jsx/FrappeCalendar.mjs +1 -1
- package/dist/jsx/FrappeCalendar.mjs.map +1 -1
- package/dist/jsx/FrappeCalendar.native.js +1 -1
- package/dist/jsx/FrappeCalendar.native.js.map +1 -1
- package/dist/jsx/FrappeDashboard.mjs +1 -1
- package/dist/jsx/FrappeDashboard.mjs.map +1 -1
- package/dist/jsx/FrappeDashboard.native.js +1 -1
- package/dist/jsx/FrappeDashboard.native.js.map +1 -1
- package/dist/jsx/FrappeForm.mjs +8 -0
- package/dist/jsx/FrappeForm.mjs.map +1 -1
- package/dist/jsx/FrappeForm.native.js +9 -0
- package/dist/jsx/FrappeForm.native.js.map +1 -1
- package/dist/jsx/FrappeImageView.mjs +1 -1
- package/dist/jsx/FrappeImageView.mjs.map +1 -1
- package/dist/jsx/FrappeImageView.native.js +1 -1
- package/dist/jsx/FrappeImageView.native.js.map +1 -1
- package/dist/jsx/FrappeInsights.mjs +355 -0
- package/dist/jsx/FrappeInsights.mjs.map +1 -0
- package/dist/jsx/FrappeInsights.native.js +447 -0
- package/dist/jsx/FrappeInsights.native.js.map +1 -0
- package/dist/jsx/FrappeLikedBy.mjs +6 -3
- package/dist/jsx/FrappeLikedBy.mjs.map +1 -1
- package/dist/jsx/FrappeLikedBy.native.js +5 -2
- package/dist/jsx/FrappeLikedBy.native.js.map +1 -1
- package/dist/jsx/FrappeListView.mjs +410 -43
- package/dist/jsx/FrappeListView.mjs.map +1 -1
- package/dist/jsx/FrappeListView.native.js +469 -42
- package/dist/jsx/FrappeListView.native.js.map +1 -1
- package/dist/jsx/FrappeNotConfigured.mjs +29 -0
- package/dist/jsx/FrappeNotConfigured.mjs.map +1 -0
- package/dist/jsx/FrappeNotConfigured.native.js +58 -0
- package/dist/jsx/FrappeNotConfigured.native.js.map +1 -0
- package/dist/jsx/FrappeRecordView.mjs +174 -0
- package/dist/jsx/FrappeRecordView.mjs.map +1 -0
- package/dist/jsx/FrappeRecordView.native.js +218 -0
- package/dist/jsx/FrappeRecordView.native.js.map +1 -0
- package/dist/jsx/FrappeReportBuilder.mjs +2 -2
- package/dist/jsx/FrappeReportBuilder.mjs.map +1 -1
- package/dist/jsx/FrappeReportBuilder.native.js +2 -2
- package/dist/jsx/FrappeReportBuilder.native.js.map +1 -1
- package/dist/jsx/FrappeReportView.mjs +1 -1
- package/dist/jsx/FrappeReportView.mjs.map +1 -1
- package/dist/jsx/FrappeReportView.native.js +2 -2
- package/dist/jsx/FrappeReportView.native.js.map +1 -1
- package/dist/jsx/FrappeTreeView.mjs +1 -1
- package/dist/jsx/FrappeTreeView.mjs.map +1 -1
- package/dist/jsx/FrappeTreeView.native.js +1 -1
- package/dist/jsx/desk/awesomebar.mjs +1 -1
- package/dist/jsx/desk/awesomebar.mjs.map +1 -1
- package/dist/jsx/desk/awesomebar.native.js +3 -3
- package/dist/jsx/desk/awesomebar.native.js.map +1 -1
- package/dist/jsx/fields/CodeEditor/index.mjs +2 -2
- package/dist/jsx/fields/CodeEditor/index.mjs.map +1 -1
- package/dist/jsx/fields/CodeEditor/index.native.js +1 -1
- package/dist/jsx/fields/CodeEditor/index.native.js.map +1 -1
- package/dist/jsx/fields/Color/index.mjs +1 -0
- package/dist/jsx/fields/Color/index.mjs.map +1 -1
- package/dist/jsx/fields/Color/index.native.js +1 -0
- package/dist/jsx/fields/Color/index.native.js.map +1 -1
- package/dist/jsx/fields/FileUpload.mjs +2 -2
- package/dist/jsx/fields/FileUpload.mjs.map +1 -1
- package/dist/jsx/fields/FileUpload.native.js +1 -1
- package/dist/jsx/fields/FileUpload.native.js.map +1 -1
- package/dist/jsx/fields/Heading/index.mjs +21 -14
- package/dist/jsx/fields/Heading/index.mjs.map +1 -1
- package/dist/jsx/fields/Heading/index.native.js +22 -13
- package/dist/jsx/fields/Heading/index.native.js.map +1 -1
- package/dist/jsx/fields/MarkdownEditor/index.mjs +2 -1
- package/dist/jsx/fields/MarkdownEditor/index.mjs.map +1 -1
- package/dist/jsx/fields/MarkdownEditor/index.native.js +1 -1
- package/dist/jsx/fields/MarkdownEditor/index.native.js.map +1 -1
- package/dist/jsx/frappeNavigation.mjs +11 -2
- package/dist/jsx/frappeNavigation.mjs.map +1 -1
- package/dist/jsx/frappeNavigation.native.js +13 -2
- package/dist/jsx/frappeNavigation.native.js.map +1 -1
- package/dist/jsx/index.js +14 -2
- package/dist/jsx/index.js.map +1 -1
- package/dist/jsx/index.mjs +14 -2
- package/dist/jsx/index.mjs.map +1 -1
- package/dist/jsx/index.native.js +34 -0
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/insights/InsightsFacetTags.mjs +122 -0
- package/dist/jsx/insights/InsightsFacetTags.mjs.map +1 -0
- package/dist/jsx/insights/InsightsFacetTags.native.js +165 -0
- package/dist/jsx/insights/InsightsFacetTags.native.js.map +1 -0
- package/dist/jsx/insights/InsightsKpiBand.mjs +99 -0
- package/dist/jsx/insights/InsightsKpiBand.mjs.map +1 -0
- package/dist/jsx/insights/InsightsKpiBand.native.js +133 -0
- package/dist/jsx/insights/InsightsKpiBand.native.js.map +1 -0
- package/dist/jsx/insights/InsightsLeaders.mjs +125 -0
- package/dist/jsx/insights/InsightsLeaders.mjs.map +1 -0
- package/dist/jsx/insights/InsightsLeaders.native.js +178 -0
- package/dist/jsx/insights/InsightsLeaders.native.js.map +1 -0
- package/dist/jsx/insights/InsightsRecords.mjs +80 -0
- package/dist/jsx/insights/InsightsRecords.mjs.map +1 -0
- package/dist/jsx/insights/InsightsRecords.native.js +109 -0
- package/dist/jsx/insights/InsightsRecords.native.js.map +1 -0
- package/dist/jsx/insights/InsightsTable.mjs +132 -0
- package/dist/jsx/insights/InsightsTable.mjs.map +1 -0
- package/dist/jsx/insights/InsightsTable.native.js +194 -0
- package/dist/jsx/insights/InsightsTable.native.js.map +1 -0
- package/dist/jsx/insights/insightsData.mjs +82 -0
- package/dist/jsx/insights/insightsData.mjs.map +1 -0
- package/dist/jsx/insights/insightsData.native.js +220 -0
- package/dist/jsx/insights/insightsData.native.js.map +1 -0
- package/dist/jsx/insights/insightsRecord.mjs +9 -0
- package/dist/jsx/insights/insightsRecord.mjs.map +1 -0
- package/dist/jsx/insights/insightsRecord.native.js +38 -0
- package/dist/jsx/insights/insightsRecord.native.js.map +1 -0
- package/dist/jsx/list/FacetBadge.mjs +37 -0
- package/dist/jsx/list/FacetBadge.mjs.map +1 -0
- package/dist/jsx/list/FacetBadge.native.js +66 -0
- package/dist/jsx/list/FacetBadge.native.js.map +1 -0
- package/dist/jsx/list/FacetRail.mjs +174 -0
- package/dist/jsx/list/FacetRail.mjs.map +1 -0
- package/dist/jsx/list/FacetRail.native.js +223 -0
- package/dist/jsx/list/FacetRail.native.js.map +1 -0
- package/dist/jsx/list/ImageWell.mjs +86 -0
- package/dist/jsx/list/ImageWell.mjs.map +1 -0
- package/dist/jsx/list/ImageWell.native.js +126 -0
- package/dist/jsx/list/ImageWell.native.js.map +1 -0
- package/dist/jsx/list/ListControls.mjs +201 -0
- package/dist/jsx/list/ListControls.mjs.map +1 -0
- package/dist/jsx/list/ListControls.native.js +252 -0
- package/dist/jsx/list/ListControls.native.js.map +1 -0
- package/dist/jsx/list/ListToastHost.mjs +18 -0
- package/dist/jsx/list/ListToastHost.mjs.map +1 -0
- package/dist/jsx/list/ListToastHost.native.js +59 -0
- package/dist/jsx/list/ListToastHost.native.js.map +1 -0
- package/dist/jsx/list/RangeFilter.mjs +85 -0
- package/dist/jsx/list/RangeFilter.mjs.map +1 -0
- package/dist/jsx/list/RangeFilter.native.js +135 -0
- package/dist/jsx/list/RangeFilter.native.js.map +1 -0
- package/dist/jsx/list/RecordCard.mjs +208 -0
- package/dist/jsx/list/RecordCard.mjs.map +1 -0
- package/dist/jsx/list/RecordCard.native.js +173 -0
- package/dist/jsx/list/RecordCard.native.js.map +1 -0
- package/dist/jsx/list/ShufflePanel.mjs +87 -0
- package/dist/jsx/list/ShufflePanel.mjs.map +1 -0
- package/dist/jsx/list/ShufflePanel.native.js +139 -0
- package/dist/jsx/list/ShufflePanel.native.js.map +1 -0
- package/dist/jsx/list/facetReading.mjs +45 -0
- package/dist/jsx/list/facetReading.mjs.map +1 -0
- package/dist/jsx/list/facetReading.native.js +163 -0
- package/dist/jsx/list/facetReading.native.js.map +1 -0
- package/dist/jsx/list/favorites.mjs +50 -0
- package/dist/jsx/list/favorites.mjs.map +1 -0
- package/dist/jsx/list/favorites.native.js +91 -0
- package/dist/jsx/list/favorites.native.js.map +1 -0
- package/dist/jsx/list/listState.mjs +71 -0
- package/dist/jsx/list/listState.mjs.map +1 -0
- package/dist/jsx/list/listState.native.js +234 -0
- package/dist/jsx/list/listState.native.js.map +1 -0
- package/dist/jsx/list/recordLook.mjs +10 -0
- package/dist/jsx/list/recordLook.mjs.map +1 -0
- package/dist/jsx/list/recordLook.native.js +39 -0
- package/dist/jsx/list/recordLook.native.js.map +1 -0
- package/dist/jsx/list/useListControls.mjs +164 -0
- package/dist/jsx/list/useListControls.mjs.map +1 -0
- package/dist/jsx/list/useListControls.native.js +272 -0
- package/dist/jsx/list/useListControls.native.js.map +1 -0
- package/dist/jsx/record/RecordBars.mjs +175 -0
- package/dist/jsx/record/RecordBars.mjs.map +1 -0
- package/dist/jsx/record/RecordBars.native.js +225 -0
- package/dist/jsx/record/RecordBars.native.js.map +1 -0
- package/dist/jsx/record/RecordGallery.mjs +42 -0
- package/dist/jsx/record/RecordGallery.mjs.map +1 -0
- package/dist/jsx/record/RecordGallery.native.js +75 -0
- package/dist/jsx/record/RecordGallery.native.js.map +1 -0
- package/dist/jsx/record/RecordHero.mjs +205 -0
- package/dist/jsx/record/RecordHero.mjs.map +1 -0
- package/dist/jsx/record/RecordHero.native.js +250 -0
- package/dist/jsx/record/RecordHero.native.js.map +1 -0
- package/dist/jsx/record/RecordPage.mjs +305 -0
- package/dist/jsx/record/RecordPage.mjs.map +1 -0
- package/dist/jsx/record/RecordPage.native.js +364 -0
- package/dist/jsx/record/RecordPage.native.js.map +1 -0
- package/dist/jsx/record/RecordPager.mjs +100 -0
- package/dist/jsx/record/RecordPager.mjs.map +1 -0
- package/dist/jsx/record/RecordPager.native.js +130 -0
- package/dist/jsx/record/RecordPager.native.js.map +1 -0
- package/dist/jsx/record/RecordRows.mjs +101 -0
- package/dist/jsx/record/RecordRows.mjs.map +1 -0
- package/dist/jsx/record/RecordRows.native.js +140 -0
- package/dist/jsx/record/RecordRows.native.js.map +1 -0
- package/dist/jsx/record/recordData.mjs +92 -0
- package/dist/jsx/record/recordData.mjs.map +1 -0
- package/dist/jsx/record/recordData.native.js +189 -0
- package/dist/jsx/record/recordData.native.js.map +1 -0
- package/dist/jsx/record/recordSections.mjs +5 -0
- package/dist/jsx/record/recordSections.mjs.map +1 -0
- package/dist/jsx/record/recordSections.native.js +33 -0
- package/dist/jsx/record/recordSections.native.js.map +1 -0
- package/dist/jsx/useFrappeFacets.mjs +1 -1
- package/dist/jsx/useFrappeFacets.mjs.map +1 -1
- package/dist/jsx/useFrappeFacets.native.js +1 -1
- package/dist/jsx/useFrappeFacets.native.js.map +1 -1
- package/package.json +16 -16
- package/src/FormSidebar.stories.tsx +2 -0
- package/src/FrappeCalendar.stories.tsx +2 -0
- package/src/FrappeCalendar.tsx +2 -2
- package/src/FrappeChartCard.stories.tsx +2 -0
- package/src/FrappeDashboard.stories.tsx +2 -0
- package/src/FrappeDashboard.tsx +2 -2
- package/src/FrappeForm.tsx +7 -1
- package/src/FrappeImageView.stories.tsx +2 -0
- package/src/FrappeImageView.tsx +2 -1
- package/src/FrappeInsights.spec.tsx +171 -0
- package/src/FrappeInsights.tsx +422 -0
- package/src/FrappeKPICard.stories.tsx +3 -3
- package/src/FrappeKanban.stories.tsx +4 -8
- package/src/FrappeLikedBy.tsx +7 -5
- package/src/FrappeListView.card.spec.tsx +157 -0
- package/src/FrappeListView.controls.spec.tsx +225 -0
- package/src/FrappeListView.seed.spec.tsx +30 -0
- package/src/FrappeListView.stories.tsx +2 -0
- package/src/FrappeListView.tsx +589 -45
- package/src/FrappeNotConfigured.tsx +29 -0
- package/src/FrappeRecordView.spec.tsx +276 -0
- package/src/FrappeRecordView.tsx +231 -0
- package/src/FrappeReportBuilder.tsx +4 -5
- package/src/FrappeReportView.tsx +1 -1
- package/src/FrappeTreeView.tsx +1 -1
- package/src/clientCache.auth.spec.tsx +94 -0
- package/src/desk/DeskFormSidebar.stories.tsx +2 -0
- package/src/desk/DeskShell.stories.tsx +12 -6
- package/src/desk/awesomebar.auth.spec.tsx +77 -0
- package/src/desk/awesomebar.tsx +1 -1
- package/src/fields/CodeEditor/index.tsx +8 -2
- package/src/fields/Color/Color.stories.tsx +2 -0
- package/src/fields/Color/index.tsx +1 -0
- package/src/fields/FileUpload.tsx +8 -2
- package/src/fields/Heading/index.tsx +41 -17
- package/src/fields/MarkdownEditor/index.native.tsx +8 -2
- package/src/fields/MarkdownEditor/index.tsx +8 -1
- package/src/fields/ReadOnly/ReadOnly.stories.tsx +2 -0
- package/src/frappeNavigation.loader.spec.tsx +45 -0
- package/src/frappeNavigation.tsx +32 -1
- package/src/frappeRoutes.notConfigured.spec.tsx +77 -0
- package/src/index.ts +53 -1
- package/src/insights/InsightsFacetTags.tsx +131 -0
- package/src/insights/InsightsKpiBand.tsx +114 -0
- package/src/insights/InsightsLeaders.tsx +146 -0
- package/src/insights/InsightsRecords.tsx +71 -0
- package/src/insights/InsightsTable.tsx +169 -0
- package/src/insights/insightsData.spec.ts +143 -0
- package/src/insights/insightsData.ts +122 -0
- package/src/insights/insightsRecord.ts +36 -0
- package/src/list/FacetBadge.tsx +41 -0
- package/src/list/FacetRail.tsx +235 -0
- package/src/list/ImageWell.tsx +110 -0
- package/src/list/ListControls.tsx +208 -0
- package/src/list/ListToastHost.tsx +27 -0
- package/src/list/RangeFilter.tsx +83 -0
- package/src/list/RecordCard.native.tsx +126 -0
- package/src/list/RecordCard.tsx +260 -0
- package/src/list/ShufflePanel.tsx +107 -0
- package/src/list/facetReading.ts +79 -0
- package/src/list/favorites.spec.ts +80 -0
- package/src/list/favorites.ts +79 -0
- package/src/list/listState.spec.ts +156 -0
- package/src/list/listState.ts +184 -0
- package/src/list/recordLook.ts +37 -0
- package/src/list/useListControls.tsx +223 -0
- package/src/record/RecordBars.tsx +187 -0
- package/src/record/RecordGallery.tsx +47 -0
- package/src/record/RecordHero.tsx +186 -0
- package/src/record/RecordPage.tsx +358 -0
- package/src/record/RecordPager.tsx +97 -0
- package/src/record/RecordRows.tsx +90 -0
- package/src/record/recordData.spec.ts +148 -0
- package/src/record/recordData.ts +124 -0
- package/src/record/recordSections.ts +62 -0
- package/src/schemaForm/SchemaForm.stories.tsx +2 -2
- package/src/useFrappeFacets.ts +14 -7
- package/types/FrappeForm.d.ts +2 -1
- package/types/FrappeForm.d.ts.map +1 -1
- package/types/FrappeImageView.d.ts.map +1 -1
- package/types/FrappeInsights.d.ts +55 -0
- package/types/FrappeInsights.d.ts.map +1 -0
- package/types/FrappeLikedBy.d.ts.map +1 -1
- package/types/FrappeListView.d.ts +85 -3
- package/types/FrappeListView.d.ts.map +1 -1
- package/types/FrappeNotConfigured.d.ts +11 -0
- package/types/FrappeNotConfigured.d.ts.map +1 -0
- package/types/FrappeRecordView.d.ts +69 -0
- package/types/FrappeRecordView.d.ts.map +1 -0
- package/types/FrappeReportBuilder.d.ts.map +1 -1
- package/types/fields/CodeEditor/index.d.ts.map +1 -1
- package/types/fields/Color/index.d.ts.map +1 -1
- package/types/fields/FileUpload.d.ts.map +1 -1
- package/types/fields/Heading/index.d.ts.map +1 -1
- package/types/fields/MarkdownEditor/index.d.ts.map +1 -1
- package/types/fields/MarkdownEditor/index.native.d.ts.map +1 -1
- package/types/frappeNavigation.d.ts +21 -0
- package/types/frappeNavigation.d.ts.map +1 -1
- package/types/index.d.ts +14 -2
- package/types/index.d.ts.map +1 -1
- package/types/insights/InsightsFacetTags.d.ts +11 -0
- package/types/insights/InsightsFacetTags.d.ts.map +1 -0
- package/types/insights/InsightsKpiBand.d.ts +22 -0
- package/types/insights/InsightsKpiBand.d.ts.map +1 -0
- package/types/insights/InsightsLeaders.d.ts +16 -0
- package/types/insights/InsightsLeaders.d.ts.map +1 -0
- package/types/insights/InsightsRecords.d.ts +19 -0
- package/types/insights/InsightsRecords.d.ts.map +1 -0
- package/types/insights/InsightsTable.d.ts +17 -0
- package/types/insights/InsightsTable.d.ts.map +1 -0
- package/types/insights/insightsData.d.ts +45 -0
- package/types/insights/insightsData.d.ts.map +1 -0
- package/types/insights/insightsRecord.d.ts +29 -0
- package/types/insights/insightsRecord.d.ts.map +1 -0
- package/types/list/FacetBadge.d.ts +13 -0
- package/types/list/FacetBadge.d.ts.map +1 -0
- package/types/list/FacetRail.d.ts +26 -0
- package/types/list/FacetRail.d.ts.map +1 -0
- package/types/list/ImageWell.d.ts +24 -0
- package/types/list/ImageWell.d.ts.map +1 -0
- package/types/list/ListControls.d.ts +30 -0
- package/types/list/ListControls.d.ts.map +1 -0
- package/types/list/ListToastHost.d.ts +7 -0
- package/types/list/ListToastHost.d.ts.map +1 -0
- package/types/list/RangeFilter.d.ts +14 -0
- package/types/list/RangeFilter.d.ts.map +1 -0
- package/types/list/RecordCard.d.ts +38 -0
- package/types/list/RecordCard.d.ts.map +1 -0
- package/types/list/RecordCard.native.d.ts +9 -0
- package/types/list/RecordCard.native.d.ts.map +1 -0
- package/types/list/ShufflePanel.d.ts +24 -0
- package/types/list/ShufflePanel.d.ts.map +1 -0
- package/types/list/facetReading.d.ts +33 -0
- package/types/list/facetReading.d.ts.map +1 -0
- package/types/list/favorites.d.ts +26 -0
- package/types/list/favorites.d.ts.map +1 -0
- package/types/list/listState.d.ts +94 -0
- package/types/list/listState.d.ts.map +1 -0
- package/types/list/recordLook.d.ts +25 -0
- package/types/list/recordLook.d.ts.map +1 -0
- package/types/list/useListControls.d.ts +48 -0
- package/types/list/useListControls.d.ts.map +1 -0
- package/types/record/RecordBars.d.ts +11 -0
- package/types/record/RecordBars.d.ts.map +1 -0
- package/types/record/RecordGallery.d.ts +17 -0
- package/types/record/RecordGallery.d.ts.map +1 -0
- package/types/record/RecordHero.d.ts +42 -0
- package/types/record/RecordHero.d.ts.map +1 -0
- package/types/record/RecordPage.d.ts +54 -0
- package/types/record/RecordPage.d.ts.map +1 -0
- package/types/record/RecordPager.d.ts +13 -0
- package/types/record/RecordPager.d.ts.map +1 -0
- package/types/record/RecordRows.d.ts +13 -0
- package/types/record/RecordRows.d.ts.map +1 -0
- package/types/record/recordData.d.ts +46 -0
- package/types/record/recordData.d.ts.map +1 -0
- package/types/record/recordSections.d.ts +67 -0
- package/types/record/recordSections.d.ts.map +1 -0
- package/types/useFrappeFacets.d.ts.map +1 -1
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { Tags, Text, XStack, isWeb } from "@multiplatform.one/components";
|
|
2
|
+
import {
|
|
3
|
+
ensureFocusVisibleRing,
|
|
4
|
+
ensureKeyboardModalityTracking,
|
|
5
|
+
keyboardFocusRingProps,
|
|
6
|
+
useResolvedKnobs,
|
|
7
|
+
wasKeyboardFocus,
|
|
8
|
+
} from "@multiplatform.one/theme";
|
|
9
|
+
import { useState } from "react";
|
|
10
|
+
import { useTranslation } from "react-i18next";
|
|
11
|
+
import type { InsightsCount } from "./insightsData";
|
|
12
|
+
|
|
13
|
+
const chipFocusRing = ensureFocusVisibleRing(keyboardFocusRingProps);
|
|
14
|
+
|
|
15
|
+
interface FacetTagChipProps {
|
|
16
|
+
value: string;
|
|
17
|
+
count: number;
|
|
18
|
+
label: string;
|
|
19
|
+
tint?: string;
|
|
20
|
+
onPress: () => void;
|
|
21
|
+
testID?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* A pressable facet value painted from its tint's ramp (DF-04), at the
|
|
26
|
+
* compact nestedControl height with the press target restored by hitSlop
|
|
27
|
+
* (LC-54, LC-73); the keyboard ring rides the whole chip (LC-71).
|
|
28
|
+
*/
|
|
29
|
+
function FacetTagChip({ value, count, label, tint = "gray", onPress, testID }: FacetTagChipProps) {
|
|
30
|
+
const { t } = useTranslation();
|
|
31
|
+
const { knobProps } = useResolvedKnobs({ compact: true });
|
|
32
|
+
const nested = knobProps.nestedControl;
|
|
33
|
+
const [kbFocus, setKbFocus] = useState(false);
|
|
34
|
+
if (isWeb) ensureKeyboardModalityTracking();
|
|
35
|
+
return (
|
|
36
|
+
<XStack
|
|
37
|
+
{...knobProps.borderRadius}
|
|
38
|
+
role="button"
|
|
39
|
+
tabIndex={0}
|
|
40
|
+
aria-label={t("{{value}}, {{count}} records", { value: label, count })}
|
|
41
|
+
cursor="pointer"
|
|
42
|
+
alignItems="center"
|
|
43
|
+
gap="$1.5"
|
|
44
|
+
paddingHorizontal="$2"
|
|
45
|
+
minHeight={nested.px}
|
|
46
|
+
height={nested.px}
|
|
47
|
+
hitSlop={nested.hitSlop}
|
|
48
|
+
data-nested-px={nested.px}
|
|
49
|
+
backgroundColor={`$${tint}3` as never}
|
|
50
|
+
hoverStyle={{ backgroundColor: `$${tint}4` as never }}
|
|
51
|
+
pressStyle={{ backgroundColor: `$${tint}5` as never }}
|
|
52
|
+
outlineWidth={0}
|
|
53
|
+
focusStyle={{ outlineWidth: 0 }}
|
|
54
|
+
focusVisibleStyle={chipFocusRing}
|
|
55
|
+
{...(isWeb
|
|
56
|
+
? {
|
|
57
|
+
onFocus: () => {
|
|
58
|
+
if (wasKeyboardFocus()) setKbFocus(true);
|
|
59
|
+
},
|
|
60
|
+
onBlur: () => setKbFocus(false),
|
|
61
|
+
onKeyDown: (event: { key?: string; preventDefault?: () => void }) => {
|
|
62
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
63
|
+
event.preventDefault?.();
|
|
64
|
+
onPress();
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
}
|
|
68
|
+
: undefined)}
|
|
69
|
+
{...(kbFocus ? keyboardFocusRingProps : undefined)}
|
|
70
|
+
onPress={onPress}
|
|
71
|
+
testID={testID ? `${testID}-${value}` : undefined}
|
|
72
|
+
>
|
|
73
|
+
<XStack
|
|
74
|
+
width="$1"
|
|
75
|
+
height="$1"
|
|
76
|
+
borderRadius={1000}
|
|
77
|
+
backgroundColor={`$${tint}9` as never}
|
|
78
|
+
flexShrink={0}
|
|
79
|
+
/>
|
|
80
|
+
<Text
|
|
81
|
+
{...knobProps.label}
|
|
82
|
+
fontWeight="600"
|
|
83
|
+
color={`$${tint}11` as never}
|
|
84
|
+
textTransform="capitalize"
|
|
85
|
+
userSelect="none"
|
|
86
|
+
>
|
|
87
|
+
{label}
|
|
88
|
+
</Text>
|
|
89
|
+
<Text {...knobProps.label} color={`$${tint}11` as never} opacity={0.7} userSelect="none">
|
|
90
|
+
{count}
|
|
91
|
+
</Text>
|
|
92
|
+
</XStack>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface InsightsFacetTagsProps {
|
|
97
|
+
distribution: readonly InsightsCount[];
|
|
98
|
+
label: (value: string) => string;
|
|
99
|
+
tint?: (value: string) => string | undefined;
|
|
100
|
+
onSelect: (value: string) => void;
|
|
101
|
+
testID?: string;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** A facet's values with their record counts, each opening the list narrowed to it. */
|
|
105
|
+
export function InsightsFacetTags({
|
|
106
|
+
distribution,
|
|
107
|
+
label,
|
|
108
|
+
tint,
|
|
109
|
+
onSelect,
|
|
110
|
+
testID,
|
|
111
|
+
}: InsightsFacetTagsProps) {
|
|
112
|
+
const { t } = useTranslation();
|
|
113
|
+
return (
|
|
114
|
+
<Tags
|
|
115
|
+
tags={distribution.map((entry) => ({ id: entry.value, label: label(entry.value) }))}
|
|
116
|
+
enableAdd={false}
|
|
117
|
+
enableRemove={false}
|
|
118
|
+
labels={{ noTags: t("No values yet") }}
|
|
119
|
+
renderTag={(tag) => (
|
|
120
|
+
<FacetTagChip
|
|
121
|
+
value={tag.id}
|
|
122
|
+
count={distribution.find((entry) => entry.value === tag.id)?.count ?? 0}
|
|
123
|
+
label={tag.label}
|
|
124
|
+
tint={tint?.(tag.id)}
|
|
125
|
+
onPress={() => onSelect(tag.id)}
|
|
126
|
+
testID={testID}
|
|
127
|
+
/>
|
|
128
|
+
)}
|
|
129
|
+
/>
|
|
130
|
+
);
|
|
131
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import {
|
|
2
|
+
KPICard,
|
|
3
|
+
Sparkline,
|
|
4
|
+
Text,
|
|
5
|
+
XStack,
|
|
6
|
+
YStack,
|
|
7
|
+
type ChartConfig,
|
|
8
|
+
type KPICardConfig,
|
|
9
|
+
} from "@multiplatform.one/components";
|
|
10
|
+
import { useResolvedKnobs } from "@multiplatform.one/theme";
|
|
11
|
+
import { ChartCard } from "../ChartCard";
|
|
12
|
+
|
|
13
|
+
export interface InsightsTile {
|
|
14
|
+
id: string;
|
|
15
|
+
title: string;
|
|
16
|
+
value: string | number;
|
|
17
|
+
hint?: string;
|
|
18
|
+
spark?: number[];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface InsightsKpiBandProps {
|
|
22
|
+
hero: KPICardConfig;
|
|
23
|
+
tiles: readonly InsightsTile[];
|
|
24
|
+
charts: readonly ChartConfig[];
|
|
25
|
+
testID?: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A supporting metric beside the hero (LC-73): compact density and the
|
|
30
|
+
* label type, painted below the page's 44px floor.
|
|
31
|
+
*/
|
|
32
|
+
function NestedKpi({ tile, testID }: { tile: InsightsTile; testID?: string }) {
|
|
33
|
+
const { knobProps } = useResolvedKnobs({ compact: true });
|
|
34
|
+
const nestedPx = knobProps.nestedControl.px;
|
|
35
|
+
return (
|
|
36
|
+
<YStack
|
|
37
|
+
{...knobProps.cardSurface}
|
|
38
|
+
backgroundColor="$color2"
|
|
39
|
+
flexGrow={1}
|
|
40
|
+
flexShrink={1}
|
|
41
|
+
flexBasis={140}
|
|
42
|
+
minWidth={0}
|
|
43
|
+
justifyContent="space-between"
|
|
44
|
+
{...knobProps.gap}
|
|
45
|
+
data-nested-px={nestedPx}
|
|
46
|
+
testID={testID}
|
|
47
|
+
>
|
|
48
|
+
<Text {...knobProps.label} color="$color10" numberOfLines={1}>
|
|
49
|
+
{tile.title}
|
|
50
|
+
</Text>
|
|
51
|
+
<Text fontSize="$7" fontWeight="700" color="$color" numberOfLines={1}>
|
|
52
|
+
{tile.value}
|
|
53
|
+
</Text>
|
|
54
|
+
{tile.hint ? (
|
|
55
|
+
<Text {...knobProps.label} color="$color10" numberOfLines={1}>
|
|
56
|
+
{tile.hint}
|
|
57
|
+
</Text>
|
|
58
|
+
) : null}
|
|
59
|
+
{tile.spark && tile.spark.length > 1 ? (
|
|
60
|
+
<Sparkline data={tile.spark} height={nestedPx} showArea title={tile.title} />
|
|
61
|
+
) : null}
|
|
62
|
+
</YStack>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* The hero count with its denser companions, then the charts. Rows wrap on
|
|
68
|
+
* flexBasis rather than riding the catalog Dashboard grid, whose percent
|
|
69
|
+
* widths plus its gap overflow a row that sums to 100%. Every child shrinks
|
|
70
|
+
* so a line narrower than one tile stays inside its frame (LC-10).
|
|
71
|
+
*/
|
|
72
|
+
export function InsightsKpiBand({ hero, tiles, charts, testID }: InsightsKpiBandProps) {
|
|
73
|
+
const { knobProps } = useResolvedKnobs();
|
|
74
|
+
return (
|
|
75
|
+
<YStack {...knobProps.gapLg} testID={testID}>
|
|
76
|
+
<XStack {...knobProps.gap} flexWrap="wrap" alignItems="stretch">
|
|
77
|
+
<KPICard config={hero} flexGrow={2} flexShrink={1} flexBasis={260} />
|
|
78
|
+
{tiles.length > 0 ? (
|
|
79
|
+
<XStack
|
|
80
|
+
{...knobProps.gap}
|
|
81
|
+
flexWrap="wrap"
|
|
82
|
+
flexGrow={3}
|
|
83
|
+
flexShrink={1}
|
|
84
|
+
flexBasis={420}
|
|
85
|
+
minWidth={0}
|
|
86
|
+
>
|
|
87
|
+
{tiles.map((tile) => (
|
|
88
|
+
<NestedKpi
|
|
89
|
+
key={tile.id}
|
|
90
|
+
tile={tile}
|
|
91
|
+
testID={testID ? `${testID}-kpi-${tile.id}` : undefined}
|
|
92
|
+
/>
|
|
93
|
+
))}
|
|
94
|
+
</XStack>
|
|
95
|
+
) : null}
|
|
96
|
+
</XStack>
|
|
97
|
+
{charts.length > 0 ? (
|
|
98
|
+
<XStack {...knobProps.gap} flexWrap="wrap" alignItems="stretch">
|
|
99
|
+
{charts.map((chart, index) => (
|
|
100
|
+
<ChartCard
|
|
101
|
+
key={chart.id}
|
|
102
|
+
config={chart}
|
|
103
|
+
flexGrow={index === 0 ? 3 : 2}
|
|
104
|
+
flexShrink={1}
|
|
105
|
+
flexBasis={index === 0 ? 420 : 320}
|
|
106
|
+
minWidth={0}
|
|
107
|
+
minHeight={240}
|
|
108
|
+
/>
|
|
109
|
+
))}
|
|
110
|
+
</XStack>
|
|
111
|
+
) : null}
|
|
112
|
+
</YStack>
|
|
113
|
+
);
|
|
114
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { Tabs, Text, XStack, YStack } from "@multiplatform.one/components";
|
|
2
|
+
import { DataTable, type DataTableColumn, type DataTableData } from "@multiplatform.one/table";
|
|
3
|
+
import { useResolvedKnobs } from "@multiplatform.one/theme";
|
|
4
|
+
import { useMemo, useState } from "react";
|
|
5
|
+
import { useTranslation } from "react-i18next";
|
|
6
|
+
import { ImageWell } from "../list/ImageWell";
|
|
7
|
+
import { topBy } from "./insightsData";
|
|
8
|
+
import {
|
|
9
|
+
formatMetric,
|
|
10
|
+
metricValue,
|
|
11
|
+
type FrappeInsightsMetric,
|
|
12
|
+
type InsightsRecordView,
|
|
13
|
+
} from "./insightsRecord";
|
|
14
|
+
|
|
15
|
+
interface LeaderRow<TDoc> extends DataTableData {
|
|
16
|
+
rank: number;
|
|
17
|
+
doc: TDoc;
|
|
18
|
+
title: string;
|
|
19
|
+
value: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface InsightsLeadersProps<TDoc> {
|
|
23
|
+
rows: readonly TDoc[];
|
|
24
|
+
metrics: readonly FrappeInsightsMetric[];
|
|
25
|
+
record: InsightsRecordView<TDoc>;
|
|
26
|
+
/** Rows per metric. */
|
|
27
|
+
count?: number;
|
|
28
|
+
testID?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The top records by a metric the reader picks on a contained tab strip,
|
|
33
|
+
* in one compact read-only DataTable; a row opens its record. Nested cell
|
|
34
|
+
* chrome uses the compact nestedControl and label type (LC-73).
|
|
35
|
+
*/
|
|
36
|
+
export function InsightsLeaders<TDoc>({
|
|
37
|
+
rows,
|
|
38
|
+
metrics,
|
|
39
|
+
record,
|
|
40
|
+
count = 5,
|
|
41
|
+
testID,
|
|
42
|
+
}: InsightsLeadersProps<TDoc>) {
|
|
43
|
+
const { t } = useTranslation();
|
|
44
|
+
const { knobProps } = useResolvedKnobs({ compact: true });
|
|
45
|
+
const [field, setField] = useState(metrics[0]?.field ?? "");
|
|
46
|
+
const metric = metrics.find((candidate) => candidate.field === field) ?? metrics[0];
|
|
47
|
+
const nestedPx = knobProps.nestedControl.px;
|
|
48
|
+
|
|
49
|
+
const leaders = useMemo<LeaderRow<TDoc>[]>(
|
|
50
|
+
() =>
|
|
51
|
+
metric
|
|
52
|
+
? topBy(rows as never[], metric.field, count).map((doc: TDoc, index) => ({
|
|
53
|
+
rank: index + 1,
|
|
54
|
+
doc,
|
|
55
|
+
title: record.title(doc),
|
|
56
|
+
value: metricValue(doc, metric.field),
|
|
57
|
+
}))
|
|
58
|
+
: [],
|
|
59
|
+
[rows, metric, count, record],
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
const columns = useMemo<DataTableColumn<LeaderRow<TDoc>>[]>(
|
|
63
|
+
() => [
|
|
64
|
+
{
|
|
65
|
+
id: "rank",
|
|
66
|
+
accessorKey: "rank",
|
|
67
|
+
header: t("Rank"),
|
|
68
|
+
size: 64,
|
|
69
|
+
cell: ({ row }) => (
|
|
70
|
+
<Text {...knobProps.label} color="$color10" fontWeight="600">
|
|
71
|
+
{`#${row.original.rank}`}
|
|
72
|
+
</Text>
|
|
73
|
+
),
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: "record",
|
|
77
|
+
accessorKey: "title",
|
|
78
|
+
header: t("Record"),
|
|
79
|
+
cell: ({ row }) => {
|
|
80
|
+
const tints = record.tints(row.original.doc);
|
|
81
|
+
const code = record.code(row.original.doc);
|
|
82
|
+
return (
|
|
83
|
+
<XStack gap="$2" alignItems="center" minWidth={0}>
|
|
84
|
+
<ImageWell
|
|
85
|
+
sources={record.images(row.original.doc)}
|
|
86
|
+
alt={row.original.title}
|
|
87
|
+
tints={tints}
|
|
88
|
+
inset={0.04}
|
|
89
|
+
width={nestedPx}
|
|
90
|
+
data-nested-px={nestedPx}
|
|
91
|
+
/>
|
|
92
|
+
<YStack flexShrink={1} minWidth={0}>
|
|
93
|
+
<Text fontWeight="600" numberOfLines={1}>
|
|
94
|
+
{row.original.title}
|
|
95
|
+
</Text>
|
|
96
|
+
{code ? (
|
|
97
|
+
<Text {...knobProps.label} color="$color10">
|
|
98
|
+
{code}
|
|
99
|
+
</Text>
|
|
100
|
+
) : null}
|
|
101
|
+
</YStack>
|
|
102
|
+
</XStack>
|
|
103
|
+
);
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
id: "value",
|
|
108
|
+
accessorKey: "value",
|
|
109
|
+
header: metric?.label ?? "",
|
|
110
|
+
align: "right",
|
|
111
|
+
cell: ({ row }) => (
|
|
112
|
+
<Text fontWeight="700">{metric ? formatMetric(metric, row.original.value) : ""}</Text>
|
|
113
|
+
),
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
[t, metric, record, nestedPx, knobProps.label],
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
if (!metric) return null;
|
|
120
|
+
return (
|
|
121
|
+
<YStack {...knobProps.gap} testID={testID}>
|
|
122
|
+
{metrics.length > 1 ? (
|
|
123
|
+
<Tabs
|
|
124
|
+
variant="contained"
|
|
125
|
+
compact
|
|
126
|
+
value={metric.field}
|
|
127
|
+
onChange={setField}
|
|
128
|
+
items={metrics.map((candidate) => ({ value: candidate.field, label: candidate.label }))}
|
|
129
|
+
/>
|
|
130
|
+
) : null}
|
|
131
|
+
<DataTable
|
|
132
|
+
data={leaders}
|
|
133
|
+
columns={columns}
|
|
134
|
+
enableFiltering={false}
|
|
135
|
+
enableGlobalSearch={false}
|
|
136
|
+
enableSorting={false}
|
|
137
|
+
enablePagination={false}
|
|
138
|
+
readOnly
|
|
139
|
+
columnLayout="auto"
|
|
140
|
+
onRowPress={(row) => record.open(row.doc)}
|
|
141
|
+
rowLabel={(row) => row.title}
|
|
142
|
+
aria-label={t("Leaders by {{metric}}", { metric: metric.label })}
|
|
143
|
+
/>
|
|
144
|
+
</YStack>
|
|
145
|
+
);
|
|
146
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Text, XStack, YStack } from "@multiplatform.one/components";
|
|
2
|
+
import { useResolvedKnobs } from "@multiplatform.one/theme";
|
|
3
|
+
import { ImageWell } from "../list/ImageWell";
|
|
4
|
+
import type { InsightsRecordView } from "./insightsRecord";
|
|
5
|
+
|
|
6
|
+
export interface InsightsRecordTile<TDoc> {
|
|
7
|
+
id: string;
|
|
8
|
+
label: string;
|
|
9
|
+
doc: TDoc;
|
|
10
|
+
value: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface InsightsRecordsProps<TDoc> {
|
|
14
|
+
tiles: readonly InsightsRecordTile<TDoc>[];
|
|
15
|
+
record: InsightsRecordView<TDoc>;
|
|
16
|
+
testID?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Record holders as quiet fact tiles: the holder's tinted image well, its
|
|
21
|
+
* title and code, and the value. Nested chrome steps with the compact
|
|
22
|
+
* nestedControl, not the page's 44px floor (LC-73).
|
|
23
|
+
*/
|
|
24
|
+
export function InsightsRecords<TDoc>({ tiles, record, testID }: InsightsRecordsProps<TDoc>) {
|
|
25
|
+
const { knobProps } = useResolvedKnobs({ compact: true });
|
|
26
|
+
const { knobProps: pageKnobs } = useResolvedKnobs();
|
|
27
|
+
const wellPx = knobProps.nestedControl.px * 2;
|
|
28
|
+
return (
|
|
29
|
+
<XStack {...pageKnobs.gap} flexWrap="wrap" testID={testID}>
|
|
30
|
+
{tiles.map((tile) => {
|
|
31
|
+
const title = record.title(tile.doc);
|
|
32
|
+
const code = record.code(tile.doc);
|
|
33
|
+
const tints = record.tints(tile.doc);
|
|
34
|
+
return (
|
|
35
|
+
<XStack
|
|
36
|
+
key={tile.id}
|
|
37
|
+
{...knobProps.cardSurface}
|
|
38
|
+
backgroundColor="$color2"
|
|
39
|
+
flexGrow={1}
|
|
40
|
+
flexBasis={220}
|
|
41
|
+
alignItems="center"
|
|
42
|
+
minWidth={0}
|
|
43
|
+
{...knobProps.gap}
|
|
44
|
+
>
|
|
45
|
+
<YStack width={wellPx} flexShrink={0} data-nested-px={knobProps.nestedControl.px}>
|
|
46
|
+
<ImageWell sources={record.images(tile.doc)} alt={title} tints={tints} inset={0.04} />
|
|
47
|
+
</YStack>
|
|
48
|
+
<YStack gap="$1" flexShrink={1} minWidth={0}>
|
|
49
|
+
<Text {...knobProps.label} color="$color10">
|
|
50
|
+
{tile.label}
|
|
51
|
+
</Text>
|
|
52
|
+
<XStack gap="$1.5" alignItems="baseline" flexWrap="wrap" minWidth={0}>
|
|
53
|
+
<Text fontWeight="700" numberOfLines={1} flexShrink={1}>
|
|
54
|
+
{title}
|
|
55
|
+
</Text>
|
|
56
|
+
{code ? (
|
|
57
|
+
<Text {...knobProps.label} color="$color10" fontWeight="600">
|
|
58
|
+
{code}
|
|
59
|
+
</Text>
|
|
60
|
+
) : null}
|
|
61
|
+
</XStack>
|
|
62
|
+
<Text fontSize="$6" fontWeight="700">
|
|
63
|
+
{tile.value}
|
|
64
|
+
</Text>
|
|
65
|
+
</YStack>
|
|
66
|
+
</XStack>
|
|
67
|
+
);
|
|
68
|
+
})}
|
|
69
|
+
</XStack>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { Avatar, Text, XStack, YStack } from "@multiplatform.one/components";
|
|
2
|
+
import { DataTable, type DataTableColumn, type DataTableData } from "@multiplatform.one/table";
|
|
3
|
+
import { useResolvedKnobs } from "@multiplatform.one/theme";
|
|
4
|
+
import { useMemo } from "react";
|
|
5
|
+
import { useTranslation } from "react-i18next";
|
|
6
|
+
import { FacetBadge } from "../list/FacetBadge";
|
|
7
|
+
import {
|
|
8
|
+
formatMetric,
|
|
9
|
+
metricValue,
|
|
10
|
+
type FrappeInsightsMetric,
|
|
11
|
+
type InsightsRecordView,
|
|
12
|
+
} from "./insightsRecord";
|
|
13
|
+
|
|
14
|
+
interface TableRow<TDoc> extends DataTableData {
|
|
15
|
+
doc: TDoc;
|
|
16
|
+
code: string;
|
|
17
|
+
title: string;
|
|
18
|
+
values: string[];
|
|
19
|
+
[metric: string]: unknown;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface InsightsTableProps<TDoc> {
|
|
23
|
+
rows: readonly TDoc[];
|
|
24
|
+
metrics: readonly FrappeInsightsMetric[];
|
|
25
|
+
record: InsightsRecordView<TDoc>;
|
|
26
|
+
/** Header of the facet column; without it, no facet column. */
|
|
27
|
+
facetLabel?: string;
|
|
28
|
+
pageSize?: number;
|
|
29
|
+
label: string;
|
|
30
|
+
testID?: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Every record in the catalog DataTable: sortable metric columns, a pager,
|
|
35
|
+
* and the stacked card layout below `$sm`. A row opens its record.
|
|
36
|
+
*/
|
|
37
|
+
export function InsightsTable<TDoc>({
|
|
38
|
+
rows,
|
|
39
|
+
metrics,
|
|
40
|
+
record,
|
|
41
|
+
facetLabel,
|
|
42
|
+
pageSize = 5,
|
|
43
|
+
label,
|
|
44
|
+
testID,
|
|
45
|
+
}: InsightsTableProps<TDoc>) {
|
|
46
|
+
const { t } = useTranslation();
|
|
47
|
+
const { knobProps } = useResolvedKnobs({ compact: true });
|
|
48
|
+
const nestedPx = knobProps.nestedControl.px;
|
|
49
|
+
const hasCode = rows.some((doc) => Boolean(record.code(doc)));
|
|
50
|
+
|
|
51
|
+
const data = useMemo<TableRow<TDoc>[]>(
|
|
52
|
+
() =>
|
|
53
|
+
rows.map((doc) => ({
|
|
54
|
+
doc,
|
|
55
|
+
code: record.code(doc) ?? "",
|
|
56
|
+
title: record.title(doc),
|
|
57
|
+
values: record.values(doc),
|
|
58
|
+
...Object.fromEntries(
|
|
59
|
+
metrics.map((metric) => [metric.field, metricValue(doc, metric.field)]),
|
|
60
|
+
),
|
|
61
|
+
})),
|
|
62
|
+
[rows, metrics, record],
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
const columns = useMemo<DataTableColumn<TableRow<TDoc>>[]>(
|
|
66
|
+
() => [
|
|
67
|
+
...(hasCode
|
|
68
|
+
? [
|
|
69
|
+
{
|
|
70
|
+
id: "code",
|
|
71
|
+
accessorKey: "code",
|
|
72
|
+
header: t("No."),
|
|
73
|
+
size: 72,
|
|
74
|
+
cell: ({ row }: { row: { original: TableRow<TDoc> } }) => (
|
|
75
|
+
<Text {...knobProps.label} color="$color10" fontWeight="600">
|
|
76
|
+
{row.original.code}
|
|
77
|
+
</Text>
|
|
78
|
+
),
|
|
79
|
+
} satisfies DataTableColumn<TableRow<TDoc>>,
|
|
80
|
+
]
|
|
81
|
+
: []),
|
|
82
|
+
{
|
|
83
|
+
id: "record",
|
|
84
|
+
accessorKey: "title",
|
|
85
|
+
header: t("Record"),
|
|
86
|
+
cell: ({ row }) => (
|
|
87
|
+
<XStack gap="$2" alignItems="center" minWidth={0}>
|
|
88
|
+
<Avatar
|
|
89
|
+
src={record.images(row.original.doc)[0] || undefined}
|
|
90
|
+
name={row.original.title}
|
|
91
|
+
fallbackBackgroundColor="$color4"
|
|
92
|
+
size={nestedPx}
|
|
93
|
+
data-nested-px={nestedPx}
|
|
94
|
+
/>
|
|
95
|
+
<YStack flexShrink={1} minWidth={0}>
|
|
96
|
+
<Text fontWeight="600" numberOfLines={1}>
|
|
97
|
+
{row.original.title}
|
|
98
|
+
</Text>
|
|
99
|
+
</YStack>
|
|
100
|
+
</XStack>
|
|
101
|
+
),
|
|
102
|
+
},
|
|
103
|
+
...(facetLabel
|
|
104
|
+
? [
|
|
105
|
+
{
|
|
106
|
+
id: "facet",
|
|
107
|
+
header: facetLabel,
|
|
108
|
+
accessorFn: (row: TableRow<TDoc>) => row.values.join(", "),
|
|
109
|
+
enableSorting: false,
|
|
110
|
+
sortable: false,
|
|
111
|
+
cell: ({ row }: { row: { original: TableRow<TDoc> } }) => (
|
|
112
|
+
<XStack gap="$1.5" flexWrap="wrap">
|
|
113
|
+
{row.original.values.length > 0 ? (
|
|
114
|
+
row.original.values.map((value) => (
|
|
115
|
+
<FacetBadge
|
|
116
|
+
key={value}
|
|
117
|
+
label={record.valueLabel(value)}
|
|
118
|
+
tint={record.valueTint(value)}
|
|
119
|
+
compact
|
|
120
|
+
/>
|
|
121
|
+
))
|
|
122
|
+
) : (
|
|
123
|
+
<Text {...knobProps.label} color="$color10">
|
|
124
|
+
—
|
|
125
|
+
</Text>
|
|
126
|
+
)}
|
|
127
|
+
</XStack>
|
|
128
|
+
),
|
|
129
|
+
} satisfies DataTableColumn<TableRow<TDoc>>,
|
|
130
|
+
]
|
|
131
|
+
: []),
|
|
132
|
+
...metrics.map(
|
|
133
|
+
(metric, index) =>
|
|
134
|
+
({
|
|
135
|
+
id: metric.field,
|
|
136
|
+
accessorKey: metric.field,
|
|
137
|
+
header: metric.label,
|
|
138
|
+
align: "right",
|
|
139
|
+
cell: ({ row }: { row: { original: TableRow<TDoc> } }) => (
|
|
140
|
+
<Text fontWeight={index === 0 ? "700" : undefined}>
|
|
141
|
+
{formatMetric(metric, row.original[metric.field] as number)}
|
|
142
|
+
</Text>
|
|
143
|
+
),
|
|
144
|
+
}) satisfies DataTableColumn<TableRow<TDoc>>,
|
|
145
|
+
),
|
|
146
|
+
],
|
|
147
|
+
[t, hasCode, facetLabel, metrics, record, nestedPx, knobProps.label],
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
return (
|
|
151
|
+
<YStack testID={testID}>
|
|
152
|
+
<DataTable
|
|
153
|
+
data={data}
|
|
154
|
+
columns={columns}
|
|
155
|
+
enableFiltering={false}
|
|
156
|
+
enableGlobalSearch={false}
|
|
157
|
+
enableSorting
|
|
158
|
+
enablePagination
|
|
159
|
+
pageSizeOptions={[pageSize, pageSize * 2, pageSize * 5]}
|
|
160
|
+
initialState={{ pagination: { pageIndex: 0, pageSize } }}
|
|
161
|
+
readOnly
|
|
162
|
+
columnLayout="auto"
|
|
163
|
+
onRowPress={(row) => record.open(row.doc)}
|
|
164
|
+
rowLabel={(row) => row.title}
|
|
165
|
+
aria-label={label}
|
|
166
|
+
/>
|
|
167
|
+
</YStack>
|
|
168
|
+
);
|
|
169
|
+
}
|