@multiplatform.one/frappe-ui 7.23.2 → 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/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 +392 -38
- package/dist/cjs/FrappeListView.native.js +454 -41
- package/dist/cjs/FrappeListView.native.js.map +1 -1
- 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/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/Heading/index.cjs +18 -11
- package/dist/cjs/fields/Heading/index.native.js +21 -12
- package/dist/cjs/fields/Heading/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/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/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 +396 -42
- package/dist/esm/FrappeListView.mjs.map +1 -1
- package/dist/esm/FrappeListView.native.js +458 -45
- package/dist/esm/FrappeListView.native.js.map +1 -1
- 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/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/Heading/index.mjs +19 -12
- package/dist/esm/fields/Heading/index.mjs.map +1 -1
- package/dist/esm/fields/Heading/index.native.js +22 -13
- package/dist/esm/fields/Heading/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/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/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 +396 -42
- package/dist/jsx/FrappeListView.mjs.map +1 -1
- package/dist/jsx/FrappeListView.native.js +454 -41
- package/dist/jsx/FrappeListView.native.js.map +1 -1
- 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/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/Heading/index.mjs +19 -12
- package/dist/jsx/fields/Heading/index.mjs.map +1 -1
- package/dist/jsx/fields/Heading/index.native.js +21 -12
- package/dist/jsx/fields/Heading/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/package.json +16 -16
- package/src/FrappeCalendar.tsx +2 -2
- package/src/FrappeDashboard.tsx +2 -2
- package/src/FrappeImageView.tsx +2 -1
- package/src/FrappeInsights.spec.tsx +171 -0
- package/src/FrappeInsights.tsx +422 -0
- 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.tsx +575 -44
- package/src/FrappeRecordView.spec.tsx +276 -0
- package/src/FrappeRecordView.tsx +231 -0
- package/src/FrappeReportBuilder.tsx +4 -5
- package/src/FrappeTreeView.tsx +1 -1
- package/src/desk/awesomebar.auth.spec.tsx +77 -0
- package/src/desk/awesomebar.tsx +1 -1
- package/src/fields/Heading/index.tsx +33 -15
- package/src/frappeNavigation.loader.spec.tsx +45 -0
- package/src/frappeNavigation.tsx +32 -1
- 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/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 +82 -2
- package/types/FrappeListView.d.ts.map +1 -1
- 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/Heading/index.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
|
@@ -49,14 +49,24 @@ var import_store = require("@multiplatform.one/store");
|
|
|
49
49
|
var import_FrappeProvider = require("./FrappeProvider.cjs");
|
|
50
50
|
var import_FrappeList = require("./FrappeList.cjs");
|
|
51
51
|
var import_FrappeNotConfigured = require("./FrappeNotConfigured.cjs");
|
|
52
|
+
var import_FrappeRowsReader = require("./FrappeRowsReader.cjs");
|
|
52
53
|
var import_FrappeTable = require("./FrappeTable.cjs");
|
|
53
54
|
var import_useDocRights = require("./formEngine/useDocRights.cjs");
|
|
54
55
|
var import_frappeNavigation = require("./frappeNavigation.cjs");
|
|
55
56
|
var import_frappeConnections = require("./frappeConnections.cjs");
|
|
56
57
|
var import_liveErrors = require("./liveErrors.cjs");
|
|
58
|
+
var import_favorites = require("./list/favorites.cjs");
|
|
59
|
+
var import_RecordCard = require("./list/RecordCard.cjs");
|
|
60
|
+
var import_recordLook = require("./list/recordLook.cjs");
|
|
61
|
+
var import_ListControls = require("./list/ListControls.cjs");
|
|
62
|
+
var import_listState = require("./list/listState.cjs");
|
|
63
|
+
var import_ListToastHost = require("./list/ListToastHost.cjs");
|
|
64
|
+
var import_ShufflePanel = require("./list/ShufflePanel.cjs");
|
|
65
|
+
var import_useListControls = require("./list/useListControls.cjs");
|
|
57
66
|
var import_useConnectionFilters = require("./useConnectionFilters.cjs");
|
|
58
67
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
59
68
|
const storageKeyPrefix = "frappe-listview-";
|
|
69
|
+
const eagerCards = 6;
|
|
60
70
|
const internalDocKeys = /* @__PURE__ */new Set(["name", "owner", "creation", "modified", "modified_by", "docstatus", "idx", "doctype", "_user_tags", "_comments", "_assign", "_liked_by", "_seen"]);
|
|
61
71
|
const layoutFieldtypes = /* @__PURE__ */new Set(["Column Break", "Section Break", "Tab Break", "HTML", "Heading", "Fold", "Button"]);
|
|
62
72
|
function fieldKeyLabel(key) {
|
|
@@ -105,10 +115,12 @@ function FrappeListViewBody({
|
|
|
105
115
|
route,
|
|
106
116
|
orderBy,
|
|
107
117
|
limit,
|
|
108
|
-
initialRows,
|
|
118
|
+
initialRows: initialRowsProp,
|
|
119
|
+
loader,
|
|
109
120
|
columns,
|
|
110
121
|
displayFields,
|
|
111
122
|
renderCard,
|
|
123
|
+
look,
|
|
112
124
|
gridProps,
|
|
113
125
|
emptyState,
|
|
114
126
|
onRetry,
|
|
@@ -119,13 +131,27 @@ function FrappeListViewBody({
|
|
|
119
131
|
showFilterSidebar = false,
|
|
120
132
|
// deprecated: switcher always renders; destructured so it stays out of stackProps
|
|
121
133
|
enableViewSwitcher: _enableViewSwitcher,
|
|
134
|
+
title,
|
|
135
|
+
subtitle,
|
|
136
|
+
actions,
|
|
137
|
+
headerAccessory,
|
|
138
|
+
titleField,
|
|
139
|
+
sorts,
|
|
140
|
+
searchFilter,
|
|
141
|
+
searchPlaceholder,
|
|
142
|
+
facets,
|
|
143
|
+
ranges,
|
|
144
|
+
favorites,
|
|
145
|
+
shuffle,
|
|
146
|
+
urlState = false,
|
|
122
147
|
baseURL,
|
|
123
148
|
auth,
|
|
124
149
|
syncOptions,
|
|
125
150
|
...stackProps
|
|
126
151
|
}) {
|
|
127
152
|
const config = (0, import_FrappeProvider.useFrappeConfig)();
|
|
128
|
-
const
|
|
153
|
+
const router = (0, import_frappeNavigation.useFrappeRouter)();
|
|
154
|
+
const navigate = router?.navigate;
|
|
129
155
|
const {
|
|
130
156
|
knobProps
|
|
131
157
|
} = (0, import_theme.useResolvedKnobs)();
|
|
@@ -150,8 +176,6 @@ function FrappeListViewBody({
|
|
|
150
176
|
fixtures: config?.fixtures
|
|
151
177
|
};
|
|
152
178
|
const [storedViewMode, setViewModeState] = (0, import_react2.useState)(defaultViewMode);
|
|
153
|
-
const requestedViewMode = controlledViewMode ?? storedViewMode;
|
|
154
|
-
const viewMode = requestedViewMode === "grid" && !renderCard ? "list" : requestedViewMode;
|
|
155
179
|
(0, import_react2.useEffect)(() => {
|
|
156
180
|
let cancelled = false;
|
|
157
181
|
setViewModeState(defaultViewMode);
|
|
@@ -165,12 +189,6 @@ function FrappeListViewBody({
|
|
|
165
189
|
cancelled = true;
|
|
166
190
|
};
|
|
167
191
|
}, [doctype, defaultViewMode]);
|
|
168
|
-
const setViewMode = (0, import_react2.useCallback)(mode => {
|
|
169
|
-
onViewModeChange?.(mode);
|
|
170
|
-
if (controlledViewMode !== void 0) return;
|
|
171
|
-
setViewModeState(mode);
|
|
172
|
-
void setStoredViewMode(doctype, mode);
|
|
173
|
-
}, [doctype, controlledViewMode, onViewModeChange]);
|
|
174
192
|
const {
|
|
175
193
|
meta,
|
|
176
194
|
isLoading: isMetaLoading,
|
|
@@ -188,14 +206,6 @@ function FrappeListViewBody({
|
|
|
188
206
|
const onAdd = !rights.create ? void 0 : onAddProp ?? (route !== void 0 && navigate ? () => navigate((0, import_frappeNavigation.frappeRouteHref)(route, {
|
|
189
207
|
mode: "create"
|
|
190
208
|
})) : void 0);
|
|
191
|
-
const asPage = view => route === void 0 ? view : /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_components.ListPageLayout, {
|
|
192
|
-
scroll: false,
|
|
193
|
-
header: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_components.PageHeader, {
|
|
194
|
-
title: doctype,
|
|
195
|
-
divider: false
|
|
196
|
-
}),
|
|
197
|
-
children: view
|
|
198
|
-
});
|
|
199
209
|
const [peekedFields, setPeekedFields] = (0, import_react2.useState)(null);
|
|
200
210
|
(0, import_react2.useEffect)(() => {
|
|
201
211
|
if (meta || isMetaLoading || !metaError || !finalBaseURL) return;
|
|
@@ -260,16 +270,16 @@ function FrappeListViewBody({
|
|
|
260
270
|
const renderListItem = (0, import_react2.useCallback)(doc => {
|
|
261
271
|
const row = doc;
|
|
262
272
|
const textFields = effectiveDisplayFields.filter(field => field.key !== imageFieldName);
|
|
263
|
-
const [
|
|
264
|
-
const titleValue =
|
|
265
|
-
const
|
|
273
|
+
const [titleField2, ...subtitleFields] = textFields;
|
|
274
|
+
const titleValue = titleField2 ? row[titleField2.key] : void 0;
|
|
275
|
+
const title2 = titleField2?.render ? titleField2.render(titleValue, doc) : titleValue ?? doc.name;
|
|
266
276
|
const subtitleParts = subtitleFields.map(field => {
|
|
267
277
|
const value = row[field.key];
|
|
268
278
|
const rendered = field.render ? field.render(value, doc) : value;
|
|
269
279
|
return rendered === null || rendered === void 0 || rendered === "" ? null : rendered;
|
|
270
280
|
}).filter(part => part !== null);
|
|
271
281
|
const imageUrl = imageFieldName ? resolveImageUrl(row[imageFieldName], finalBaseURL) : "";
|
|
272
|
-
const titleName = typeof
|
|
282
|
+
const titleName = typeof title2 === "string" ? title2 : void 0;
|
|
273
283
|
return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.XStack, {
|
|
274
284
|
alignItems: "center",
|
|
275
285
|
flex: 1,
|
|
@@ -292,7 +302,7 @@ function FrappeListViewBody({
|
|
|
292
302
|
...{
|
|
293
303
|
"data-list-slot": "title"
|
|
294
304
|
},
|
|
295
|
-
children:
|
|
305
|
+
children: title2
|
|
296
306
|
}), subtitleParts.length > 0 && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Text, {
|
|
297
307
|
...knobProps.body,
|
|
298
308
|
color: knobProps.textAccentColor,
|
|
@@ -333,23 +343,76 @@ function FrappeListViewBody({
|
|
|
333
343
|
setActiveFilters(filters);
|
|
334
344
|
}, [filters]);
|
|
335
345
|
const effectiveConnections = (0, import_react2.useMemo)(() => connections ?? (isMetaLoading ? void 0 : (0, import_frappeConnections.connectionsFromMeta)(meta)), [connections, isMetaLoading, meta]);
|
|
336
|
-
const linkFilters = (0, import_useConnectionFilters.useConnectionFilters)(connectionConfig, doctype, activeFilters, effectiveConnections);
|
|
337
|
-
const resolvedFilters = linkFilters.filters;
|
|
338
|
-
const [searchText, setSearchText] = (0, import_react2.useState)("");
|
|
339
|
-
const [debouncedSearch, setDebouncedSearch] = (0, import_react2.useState)("");
|
|
340
346
|
const searchField = (0, import_react2.useMemo)(() => {
|
|
341
347
|
if (meta?.title_field) return meta.title_field;
|
|
342
348
|
if (metaListFields.length > 0) return metaListFields[0].fieldname;
|
|
343
349
|
if (peekedFields && peekedFields.length > 0) return peekedFields[0];
|
|
344
350
|
return "name";
|
|
345
351
|
}, [meta, metaListFields, peekedFields]);
|
|
352
|
+
const hasCards = Boolean(renderCard || look?.images);
|
|
353
|
+
const listControls = {
|
|
354
|
+
sorts,
|
|
355
|
+
facets,
|
|
356
|
+
ranges,
|
|
357
|
+
views: hasCards ? ["grid", "list", "table"] : ["list", "table"],
|
|
358
|
+
defaultView: defaultViewMode
|
|
359
|
+
};
|
|
360
|
+
const hasControls = Boolean(sorts?.length || facets?.length || ranges?.length || favorites || shuffle);
|
|
361
|
+
const favoritesStorageKey = favorites ? typeof favorites === "string" ? favorites : (0, import_favorites.favoritesKey)(doctype) : void 0;
|
|
362
|
+
const list = (0, import_useListControls.useListControls)({
|
|
363
|
+
doctype,
|
|
364
|
+
controls: listControls,
|
|
365
|
+
connections: effectiveConnections,
|
|
366
|
+
connection: connectionConfig,
|
|
367
|
+
limit,
|
|
368
|
+
favoritesKey: favoritesStorageKey,
|
|
369
|
+
router: urlState ? router : void 0,
|
|
370
|
+
readBase: Boolean(subtitle || facets?.length || ranges?.length)
|
|
371
|
+
});
|
|
372
|
+
const updateList = list.update;
|
|
373
|
+
const requestedViewMode = controlledViewMode ?? (urlState ? list.state.view : void 0) ?? storedViewMode;
|
|
374
|
+
const viewMode = requestedViewMode === "grid" && !hasCards ? "list" : requestedViewMode;
|
|
375
|
+
const setViewMode = (0, import_react2.useCallback)(mode => {
|
|
376
|
+
onViewModeChange?.(mode);
|
|
377
|
+
if (controlledViewMode !== void 0) return;
|
|
378
|
+
if (urlState) {
|
|
379
|
+
updateList({
|
|
380
|
+
view: mode
|
|
381
|
+
});
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
setViewModeState(mode);
|
|
385
|
+
void setStoredViewMode(doctype, mode);
|
|
386
|
+
}, [doctype, controlledViewMode, onViewModeChange, urlState, updateList]);
|
|
387
|
+
const controlsKey = JSON.stringify({
|
|
388
|
+
facets: facets?.map(facet => [facet.param, facet.field, facet.doctype]),
|
|
389
|
+
ranges: ranges?.map(range => [range.param, range.field]),
|
|
390
|
+
sorts: sorts?.map(sort => [sort.value, sort.orderBy])
|
|
391
|
+
});
|
|
392
|
+
const controlFilters = (0, import_react2.useMemo)(() => {
|
|
393
|
+
if (!hasControls) return activeFilters;
|
|
394
|
+
const base = !activeFilters ? [] : Array.isArray(activeFilters) ? activeFilters : Object.entries(activeFilters).map(([field, value]) => [field, "=", value]);
|
|
395
|
+
return (0, import_listState.listStateFilters)(list.state, listControls, {
|
|
396
|
+
base,
|
|
397
|
+
search: searchFilter ?? (query => [[searchField, "like", `%${query}%`]]),
|
|
398
|
+
favorites: list.favorites.favoriteSet
|
|
399
|
+
});
|
|
400
|
+
}, [hasControls, activeFilters, list.state, list.favorites.favoriteSet, searchFilter, searchField, controlsKey]);
|
|
401
|
+
const effectiveOrderBy = hasControls ? (0, import_listState.listStateOrderBy)(list.state, listControls, orderBy) : orderBy;
|
|
402
|
+
const loaded = (0, import_frappeNavigation.useRouteLoaderData)(loader);
|
|
403
|
+
const initialRows = initialRowsProp ?? loaded?.rows;
|
|
404
|
+
const seedRows = !hasControls || !(0, import_listState.isListNarrowed)(list.state) && (!sorts?.length || list.state.sort === sorts[0].value) ? initialRows : void 0;
|
|
405
|
+
const linkFilters = (0, import_useConnectionFilters.useConnectionFilters)(connectionConfig, doctype, controlFilters, effectiveConnections);
|
|
406
|
+
const resolvedFilters = linkFilters.filters;
|
|
407
|
+
const [searchText, setSearchText] = (0, import_react2.useState)("");
|
|
408
|
+
const [debouncedSearch, setDebouncedSearch] = (0, import_react2.useState)("");
|
|
346
409
|
const listFilters = (0, import_react2.useMemo)(() => {
|
|
347
410
|
const query = debouncedSearch.trim();
|
|
348
411
|
if (!query) return resolvedFilters;
|
|
349
|
-
const
|
|
350
|
-
if (!resolvedFilters) return [
|
|
351
|
-
if (Array.isArray(resolvedFilters)) return [...resolvedFilters,
|
|
352
|
-
return [...Object.entries(resolvedFilters).map(([key, value]) => [key, "=", value]),
|
|
412
|
+
const searchFilter2 = [searchField, "like", `%${query}%`];
|
|
413
|
+
if (!resolvedFilters) return [searchFilter2];
|
|
414
|
+
if (Array.isArray(resolvedFilters)) return [...resolvedFilters, searchFilter2];
|
|
415
|
+
return [...Object.entries(resolvedFilters).map(([key, value]) => [key, "=", value]), searchFilter2];
|
|
353
416
|
}, [resolvedFilters, debouncedSearch, searchField]);
|
|
354
417
|
const hasProvidedFilters = (0, import_react2.useMemo)(() => {
|
|
355
418
|
if (!activeFilters) return false;
|
|
@@ -376,18 +439,305 @@ function FrappeListViewBody({
|
|
|
376
439
|
const handleDeleteFilter = (0, import_react2.useCallback)(async name => {
|
|
377
440
|
await savedFiltersHook.deleteFilter(name);
|
|
378
441
|
}, [savedFiltersHook]);
|
|
442
|
+
const slug = doctype.toLowerCase().replace(/\s+/g, "-");
|
|
443
|
+
const searchId = `${slug}-list-search`;
|
|
444
|
+
const resultsId = `${slug}-results`;
|
|
445
|
+
const nameField = titleField ?? meta?.title_field;
|
|
446
|
+
const [shuffleOpen, setShuffleOpen] = (0, import_react2.useState)(false);
|
|
447
|
+
const [shuffleRows, setShuffleRows] = (0, import_react2.useState)([]);
|
|
448
|
+
const handleShuffleRows = (0, import_react2.useCallback)(snapshot => setShuffleRows(snapshot.rows), []);
|
|
449
|
+
const shuffleOrderKey = JSON.stringify(sorts?.[0]?.orderBy ?? orderBy ?? null);
|
|
450
|
+
const shuffleFiltersKey = JSON.stringify(resolvedFilters ?? null);
|
|
451
|
+
const shuffleFieldsKey = JSON.stringify(effectiveFields);
|
|
452
|
+
const shuffleOptions = (0, import_react2.useMemo)(() => ({
|
|
453
|
+
fields: JSON.parse(shuffleFieldsKey),
|
|
454
|
+
filters: JSON.parse(shuffleFiltersKey) ?? void 0,
|
|
455
|
+
orderBy: JSON.parse(shuffleOrderKey) ?? void 0,
|
|
456
|
+
limit: limit ?? 0
|
|
457
|
+
}), [shuffleFieldsKey, shuffleFiltersKey, shuffleOrderKey, limit]);
|
|
458
|
+
const {
|
|
459
|
+
isFavorite,
|
|
460
|
+
toggle: toggleStar
|
|
461
|
+
} = list.favorites;
|
|
462
|
+
const toggleFavorite = (0, import_react2.useCallback)(doc => {
|
|
463
|
+
const name = doc.name;
|
|
464
|
+
if (!name) return;
|
|
465
|
+
const starred = isFavorite(name);
|
|
466
|
+
toggleStar(name);
|
|
467
|
+
const titleValue = nameField ? doc[nameField] : void 0;
|
|
468
|
+
const label = typeof titleValue === "string" && titleValue ? titleValue : name;
|
|
469
|
+
(0, import_components.showToast)(starred ? {
|
|
470
|
+
id: `${slug}-favorite-${name}`,
|
|
471
|
+
title: t("{{name}} removed from favorites", {
|
|
472
|
+
name: label
|
|
473
|
+
}),
|
|
474
|
+
intent: "accent",
|
|
475
|
+
action: {
|
|
476
|
+
label: t("Undo"),
|
|
477
|
+
onPress: () => toggleStar(name)
|
|
478
|
+
}
|
|
479
|
+
} : {
|
|
480
|
+
id: `${slug}-favorite-${name}`,
|
|
481
|
+
title: t("{{name}} added to favorites", {
|
|
482
|
+
name: label
|
|
483
|
+
}),
|
|
484
|
+
intent: "success"
|
|
485
|
+
});
|
|
486
|
+
}, [isFavorite, toggleStar, nameField, slug, t]);
|
|
487
|
+
const cardFor = doc => {
|
|
488
|
+
const name = doc.name ?? "";
|
|
489
|
+
const row = doc;
|
|
490
|
+
return {
|
|
491
|
+
href: route !== void 0 && name ? (0, import_frappeNavigation.frappeRouteHref)(route, {
|
|
492
|
+
mode: "view",
|
|
493
|
+
name
|
|
494
|
+
}) : void 0,
|
|
495
|
+
open: () => onItemClick?.(doc),
|
|
496
|
+
facets: Object.fromEntries((facets ?? []).map(facet => [facet.param, facet.doctype ? list.facets[facet.param]?.values.get(name) ?? [] : row[facet.field] === void 0 || row[facet.field] === null ? [] : [String(row[facet.field])]])),
|
|
497
|
+
favorite: favoritesStorageKey && name ? {
|
|
498
|
+
active: isFavorite(name),
|
|
499
|
+
toggle: () => toggleFavorite(doc)
|
|
500
|
+
} : void 0
|
|
501
|
+
};
|
|
502
|
+
};
|
|
503
|
+
const tintFacet = facets?.find(facet => facet.tint);
|
|
504
|
+
const drawRecordCard = (doc, index) => {
|
|
505
|
+
const card = cardFor(doc);
|
|
506
|
+
const name = doc.name ?? "";
|
|
507
|
+
const values = tintFacet ? card.facets[tintFacet.param] ?? [] : [];
|
|
508
|
+
const title2 = (0, import_recordLook.recordTitle)(doc, look, nameField);
|
|
509
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_RecordCard.RecordCard, {
|
|
510
|
+
title: title2,
|
|
511
|
+
subtitle: look?.subtitle?.(doc),
|
|
512
|
+
code: look?.code?.(doc),
|
|
513
|
+
images: look?.images?.(doc, finalBaseURL) ?? [],
|
|
514
|
+
tints: values.slice(0, 2).map(value => tintFacet?.tint?.(value)),
|
|
515
|
+
badges: values.map(value => ({
|
|
516
|
+
value,
|
|
517
|
+
label: tintFacet?.optionLabel?.(value) ?? value,
|
|
518
|
+
tint: tintFacet?.tint?.(value)
|
|
519
|
+
})),
|
|
520
|
+
href: card.href,
|
|
521
|
+
onPress: card.open,
|
|
522
|
+
favorite: card.favorite,
|
|
523
|
+
lazy: index >= eagerCards,
|
|
524
|
+
testID: `${slug}-card-${name}`,
|
|
525
|
+
favoriteTestID: `${slug}-favorite-${name}`
|
|
526
|
+
});
|
|
527
|
+
};
|
|
528
|
+
const drawCard = renderCard ? (doc, index) => renderCard(doc, index, cardFor(doc)) : look?.images ? drawRecordCard : void 0;
|
|
529
|
+
(0, import_react2.useEffect)(() => {
|
|
530
|
+
if (!import_tamagui.isWeb || typeof document === "undefined" || !showSearch) return;
|
|
531
|
+
const handleKeyDown = event => {
|
|
532
|
+
if (event.key !== "/" || event.metaKey || event.ctrlKey || event.altKey) return;
|
|
533
|
+
if (event.defaultPrevented) return;
|
|
534
|
+
const target = event.target;
|
|
535
|
+
if (target) {
|
|
536
|
+
const tag = target.tagName;
|
|
537
|
+
if (tag === "INPUT" || tag === "TEXTAREA" || tag === "SELECT") return;
|
|
538
|
+
if (target.isContentEditable) return;
|
|
539
|
+
if (target.closest?.('[role="dialog"], [role="menu"], [role="listbox"]')) return;
|
|
540
|
+
}
|
|
541
|
+
const input = document.getElementById(searchId)?.querySelector("input");
|
|
542
|
+
if (!input) return;
|
|
543
|
+
event.preventDefault();
|
|
544
|
+
input.focus();
|
|
545
|
+
input.select?.();
|
|
546
|
+
};
|
|
547
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
548
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
549
|
+
}, [searchId, showSearch]);
|
|
550
|
+
const headerOwnsTools = route !== void 0 && !showToolbar;
|
|
551
|
+
const pressFor = action => action.onPress ?? (action.href && navigate ? () => navigate(action.href) : void 0);
|
|
552
|
+
const headerActions = headerOwnsTools || headerAccessory || actions?.length ? /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.XStack, {
|
|
553
|
+
...knobProps.gap,
|
|
554
|
+
alignItems: "center",
|
|
555
|
+
flexWrap: "wrap",
|
|
556
|
+
flexShrink: 1,
|
|
557
|
+
minWidth: 0,
|
|
558
|
+
children: [headerOwnsTools ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_components.Tooltip, {
|
|
559
|
+
content: t("Switch views"),
|
|
560
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.XStack, {
|
|
561
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_components.ViewSwitcher, {
|
|
562
|
+
views: [...(hasCards ? [{
|
|
563
|
+
type: "grid",
|
|
564
|
+
label: t("Cards"),
|
|
565
|
+
icon: import_react.ImageIcon
|
|
566
|
+
}] : []), {
|
|
567
|
+
type: "list",
|
|
568
|
+
label: t("List"),
|
|
569
|
+
icon: import_react.ListIcon
|
|
570
|
+
}, {
|
|
571
|
+
type: "table",
|
|
572
|
+
label: t("Table"),
|
|
573
|
+
icon: import_react.TableIcon
|
|
574
|
+
}],
|
|
575
|
+
currentView: viewMode,
|
|
576
|
+
onViewChange: v => setViewMode(v)
|
|
577
|
+
})
|
|
578
|
+
})
|
|
579
|
+
}) : null, headerAccessory, actions?.map(action => {
|
|
580
|
+
const Icon = action.icon;
|
|
581
|
+
const onPress = pressFor(action);
|
|
582
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_react2.default.Fragment, {
|
|
583
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_components.Tooltip, {
|
|
584
|
+
content: action.hint ?? action.label,
|
|
585
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_forms.Button, {
|
|
586
|
+
outlined: true,
|
|
587
|
+
onPress,
|
|
588
|
+
icon: Icon ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(Icon, {
|
|
589
|
+
size: 16
|
|
590
|
+
}) : void 0,
|
|
591
|
+
"$max-sm": {
|
|
592
|
+
display: "none"
|
|
593
|
+
},
|
|
594
|
+
testID: action.testID,
|
|
595
|
+
children: action.label
|
|
596
|
+
})
|
|
597
|
+
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_forms.Button, {
|
|
598
|
+
outlined: true,
|
|
599
|
+
circular: true,
|
|
600
|
+
onPress,
|
|
601
|
+
icon: Icon ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(Icon, {
|
|
602
|
+
size: 16
|
|
603
|
+
}) : void 0,
|
|
604
|
+
display: "none",
|
|
605
|
+
"aria-label": action.label,
|
|
606
|
+
"$max-sm": {
|
|
607
|
+
display: "flex"
|
|
608
|
+
}
|
|
609
|
+
})]
|
|
610
|
+
}, action.label);
|
|
611
|
+
}), headerOwnsTools && onAdd ? /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
612
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_forms.Button, {
|
|
613
|
+
theme: "accent",
|
|
614
|
+
onPress: onAdd,
|
|
615
|
+
icon: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react.PlusIcon, {
|
|
616
|
+
size: 16
|
|
617
|
+
}),
|
|
618
|
+
"$max-sm": {
|
|
619
|
+
display: "none"
|
|
620
|
+
},
|
|
621
|
+
children: t("Add {{doctype}}", {
|
|
622
|
+
doctype
|
|
623
|
+
})
|
|
624
|
+
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_forms.Button, {
|
|
625
|
+
theme: "accent",
|
|
626
|
+
onPress: onAdd,
|
|
627
|
+
icon: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react.PlusIcon, {
|
|
628
|
+
size: 16
|
|
629
|
+
}),
|
|
630
|
+
display: "none",
|
|
631
|
+
"$max-sm": {
|
|
632
|
+
display: "flex"
|
|
633
|
+
},
|
|
634
|
+
children: t("Add")
|
|
635
|
+
})]
|
|
636
|
+
}) : null]
|
|
637
|
+
}) : void 0;
|
|
638
|
+
const controlsBand = hasControls ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_ListControls.ListControls, {
|
|
639
|
+
controls: listControls,
|
|
640
|
+
list,
|
|
641
|
+
searchId,
|
|
642
|
+
searchPlaceholder,
|
|
643
|
+
showSearch,
|
|
644
|
+
showFavorites: Boolean(favoritesStorageKey),
|
|
645
|
+
shuffle: shuffle ? {
|
|
646
|
+
open: shuffleOpen,
|
|
647
|
+
toggle: () => setShuffleOpen(open => !open),
|
|
648
|
+
panelId: `${slug}-shuffle-panel`
|
|
649
|
+
} : void 0,
|
|
650
|
+
shufflePanel: shuffle && shuffleOpen && shuffleRows.length > 0 && drawCard ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_ShufflePanel.ShufflePanel, {
|
|
651
|
+
id: `${slug}-shuffle-panel`,
|
|
652
|
+
label: t("Surprise me"),
|
|
653
|
+
rows: shuffleRows,
|
|
654
|
+
itemLabel: shuffle.label,
|
|
655
|
+
renderPick: doc => drawCard(doc, 0),
|
|
656
|
+
onGo: doc => {
|
|
657
|
+
setShuffleOpen(false);
|
|
658
|
+
onItemClick?.(doc);
|
|
659
|
+
},
|
|
660
|
+
testID: `${slug}-shuffle-panel`
|
|
661
|
+
}) : null,
|
|
662
|
+
separator: !surface,
|
|
663
|
+
testID: slug
|
|
664
|
+
}) : null;
|
|
665
|
+
const asPage = view => {
|
|
666
|
+
const extras = /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
667
|
+
children: [list.readers, shuffle && shuffleOpen && !linkFilters.pending ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_FrappeRowsReader.FrappeRowsReader, {
|
|
668
|
+
connection: connectionConfig,
|
|
669
|
+
doctype,
|
|
670
|
+
options: shuffleOptions,
|
|
671
|
+
onChange: handleShuffleRows
|
|
672
|
+
}) : null, favoritesStorageKey ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_ListToastHost.ListToastHost, {}) : null]
|
|
673
|
+
});
|
|
674
|
+
if (route === void 0) {
|
|
675
|
+
return controlsBand ? /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {
|
|
676
|
+
...knobProps.gap,
|
|
677
|
+
flex: viewMode === "grid" ? void 0 : 1,
|
|
678
|
+
children: [controlsBand, view, extras]
|
|
679
|
+
}) : /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
680
|
+
children: [view, extras]
|
|
681
|
+
});
|
|
682
|
+
}
|
|
683
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_components.ListPageLayout, {
|
|
684
|
+
scroll: !surface,
|
|
685
|
+
header: /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
686
|
+
children: [controlsBand ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_components.SkipLink, {
|
|
687
|
+
targetId: resultsId,
|
|
688
|
+
children: t("Skip to results")
|
|
689
|
+
}) : null, /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_components.PageHeader, {
|
|
690
|
+
title: title ?? doctype,
|
|
691
|
+
subtitle: subtitle && list.total !== void 0 ? subtitle(list.total) : void 0,
|
|
692
|
+
actions: headerActions,
|
|
693
|
+
divider: !surface
|
|
694
|
+
})]
|
|
695
|
+
}),
|
|
696
|
+
toolbar: controlsBand ?? void 0,
|
|
697
|
+
children: [view, extras]
|
|
698
|
+
});
|
|
699
|
+
};
|
|
700
|
+
const controlsEmptyState = hasControls ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_components.EmptyState, {
|
|
701
|
+
"aria-live": "polite",
|
|
702
|
+
icon: list.state.favoritesOnly ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react.HeartIcon, {
|
|
703
|
+
size: 28
|
|
704
|
+
}) : (0, import_listState.isListNarrowed)(list.state) ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react.MagnifyingGlassIcon, {
|
|
705
|
+
size: 28
|
|
706
|
+
}) : /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react.SparkleIcon, {
|
|
707
|
+
size: 28
|
|
708
|
+
}),
|
|
709
|
+
title: list.state.favoritesOnly ? t("No favorites yet") : list.state.search.trim() ? t('No match for "{{query}}"', {
|
|
710
|
+
query: list.state.search.trim()
|
|
711
|
+
}) : (0, import_listState.isListNarrowed)(list.state) ? t("No {{doctype}} match the active filters", {
|
|
712
|
+
doctype
|
|
713
|
+
}) : t("No {{doctype}} yet", {
|
|
714
|
+
doctype
|
|
715
|
+
}),
|
|
716
|
+
description: list.state.favoritesOnly ? t("Tap the heart on a record to favorite it.") : (0, import_listState.isListNarrowed)(list.state) ? t("Try a different search or filter.") : void 0,
|
|
717
|
+
action: (0, import_listState.isListNarrowed)(list.state) ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_forms.Button, {
|
|
718
|
+
outlined: true,
|
|
719
|
+
onPress: list.clear,
|
|
720
|
+
children: t("Clear filters")
|
|
721
|
+
}) : onAdd ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_forms.Button, {
|
|
722
|
+
theme: "accent",
|
|
723
|
+
onPress: onAdd,
|
|
724
|
+
children: t("Add your first {{doctype}}", {
|
|
725
|
+
doctype
|
|
726
|
+
})
|
|
727
|
+
}) : void 0
|
|
728
|
+
}) : void 0;
|
|
379
729
|
if (isMetaLoading && !fields) {
|
|
380
730
|
return asPage(/* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {
|
|
381
731
|
...knobProps.panelPadding,
|
|
382
732
|
alignItems: "center",
|
|
383
733
|
justifyContent: "center",
|
|
734
|
+
gap: "$2",
|
|
384
735
|
...stackProps,
|
|
385
736
|
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_forms.Spinner, {
|
|
386
737
|
size: "large"
|
|
387
738
|
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Text, {
|
|
388
739
|
...knobProps.body,
|
|
389
740
|
color: knobProps.textAccentColor,
|
|
390
|
-
marginTop: "$2",
|
|
391
741
|
children: t("Loading {{doctype}} schema...", {
|
|
392
742
|
doctype
|
|
393
743
|
})
|
|
@@ -407,7 +757,7 @@ function FrappeListViewBody({
|
|
|
407
757
|
alignItems: "center",
|
|
408
758
|
...knobProps.gap,
|
|
409
759
|
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_components.ViewSwitcher, {
|
|
410
|
-
views: [...(
|
|
760
|
+
views: [...(hasCards ? [{
|
|
411
761
|
type: "grid",
|
|
412
762
|
label: t("Cards")
|
|
413
763
|
}] : []), {
|
|
@@ -500,6 +850,7 @@ function FrappeListViewBody({
|
|
|
500
850
|
borderBottomColor: "$borderColor",
|
|
501
851
|
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
502
852
|
flex: 1,
|
|
853
|
+
id: searchId,
|
|
503
854
|
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_forms.SearchInput, {
|
|
504
855
|
value: searchText,
|
|
505
856
|
onChange: setSearchText,
|
|
@@ -519,23 +870,23 @@ function FrappeListViewBody({
|
|
|
519
870
|
const isGrid = viewMode === "grid";
|
|
520
871
|
return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {
|
|
521
872
|
flex: isGrid ? void 0 : 1,
|
|
522
|
-
children: [showSearch ? renderListSearch() : null, /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_FrappeList.FrappeList, {
|
|
873
|
+
children: [showSearch && !hasControls ? renderListSearch() : null, /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_FrappeList.FrappeList, {
|
|
523
874
|
layout: isGrid ? "grid" : "list",
|
|
524
875
|
gridProps,
|
|
525
|
-
emptyState,
|
|
876
|
+
emptyState: emptyState ?? controlsEmptyState,
|
|
526
877
|
pageSize,
|
|
527
878
|
onRetry: onRetry ?? handleRefresh,
|
|
528
879
|
doctype,
|
|
529
880
|
fields: effectiveFields,
|
|
530
881
|
filters: listFilters,
|
|
531
|
-
renderItem: isGrid &&
|
|
882
|
+
renderItem: isGrid && drawCard ? drawCard : renderListItem,
|
|
532
883
|
onItemClick,
|
|
533
884
|
baseURL: finalBaseURL,
|
|
534
885
|
auth: finalAuth,
|
|
535
886
|
syncOptions: finalSyncOptions,
|
|
536
|
-
orderBy,
|
|
887
|
+
orderBy: effectiveOrderBy,
|
|
537
888
|
limit,
|
|
538
|
-
initialRows,
|
|
889
|
+
initialRows: seedRows,
|
|
539
890
|
...(noResultsMessage ? {
|
|
540
891
|
emptyMessage: noResultsMessage
|
|
541
892
|
} : {})
|
|
@@ -578,6 +929,9 @@ function FrappeListViewBody({
|
|
|
578
929
|
...(surface ? knobProps.containerRadius : {}),
|
|
579
930
|
overflow: surface ? "hidden" : void 0,
|
|
580
931
|
testID: `${doctype.toLowerCase()}-list`,
|
|
932
|
+
...(hasControls ? {
|
|
933
|
+
id: resultsId
|
|
934
|
+
} : {}),
|
|
581
935
|
...stackProps,
|
|
582
936
|
children: [renderToolbar(), linkFilters.readers, showFilterSidebar ? /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.XStack, {
|
|
583
937
|
flex: 1,
|