@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
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { InMemoryFixtureProvider } from "@multiplatform.one/frappe";
|
|
2
2
|
import { action } from "@multiplatform.one/storybook";
|
|
3
3
|
import { Text, YStack } from "@multiplatform.one/components";
|
|
4
|
+
import { sizeRecipeEscape } from "@multiplatform.one/theme";
|
|
4
5
|
import { FrappeProvider } from "../FrappeProvider";
|
|
5
6
|
import { DeskShell } from "./DeskShell";
|
|
6
7
|
|
|
8
|
+
const frameHeight = sizeRecipeEscape(
|
|
9
|
+
640,
|
|
10
|
+
"story canvas: a fixed-height frame for a full-height screen to fill",
|
|
11
|
+
);
|
|
12
|
+
|
|
7
13
|
export default {
|
|
8
14
|
title: "FrappeUI/Desk/DeskShell",
|
|
9
15
|
component: DeskShell,
|
|
@@ -85,7 +91,7 @@ const content = (blocks: number) => (
|
|
|
85
91
|
|
|
86
92
|
export const Main = (args: Record<string, unknown>) => (
|
|
87
93
|
<FrappeProvider baseURL={MOCK_HOST} fixtures={new InMemoryFixtureProvider({})}>
|
|
88
|
-
<YStack height={
|
|
94
|
+
<YStack height={frameHeight}>
|
|
89
95
|
<DeskShell
|
|
90
96
|
breadcrumbs={[{ label: "Desk", href: "/desk" }, { label: "Todo" }]}
|
|
91
97
|
onNavigate={action("onNavigate")}
|
|
@@ -102,7 +108,7 @@ Main.storyName = "Main";
|
|
|
102
108
|
|
|
103
109
|
export const NoSidebar = () => (
|
|
104
110
|
<FrappeProvider baseURL={MOCK_HOST} fixtures={new InMemoryFixtureProvider({})}>
|
|
105
|
-
<YStack height={
|
|
111
|
+
<YStack height={frameHeight}>
|
|
106
112
|
<DeskShell showSidebar={false} onNavigate={action("onNavigate")}>
|
|
107
113
|
{content(2)}
|
|
108
114
|
</DeskShell>
|
|
@@ -112,7 +118,7 @@ export const NoSidebar = () => (
|
|
|
112
118
|
|
|
113
119
|
export const NoAwesomebar = () => (
|
|
114
120
|
<FrappeProvider baseURL={MOCK_HOST} fixtures={new InMemoryFixtureProvider({})}>
|
|
115
|
-
<YStack height={
|
|
121
|
+
<YStack height={frameHeight}>
|
|
116
122
|
<DeskShell showAwesomebar={false} onNavigate={action("onNavigate")}>
|
|
117
123
|
{content(2)}
|
|
118
124
|
</DeskShell>
|
|
@@ -123,7 +129,7 @@ export const NoAwesomebar = () => (
|
|
|
123
129
|
/** Long page content must scroll inside the main area, header staying fixed. */
|
|
124
130
|
export const LongContent = () => (
|
|
125
131
|
<FrappeProvider baseURL={MOCK_HOST} fixtures={new InMemoryFixtureProvider({})}>
|
|
126
|
-
<YStack height={
|
|
132
|
+
<YStack height={frameHeight}>
|
|
127
133
|
<DeskShell
|
|
128
134
|
breadcrumbs={[{ label: "Desk", href: "/desk" }, { label: "Long" }]}
|
|
129
135
|
onNavigate={action("onNavigate")}
|
|
@@ -136,7 +142,7 @@ export const LongContent = () => (
|
|
|
136
142
|
|
|
137
143
|
/** No breadcrumbs, no provider config: shell must still render header + nav + content. */
|
|
138
144
|
export const Bare = () => (
|
|
139
|
-
<YStack height={
|
|
145
|
+
<YStack height={frameHeight}>
|
|
140
146
|
<DeskShell onNavigate={action("onNavigate")}>{content(1)}</DeskShell>
|
|
141
147
|
</YStack>
|
|
142
148
|
);
|
|
@@ -144,7 +150,7 @@ export const Bare = () => (
|
|
|
144
150
|
/** Compact viewport: rail collapses to a phosphor toggle + overlay drawer. */
|
|
145
151
|
export const Narrow = () => (
|
|
146
152
|
<FrappeProvider baseURL={MOCK_HOST} fixtures={new InMemoryFixtureProvider({})}>
|
|
147
|
-
<YStack height={
|
|
153
|
+
<YStack height={frameHeight}>
|
|
148
154
|
<DeskShell
|
|
149
155
|
breadcrumbs={[{ label: "Desk", href: "/desk" }, { label: "Todo" }]}
|
|
150
156
|
onNavigate={action("onNavigate")}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// The desk Awesomebar keeps its document-search client in a ref. When the
|
|
2
|
+
// provider's connection starts sending its token, or sends it under another
|
|
3
|
+
// scheme, the next search must carry the new credentials instead of going out
|
|
4
|
+
// on a client built for the old ones (MPO-410).
|
|
5
|
+
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
6
|
+
import { act, waitFor } from "@testing-library/react";
|
|
7
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
8
|
+
import { FrappeProvider } from "../FrappeProvider";
|
|
9
|
+
import { Awesomebar } from "./awesomebar";
|
|
10
|
+
|
|
11
|
+
const combobox = vi.hoisted(() => ({
|
|
12
|
+
search: undefined as ((query: string) => void) | undefined,
|
|
13
|
+
}));
|
|
14
|
+
vi.mock("@multiplatform.one/forms", () => ({
|
|
15
|
+
formCommonColors: { muted: "$color10" },
|
|
16
|
+
Combobox: ({ onSearch }: { onSearch?: (query: string) => void }) => {
|
|
17
|
+
combobox.search = onSearch;
|
|
18
|
+
return null;
|
|
19
|
+
},
|
|
20
|
+
}));
|
|
21
|
+
|
|
22
|
+
type Auth = { useToken: boolean; token: string; type: string };
|
|
23
|
+
|
|
24
|
+
const auth = (useToken: boolean, type = "token"): Auth => ({ useToken, token: "key:secret", type });
|
|
25
|
+
|
|
26
|
+
const changes: [string, Auth, Auth, (string | null)[]][] = [
|
|
27
|
+
["starts sending its token", auth(false), auth(true), [null, "token key:secret"]],
|
|
28
|
+
[
|
|
29
|
+
"switches its token scheme",
|
|
30
|
+
auth(true, "token"),
|
|
31
|
+
auth(true, "Bearer"),
|
|
32
|
+
["token key:secret", "Bearer key:secret"],
|
|
33
|
+
],
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
const searchPath = "/api/method/frappe.utils.global_search.search";
|
|
37
|
+
let run = 0;
|
|
38
|
+
let searches: (string | null)[] = [];
|
|
39
|
+
|
|
40
|
+
beforeEach(() => {
|
|
41
|
+
run += 1;
|
|
42
|
+
searches = [];
|
|
43
|
+
vi.stubGlobal("fetch", async (input: string | URL | Request, init?: RequestInit) => {
|
|
44
|
+
const url = new URL(String(input));
|
|
45
|
+
if (url.pathname === searchPath) {
|
|
46
|
+
searches.push(new Headers(init?.headers).get("Authorization"));
|
|
47
|
+
}
|
|
48
|
+
return Response.json({ message: [], data: [] });
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
afterEach(() => vi.unstubAllGlobals());
|
|
53
|
+
|
|
54
|
+
describe("Awesomebar document search", () => {
|
|
55
|
+
it.each(changes)(
|
|
56
|
+
"searches with the new credentials when the connection %s",
|
|
57
|
+
async (_, before, after, expected) => {
|
|
58
|
+
const baseURL = `http://awesomebar-${run}.test`;
|
|
59
|
+
const ui = (connectionAuth: Auth) => (
|
|
60
|
+
<FrappeProvider baseURL={baseURL} realtime={false} auth={connectionAuth}>
|
|
61
|
+
<Awesomebar />
|
|
62
|
+
</FrappeProvider>
|
|
63
|
+
);
|
|
64
|
+
const { rerender } = renderWithProviders(ui(before));
|
|
65
|
+
act(() => {
|
|
66
|
+
combobox.search?.("pikachu");
|
|
67
|
+
});
|
|
68
|
+
await waitFor(() => expect(searches).toHaveLength(1));
|
|
69
|
+
rerender(ui(after));
|
|
70
|
+
act(() => {
|
|
71
|
+
combobox.search?.("raichu");
|
|
72
|
+
});
|
|
73
|
+
await waitFor(() => expect(searches).toHaveLength(2));
|
|
74
|
+
expect(searches).toEqual(expected);
|
|
75
|
+
},
|
|
76
|
+
);
|
|
77
|
+
});
|
package/src/desk/awesomebar.tsx
CHANGED
|
@@ -172,7 +172,7 @@ export function Awesomebar({ onNavigate, basePath = "/desk", ...stackProps }: Aw
|
|
|
172
172
|
const httpRef = useRef<HttpClient | undefined>(undefined);
|
|
173
173
|
const configKeyRef = useRef("");
|
|
174
174
|
if (config?.baseURL) {
|
|
175
|
-
const key = `${config.baseURL}:${config.auth?.token ?? ""}`;
|
|
175
|
+
const key = `${config.baseURL}:${config.auth?.useToken ? "t" : ""}:${config.auth?.token ?? ""}:${config.auth?.type ?? ""}`;
|
|
176
176
|
if (key !== configKeyRef.current) {
|
|
177
177
|
httpRef.current = createHttpClientFromConfig({
|
|
178
178
|
baseURL: config.baseURL,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
useResolvedValidators,
|
|
30
30
|
type AnyFormApi,
|
|
31
31
|
} from "@multiplatform.one/forms";
|
|
32
|
-
import { useResolvedKnobs } from "@multiplatform.one/theme";
|
|
32
|
+
import { sizeRecipeForToken, useResolvedKnobs } from "@multiplatform.one/theme";
|
|
33
33
|
import { useEffect, useState, type ReactNode } from "react";
|
|
34
34
|
import { useTranslation } from "react-i18next";
|
|
35
35
|
import type { FontSizeTokens, LabelProps, SizeTokens } from "tamagui";
|
|
@@ -183,7 +183,13 @@ export function CodeEditorField({
|
|
|
183
183
|
if (skeleton) {
|
|
184
184
|
return (
|
|
185
185
|
<YStack {...knobProps.gap} width="100%">
|
|
186
|
-
{label &&
|
|
186
|
+
{label && (
|
|
187
|
+
<Skeleton
|
|
188
|
+
variant="text"
|
|
189
|
+
width="30%"
|
|
190
|
+
height={sizeRecipeForToken(knobProps.sizeToken).fontSize}
|
|
191
|
+
/>
|
|
192
|
+
)}
|
|
187
193
|
<Skeleton variant="rounded" width="100%" height={compact ? 120 : 200} />
|
|
188
194
|
</YStack>
|
|
189
195
|
);
|
|
@@ -6,6 +6,8 @@ import { fieldtypeToTableField } from "../../fieldRegistry";
|
|
|
6
6
|
import { FrappeStoryProvider } from "../../frappeStoryTarget";
|
|
7
7
|
import { Color, type ColorProps } from ".";
|
|
8
8
|
|
|
9
|
+
// hex-escape: Color field values are hex strings: specimen data, not paint
|
|
10
|
+
|
|
9
11
|
export default {
|
|
10
12
|
title: "FrappeUI/Color",
|
|
11
13
|
component: Color,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFrappeCollection } from "@multiplatform.one/frappe";
|
|
2
2
|
import { Skeleton } from "@multiplatform.one/forms";
|
|
3
3
|
import { FileIcon, UploadIcon, XIcon } from "@phosphor-icons/react";
|
|
4
|
-
import { useResolvedKnobs } from "@multiplatform.one/theme";
|
|
4
|
+
import { sizeRecipeForToken, useResolvedKnobs } from "@multiplatform.one/theme";
|
|
5
5
|
import type React from "react";
|
|
6
6
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
7
7
|
import { useTranslation } from "react-i18next";
|
|
@@ -276,7 +276,13 @@ export function FileUpload({
|
|
|
276
276
|
if (skeleton) {
|
|
277
277
|
return (
|
|
278
278
|
<YStack {...knobProps.gap}>
|
|
279
|
-
{label &&
|
|
279
|
+
{label && (
|
|
280
|
+
<Skeleton
|
|
281
|
+
variant="text"
|
|
282
|
+
width="30%"
|
|
283
|
+
height={sizeRecipeForToken(knobProps.sizeToken).fontSize}
|
|
284
|
+
/>
|
|
285
|
+
)}
|
|
280
286
|
<Skeleton variant="rounded" width="100%" height={minHeight} />
|
|
281
287
|
</YStack>
|
|
282
288
|
);
|
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
import { useRegisterPageHeading } from "@multiplatform.one/components";
|
|
2
2
|
import { Skeleton } from "@multiplatform.one/forms";
|
|
3
|
-
import { useResolvedKnobs } from "@multiplatform.one/theme";
|
|
3
|
+
import { sizeRecipeEscape, useResolvedKnobs } from "@multiplatform.one/theme";
|
|
4
4
|
import type React from "react";
|
|
5
5
|
import { useCallback, useEffect, useId, useState } from "react";
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
getTokenValue,
|
|
8
|
+
H1,
|
|
9
|
+
H2,
|
|
10
|
+
H3,
|
|
11
|
+
H4,
|
|
12
|
+
Separator,
|
|
13
|
+
Text,
|
|
14
|
+
XStack,
|
|
15
|
+
YStack,
|
|
16
|
+
type YStackProps,
|
|
17
|
+
} from "tamagui";
|
|
7
18
|
|
|
8
19
|
export type HeadingLevel = 1 | 2 | 3 | 4;
|
|
9
20
|
|
|
@@ -105,7 +116,13 @@ export function Heading({
|
|
|
105
116
|
<YStack {...knobProps.gap} {...stackProps}>
|
|
106
117
|
<Skeleton variant="text" width="45%" height={compact ? 18 : 24} />
|
|
107
118
|
<Skeleton variant="text" width="70%" height={compact ? 12 : 14} />
|
|
108
|
-
{showSeparator &&
|
|
119
|
+
{showSeparator && (
|
|
120
|
+
<Skeleton
|
|
121
|
+
variant="rounded"
|
|
122
|
+
width="100%"
|
|
123
|
+
height={sizeRecipeEscape(1, "separator bone: the 1px rule a Separator draws")}
|
|
124
|
+
/>
|
|
125
|
+
)}
|
|
109
126
|
</YStack>
|
|
110
127
|
);
|
|
111
128
|
}
|
|
@@ -148,23 +165,30 @@ export function Heading({
|
|
|
148
165
|
</XStack>
|
|
149
166
|
);
|
|
150
167
|
|
|
168
|
+
const spacePx = (token: unknown) =>
|
|
169
|
+
Number(getTokenValue(token as Parameters<typeof getTokenValue>[0], "space")) || 0;
|
|
170
|
+
const descriptionGap = Math.max(0, spacePx(stackProps.gap ?? knobProps.gap.gap) - spacePx("$1"));
|
|
171
|
+
const showDescription = Boolean(resolvedDescription) && !isCollapsed;
|
|
172
|
+
|
|
151
173
|
return (
|
|
152
174
|
<YStack {...knobProps.gap} {...stackProps}>
|
|
153
|
-
{
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
175
|
+
<YStack gap={descriptionGap} paddingBottom={showDescription ? "$1" : undefined}>
|
|
176
|
+
{headingContent}
|
|
177
|
+
{showDescription && (
|
|
178
|
+
<Text
|
|
179
|
+
fontSize={knobProps.sizeToken}
|
|
180
|
+
{...knobProps.body}
|
|
181
|
+
color="$color10"
|
|
182
|
+
paddingInlineStart={canCollapse ? "$6" : undefined}
|
|
183
|
+
>
|
|
184
|
+
{resolvedDescription}
|
|
185
|
+
</Text>
|
|
186
|
+
)}
|
|
187
|
+
</YStack>
|
|
166
188
|
{showSeparator && (
|
|
167
|
-
<
|
|
189
|
+
<YStack paddingVertical={compact ? "$0.5" : "$1"}>
|
|
190
|
+
<Separator backgroundColor="$color5" />
|
|
191
|
+
</YStack>
|
|
168
192
|
)}
|
|
169
193
|
{collapsible ? (
|
|
170
194
|
// Always mounted so the aria-controls target exists while collapsed
|
|
@@ -31,7 +31,7 @@ import { useEffect, useState, type ComponentType, type ReactNode } from "react";
|
|
|
31
31
|
import { useTranslation } from "react-i18next";
|
|
32
32
|
import type { FontSizeTokens, LabelProps, SizeTokens } from "tamagui";
|
|
33
33
|
import { Paragraph, YStack } from "tamagui";
|
|
34
|
-
import { useResolvedKnobs } from "@multiplatform.one/theme";
|
|
34
|
+
import { sizeRecipeForToken, useResolvedKnobs } from "@multiplatform.one/theme";
|
|
35
35
|
import { EditorPreviewPanes, PreviewSurface } from "../shared/EditorPreviewPanes";
|
|
36
36
|
|
|
37
37
|
// ---------------------------------------------------------------------------
|
|
@@ -176,7 +176,13 @@ export function MarkdownEditorField({
|
|
|
176
176
|
if (skeleton) {
|
|
177
177
|
return (
|
|
178
178
|
<YStack {...knobProps.gap} width="100%">
|
|
179
|
-
{label &&
|
|
179
|
+
{label && (
|
|
180
|
+
<Skeleton
|
|
181
|
+
variant="text"
|
|
182
|
+
width="30%"
|
|
183
|
+
height={sizeRecipeForToken(knobProps.sizeToken).fontSize}
|
|
184
|
+
/>
|
|
185
|
+
)}
|
|
180
186
|
<Skeleton variant="rounded" width="100%" height={compact ? 120 : 200} />
|
|
181
187
|
</YStack>
|
|
182
188
|
);
|
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
type AnyFormApi,
|
|
28
28
|
} from "@multiplatform.one/forms";
|
|
29
29
|
import { RichEditor, type RichEditorRef } from "@multiplatform.one/rich-text";
|
|
30
|
+
import { sizeRecipeForToken } from "@multiplatform.one/theme";
|
|
30
31
|
import { useEffect, useRef, useState, type ReactNode } from "react";
|
|
31
32
|
import type { LabelProps, SizeTokens } from "tamagui";
|
|
32
33
|
import { YStack } from "tamagui";
|
|
@@ -111,7 +112,13 @@ export function MarkdownEditorField({
|
|
|
111
112
|
if (skeleton) {
|
|
112
113
|
return (
|
|
113
114
|
<YStack {...knobProps.gap} width="100%">
|
|
114
|
-
{label &&
|
|
115
|
+
{label && (
|
|
116
|
+
<Skeleton
|
|
117
|
+
variant="text"
|
|
118
|
+
width="30%"
|
|
119
|
+
height={sizeRecipeForToken(knobProps.sizeToken).fontSize}
|
|
120
|
+
/>
|
|
121
|
+
)}
|
|
115
122
|
<Skeleton variant="rounded" width="100%" height={compact ? 120 : 200} />
|
|
116
123
|
</YStack>
|
|
117
124
|
);
|
|
@@ -4,6 +4,8 @@ import { fieldtypeToTableField } from "../../fieldRegistry";
|
|
|
4
4
|
import { FrappeStoryProvider } from "../../frappeStoryTarget";
|
|
5
5
|
import { ReadOnly } from ".";
|
|
6
6
|
|
|
7
|
+
// hex-escape: Color field values are hex strings: specimen data, not paint
|
|
8
|
+
|
|
7
9
|
export default {
|
|
8
10
|
title: "FrappeUI/ReadOnly",
|
|
9
11
|
component: ReadOnly,
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// MPO-411. A routed view reads what its route's loader rendered on the server
|
|
2
|
+
// through the host's navigation, so an app hands the view its loader instead
|
|
3
|
+
// of reading the router itself.
|
|
4
|
+
import { render } from "@testing-library/react";
|
|
5
|
+
import { describe, expect, it, vi } from "vitest";
|
|
6
|
+
import {
|
|
7
|
+
FrappeNavigationProvider,
|
|
8
|
+
useRouteLoaderData,
|
|
9
|
+
type FrappeNavigation,
|
|
10
|
+
} from "./frappeNavigation";
|
|
11
|
+
|
|
12
|
+
const loader = async () => ({ rows: [] });
|
|
13
|
+
|
|
14
|
+
function Probe({ of, seen }: { of?: typeof loader; seen: (value: unknown) => void }) {
|
|
15
|
+
seen(useRouteLoaderData(of));
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function read(navigation: FrappeNavigation | undefined, of?: typeof loader): unknown {
|
|
20
|
+
const seen = vi.fn();
|
|
21
|
+
render(
|
|
22
|
+
<FrappeNavigationProvider navigation={navigation}>
|
|
23
|
+
<Probe of={of} seen={seen} />
|
|
24
|
+
</FrappeNavigationProvider>,
|
|
25
|
+
);
|
|
26
|
+
return seen.mock.calls.at(-1)?.[0];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const base: FrappeNavigation = { usePathname: () => "/pokemon", useNavigate: () => () => {} };
|
|
30
|
+
|
|
31
|
+
describe("useRouteLoaderData", () => {
|
|
32
|
+
it("hands the host the loader and returns what it read", () => {
|
|
33
|
+
const useLoader = vi.fn(() => ({ rows: ["bulbasaur"] }));
|
|
34
|
+
expect(read({ ...base, useLoader }, loader)).toEqual({ rows: ["bulbasaur"] });
|
|
35
|
+
expect(useLoader).toHaveBeenCalledWith(loader);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it("reads nothing without a loader or a host that runs them", () => {
|
|
39
|
+
const useLoader = vi.fn(() => ({ rows: ["bulbasaur"] }));
|
|
40
|
+
expect(read({ ...base, useLoader })).toBeUndefined();
|
|
41
|
+
expect(useLoader).not.toHaveBeenCalled();
|
|
42
|
+
expect(read(base, loader)).toBeUndefined();
|
|
43
|
+
expect(read(undefined, loader)).toBeUndefined();
|
|
44
|
+
});
|
|
45
|
+
});
|
package/src/frappeNavigation.tsx
CHANGED
|
@@ -15,12 +15,28 @@ export interface FrappeNavigation {
|
|
|
15
15
|
usePathname(): string;
|
|
16
16
|
/** A function that pushes an href onto the history. */
|
|
17
17
|
useNavigate(): (href: string) => void;
|
|
18
|
+
/**
|
|
19
|
+
* The query params of the route the caller renders in. A host without
|
|
20
|
+
* them leaves a routed list's controls out of the URL.
|
|
21
|
+
*/
|
|
22
|
+
useSearchParams?(): Record<string, string | undefined>;
|
|
23
|
+
/** A function that replaces query params in place; undefined drops one. */
|
|
24
|
+
useSetSearchParams?(): (params: Record<string, string | undefined>) => void;
|
|
25
|
+
/**
|
|
26
|
+
* What the route's loader returned (the page it rendered on the server),
|
|
27
|
+
* given the loader the route exports. A host without loaders leaves it
|
|
28
|
+
* out, and a view reads live from the start.
|
|
29
|
+
*/
|
|
30
|
+
useLoader?(loader: (...args: never[]) => unknown): unknown;
|
|
18
31
|
}
|
|
19
32
|
|
|
20
33
|
/** A routed view's handle on the host router. */
|
|
21
34
|
export interface FrappeRouter {
|
|
22
35
|
pathname: string;
|
|
23
36
|
navigate(href: string): void;
|
|
37
|
+
/** Present when the host hands its query params to routed views. */
|
|
38
|
+
searchParams?: Record<string, string | undefined>;
|
|
39
|
+
setSearchParams?: (params: Record<string, string | undefined>) => void;
|
|
24
40
|
}
|
|
25
41
|
|
|
26
42
|
const FrappeNavigationContext = createContext<FrappeNavigation | undefined>(undefined);
|
|
@@ -44,6 +60,17 @@ export function useFrappeNavigation(): FrappeNavigation | undefined {
|
|
|
44
60
|
return useContext(FrappeNavigationContext);
|
|
45
61
|
}
|
|
46
62
|
|
|
63
|
+
/**
|
|
64
|
+
* What `loader` returned for the route the caller renders in, through the
|
|
65
|
+
* host's navigation; undefined without a loader or a host that runs them.
|
|
66
|
+
*/
|
|
67
|
+
export function useRouteLoaderData(loader: ((...args: never[]) => unknown) | undefined): unknown {
|
|
68
|
+
const navigation = useContext(FrappeNavigationContext);
|
|
69
|
+
if (!loader || !navigation?.useLoader) return undefined;
|
|
70
|
+
// oxlint-disable-next-line rules-of-hooks -- one navigation and one loader per view
|
|
71
|
+
return navigation.useLoader(loader);
|
|
72
|
+
}
|
|
73
|
+
|
|
47
74
|
/** The host router for a routed view, or undefined when the host gave none. */
|
|
48
75
|
export function useFrappeRouter(): FrappeRouter | undefined {
|
|
49
76
|
const navigation = useFrappeNavigation();
|
|
@@ -52,7 +79,11 @@ export function useFrappeRouter(): FrappeRouter | undefined {
|
|
|
52
79
|
const pathname = navigation.usePathname();
|
|
53
80
|
// oxlint-disable-next-line rules-of-hooks -- one navigation per tree
|
|
54
81
|
const navigate = navigation.useNavigate();
|
|
55
|
-
|
|
82
|
+
// oxlint-disable-next-line rules-of-hooks -- one navigation per tree
|
|
83
|
+
const searchParams = navigation.useSearchParams?.();
|
|
84
|
+
// oxlint-disable-next-line rules-of-hooks -- one navigation per tree
|
|
85
|
+
const setSearchParams = navigation.useSetSearchParams?.();
|
|
86
|
+
return { pathname, navigate, searchParams, setSearchParams };
|
|
56
87
|
}
|
|
57
88
|
|
|
58
89
|
/**
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// A host built with Frappe off (MPO-403): createApp mounts no FrappeProvider
|
|
2
|
+
// without FRAPPE_ENABLED, so a doctype's routed pages find no bench URL and no
|
|
3
|
+
// fixture corpus. They say the backend isn't configured instead of throwing
|
|
4
|
+
// and taking the route down, and they dial nothing.
|
|
5
|
+
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
6
|
+
import { cleanup, screen } from "@testing-library/react";
|
|
7
|
+
import i18next from "i18next";
|
|
8
|
+
import { initReactI18next } from "react-i18next";
|
|
9
|
+
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
|
10
|
+
import { FrappeForm } from "./FrappeForm";
|
|
11
|
+
import { FrappeListView } from "./FrappeListView";
|
|
12
|
+
import { FrappeProvider } from "./FrappeProvider";
|
|
13
|
+
|
|
14
|
+
interface Move {
|
|
15
|
+
name: string;
|
|
16
|
+
doctype: string;
|
|
17
|
+
move_name?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const doctype = "Poke Move";
|
|
21
|
+
const route = "/moves";
|
|
22
|
+
|
|
23
|
+
let fetchSpy: ReturnType<typeof vi.fn>;
|
|
24
|
+
|
|
25
|
+
beforeAll(async () => {
|
|
26
|
+
await i18next.use(initReactI18next).init({
|
|
27
|
+
lng: "en",
|
|
28
|
+
interpolation: { escapeValue: false },
|
|
29
|
+
resources: { en: { translation: {} } },
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
beforeEach(() => {
|
|
34
|
+
fetchSpy = vi.fn(async () => {
|
|
35
|
+
throw new Error("a page with no bench dialled one");
|
|
36
|
+
});
|
|
37
|
+
vi.stubGlobal("fetch", fetchSpy);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
afterEach(() => {
|
|
41
|
+
cleanup();
|
|
42
|
+
vi.restoreAllMocks();
|
|
43
|
+
vi.unstubAllGlobals();
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
function expectNotConfigured() {
|
|
47
|
+
expect(screen.getByTestId("frappe-not-configured")).toBeTruthy();
|
|
48
|
+
expect(screen.getByText("Frappe is not configured")).toBeTruthy();
|
|
49
|
+
expect(fetchSpy).not.toHaveBeenCalled();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
describe("a doctype's pages on a host with no Frappe backend", () => {
|
|
53
|
+
it("the new page says the backend isn't configured", () => {
|
|
54
|
+
renderWithProviders(<FrappeForm<Move> doctype={doctype} route={route} />);
|
|
55
|
+
expectNotConfigured();
|
|
56
|
+
expect(screen.getByText(`${doctype} can't load without a Frappe bench URL.`)).toBeTruthy();
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it("a record page says the backend isn't configured", () => {
|
|
60
|
+
renderWithProviders(<FrappeForm<Move> doctype={doctype} name="a1b2c3" />);
|
|
61
|
+
expectNotConfigured();
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it("the list page says the backend isn't configured", () => {
|
|
65
|
+
renderWithProviders(<FrappeListView<Move> doctype={doctype} route={route} />);
|
|
66
|
+
expectNotConfigured();
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it("a provider that resolved no bench URL reads the same", () => {
|
|
70
|
+
renderWithProviders(
|
|
71
|
+
<FrappeProvider realtime={false}>
|
|
72
|
+
<FrappeForm<Move> doctype={doctype} route={route} />
|
|
73
|
+
</FrappeProvider>,
|
|
74
|
+
);
|
|
75
|
+
expectNotConfigured();
|
|
76
|
+
});
|
|
77
|
+
});
|
package/src/index.ts
CHANGED
|
@@ -26,6 +26,7 @@ export {
|
|
|
26
26
|
} from "./FrappeProvider";
|
|
27
27
|
export {
|
|
28
28
|
FrappeNavigationProvider,
|
|
29
|
+
useRouteLoaderData,
|
|
29
30
|
frappeRouteHref,
|
|
30
31
|
frappeRouteTarget,
|
|
31
32
|
useFrappeNavigation,
|
|
@@ -67,7 +68,58 @@ export {
|
|
|
67
68
|
type SidebarPerson,
|
|
68
69
|
} from "./FormSidebar";
|
|
69
70
|
export { FrappeList, type FrappeListProps } from "./FrappeList";
|
|
70
|
-
export {
|
|
71
|
+
export {
|
|
72
|
+
FrappeListView,
|
|
73
|
+
type FrappeListAction,
|
|
74
|
+
type FrappeListCard,
|
|
75
|
+
type FrappeListViewProps,
|
|
76
|
+
type ListViewMode,
|
|
77
|
+
} from "./FrappeListView";
|
|
78
|
+
export {
|
|
79
|
+
isListNarrowed,
|
|
80
|
+
listStateFilters,
|
|
81
|
+
listStateFromParams,
|
|
82
|
+
listStateOrderBy,
|
|
83
|
+
listStateParams,
|
|
84
|
+
type FrappeListControls,
|
|
85
|
+
type FrappeListFacet,
|
|
86
|
+
type FrappeListFilter,
|
|
87
|
+
type FrappeListParams,
|
|
88
|
+
type FrappeListRange,
|
|
89
|
+
type FrappeListSort,
|
|
90
|
+
type FrappeListState,
|
|
91
|
+
} from "./list/listState";
|
|
92
|
+
export {
|
|
93
|
+
createFavoritesStore,
|
|
94
|
+
favoritesKey,
|
|
95
|
+
favoritesStore,
|
|
96
|
+
toggleFavoriteIn,
|
|
97
|
+
useFavorites,
|
|
98
|
+
type FavoritesState,
|
|
99
|
+
type UseFavorites,
|
|
100
|
+
} from "./list/favorites";
|
|
101
|
+
export { FacetRail, type FacetRailOption, type FacetRailProps } from "./list/FacetRail";
|
|
102
|
+
export { RangeFilter, rangeCeiling, type RangeFilterProps } from "./list/RangeFilter";
|
|
103
|
+
export { ShufflePanel, type ShufflePanelProps } from "./list/ShufflePanel";
|
|
104
|
+
export { FacetBadge, type FacetBadgeProps } from "./list/FacetBadge";
|
|
105
|
+
export { ImageWell, type ImageWellProps } from "./list/ImageWell";
|
|
106
|
+
export { RecordCard, type RecordCardBadge, type RecordCardProps } from "./list/RecordCard";
|
|
107
|
+
export { recordTitle, type FrappeRecordLook, type FrappeRecordSlide } from "./list/recordLook";
|
|
108
|
+
export {
|
|
109
|
+
FrappeRecordView,
|
|
110
|
+
type FrappeRecordAction,
|
|
111
|
+
type FrappeRecordBarsSection,
|
|
112
|
+
type FrappeRecordRowsSection,
|
|
113
|
+
type FrappeRecordSection,
|
|
114
|
+
type FrappeRecordTab,
|
|
115
|
+
type FrappeRecordViewProps,
|
|
116
|
+
} from "./FrappeRecordView";
|
|
117
|
+
export { RecordBars } from "./record/RecordBars";
|
|
118
|
+
export {
|
|
119
|
+
FrappeInsights,
|
|
120
|
+
type FrappeInsightsMetric,
|
|
121
|
+
type FrappeInsightsProps,
|
|
122
|
+
} from "./FrappeInsights";
|
|
71
123
|
export {
|
|
72
124
|
useConnectionFilters,
|
|
73
125
|
type ConnectionFiltersResult,
|