@multiplatform.one/frappe-ui 7.23.2 → 7.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ChartCard.native.js.map +1 -1
- package/dist/cjs/FileBrowser/AttachLibrary.native.js.map +1 -1
- package/dist/cjs/FileBrowser/folderTree.native.js.map +1 -1
- package/dist/cjs/FileBrowser/index.native.js.map +1 -1
- package/dist/cjs/FileBrowser/types.native.js.map +1 -1
- package/dist/cjs/FileBrowser/viewPersistence.native.js.map +1 -1
- package/dist/cjs/FormSidebar.native.js.map +1 -1
- package/dist/cjs/FrappeAssignment.native.js.map +1 -1
- 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/FrappeChartCard.native.js.map +1 -1
- package/dist/cjs/FrappeConnectionIndicator.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.native.js +1 -1
- package/dist/cjs/FrappeForm.native.js.map +1 -1
- package/dist/cjs/FrappeFormActions.native.js.map +1 -1
- package/dist/cjs/FrappeFormConnections.native.js.map +1 -1
- package/dist/cjs/FrappeGantt.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/FrappeKPICard.native.js.map +1 -1
- package/dist/cjs/FrappeKanban.native.js.map +1 -1
- 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/FrappeList.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/FrappeNotConfigured.native.js.map +1 -1
- package/dist/cjs/FrappeProvider.native.js.map +1 -1
- package/dist/cjs/FrappeReconnectIndicator.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/FrappeReportView.native.js +3 -3
- package/dist/cjs/FrappeReportView.native.js.map +1 -1
- package/dist/cjs/FrappeRowsReader.native.js.map +1 -1
- package/dist/cjs/FrappeTable.native.js.map +1 -1
- package/dist/cjs/FrappeTreeView.cjs +1 -1
- package/dist/cjs/FrappeTreeView.native.js +1 -1
- package/dist/cjs/FrappeTreeView.native.js.map +1 -1
- package/dist/cjs/SyncErrorNotice.native.js.map +1 -1
- package/dist/cjs/commentActions.native.js.map +1 -1
- package/dist/cjs/components/attachments.native.js.map +1 -1
- package/dist/cjs/components/tags.native.js.map +1 -1
- package/dist/cjs/components/timeline.native.js.map +1 -1
- package/dist/cjs/dependsOn.native.js.map +1 -1
- package/dist/cjs/desk/DeskFormPage.native.js.map +1 -1
- package/dist/cjs/desk/DeskFormSidebar.native.js.map +1 -1
- package/dist/cjs/desk/DeskListPage.native.js.map +1 -1
- package/dist/cjs/desk/DeskShell.native.js.map +1 -1
- package/dist/cjs/desk/DeskSidebar.native.js.map +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/fieldOverrides.native.js.map +1 -1
- package/dist/cjs/fieldRegistry.native.js +31 -31
- package/dist/cjs/fieldRegistry.native.js.map +1 -1
- package/dist/cjs/fields/Barcode/index.native.js.map +1 -1
- package/dist/cjs/fields/Check/index.native.js.map +1 -1
- package/dist/cjs/fields/CodeEditor/index.native.js.map +1 -1
- package/dist/cjs/fields/Color/index.native.js.map +1 -1
- package/dist/cjs/fields/Data/index.native.js.map +1 -1
- package/dist/cjs/fields/Date/sheetKeyboard.native.js.map +1 -1
- package/dist/cjs/fields/Date/types.native.js.map +1 -1
- package/dist/cjs/fields/Date/wire.native.js.map +1 -1
- package/dist/cjs/fields/DateRange/index.native.js.map +1 -1
- package/dist/cjs/fields/Duration/index.native.js.map +1 -1
- package/dist/cjs/fields/DynamicLink.native.js.map +1 -1
- package/dist/cjs/fields/FileUpload.native.js.map +1 -1
- package/dist/cjs/fields/FileUploadField/index.native.js.map +1 -1
- package/dist/cjs/fields/Geolocation/index.native.js.map +1 -1
- package/dist/cjs/fields/HTML/index.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/fields/Icon/index.native.js.map +1 -1
- package/dist/cjs/fields/Link.native.js.map +1 -1
- package/dist/cjs/fields/LinkTree.native.js.map +1 -1
- package/dist/cjs/fields/LongText/index.native.js.map +1 -1
- package/dist/cjs/fields/MentionInput/index.native.js.map +1 -1
- package/dist/cjs/fields/Numeric/index.native.js.map +1 -1
- package/dist/cjs/fields/OTPInput/index.native.js.map +1 -1
- package/dist/cjs/fields/Password/index.native.js.map +1 -1
- package/dist/cjs/fields/Phone/index.native.js.map +1 -1
- package/dist/cjs/fields/Progress/index.native.js.map +1 -1
- package/dist/cjs/fields/RadioGroup/index.native.js.map +1 -1
- package/dist/cjs/fields/Rating/index.native.js.map +1 -1
- package/dist/cjs/fields/ReadOnly/index.native.js.map +1 -1
- package/dist/cjs/fields/Select/index.native.js.map +1 -1
- package/dist/cjs/fields/Signature/index.native.js.map +1 -1
- package/dist/cjs/fields/Slider/index.native.js.map +1 -1
- package/dist/cjs/fields/SmallText/index.native.js.map +1 -1
- package/dist/cjs/fields/Switch/index.native.js.map +1 -1
- package/dist/cjs/fields/TableMultiSelect.native.js.map +1 -1
- package/dist/cjs/fields/TextEditor/types.native.js.map +1 -1
- package/dist/cjs/fields/TimePicker/index.native.js.map +1 -1
- package/dist/cjs/fields/ToggleGroup/index.native.js.map +1 -1
- package/dist/cjs/fields/shared/EditorPreviewPanes.native.js.map +1 -1
- package/dist/cjs/filterFields.native.js.map +1 -1
- package/dist/cjs/formEngine/createPrefill.native.js.map +1 -1
- package/dist/cjs/formEngine/dirtyTracking.native.js.map +1 -1
- package/dist/cjs/formEngine/docLifecycle.native.js.map +1 -1
- package/dist/cjs/formEngine/docPermissions.native.js.map +1 -1
- package/dist/cjs/formEngine/doctypeMeta.native.js.map +1 -1
- package/dist/cjs/formEngine/fetchFrom.native.js.map +1 -1
- package/dist/cjs/formEngine/fieldPermissions.native.js.map +1 -1
- package/dist/cjs/formEngine/formActions.native.js.map +1 -1
- package/dist/cjs/formEngine/formLayout.native.js.map +1 -1
- package/dist/cjs/formEngine/index.native.js.map +1 -1
- package/dist/cjs/formEngine/useAmendedAs.native.js.map +1 -1
- package/dist/cjs/formEngine/useDocRights.native.js.map +1 -1
- package/dist/cjs/formEngine/useFormEngine.native.js.map +1 -1
- package/dist/cjs/formEngine/useSessionRoles.native.js.map +1 -1
- package/dist/cjs/frappeConnections.native.js.map +1 -1
- package/dist/cjs/frappeEventColor.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/frappeStoryTarget.native.js.map +1 -1
- package/dist/cjs/frappeUsers.native.js.map +1 -1
- package/dist/cjs/index.cjs +34 -0
- package/dist/cjs/index.native.js +68 -34
- 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/listColumns.native.js.map +1 -1
- package/dist/cjs/list/listFields.native.js.map +1 -1
- package/dist/cjs/list/listFormat.native.js.map +1 -1
- 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/statusColors.native.js.map +1 -1
- 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/liveErrors.native.js.map +1 -1
- 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/resolveControl.native.js.map +1 -1
- package/dist/cjs/schemaForm/SchemaWizard.native.js.map +1 -1
- package/dist/cjs/schemaForm/applyFieldOrder.native.js.map +1 -1
- package/dist/cjs/schemaForm/index.native.js +1 -1
- package/dist/cjs/schemaForm/index.native.js.map +1 -1
- package/dist/cjs/shared/devWarn.native.js.map +1 -1
- package/dist/cjs/shared/useKeyboardInset.native.js.map +1 -1
- package/dist/cjs/syncError.native.js.map +1 -1
- package/dist/cjs/useConnectionFilters.native.js.map +1 -1
- package/dist/cjs/useFrappeAggregate.native.js.map +1 -1
- package/dist/cjs/useFrappeFacets.native.js.map +1 -1
- package/dist/cjs/useFrappePagination.native.js.map +1 -1
- package/dist/cjs/useFrappeRows.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/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
package/src/FrappeCalendar.tsx
CHANGED
|
@@ -274,9 +274,9 @@ export function FrappeCalendar<TDoc extends { name: string; doctype: string }>({
|
|
|
274
274
|
if (isLoading) {
|
|
275
275
|
if (loading) return <>{loading}</>;
|
|
276
276
|
return (
|
|
277
|
-
<YStack {...knobProps.panelPadding} alignItems="center" {...stackProps}>
|
|
277
|
+
<YStack {...knobProps.panelPadding} alignItems="center" gap="$2" {...stackProps}>
|
|
278
278
|
<Spinner size="large" />
|
|
279
|
-
<Text color={formCommonColors.muted}
|
|
279
|
+
<Text color={formCommonColors.muted} {...knobProps.body}>
|
|
280
280
|
{t("Loading {{doctype}}...", { doctype })}
|
|
281
281
|
</Text>
|
|
282
282
|
</YStack>
|
package/src/FrappeDashboard.tsx
CHANGED
|
@@ -158,9 +158,9 @@ function LiveDashboardContent<TDoc extends { name: string; doctype: string }>({
|
|
|
158
158
|
if (isLiveLoading && liveData.length === 0) {
|
|
159
159
|
if (loading) return <>{loading}</>;
|
|
160
160
|
return (
|
|
161
|
-
<YStack {...knobProps.panelPadding} alignItems="center" {...stackProps}>
|
|
161
|
+
<YStack {...knobProps.panelPadding} alignItems="center" gap="$2" {...stackProps}>
|
|
162
162
|
<Spinner size="large" />
|
|
163
|
-
<Text color={knobProps.textAccentColor}
|
|
163
|
+
<Text color={knobProps.textAccentColor} {...knobProps.body}>
|
|
164
164
|
{t("Loading dashboard...")}
|
|
165
165
|
</Text>
|
|
166
166
|
</YStack>
|
package/src/FrappeImageView.tsx
CHANGED
|
@@ -132,10 +132,11 @@ export function FrappeImageView<TDoc extends { name: string; doctype: string }>(
|
|
|
132
132
|
{...knobProps.panelPadding}
|
|
133
133
|
alignItems="center"
|
|
134
134
|
justifyContent="center"
|
|
135
|
+
gap="$2"
|
|
135
136
|
{...(stackProps as any)}
|
|
136
137
|
>
|
|
137
138
|
<Spinner size="large" />
|
|
138
|
-
<Text color={formCommonColors.muted} {...knobProps.body}
|
|
139
|
+
<Text color={formCommonColors.muted} {...knobProps.body}>
|
|
139
140
|
{t("Loading {{doctype}}...", { doctype })}
|
|
140
141
|
</Text>
|
|
141
142
|
</YStack>
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
// FrappeInsights (MPO-411): a doctype's analytics page over the rows its list
|
|
2
|
+
// reads, declared from the list's facet and numeric fields instead of a page
|
|
3
|
+
// of hand-rolled sections (pokemon's insights).
|
|
4
|
+
import { Order } from "@multiplatform.one/frappe";
|
|
5
|
+
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
6
|
+
import { cleanup, fireEvent, screen, waitFor, within } from "@testing-library/react";
|
|
7
|
+
import i18next from "i18next";
|
|
8
|
+
import { initReactI18next } from "react-i18next";
|
|
9
|
+
import { afterAll, afterEach, beforeAll, describe, expect, it, vi } from "vitest";
|
|
10
|
+
import {
|
|
11
|
+
createRosterFixtures,
|
|
12
|
+
rosterPokemonFields,
|
|
13
|
+
rosterPokemonMeta,
|
|
14
|
+
type RosterPokemon,
|
|
15
|
+
} from "../tests/fixtures/pokemonRoster";
|
|
16
|
+
import { FrappeInsights, type FrappeInsightsProps } from "./FrappeInsights";
|
|
17
|
+
import type { FrappeNavigation } from "./frappeNavigation";
|
|
18
|
+
import { FrappeProvider } from "./FrappeProvider";
|
|
19
|
+
import { favoritesStore } from "./list/favorites";
|
|
20
|
+
|
|
21
|
+
const host = "https://insights.spec.test";
|
|
22
|
+
const realFetch = globalThis.fetch;
|
|
23
|
+
const favoritesKey = "insights-spec-favorites";
|
|
24
|
+
|
|
25
|
+
beforeAll(async () => {
|
|
26
|
+
await i18next.use(initReactI18next).init({
|
|
27
|
+
lng: "en",
|
|
28
|
+
interpolation: { escapeValue: false },
|
|
29
|
+
resources: { en: { translation: {} } },
|
|
30
|
+
});
|
|
31
|
+
globalThis.fetch = (async (input: RequestInfo | URL, init?: RequestInit) => {
|
|
32
|
+
const url = typeof input === "string" ? input : input instanceof URL ? input.href : input.url;
|
|
33
|
+
if (url.startsWith(host)) {
|
|
34
|
+
const body = /\/api\/resource\/DocType\//.test(url)
|
|
35
|
+
? { data: rosterPokemonMeta }
|
|
36
|
+
: { data: [] };
|
|
37
|
+
return new Response(JSON.stringify(body), {
|
|
38
|
+
status: 200,
|
|
39
|
+
headers: { "Content-Type": "application/json" },
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
return realFetch(input as RequestInfo, init);
|
|
43
|
+
}) as typeof fetch;
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
afterAll(() => {
|
|
47
|
+
globalThis.fetch = realFetch;
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
afterEach(() => {
|
|
51
|
+
cleanup();
|
|
52
|
+
favoritesStore(favoritesKey).setState(() => ({ names: [] }));
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
const insights: FrappeInsightsProps<RosterPokemon> = {
|
|
56
|
+
doctype: "Pokemon",
|
|
57
|
+
route: "/pokemon",
|
|
58
|
+
listTitle: "Roster",
|
|
59
|
+
subtitle: (count) => `${count} analyzed`,
|
|
60
|
+
fields: rosterPokemonFields,
|
|
61
|
+
orderBy: [{ field: "poke_id", order: Order.Asc }],
|
|
62
|
+
facet: {
|
|
63
|
+
param: "type",
|
|
64
|
+
doctype: "Pokemon Poke Type",
|
|
65
|
+
field: "poke_type",
|
|
66
|
+
orderBy: "slot",
|
|
67
|
+
label: "Type",
|
|
68
|
+
options: ["grass", "poison", "fire", "water", "electric", "ghost", "normal"],
|
|
69
|
+
tint: (type) => (type === "fire" ? "tomato" : undefined),
|
|
70
|
+
},
|
|
71
|
+
facetPlural: "Types",
|
|
72
|
+
metrics: [
|
|
73
|
+
{
|
|
74
|
+
field: "base_experience",
|
|
75
|
+
label: "Base XP",
|
|
76
|
+
record: "Highest base XP",
|
|
77
|
+
format: (v) => `${v} xp`,
|
|
78
|
+
},
|
|
79
|
+
{ field: "poke_id", label: "Number" },
|
|
80
|
+
],
|
|
81
|
+
favorites: favoritesKey,
|
|
82
|
+
look: { code: (doc) => `#${String(doc.poke_id).padStart(3, "0")}` },
|
|
83
|
+
testID: "insights",
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
function renderInsights(
|
|
87
|
+
props: Partial<FrappeInsightsProps<RosterPokemon>> = {},
|
|
88
|
+
navigate = vi.fn(),
|
|
89
|
+
fixtures = createRosterFixtures(),
|
|
90
|
+
) {
|
|
91
|
+
const navigation: FrappeNavigation = {
|
|
92
|
+
usePathname: () => "/pokemon/insights",
|
|
93
|
+
useNavigate: () => navigate,
|
|
94
|
+
};
|
|
95
|
+
return renderWithProviders(
|
|
96
|
+
<FrappeProvider baseURL={host} fixtures={fixtures} navigation={navigation}>
|
|
97
|
+
<FrappeInsights<RosterPokemon> {...insights} {...props} />
|
|
98
|
+
</FrappeProvider>,
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
async function tile(id: string): Promise<HTMLElement> {
|
|
103
|
+
return screen.findByTestId(`insights-dashboard-kpi-${id}`, {}, { timeout: 5000 });
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
describe("FrappeInsights header and counts", () => {
|
|
107
|
+
it("titles the page under the list's breadcrumb and counts the records", async () => {
|
|
108
|
+
renderInsights();
|
|
109
|
+
expect(await screen.findByText("6 analyzed", {}, { timeout: 5000 })).toBeTruthy();
|
|
110
|
+
expect(screen.getAllByText("Insights").length).toBeGreaterThan(0);
|
|
111
|
+
expect(screen.getByText("Total Roster")).toBeTruthy();
|
|
112
|
+
expect(screen.getByText("Roster")).toBeTruthy();
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
it("counts the favorites, the facet's distinct values and averages the first metric", async () => {
|
|
116
|
+
favoritesStore(favoritesKey).setState(() => ({ names: ["pikachu", "gengar"] }));
|
|
117
|
+
renderInsights();
|
|
118
|
+
await waitFor(async () => expect((await tile("facet")).textContent).toContain("7"), {
|
|
119
|
+
timeout: 5000,
|
|
120
|
+
});
|
|
121
|
+
expect((await tile("facet")).textContent).toContain("Distinct Types");
|
|
122
|
+
expect((await tile("facet")).textContent).toContain("2 with 2+");
|
|
123
|
+
expect((await tile("favorites")).textContent).toContain("2 of 6");
|
|
124
|
+
expect((await tile("average")).textContent).toContain(
|
|
125
|
+
`${Math.round((64 + 62 + 63 + 112 + 250 + 65) / 6)} xp`,
|
|
126
|
+
);
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
describe("FrappeInsights records and leaders", () => {
|
|
131
|
+
it("crowns the holder of a metric that names its record", async () => {
|
|
132
|
+
renderInsights();
|
|
133
|
+
const records = await screen.findByTestId("insights-records", {}, { timeout: 5000 });
|
|
134
|
+
expect(records.textContent).toContain("Highest base XP");
|
|
135
|
+
expect(records.textContent).toContain("gengar");
|
|
136
|
+
expect(records.textContent).toContain("#094");
|
|
137
|
+
expect(records.textContent).toContain("250 xp");
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
it("ranks the leaders by the picked metric and opens a row's record", async () => {
|
|
141
|
+
const navigate = vi.fn();
|
|
142
|
+
renderInsights({}, navigate);
|
|
143
|
+
const leaders = await screen.findByTestId("insights-leaderboard", {}, { timeout: 5000 });
|
|
144
|
+
await waitFor(() => expect(within(leaders).getAllByText(/^#\d$/).length).toBe(5));
|
|
145
|
+
fireEvent.click(within(leaders).getByText("gengar"));
|
|
146
|
+
expect(navigate).toHaveBeenCalledWith("/pokemon/gengar");
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
describe("FrappeInsights table and facet links", () => {
|
|
151
|
+
it("tags each record with its facet values and links a value to the narrowed list", async () => {
|
|
152
|
+
const navigate = vi.fn();
|
|
153
|
+
renderInsights({}, navigate);
|
|
154
|
+
const poison = await screen.findByTestId("insights-tag-poison", {}, { timeout: 5000 });
|
|
155
|
+
expect(poison.textContent).toContain("2");
|
|
156
|
+
fireEvent.click(poison);
|
|
157
|
+
expect(navigate).toHaveBeenCalledWith("/pokemon?type=poison");
|
|
158
|
+
const table = screen.getByTestId("insights-roster");
|
|
159
|
+
expect(table.textContent).toContain("Types");
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
describe("FrappeInsights honest states", () => {
|
|
164
|
+
it("offers the first record when there is nothing to analyze", async () => {
|
|
165
|
+
const navigate = vi.fn();
|
|
166
|
+
renderInsights({}, navigate, createRosterFixtures({ Pokemon: [] }));
|
|
167
|
+
expect(await screen.findByText("No Roster to analyze", {}, { timeout: 5000 })).toBeTruthy();
|
|
168
|
+
fireEvent.click(await screen.findByText("Add your first Pokemon"));
|
|
169
|
+
expect(navigate).toHaveBeenCalledWith("/pokemon/new");
|
|
170
|
+
});
|
|
171
|
+
});
|
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AsyncSkeleton,
|
|
3
|
+
Breadcrumbs,
|
|
4
|
+
Button,
|
|
5
|
+
EmptyState,
|
|
6
|
+
PageHeader,
|
|
7
|
+
PageSection,
|
|
8
|
+
Screen,
|
|
9
|
+
XStack,
|
|
10
|
+
YStack,
|
|
11
|
+
useTheme,
|
|
12
|
+
type ChartConfig,
|
|
13
|
+
} from "@multiplatform.one/components";
|
|
14
|
+
import { useDocTypeMeta, type Order } from "@multiplatform.one/frappe";
|
|
15
|
+
import { useResolvedKnobs } from "@multiplatform.one/theme";
|
|
16
|
+
import { ArrowLeftIcon, SparkleIcon } from "@phosphor-icons/react";
|
|
17
|
+
import { useMemo, useRef } from "react";
|
|
18
|
+
import { useTranslation } from "react-i18next";
|
|
19
|
+
import { connectionsFromMeta, type FrappeConnection } from "./frappeConnections";
|
|
20
|
+
import { frappeRouteHref, useFrappeRouter } from "./frappeNavigation";
|
|
21
|
+
import { FrappeNotConfigured } from "./FrappeNotConfigured";
|
|
22
|
+
import { useFrappeConfig } from "./FrappeProvider";
|
|
23
|
+
import { FrappeReconnectIndicator } from "./FrappeReconnectIndicator";
|
|
24
|
+
import { useDocRights } from "./formEngine/useDocRights";
|
|
25
|
+
import {
|
|
26
|
+
average,
|
|
27
|
+
facetDistribution,
|
|
28
|
+
foldDistribution,
|
|
29
|
+
histogram,
|
|
30
|
+
multiValued,
|
|
31
|
+
orderRows,
|
|
32
|
+
topBy,
|
|
33
|
+
} from "./insights/insightsData";
|
|
34
|
+
import { InsightsFacetTags } from "./insights/InsightsFacetTags";
|
|
35
|
+
import { InsightsKpiBand, type InsightsTile } from "./insights/InsightsKpiBand";
|
|
36
|
+
import { InsightsLeaders } from "./insights/InsightsLeaders";
|
|
37
|
+
import {
|
|
38
|
+
formatMetric,
|
|
39
|
+
type FrappeInsightsMetric,
|
|
40
|
+
type InsightsRecordView,
|
|
41
|
+
} from "./insights/insightsRecord";
|
|
42
|
+
import { InsightsRecords } from "./insights/InsightsRecords";
|
|
43
|
+
import { InsightsTable } from "./insights/InsightsTable";
|
|
44
|
+
import { facetRead, readFacet } from "./list/facetReading";
|
|
45
|
+
import { favoritesKey, useFavorites } from "./list/favorites";
|
|
46
|
+
import type { FrappeListFacet } from "./list/listState";
|
|
47
|
+
import { recordTitle, type FrappeRecordLook } from "./list/recordLook";
|
|
48
|
+
import { useFrappeConnection, useFrappeRows } from "./useFrappeRows";
|
|
49
|
+
|
|
50
|
+
export type { FrappeInsightsMetric };
|
|
51
|
+
|
|
52
|
+
/** Slices of the facet pie before the tail folds into "Other". */
|
|
53
|
+
const pieSlices = 7;
|
|
54
|
+
|
|
55
|
+
const noMetrics: readonly FrappeInsightsMetric[] = [];
|
|
56
|
+
|
|
57
|
+
export interface FrappeInsightsProps<TDoc extends { name: string; doctype: string }> {
|
|
58
|
+
doctype: string;
|
|
59
|
+
/** The doctype's list route: the breadcrumb, Back, record pages and facet links hang off it. */
|
|
60
|
+
route: string;
|
|
61
|
+
/** The list's title; defaults to the doctype. */
|
|
62
|
+
listTitle?: string;
|
|
63
|
+
/** Defaults to "Insights". */
|
|
64
|
+
title?: string;
|
|
65
|
+
subtitle?: (count: number) => string;
|
|
66
|
+
/** The list's fields and ceiling, so both pages share one read. */
|
|
67
|
+
fields?: readonly (keyof TDoc & string)[];
|
|
68
|
+
limit?: number;
|
|
69
|
+
orderBy?: Array<{ field: keyof TDoc & string; order: Order }>;
|
|
70
|
+
/** Declared connections; defaults to the meta's (a Guest cannot read meta). */
|
|
71
|
+
connections?: readonly FrappeConnection[];
|
|
72
|
+
/** Its values chart as a pie, count distinct, tag the table and link to the narrowed list. */
|
|
73
|
+
facet?: FrappeListFacet;
|
|
74
|
+
/** The collective name of the facet's values ("Types"); defaults to its label. */
|
|
75
|
+
facetPlural?: string;
|
|
76
|
+
/** Numeric fields: the first charts and averages, each ranks and columns, `record` ones crown a holder. */
|
|
77
|
+
metrics?: readonly FrappeInsightsMetric[];
|
|
78
|
+
/** Count the list's favorites: true keys them by doctype, a string names the key. */
|
|
79
|
+
favorites?: boolean | string;
|
|
80
|
+
look?: FrappeRecordLook<TDoc>;
|
|
81
|
+
titleField?: string;
|
|
82
|
+
/** Rows per page of the full table. */
|
|
83
|
+
pageSize?: number;
|
|
84
|
+
/** Prefix of the sections' test ids. */
|
|
85
|
+
testID?: string;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* A doctype's analytics page over the rows its list reads: the count, the
|
|
90
|
+
* favorites, the facet's spread and the first metric's average, a facet pie
|
|
91
|
+
* and a metric histogram, record holders, leaders per metric, every record
|
|
92
|
+
* in a table, and the facet's values linking back to the narrowed list.
|
|
93
|
+
* Not configured, error, loading and empty are four honest states under
|
|
94
|
+
* the same wayfinding header.
|
|
95
|
+
*/
|
|
96
|
+
export function FrappeInsights<TDoc extends { name: string; doctype: string }>({
|
|
97
|
+
doctype,
|
|
98
|
+
route,
|
|
99
|
+
listTitle,
|
|
100
|
+
title,
|
|
101
|
+
subtitle,
|
|
102
|
+
fields,
|
|
103
|
+
limit,
|
|
104
|
+
orderBy,
|
|
105
|
+
connections,
|
|
106
|
+
facet: facetProp,
|
|
107
|
+
facetPlural,
|
|
108
|
+
metrics: metricsProp = noMetrics,
|
|
109
|
+
favorites,
|
|
110
|
+
look,
|
|
111
|
+
titleField,
|
|
112
|
+
pageSize = 5,
|
|
113
|
+
testID,
|
|
114
|
+
}: FrappeInsightsProps<TDoc>) {
|
|
115
|
+
const { t } = useTranslation();
|
|
116
|
+
const { knobProps } = useResolvedKnobs();
|
|
117
|
+
const theme = useTheme() as unknown as Record<string, { val?: string } | undefined>;
|
|
118
|
+
const config = useFrappeConfig();
|
|
119
|
+
const connection = useFrappeConnection();
|
|
120
|
+
const navigate = useFrappeRouter()?.navigate;
|
|
121
|
+
const { meta } = useDocTypeMeta(connection, doctype);
|
|
122
|
+
const { rights } = useDocRights(connection, meta);
|
|
123
|
+
const listName = listTitle ?? doctype;
|
|
124
|
+
const pageTitle = title ?? t("Insights");
|
|
125
|
+
|
|
126
|
+
// Declarations arrive as fresh objects every render. The sections' tables
|
|
127
|
+
// keep their page only while their data keeps its identity, so the facet
|
|
128
|
+
// and metrics settle on what they declare and the functions ride refs.
|
|
129
|
+
const latest = useRef({ facet: facetProp, metrics: metricsProp, look, navigate });
|
|
130
|
+
latest.current = { facet: facetProp, metrics: metricsProp, look, navigate };
|
|
131
|
+
const facetKey = JSON.stringify(facetProp ?? null);
|
|
132
|
+
const metricsKey = JSON.stringify(metricsProp);
|
|
133
|
+
const facet = useMemo(() => latest.current.facet, [facetKey]);
|
|
134
|
+
const metrics = useMemo(() => latest.current.metrics, [metricsKey]);
|
|
135
|
+
|
|
136
|
+
const {
|
|
137
|
+
rows: readRows,
|
|
138
|
+
isLoading,
|
|
139
|
+
error,
|
|
140
|
+
} = useFrappeRows<TDoc>(connection, doctype, { fields, limit, orderBy });
|
|
141
|
+
const orderKey = JSON.stringify(orderBy ?? null);
|
|
142
|
+
const rows = useMemo(
|
|
143
|
+
() => orderRows(readRows as never[], JSON.parse(orderKey)) as TDoc[],
|
|
144
|
+
[readRows, orderKey],
|
|
145
|
+
);
|
|
146
|
+
const read = facet
|
|
147
|
+
? facetRead(facet, doctype, connections ?? connectionsFromMeta(meta), limit)
|
|
148
|
+
: undefined;
|
|
149
|
+
const readKey = JSON.stringify(read ?? null);
|
|
150
|
+
const facetQuery = useMemo(() => JSON.parse(readKey) as typeof read | null, [readKey]);
|
|
151
|
+
const facetOptions = useMemo(
|
|
152
|
+
() => ({ ...facetQuery?.options, enabled: Boolean(facetQuery?.ready) }),
|
|
153
|
+
[facetQuery],
|
|
154
|
+
);
|
|
155
|
+
const { rows: facetRows } = useFrappeRows<TDoc>(
|
|
156
|
+
connection,
|
|
157
|
+
facetQuery?.doctype ?? "",
|
|
158
|
+
facetOptions as never,
|
|
159
|
+
);
|
|
160
|
+
const values = useMemo(
|
|
161
|
+
() =>
|
|
162
|
+
facet && facetQuery
|
|
163
|
+
? readFacet(facet, facetQuery.linkField, facetRows as never).values
|
|
164
|
+
: new Map<string, string[]>(),
|
|
165
|
+
[facet, facetQuery, facetRows],
|
|
166
|
+
);
|
|
167
|
+
const { count: favoritesCount } = useFavorites(
|
|
168
|
+
favorites ? (typeof favorites === "string" ? favorites : favoritesKey(doctype)) : undefined,
|
|
169
|
+
);
|
|
170
|
+
|
|
171
|
+
const nameField = titleField ?? meta?.title_field;
|
|
172
|
+
const baseURL = config?.baseURL;
|
|
173
|
+
const record = useMemo<InsightsRecordView<TDoc>>(
|
|
174
|
+
() => ({
|
|
175
|
+
title: (doc) => recordTitle(doc, latest.current.look, nameField),
|
|
176
|
+
code: (doc) => latest.current.look?.code?.(doc) || undefined,
|
|
177
|
+
images: (doc) => latest.current.look?.images?.(doc, baseURL) ?? [],
|
|
178
|
+
values: (doc) => values.get(doc.name) ?? [],
|
|
179
|
+
tints: (doc) => (values.get(doc.name) ?? []).map((value) => facet?.tint?.(value)),
|
|
180
|
+
valueLabel: (value) => facet?.optionLabel?.(value) ?? value,
|
|
181
|
+
valueTint: (value) => facet?.tint?.(value),
|
|
182
|
+
open: (doc) =>
|
|
183
|
+
latest.current.navigate?.(frappeRouteHref(route, { mode: "view", name: doc.name })),
|
|
184
|
+
}),
|
|
185
|
+
[nameField, baseURL, values, facet, route],
|
|
186
|
+
);
|
|
187
|
+
|
|
188
|
+
const distribution = useMemo(() => facetDistribution(values, rows), [values, rows]);
|
|
189
|
+
const lead = metrics[0];
|
|
190
|
+
const plural = facetPlural ?? facet?.label ?? "";
|
|
191
|
+
|
|
192
|
+
const tiles: InsightsTile[] = [];
|
|
193
|
+
if (favorites) {
|
|
194
|
+
tiles.push({
|
|
195
|
+
id: "favorites",
|
|
196
|
+
title: t("Favorites"),
|
|
197
|
+
value: favoritesCount,
|
|
198
|
+
hint: t("{{count}} of {{total}}", { count: favoritesCount, total: rows.length }),
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
if (facet) {
|
|
202
|
+
const several = multiValued(values, rows);
|
|
203
|
+
tiles.push({
|
|
204
|
+
id: "facet",
|
|
205
|
+
title: t("Distinct {{facets}}", { facets: plural }),
|
|
206
|
+
value: distribution.length,
|
|
207
|
+
hint:
|
|
208
|
+
several > 0
|
|
209
|
+
? t("{{count}} with 2+", { count: several })
|
|
210
|
+
: distribution[0]
|
|
211
|
+
? record.valueLabel(distribution[0].value)
|
|
212
|
+
: undefined,
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
const buckets = lead ? histogram(rows as never[], lead.field, lead.bucket) : [];
|
|
216
|
+
if (lead) {
|
|
217
|
+
tiles.push({
|
|
218
|
+
id: "average",
|
|
219
|
+
title: t("Average {{metric}}", { metric: lead.label }),
|
|
220
|
+
value: formatMetric(lead, Math.round(average(rows as never[], lead.field))),
|
|
221
|
+
spark: buckets.map((bucket) => bucket.value),
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
const charts: ChartConfig[] = [];
|
|
225
|
+
if (facet) {
|
|
226
|
+
charts.push({
|
|
227
|
+
id: "facet-distribution",
|
|
228
|
+
title: t("{{facet}} distribution", { facet: facet.label }),
|
|
229
|
+
type: "pie",
|
|
230
|
+
data: foldDistribution(distribution, pieSlices).map((entry) => ({
|
|
231
|
+
label: entry.other ? t("Other") : record.valueLabel(entry.value),
|
|
232
|
+
value: entry.count,
|
|
233
|
+
color: theme[`${(!entry.other && facet.tint?.(entry.value)) || "gray"}9`]?.val,
|
|
234
|
+
})),
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
if (lead) {
|
|
238
|
+
charts.push({
|
|
239
|
+
id: "metric-histogram",
|
|
240
|
+
title: t("{{metric}} distribution", { metric: lead.label }),
|
|
241
|
+
type: "bar",
|
|
242
|
+
data: buckets,
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
const holders = metrics
|
|
246
|
+
.filter((metric) => metric.record)
|
|
247
|
+
.flatMap((metric) => {
|
|
248
|
+
const doc = topBy(rows as never[], metric.field, 1)[0] as TDoc | undefined;
|
|
249
|
+
return doc
|
|
250
|
+
? [
|
|
251
|
+
{
|
|
252
|
+
id: metric.field,
|
|
253
|
+
label: metric.record as string,
|
|
254
|
+
doc,
|
|
255
|
+
value: formatMetric(metric, Number(doc[metric.field as keyof TDoc]) || 0),
|
|
256
|
+
},
|
|
257
|
+
]
|
|
258
|
+
: [];
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
const onAdd =
|
|
262
|
+
rights.create && navigate
|
|
263
|
+
? () => navigate(frappeRouteHref(route, { mode: "create" }))
|
|
264
|
+
: undefined;
|
|
265
|
+
const sectionId = (name: string) => (testID ? `${testID}-${name}` : undefined);
|
|
266
|
+
|
|
267
|
+
if (!config?.baseURL && !config?.fixtures) {
|
|
268
|
+
return <FrappeNotConfigured doctype={doctype} page />;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
const header = (
|
|
272
|
+
<YStack {...knobProps.gap}>
|
|
273
|
+
<Breadcrumbs
|
|
274
|
+
items={[{ label: listName, href: route }, { label: pageTitle }]}
|
|
275
|
+
onNavigate={(href) => navigate?.(href)}
|
|
276
|
+
/>
|
|
277
|
+
<PageHeader
|
|
278
|
+
title={pageTitle}
|
|
279
|
+
subtitle={
|
|
280
|
+
subtitle && !isLoading && !error && rows.length > 0 ? subtitle(rows.length) : undefined
|
|
281
|
+
}
|
|
282
|
+
actions={
|
|
283
|
+
<Button
|
|
284
|
+
variant="outlined"
|
|
285
|
+
minHeight={knobProps.sizeToken}
|
|
286
|
+
onPress={() => navigate?.(route)}
|
|
287
|
+
icon={<ArrowLeftIcon size={16} />}
|
|
288
|
+
testID={sectionId("back")}
|
|
289
|
+
>
|
|
290
|
+
{t("Back to {{title}}", { title: listName })}
|
|
291
|
+
</Button>
|
|
292
|
+
}
|
|
293
|
+
/>
|
|
294
|
+
</YStack>
|
|
295
|
+
);
|
|
296
|
+
|
|
297
|
+
if (error) {
|
|
298
|
+
return (
|
|
299
|
+
<Screen scroll={false}>
|
|
300
|
+
{header}
|
|
301
|
+
<EmptyState
|
|
302
|
+
intent="error"
|
|
303
|
+
title={t("Couldn't load {{title}}", { title: listName })}
|
|
304
|
+
description={t("Check the connection and try again.")}
|
|
305
|
+
/>
|
|
306
|
+
</Screen>
|
|
307
|
+
);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
if (isLoading) {
|
|
311
|
+
return (
|
|
312
|
+
<Screen>
|
|
313
|
+
{header}
|
|
314
|
+
<YStack testID={sectionId("skeleton")}>
|
|
315
|
+
<AsyncSkeleton layout="dashboard" />
|
|
316
|
+
</YStack>
|
|
317
|
+
</Screen>
|
|
318
|
+
);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
if (rows.length === 0) {
|
|
322
|
+
return (
|
|
323
|
+
<Screen scroll={false}>
|
|
324
|
+
{header}
|
|
325
|
+
<EmptyState
|
|
326
|
+
icon={<SparkleIcon size={28} />}
|
|
327
|
+
title={t("No {{title}} to analyze", { title: listName })}
|
|
328
|
+
description={t("Add a record and the analytics will light up.")}
|
|
329
|
+
action={
|
|
330
|
+
onAdd ? (
|
|
331
|
+
<Button theme="accent" onPress={onAdd}>
|
|
332
|
+
{t("Add your first {{doctype}}", { doctype })}
|
|
333
|
+
</Button>
|
|
334
|
+
) : undefined
|
|
335
|
+
}
|
|
336
|
+
/>
|
|
337
|
+
</Screen>
|
|
338
|
+
);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
return (
|
|
342
|
+
<Screen>
|
|
343
|
+
<FrappeReconnectIndicator config={connection} />
|
|
344
|
+
{header}
|
|
345
|
+
|
|
346
|
+
<InsightsKpiBand
|
|
347
|
+
hero={{ id: "total", title: t("Total {{title}}", { title: listName }), value: rows.length }}
|
|
348
|
+
tiles={tiles}
|
|
349
|
+
charts={charts}
|
|
350
|
+
testID={sectionId("dashboard")}
|
|
351
|
+
/>
|
|
352
|
+
|
|
353
|
+
{holders.length > 0 || metrics.length > 0 ? (
|
|
354
|
+
<XStack flexWrap="wrap" alignItems="flex-start" {...knobProps.gapLg}>
|
|
355
|
+
{holders.length > 0 ? (
|
|
356
|
+
<PageSection
|
|
357
|
+
title={t("Record holders")}
|
|
358
|
+
divider={false}
|
|
359
|
+
flexGrow={1}
|
|
360
|
+
flexShrink={1}
|
|
361
|
+
flexBasis={280}
|
|
362
|
+
minWidth={0}
|
|
363
|
+
>
|
|
364
|
+
<InsightsRecords tiles={holders} record={record} testID={sectionId("records")} />
|
|
365
|
+
</PageSection>
|
|
366
|
+
) : null}
|
|
367
|
+
{metrics.length > 0 ? (
|
|
368
|
+
<PageSection
|
|
369
|
+
title={t("Leaders")}
|
|
370
|
+
description={t("The top five by the field you pick; open any row.")}
|
|
371
|
+
divider={false}
|
|
372
|
+
flexGrow={2}
|
|
373
|
+
flexShrink={1}
|
|
374
|
+
flexBasis={420}
|
|
375
|
+
minWidth={0}
|
|
376
|
+
>
|
|
377
|
+
<InsightsLeaders
|
|
378
|
+
rows={rows}
|
|
379
|
+
metrics={metrics}
|
|
380
|
+
record={record}
|
|
381
|
+
testID={sectionId("leaderboard")}
|
|
382
|
+
/>
|
|
383
|
+
</PageSection>
|
|
384
|
+
) : null}
|
|
385
|
+
</XStack>
|
|
386
|
+
) : null}
|
|
387
|
+
|
|
388
|
+
<PageSection
|
|
389
|
+
title={t("All {{title}}", { title: listName })}
|
|
390
|
+
description={t("Every record, {{count}} per page; sort any column.", { count: pageSize })}
|
|
391
|
+
divider={false}
|
|
392
|
+
>
|
|
393
|
+
<InsightsTable
|
|
394
|
+
rows={rows}
|
|
395
|
+
metrics={metrics}
|
|
396
|
+
record={record}
|
|
397
|
+
facetLabel={facet ? plural : undefined}
|
|
398
|
+
pageSize={pageSize}
|
|
399
|
+
label={t("All {{title}}", { title: listName })}
|
|
400
|
+
testID={sectionId("roster")}
|
|
401
|
+
/>
|
|
402
|
+
</PageSection>
|
|
403
|
+
|
|
404
|
+
{facet ? (
|
|
405
|
+
<PageSection
|
|
406
|
+
title={t("Browse by {{facet}}", { facet: facet.label })}
|
|
407
|
+
description={t("Open the list narrowed to one value.")}
|
|
408
|
+
divider={false}
|
|
409
|
+
paddingBottom="$6"
|
|
410
|
+
>
|
|
411
|
+
<InsightsFacetTags
|
|
412
|
+
distribution={distribution}
|
|
413
|
+
label={record.valueLabel}
|
|
414
|
+
tint={facet.tint}
|
|
415
|
+
onSelect={(value) => navigate?.(`${route}?${facet.param}=${encodeURIComponent(value)}`)}
|
|
416
|
+
testID={sectionId("tag")}
|
|
417
|
+
/>
|
|
418
|
+
</PageSection>
|
|
419
|
+
) : null}
|
|
420
|
+
</Screen>
|
|
421
|
+
);
|
|
422
|
+
}
|
package/src/FrappeLikedBy.tsx
CHANGED
|
@@ -18,12 +18,14 @@ import { useResolvedKnobs } from "@multiplatform.one/theme";
|
|
|
18
18
|
import { HeartIcon } from "@phosphor-icons/react";
|
|
19
19
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
20
20
|
import { useTranslation } from "react-i18next";
|
|
21
|
-
import { Text, XStack, YStack, isWeb, useTheme, type YStackProps } from "tamagui";
|
|
21
|
+
import { Text, XStack, YStack, isWeb, styled, useTheme, type YStackProps } from "tamagui";
|
|
22
22
|
import { useFrappeConfig } from "./FrappeProvider";
|
|
23
23
|
import { FrappeReconnectIndicator } from "./FrappeReconnectIndicator";
|
|
24
24
|
import { useFrappeUsers } from "./frappeUsers";
|
|
25
25
|
import { toLiveLoadError } from "./liveErrors";
|
|
26
26
|
|
|
27
|
+
const LikedByAvatarSlot = styled(XStack, { name: "LikedByAvatarSlot" });
|
|
28
|
+
|
|
27
29
|
// ---------------------------------------------------------------------------
|
|
28
30
|
// Pure helpers (unit-tested)
|
|
29
31
|
// ---------------------------------------------------------------------------
|
|
@@ -316,19 +318,19 @@ function FrappeLikedByBody({
|
|
|
316
318
|
{visibleAvatars.map((id, index) => {
|
|
317
319
|
const info = users.get(id);
|
|
318
320
|
return (
|
|
319
|
-
<
|
|
321
|
+
<LikedByAvatarSlot key={id} marginLeft={index === 0 ? 0 : -8} zIndex={index + 1}>
|
|
320
322
|
<Avatar size="$1.5" src={info?.image} name={info?.label ?? id} />
|
|
321
|
-
</
|
|
323
|
+
</LikedByAvatarSlot>
|
|
322
324
|
);
|
|
323
325
|
})}
|
|
324
326
|
{overflow > 0 ? (
|
|
325
|
-
<
|
|
327
|
+
<LikedByAvatarSlot marginLeft={-8} zIndex={visibleAvatars.length + 1}>
|
|
326
328
|
<Avatar
|
|
327
329
|
size="$1.5"
|
|
328
330
|
initials={`+${overflow}`}
|
|
329
331
|
alt={t("{{count}} more users", { count: overflow })}
|
|
330
332
|
/>
|
|
331
|
-
</
|
|
333
|
+
</LikedByAvatarSlot>
|
|
332
334
|
) : null}
|
|
333
335
|
</XStack>
|
|
334
336
|
) : null}
|