@multiplatform.one/frappe-ui 7.66.0 → 7.68.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/FileBrowser/index.cjs +15 -25
- package/dist/cjs/FileBrowser/index.native.js +15 -25
- package/dist/cjs/FileBrowser/index.native.js.map +1 -1
- package/dist/cjs/FormSidebar.cjs +107 -194
- package/dist/cjs/FormSidebar.native.js +120 -216
- package/dist/cjs/FormSidebar.native.js.map +1 -1
- package/dist/cjs/FrappeAssignment.cjs +0 -3
- package/dist/cjs/FrappeAssignment.native.js +0 -3
- package/dist/cjs/FrappeAssignment.native.js.map +1 -1
- package/dist/cjs/FrappeConnectionIndicator.cjs +5 -24
- package/dist/cjs/FrappeConnectionIndicator.native.js +5 -24
- package/dist/cjs/FrappeConnectionIndicator.native.js.map +1 -1
- package/dist/cjs/FrappeDashboard.cjs +0 -2
- package/dist/cjs/FrappeDashboard.native.js +0 -2
- package/dist/cjs/FrappeDashboard.native.js.map +1 -1
- package/dist/cjs/FrappeForm.cjs +6 -5
- package/dist/cjs/FrappeForm.native.js +6 -5
- package/dist/cjs/FrappeForm.native.js.map +1 -1
- package/dist/cjs/FrappeFormActions.cjs +20 -30
- package/dist/cjs/FrappeFormActions.native.js +23 -31
- package/dist/cjs/FrappeFormActions.native.js.map +1 -1
- package/dist/cjs/FrappeImageView.cjs +46 -65
- package/dist/cjs/FrappeImageView.native.js +46 -68
- package/dist/cjs/FrappeImageView.native.js.map +1 -1
- package/dist/cjs/FrappeKanban.cjs +0 -1
- package/dist/cjs/FrappeKanban.native.js +0 -1
- package/dist/cjs/FrappeKanban.native.js.map +1 -1
- package/dist/cjs/FrappeLikedBy.cjs +1 -1
- package/dist/cjs/FrappeLikedBy.native.js +1 -1
- package/dist/cjs/FrappeLikedBy.native.js.map +1 -1
- package/dist/cjs/FrappeListView.cjs +24 -68
- package/dist/cjs/FrappeListView.native.js +25 -72
- package/dist/cjs/FrappeListView.native.js.map +1 -1
- package/dist/cjs/FrappeRecordView.cjs +4 -0
- package/dist/cjs/FrappeRecordView.native.js +4 -0
- package/dist/cjs/FrappeRecordView.native.js.map +1 -1
- package/dist/cjs/FrappeReportBuilder.cjs +21 -18
- package/dist/cjs/FrappeReportBuilder.native.js +21 -18
- package/dist/cjs/FrappeReportBuilder.native.js.map +1 -1
- package/dist/cjs/FrappeReportView.cjs +2 -4
- package/dist/cjs/FrappeReportView.native.js +2 -4
- package/dist/cjs/FrappeReportView.native.js.map +1 -1
- package/dist/cjs/SyncErrorNotice.cjs +8 -36
- package/dist/cjs/SyncErrorNotice.native.js +8 -36
- package/dist/cjs/SyncErrorNotice.native.js.map +1 -1
- package/dist/cjs/desk/DeskFormSidebar.cjs +1 -6
- package/dist/cjs/desk/DeskFormSidebar.native.js +1 -6
- package/dist/cjs/desk/DeskFormSidebar.native.js.map +1 -1
- package/dist/cjs/desk/DeskShell.cjs +0 -1
- package/dist/cjs/desk/DeskShell.native.js +0 -1
- package/dist/cjs/desk/DeskShell.native.js.map +1 -1
- package/dist/cjs/fields/Date/catalog.native.js +0 -1
- package/dist/cjs/fields/Date/catalog.native.js.map +1 -1
- package/dist/cjs/fields/Date/index.native.js +4 -363
- package/dist/cjs/fields/Date/index.native.js.map +1 -1
- package/dist/cjs/fields/FileUpload.cjs +50 -58
- package/dist/cjs/fields/FileUpload.native.js +50 -56
- package/dist/cjs/fields/FileUpload.native.js.map +1 -1
- package/dist/cjs/insights/InsightsFacetTags.cjs +16 -92
- package/dist/cjs/insights/InsightsFacetTags.native.js +15 -97
- package/dist/cjs/insights/InsightsFacetTags.native.js.map +1 -1
- package/dist/cjs/list/FacetBadge.cjs +4 -28
- package/dist/cjs/list/FacetBadge.native.js +4 -28
- package/dist/cjs/list/FacetBadge.native.js.map +1 -1
- package/dist/cjs/list/FacetRail.cjs +37 -128
- package/dist/cjs/list/FacetRail.native.js +32 -130
- package/dist/cjs/list/FacetRail.native.js.map +1 -1
- package/dist/cjs/list/ListControls.cjs +1 -3
- package/dist/cjs/list/ListControls.native.js +1 -3
- package/dist/cjs/list/ListControls.native.js.map +1 -1
- package/dist/cjs/list/ListControlsSheet.cjs +5 -15
- package/dist/cjs/list/ListControlsSheet.native.js +7 -17
- package/dist/cjs/list/ListControlsSheet.native.js.map +1 -1
- package/dist/cjs/list/ListSidebarToolbar.cjs +5 -20
- package/dist/cjs/list/ListSidebarToolbar.native.js +7 -22
- package/dist/cjs/list/ListSidebarToolbar.native.js.map +1 -1
- package/dist/cjs/list/RecordCard.cjs +95 -127
- package/dist/cjs/list/RecordCard.native.js +78 -96
- package/dist/cjs/list/RecordCard.native.js.map +1 -1
- package/dist/cjs/list/ShufflePanel.cjs +55 -36
- package/dist/cjs/list/ShufflePanel.native.js +62 -39
- package/dist/cjs/list/ShufflePanel.native.js.map +1 -1
- package/dist/cjs/list/listColumns.cjs +1 -1
- package/dist/cjs/list/listColumns.native.js +1 -1
- package/dist/cjs/list/listColumns.native.js.map +1 -1
- package/dist/cjs/record/RecordHero.cjs +7 -85
- package/dist/cjs/record/RecordHero.native.js +7 -85
- package/dist/cjs/record/RecordHero.native.js.map +1 -1
- package/dist/cjs/record/RecordPage.cjs +5 -10
- package/dist/cjs/record/RecordPage.native.js +5 -10
- package/dist/cjs/record/RecordPage.native.js.map +1 -1
- package/dist/cjs/report/ReportViewToolbar.cjs +76 -47
- package/dist/cjs/report/ReportViewToolbar.native.js +79 -48
- package/dist/cjs/report/ReportViewToolbar.native.js.map +1 -1
- package/dist/esm/FileBrowser/index.mjs +16 -26
- package/dist/esm/FileBrowser/index.mjs.map +1 -1
- package/dist/esm/FileBrowser/index.native.js +16 -26
- package/dist/esm/FileBrowser/index.native.js.map +1 -1
- package/dist/esm/FormSidebar.mjs +110 -197
- package/dist/esm/FormSidebar.mjs.map +1 -1
- package/dist/esm/FormSidebar.native.js +123 -219
- package/dist/esm/FormSidebar.native.js.map +1 -1
- package/dist/esm/FrappeAssignment.mjs +0 -3
- package/dist/esm/FrappeAssignment.mjs.map +1 -1
- package/dist/esm/FrappeAssignment.native.js +0 -3
- package/dist/esm/FrappeAssignment.native.js.map +1 -1
- package/dist/esm/FrappeConnectionIndicator.mjs +7 -26
- package/dist/esm/FrappeConnectionIndicator.mjs.map +1 -1
- package/dist/esm/FrappeConnectionIndicator.native.js +7 -26
- package/dist/esm/FrappeConnectionIndicator.native.js.map +1 -1
- package/dist/esm/FrappeDashboard.mjs +0 -2
- package/dist/esm/FrappeDashboard.mjs.map +1 -1
- package/dist/esm/FrappeDashboard.native.js +0 -2
- package/dist/esm/FrappeDashboard.native.js.map +1 -1
- package/dist/esm/FrappeForm.mjs +7 -6
- package/dist/esm/FrappeForm.mjs.map +1 -1
- package/dist/esm/FrappeForm.native.js +7 -6
- package/dist/esm/FrappeForm.native.js.map +1 -1
- package/dist/esm/FrappeFormActions.mjs +22 -32
- package/dist/esm/FrappeFormActions.mjs.map +1 -1
- package/dist/esm/FrappeFormActions.native.js +25 -33
- package/dist/esm/FrappeFormActions.native.js.map +1 -1
- package/dist/esm/FrappeImageView.mjs +48 -67
- package/dist/esm/FrappeImageView.mjs.map +1 -1
- package/dist/esm/FrappeImageView.native.js +48 -70
- package/dist/esm/FrappeImageView.native.js.map +1 -1
- package/dist/esm/FrappeKanban.mjs +0 -1
- package/dist/esm/FrappeKanban.mjs.map +1 -1
- package/dist/esm/FrappeKanban.native.js +0 -1
- package/dist/esm/FrappeKanban.native.js.map +1 -1
- package/dist/esm/FrappeLikedBy.mjs +1 -1
- package/dist/esm/FrappeLikedBy.mjs.map +1 -1
- package/dist/esm/FrappeLikedBy.native.js +1 -1
- package/dist/esm/FrappeLikedBy.native.js.map +1 -1
- package/dist/esm/FrappeListView.mjs +25 -69
- package/dist/esm/FrappeListView.mjs.map +1 -1
- package/dist/esm/FrappeListView.native.js +26 -73
- package/dist/esm/FrappeListView.native.js.map +1 -1
- package/dist/esm/FrappeRecordView.mjs +4 -0
- package/dist/esm/FrappeRecordView.mjs.map +1 -1
- package/dist/esm/FrappeRecordView.native.js +4 -0
- package/dist/esm/FrappeRecordView.native.js.map +1 -1
- package/dist/esm/FrappeReportBuilder.mjs +21 -18
- package/dist/esm/FrappeReportBuilder.mjs.map +1 -1
- package/dist/esm/FrappeReportBuilder.native.js +21 -18
- package/dist/esm/FrappeReportBuilder.native.js.map +1 -1
- package/dist/esm/FrappeReportView.mjs +3 -5
- package/dist/esm/FrappeReportView.mjs.map +1 -1
- package/dist/esm/FrappeReportView.native.js +3 -5
- package/dist/esm/FrappeReportView.native.js.map +1 -1
- package/dist/esm/SyncErrorNotice.mjs +10 -38
- package/dist/esm/SyncErrorNotice.mjs.map +1 -1
- package/dist/esm/SyncErrorNotice.native.js +10 -38
- package/dist/esm/SyncErrorNotice.native.js.map +1 -1
- package/dist/esm/desk/DeskFormSidebar.mjs +1 -6
- package/dist/esm/desk/DeskFormSidebar.mjs.map +1 -1
- package/dist/esm/desk/DeskFormSidebar.native.js +1 -6
- package/dist/esm/desk/DeskFormSidebar.native.js.map +1 -1
- package/dist/esm/desk/DeskShell.mjs +0 -1
- package/dist/esm/desk/DeskShell.mjs.map +1 -1
- package/dist/esm/desk/DeskShell.native.js +0 -1
- package/dist/esm/desk/DeskShell.native.js.map +1 -1
- package/dist/esm/fields/Date/catalog.mjs.map +1 -1
- package/dist/esm/fields/Date/catalog.native.js +0 -1
- package/dist/esm/fields/Date/catalog.native.js.map +1 -1
- package/dist/esm/fields/Date/index.native.js +2 -361
- package/dist/esm/fields/Date/index.native.js.map +1 -1
- package/dist/esm/fields/FileUpload.mjs +53 -61
- package/dist/esm/fields/FileUpload.mjs.map +1 -1
- package/dist/esm/fields/FileUpload.native.js +53 -59
- package/dist/esm/fields/FileUpload.native.js.map +1 -1
- package/dist/esm/insights/InsightsFacetTags.mjs +18 -94
- package/dist/esm/insights/InsightsFacetTags.mjs.map +1 -1
- package/dist/esm/insights/InsightsFacetTags.native.js +17 -99
- package/dist/esm/insights/InsightsFacetTags.native.js.map +1 -1
- package/dist/esm/list/FacetBadge.mjs +5 -29
- package/dist/esm/list/FacetBadge.mjs.map +1 -1
- package/dist/esm/list/FacetBadge.native.js +5 -29
- package/dist/esm/list/FacetBadge.native.js.map +1 -1
- package/dist/esm/list/FacetRail.mjs +40 -131
- package/dist/esm/list/FacetRail.mjs.map +1 -1
- package/dist/esm/list/FacetRail.native.js +35 -133
- package/dist/esm/list/FacetRail.native.js.map +1 -1
- package/dist/esm/list/ListControls.mjs +1 -3
- package/dist/esm/list/ListControls.mjs.map +1 -1
- package/dist/esm/list/ListControls.native.js +1 -3
- package/dist/esm/list/ListControls.native.js.map +1 -1
- package/dist/esm/list/ListControlsSheet.mjs +6 -16
- package/dist/esm/list/ListControlsSheet.mjs.map +1 -1
- package/dist/esm/list/ListControlsSheet.native.js +8 -18
- package/dist/esm/list/ListControlsSheet.native.js.map +1 -1
- package/dist/esm/list/ListSidebarToolbar.mjs +6 -21
- package/dist/esm/list/ListSidebarToolbar.mjs.map +1 -1
- package/dist/esm/list/ListSidebarToolbar.native.js +8 -23
- package/dist/esm/list/ListSidebarToolbar.native.js.map +1 -1
- package/dist/esm/list/RecordCard.mjs +95 -127
- package/dist/esm/list/RecordCard.mjs.map +1 -1
- package/dist/esm/list/RecordCard.native.js +78 -96
- package/dist/esm/list/RecordCard.native.js.map +1 -1
- package/dist/esm/list/ShufflePanel.mjs +57 -38
- package/dist/esm/list/ShufflePanel.mjs.map +1 -1
- package/dist/esm/list/ShufflePanel.native.js +64 -41
- package/dist/esm/list/ShufflePanel.native.js.map +1 -1
- package/dist/esm/list/listColumns.mjs +1 -1
- package/dist/esm/list/listColumns.mjs.map +1 -1
- package/dist/esm/list/listColumns.native.js +1 -1
- package/dist/esm/list/listColumns.native.js.map +1 -1
- package/dist/esm/record/RecordHero.mjs +8 -86
- package/dist/esm/record/RecordHero.mjs.map +1 -1
- package/dist/esm/record/RecordHero.native.js +8 -86
- package/dist/esm/record/RecordHero.native.js.map +1 -1
- package/dist/esm/record/RecordPage.mjs +6 -11
- package/dist/esm/record/RecordPage.mjs.map +1 -1
- package/dist/esm/record/RecordPage.native.js +6 -11
- package/dist/esm/record/RecordPage.native.js.map +1 -1
- package/dist/esm/report/ReportViewToolbar.mjs +78 -49
- package/dist/esm/report/ReportViewToolbar.mjs.map +1 -1
- package/dist/esm/report/ReportViewToolbar.native.js +81 -50
- package/dist/esm/report/ReportViewToolbar.native.js.map +1 -1
- package/dist/jsx/FileBrowser/index.mjs +16 -26
- package/dist/jsx/FileBrowser/index.mjs.map +1 -1
- package/dist/jsx/FileBrowser/index.native.js +15 -25
- package/dist/jsx/FileBrowser/index.native.js.map +1 -1
- package/dist/jsx/FormSidebar.mjs +110 -197
- package/dist/jsx/FormSidebar.mjs.map +1 -1
- package/dist/jsx/FormSidebar.native.js +120 -216
- package/dist/jsx/FormSidebar.native.js.map +1 -1
- package/dist/jsx/FrappeAssignment.mjs +0 -3
- package/dist/jsx/FrappeAssignment.mjs.map +1 -1
- package/dist/jsx/FrappeAssignment.native.js +0 -3
- package/dist/jsx/FrappeAssignment.native.js.map +1 -1
- package/dist/jsx/FrappeConnectionIndicator.mjs +7 -26
- package/dist/jsx/FrappeConnectionIndicator.mjs.map +1 -1
- package/dist/jsx/FrappeConnectionIndicator.native.js +5 -24
- package/dist/jsx/FrappeConnectionIndicator.native.js.map +1 -1
- package/dist/jsx/FrappeDashboard.mjs +0 -2
- package/dist/jsx/FrappeDashboard.mjs.map +1 -1
- package/dist/jsx/FrappeDashboard.native.js +0 -2
- package/dist/jsx/FrappeDashboard.native.js.map +1 -1
- package/dist/jsx/FrappeForm.mjs +7 -6
- package/dist/jsx/FrappeForm.mjs.map +1 -1
- package/dist/jsx/FrappeForm.native.js +6 -5
- package/dist/jsx/FrappeForm.native.js.map +1 -1
- package/dist/jsx/FrappeFormActions.mjs +22 -32
- package/dist/jsx/FrappeFormActions.mjs.map +1 -1
- package/dist/jsx/FrappeFormActions.native.js +23 -31
- package/dist/jsx/FrappeFormActions.native.js.map +1 -1
- package/dist/jsx/FrappeImageView.mjs +48 -67
- package/dist/jsx/FrappeImageView.mjs.map +1 -1
- package/dist/jsx/FrappeImageView.native.js +46 -68
- package/dist/jsx/FrappeImageView.native.js.map +1 -1
- package/dist/jsx/FrappeKanban.mjs +0 -1
- package/dist/jsx/FrappeKanban.mjs.map +1 -1
- package/dist/jsx/FrappeKanban.native.js +0 -1
- package/dist/jsx/FrappeKanban.native.js.map +1 -1
- package/dist/jsx/FrappeLikedBy.mjs +1 -1
- package/dist/jsx/FrappeLikedBy.mjs.map +1 -1
- package/dist/jsx/FrappeLikedBy.native.js +1 -1
- package/dist/jsx/FrappeLikedBy.native.js.map +1 -1
- package/dist/jsx/FrappeListView.mjs +25 -69
- package/dist/jsx/FrappeListView.mjs.map +1 -1
- package/dist/jsx/FrappeListView.native.js +25 -72
- package/dist/jsx/FrappeListView.native.js.map +1 -1
- package/dist/jsx/FrappeRecordView.mjs +4 -0
- package/dist/jsx/FrappeRecordView.mjs.map +1 -1
- package/dist/jsx/FrappeRecordView.native.js +4 -0
- package/dist/jsx/FrappeRecordView.native.js.map +1 -1
- package/dist/jsx/FrappeReportBuilder.mjs +21 -18
- package/dist/jsx/FrappeReportBuilder.mjs.map +1 -1
- package/dist/jsx/FrappeReportBuilder.native.js +21 -18
- package/dist/jsx/FrappeReportBuilder.native.js.map +1 -1
- package/dist/jsx/FrappeReportView.mjs +3 -5
- package/dist/jsx/FrappeReportView.mjs.map +1 -1
- package/dist/jsx/FrappeReportView.native.js +2 -4
- package/dist/jsx/FrappeReportView.native.js.map +1 -1
- package/dist/jsx/SyncErrorNotice.mjs +10 -38
- package/dist/jsx/SyncErrorNotice.mjs.map +1 -1
- package/dist/jsx/SyncErrorNotice.native.js +8 -36
- package/dist/jsx/SyncErrorNotice.native.js.map +1 -1
- package/dist/jsx/desk/DeskFormSidebar.mjs +1 -6
- package/dist/jsx/desk/DeskFormSidebar.mjs.map +1 -1
- package/dist/jsx/desk/DeskFormSidebar.native.js +1 -6
- package/dist/jsx/desk/DeskFormSidebar.native.js.map +1 -1
- package/dist/jsx/desk/DeskShell.mjs +0 -1
- package/dist/jsx/desk/DeskShell.mjs.map +1 -1
- package/dist/jsx/desk/DeskShell.native.js +0 -1
- package/dist/jsx/desk/DeskShell.native.js.map +1 -1
- package/dist/jsx/fields/Date/catalog.mjs.map +1 -1
- package/dist/jsx/fields/Date/catalog.native.js +0 -1
- package/dist/jsx/fields/Date/catalog.native.js.map +1 -1
- package/dist/jsx/fields/Date/index.native.js +4 -363
- package/dist/jsx/fields/Date/index.native.js.map +1 -1
- package/dist/jsx/fields/FileUpload.mjs +53 -61
- package/dist/jsx/fields/FileUpload.mjs.map +1 -1
- package/dist/jsx/fields/FileUpload.native.js +50 -56
- package/dist/jsx/fields/FileUpload.native.js.map +1 -1
- package/dist/jsx/insights/InsightsFacetTags.mjs +18 -94
- package/dist/jsx/insights/InsightsFacetTags.mjs.map +1 -1
- package/dist/jsx/insights/InsightsFacetTags.native.js +15 -97
- package/dist/jsx/insights/InsightsFacetTags.native.js.map +1 -1
- package/dist/jsx/list/FacetBadge.mjs +5 -29
- package/dist/jsx/list/FacetBadge.mjs.map +1 -1
- package/dist/jsx/list/FacetBadge.native.js +4 -28
- package/dist/jsx/list/FacetBadge.native.js.map +1 -1
- package/dist/jsx/list/FacetRail.mjs +40 -131
- package/dist/jsx/list/FacetRail.mjs.map +1 -1
- package/dist/jsx/list/FacetRail.native.js +32 -130
- package/dist/jsx/list/FacetRail.native.js.map +1 -1
- package/dist/jsx/list/ListControls.mjs +1 -3
- package/dist/jsx/list/ListControls.mjs.map +1 -1
- package/dist/jsx/list/ListControls.native.js +1 -3
- package/dist/jsx/list/ListControls.native.js.map +1 -1
- package/dist/jsx/list/ListControlsSheet.mjs +6 -16
- package/dist/jsx/list/ListControlsSheet.mjs.map +1 -1
- package/dist/jsx/list/ListControlsSheet.native.js +7 -17
- package/dist/jsx/list/ListControlsSheet.native.js.map +1 -1
- package/dist/jsx/list/ListSidebarToolbar.mjs +6 -21
- package/dist/jsx/list/ListSidebarToolbar.mjs.map +1 -1
- package/dist/jsx/list/ListSidebarToolbar.native.js +7 -22
- package/dist/jsx/list/ListSidebarToolbar.native.js.map +1 -1
- package/dist/jsx/list/RecordCard.mjs +95 -127
- package/dist/jsx/list/RecordCard.mjs.map +1 -1
- package/dist/jsx/list/RecordCard.native.js +78 -96
- package/dist/jsx/list/RecordCard.native.js.map +1 -1
- package/dist/jsx/list/ShufflePanel.mjs +57 -38
- package/dist/jsx/list/ShufflePanel.mjs.map +1 -1
- package/dist/jsx/list/ShufflePanel.native.js +62 -39
- package/dist/jsx/list/ShufflePanel.native.js.map +1 -1
- package/dist/jsx/list/listColumns.mjs +1 -1
- package/dist/jsx/list/listColumns.mjs.map +1 -1
- package/dist/jsx/list/listColumns.native.js +1 -1
- package/dist/jsx/list/listColumns.native.js.map +1 -1
- package/dist/jsx/record/RecordHero.mjs +8 -86
- package/dist/jsx/record/RecordHero.mjs.map +1 -1
- package/dist/jsx/record/RecordHero.native.js +7 -85
- package/dist/jsx/record/RecordHero.native.js.map +1 -1
- package/dist/jsx/record/RecordPage.mjs +6 -11
- package/dist/jsx/record/RecordPage.mjs.map +1 -1
- package/dist/jsx/record/RecordPage.native.js +5 -10
- package/dist/jsx/record/RecordPage.native.js.map +1 -1
- package/dist/jsx/report/ReportViewToolbar.mjs +78 -49
- package/dist/jsx/report/ReportViewToolbar.mjs.map +1 -1
- package/dist/jsx/report/ReportViewToolbar.native.js +79 -48
- package/dist/jsx/report/ReportViewToolbar.native.js.map +1 -1
- package/package.json +16 -16
- package/src/FileBrowser/index.tsx +11 -15
- package/src/FormSidebar.stories.tsx +1 -1
- package/src/FormSidebar.tsx +146 -251
- package/src/FrappeAssignment.tsx +0 -3
- package/src/FrappeConnectionIndicator.tsx +6 -28
- package/src/FrappeDashboard.spec.tsx +7 -3
- package/src/FrappeDashboard.tsx +0 -2
- package/src/FrappeForm.connections.spec.tsx +2 -2
- package/src/FrappeForm.deskSemantics.spec.tsx +2 -2
- package/src/FrappeForm.lifecycle.spec.tsx +27 -27
- package/src/FrappeForm.tsx +11 -7
- package/src/FrappeFormActions.tsx +24 -38
- package/src/FrappeImageView.stories.tsx +1 -6
- package/src/FrappeImageView.tsx +52 -66
- package/src/FrappeKanban.tsx +0 -1
- package/src/FrappeLikedBy.tsx +1 -1
- package/src/FrappeListView.controls.spec.tsx +3 -2
- package/src/FrappeListView.spec.tsx +7 -3
- package/src/FrappeListView.tsx +23 -56
- package/src/FrappeRecordView.tsx +16 -3
- package/src/FrappeReportBuilder.tsx +21 -19
- package/src/FrappeReportView.tsx +3 -6
- package/src/SyncErrorNotice.spec.tsx +7 -12
- package/src/SyncErrorNotice.stories.tsx +2 -4
- package/src/SyncErrorNotice.tsx +13 -41
- package/src/desk/DeskFormSidebar.tsx +1 -2
- package/src/desk/DeskShell.tsx +1 -1
- package/src/desk/deskDocumentRoutes.spec.tsx +7 -4
- package/src/fields/Date/catalog.tsx +6 -7
- package/src/fields/Date/nativeIsCatalog.spec.tsx +26 -0
- package/src/fields/Date/typeParity.spec.tsx +26 -102
- package/src/fields/FileUpload.spec.tsx +18 -3
- package/src/fields/FileUpload.tsx +64 -68
- package/src/frappeRemainder.designLaw.spec.ts +8 -7
- package/src/insights/InsightsFacetTags.tsx +21 -102
- package/src/list/FacetBadge.tsx +7 -29
- package/src/list/FacetRail.spec.tsx +11 -10
- package/src/list/FacetRail.tsx +49 -161
- package/src/list/ListControls.tsx +1 -3
- package/src/list/ListControlsSheet.tsx +10 -12
- package/src/list/ListSidebarToolbar.tsx +7 -18
- package/src/list/RecordCard.native.tsx +65 -71
- package/src/list/RecordCard.spec.tsx +8 -5
- package/src/list/RecordCard.tsx +110 -129
- package/src/list/ShufflePanel.tsx +63 -38
- package/src/list/listColumns.tsx +1 -1
- package/src/record/RecordHero.tsx +11 -51
- package/src/record/RecordPage.tsx +8 -11
- package/src/report/ReportViewToolbar.spec.tsx +45 -3
- package/src/report/ReportViewToolbar.tsx +113 -62
- package/src/useFrappeForm.spec.tsx +1 -1
- package/types/FileBrowser/index.d.ts.map +1 -1
- package/types/FormSidebar.d.ts +13 -3
- package/types/FormSidebar.d.ts.map +1 -1
- package/types/FrappeAssignment.d.ts.map +1 -1
- package/types/FrappeConnectionIndicator.d.ts +2 -1
- package/types/FrappeConnectionIndicator.d.ts.map +1 -1
- package/types/FrappeDashboard.d.ts.map +1 -1
- package/types/FrappeFormActions.d.ts.map +1 -1
- package/types/FrappeImageView.d.ts.map +1 -1
- package/types/FrappeKanban.d.ts.map +1 -1
- package/types/FrappeListView.d.ts.map +1 -1
- package/types/FrappeRecordView.d.ts.map +1 -1
- package/types/FrappeReportBuilder.d.ts.map +1 -1
- package/types/FrappeReportView.d.ts.map +1 -1
- package/types/SyncErrorNotice.d.ts +4 -6
- package/types/SyncErrorNotice.d.ts.map +1 -1
- package/types/desk/DeskFormSidebar.d.ts.map +1 -1
- package/types/desk/DeskShell.d.ts.map +1 -1
- package/types/fields/Date/catalog.d.ts +5 -4
- package/types/fields/Date/catalog.d.ts.map +1 -1
- package/types/fields/FileUpload.d.ts.map +1 -1
- package/types/insights/InsightsFacetTags.d.ts +4 -1
- package/types/insights/InsightsFacetTags.d.ts.map +1 -1
- package/types/list/FacetBadge.d.ts +3 -3
- package/types/list/FacetBadge.d.ts.map +1 -1
- package/types/list/FacetRail.d.ts +7 -5
- package/types/list/FacetRail.d.ts.map +1 -1
- package/types/list/ListControls.d.ts.map +1 -1
- package/types/list/ListControlsSheet.d.ts.map +1 -1
- package/types/list/ListSidebarToolbar.d.ts.map +1 -1
- package/types/list/RecordCard.d.ts +6 -6
- package/types/list/RecordCard.d.ts.map +1 -1
- package/types/list/RecordCard.native.d.ts +4 -3
- package/types/list/RecordCard.native.d.ts.map +1 -1
- package/types/list/ShufflePanel.d.ts +8 -3
- package/types/list/ShufflePanel.d.ts.map +1 -1
- package/types/record/RecordHero.d.ts +5 -1
- package/types/record/RecordHero.d.ts.map +1 -1
- package/types/record/RecordPage.d.ts.map +1 -1
- package/types/report/ReportViewToolbar.d.ts.map +1 -1
- package/dist/cjs/fields/Date/dateTimePickerLoader.cjs +0 -38
- package/dist/cjs/fields/Date/dateTimePickerLoader.native.js +0 -42
- package/dist/cjs/fields/Date/dateTimePickerLoader.native.js.map +0 -1
- package/dist/cjs/fields/Date/sheetKeyboard.cjs +0 -54
- package/dist/cjs/fields/Date/sheetKeyboard.native.js +0 -57
- package/dist/cjs/fields/Date/sheetKeyboard.native.js.map +0 -1
- package/dist/esm/fields/Date/dateTimePickerLoader.mjs +0 -13
- package/dist/esm/fields/Date/dateTimePickerLoader.mjs.map +0 -1
- package/dist/esm/fields/Date/dateTimePickerLoader.native.js +0 -14
- package/dist/esm/fields/Date/dateTimePickerLoader.native.js.map +0 -1
- package/dist/esm/fields/Date/sheetKeyboard.mjs +0 -21
- package/dist/esm/fields/Date/sheetKeyboard.mjs.map +0 -1
- package/dist/esm/fields/Date/sheetKeyboard.native.js +0 -21
- package/dist/esm/fields/Date/sheetKeyboard.native.js.map +0 -1
- package/dist/jsx/fields/Date/dateTimePickerLoader.mjs +0 -13
- package/dist/jsx/fields/Date/dateTimePickerLoader.mjs.map +0 -1
- package/dist/jsx/fields/Date/dateTimePickerLoader.native.js +0 -42
- package/dist/jsx/fields/Date/dateTimePickerLoader.native.js.map +0 -1
- package/dist/jsx/fields/Date/sheetKeyboard.mjs +0 -21
- package/dist/jsx/fields/Date/sheetKeyboard.mjs.map +0 -1
- package/dist/jsx/fields/Date/sheetKeyboard.native.js +0 -57
- package/dist/jsx/fields/Date/sheetKeyboard.native.js.map +0 -1
- package/src/fields/Date/dateTimePickerLoader.ts +0 -25
- package/src/fields/Date/index.native.tsx +0 -445
- package/src/fields/Date/nativeFallback.spec.tsx +0 -21
- package/src/fields/Date/nativePresentation.spec.tsx +0 -278
- package/src/fields/Date/sheetKeyboard.spec.ts +0 -60
- package/src/fields/Date/sheetKeyboard.ts +0 -45
- package/types/fields/Date/dateTimePickerLoader.d.ts +0 -11
- package/types/fields/Date/dateTimePickerLoader.d.ts.map +0 -1
- package/types/fields/Date/index.native.d.ts +0 -14
- package/types/fields/Date/index.native.d.ts.map +0 -1
- package/types/fields/Date/sheetKeyboard.d.ts +0 -20
- package/types/fields/Date/sheetKeyboard.d.ts.map +0 -1
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export type DateTimePickerComponent =
|
|
2
|
-
typeof import("@react-native-community/datetimepicker").default;
|
|
3
|
-
export type { DateTimePickerEvent } from "@react-native-community/datetimepicker";
|
|
4
|
-
|
|
5
|
-
let cached: DateTimePickerComponent | null | undefined;
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Loads the optional `@react-native-community/datetimepicker` peer at runtime,
|
|
9
|
-
* the same contract as forms' `nativeDateTime/dateTimePickerLoader.ts`. A
|
|
10
|
-
* static import of an absent peer stays external in the native bundle and
|
|
11
|
-
* hermesc rejects the leftover `import` statement (FZ-7357); the guarded
|
|
12
|
-
* `require` returns null instead, and the field renders its catalog half.
|
|
13
|
-
*/
|
|
14
|
-
export function loadDateTimePicker(): DateTimePickerComponent | null {
|
|
15
|
-
if (cached !== undefined) return cached;
|
|
16
|
-
try {
|
|
17
|
-
const mod = require("@react-native-community/datetimepicker") as {
|
|
18
|
-
default?: DateTimePickerComponent;
|
|
19
|
-
};
|
|
20
|
-
cached = mod?.default ?? null;
|
|
21
|
-
} catch {
|
|
22
|
-
cached = null;
|
|
23
|
-
}
|
|
24
|
-
return cached;
|
|
25
|
-
}
|
|
@@ -1,445 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
formatAbsoluteDate,
|
|
3
|
-
formatAbsoluteDateTime,
|
|
4
|
-
formatTimeOfDay,
|
|
5
|
-
} from "@multiplatform.one/theme";
|
|
6
|
-
import {
|
|
7
|
-
Button,
|
|
8
|
-
Field,
|
|
9
|
-
FieldLayout,
|
|
10
|
-
Skeleton,
|
|
11
|
-
formCommonColors,
|
|
12
|
-
getFieldError,
|
|
13
|
-
mergeFieldHandler,
|
|
14
|
-
useFormField,
|
|
15
|
-
useResolvedValidators,
|
|
16
|
-
} from "@multiplatform.one/forms";
|
|
17
|
-
import { useContext, useState } from "react";
|
|
18
|
-
import {
|
|
19
|
-
Modal,
|
|
20
|
-
Pressable,
|
|
21
|
-
StyleSheet,
|
|
22
|
-
useColorScheme,
|
|
23
|
-
useWindowDimensions,
|
|
24
|
-
View as RNView,
|
|
25
|
-
} from "react-native";
|
|
26
|
-
import { SafeAreaInsetsContext, initialWindowMetrics } from "react-native-safe-area-context";
|
|
27
|
-
import { platform } from "@multiplatform.one/platform";
|
|
28
|
-
import { View, XStack, YStack, useProps, useTheme, useThemeName } from "tamagui";
|
|
29
|
-
import { useKeyboardInset } from "../../shared/useKeyboardInset";
|
|
30
|
-
import { Date as CatalogDate } from "./catalog";
|
|
31
|
-
import {
|
|
32
|
-
type DateTimePickerComponent,
|
|
33
|
-
type DateTimePickerEvent,
|
|
34
|
-
loadDateTimePicker,
|
|
35
|
-
} from "./dateTimePickerLoader";
|
|
36
|
-
import { datePickerHeight, dateSheetBottomPadding, dateSheetMaxHeight } from "./sheetKeyboard";
|
|
37
|
-
import type { DateProps } from "./types";
|
|
38
|
-
import { fromFrappeDateValue, toFrappeDateValue } from "./wire";
|
|
39
|
-
import { Text } from "@multiplatform.one/components";
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Design-law: trigger and sheet actions are house Button. The OS picker stays
|
|
43
|
-
* `Modal animationType="fade"` so the scrim plants in place (MPO-62); the
|
|
44
|
-
* sheet caps above the keyboard via inset padding (MPO-64).
|
|
45
|
-
*/
|
|
46
|
-
|
|
47
|
-
export type { DateProps } from "./types";
|
|
48
|
-
|
|
49
|
-
type FieldType = "date" | "datetime" | "time";
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Display value for the trigger — the house registers (LC-12 render channel),
|
|
53
|
-
* so the native picker reads the same voice as the web picker, table date
|
|
54
|
-
* cells and the timeline. A picker is an editing surface, so the year is
|
|
55
|
-
* always shown.
|
|
56
|
-
*/
|
|
57
|
-
function formatDisplayValue(value: string, type: FieldType): string {
|
|
58
|
-
if (!value) return "";
|
|
59
|
-
try {
|
|
60
|
-
const date = fromFrappeDateValue(value, type);
|
|
61
|
-
if (type === "time") return formatTimeOfDay(date);
|
|
62
|
-
if (type === "datetime") return formatAbsoluteDateTime(date, { year: "always" });
|
|
63
|
-
return formatAbsoluteDate(date, { year: "always" });
|
|
64
|
-
} catch {
|
|
65
|
-
return value;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* The form branch stores what the picker committed (a `Date`, matching the
|
|
71
|
-
* web half); the standalone branch is handed the Frappe wire string. Both
|
|
72
|
-
* arrive here so the rest of the component reads one shape.
|
|
73
|
-
*/
|
|
74
|
-
function toWireValue(raw: unknown, type: FieldType): string {
|
|
75
|
-
if (raw == null || raw === "") return "";
|
|
76
|
-
if (raw instanceof Date) return Number.isNaN(raw.getTime()) ? "" : toFrappeDateValue(raw, type);
|
|
77
|
-
return String(raw);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/** What the picker opens on: the current value, else now. */
|
|
81
|
-
function seedDate(wire: string, type: FieldType): Date {
|
|
82
|
-
if (!wire) return new Date();
|
|
83
|
-
try {
|
|
84
|
-
const parsed = fromFrappeDateValue(wire, type);
|
|
85
|
-
return Number.isNaN(parsed.getTime()) ? new Date() : parsed;
|
|
86
|
-
} catch {
|
|
87
|
-
return new Date();
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* The OS picker renders itself, so the only styling channel it exposes is
|
|
93
|
-
* light/dark plus an accent — see the R-IDENTITY declaration for this part.
|
|
94
|
-
* Read the app theme first and fall back to the OS scheme, the same order
|
|
95
|
-
* the native rich-text editor uses.
|
|
96
|
-
*/
|
|
97
|
-
function useNativePickerScheme(): "light" | "dark" {
|
|
98
|
-
const themeName = useThemeName();
|
|
99
|
-
const osScheme = useColorScheme();
|
|
100
|
-
if (themeName) return String(themeName).startsWith("dark") ? "dark" : "light";
|
|
101
|
-
return osScheme === "dark" ? "dark" : "light";
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Native `Date` field for iOS and Android.
|
|
106
|
-
*
|
|
107
|
-
* Resolution picks this file over `index.tsx` on native, so the field is the
|
|
108
|
-
* real OS picker: the iOS 14+ calendar for dates (`inline`), the wheel for
|
|
109
|
-
* times, and the Material dialog on Android. Declared as `Date` rather than
|
|
110
|
-
* written as `function Date` so the global `Date` constructor stays reachable
|
|
111
|
-
* inside this module.
|
|
112
|
-
*/
|
|
113
|
-
function OsDateField<
|
|
114
|
-
TData extends Record<string, unknown> = Record<string, unknown>,
|
|
115
|
-
TName extends string = string,
|
|
116
|
-
>({
|
|
117
|
-
DateTimePicker,
|
|
118
|
-
...props
|
|
119
|
-
}: DateProps<TData, TName> & { DateTimePicker: DateTimePickerComponent }) {
|
|
120
|
-
const {
|
|
121
|
-
defaultValue,
|
|
122
|
-
disabled,
|
|
123
|
-
error: errorProp,
|
|
124
|
-
form,
|
|
125
|
-
helperText,
|
|
126
|
-
id: idProp,
|
|
127
|
-
inputProps: _inputProps,
|
|
128
|
-
label,
|
|
129
|
-
labelProps,
|
|
130
|
-
maxDate,
|
|
131
|
-
minDate,
|
|
132
|
-
mode,
|
|
133
|
-
name,
|
|
134
|
-
onBlur,
|
|
135
|
-
onChange,
|
|
136
|
-
placeholder,
|
|
137
|
-
preserveValue,
|
|
138
|
-
readOnly,
|
|
139
|
-
required,
|
|
140
|
-
size,
|
|
141
|
-
skeleton,
|
|
142
|
-
type = "date",
|
|
143
|
-
validators,
|
|
144
|
-
value,
|
|
145
|
-
} = useProps(props) as DateProps<TData, TName> & Record<string, unknown>;
|
|
146
|
-
|
|
147
|
-
const { resolvedForm, knobProps, id } = useFormField({ form, id: idProp });
|
|
148
|
-
const resolvedValidators = useResolvedValidators(required, validators, label, name);
|
|
149
|
-
const themeVariant = useNativePickerScheme();
|
|
150
|
-
const theme = useTheme();
|
|
151
|
-
const accentColor = theme.accentColor?.val;
|
|
152
|
-
// MPO-64 leftover: the sheet must end ABOVE the keyboard, not run under it.
|
|
153
|
-
const keyboardInset = useKeyboardInset();
|
|
154
|
-
const { height: windowHeight } = useWindowDimensions();
|
|
155
|
-
const topInset = useContext(SafeAreaInsetsContext)?.top ?? initialWindowMetrics?.insets.top ?? 0;
|
|
156
|
-
const maxHeight = dateSheetMaxHeight(windowHeight, keyboardInset, topInset);
|
|
157
|
-
|
|
158
|
-
const [showPicker, setShowPicker] = useState(false);
|
|
159
|
-
const [showTimePicker, setShowTimePicker] = useState(false);
|
|
160
|
-
const [tempDate, setTempDate] = useState<Date | null>(null);
|
|
161
|
-
|
|
162
|
-
const fieldType = type as FieldType;
|
|
163
|
-
const isIOS = platform.isIos;
|
|
164
|
-
const sheetBottomPadding = dateSheetBottomPadding(keyboardInset, isIOS);
|
|
165
|
-
const pickerMode: "date" | "time" =
|
|
166
|
-
fieldType === "time" || (fieldType === "datetime" && showTimePicker) ? "time" : "date";
|
|
167
|
-
// iOS 14 made the calendar the date presentation and left the wheel to time;
|
|
168
|
-
// `spinner` for a date is Apple's legacy style. `inline` rather than
|
|
169
|
-
// `compact` because the picker already lives in a sheet with its own
|
|
170
|
-
// Cancel/Done — `compact` would be a field that opens a second popover.
|
|
171
|
-
const iosDisplay = pickerMode === "time" ? "spinner" : "inline";
|
|
172
|
-
|
|
173
|
-
function closePicker() {
|
|
174
|
-
setShowPicker(false);
|
|
175
|
-
setShowTimePicker(false);
|
|
176
|
-
setTempDate(null);
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
function renderControl(
|
|
180
|
-
wire: string,
|
|
181
|
-
hasError: boolean,
|
|
182
|
-
commit?: (value: unknown) => void,
|
|
183
|
-
blur?: () => void,
|
|
184
|
-
) {
|
|
185
|
-
const seed = seedDate(wire, fieldType);
|
|
186
|
-
const displayValue = formatDisplayValue(wire, fieldType);
|
|
187
|
-
const resolvedPlaceholder =
|
|
188
|
-
placeholder ??
|
|
189
|
-
(fieldType === "time"
|
|
190
|
-
? "Select time"
|
|
191
|
-
: fieldType === "datetime"
|
|
192
|
-
? "Select date & time"
|
|
193
|
-
: "Select date");
|
|
194
|
-
|
|
195
|
-
function emit(picked: Date) {
|
|
196
|
-
// No `previousValue`: the native picker chooses date and time itself,
|
|
197
|
-
// so there is no earlier time part to preserve (the web half's case).
|
|
198
|
-
commit?.(picked);
|
|
199
|
-
(onChange as ((v: string) => void) | undefined)?.(toFrappeDateValue(picked, fieldType));
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
function openPicker() {
|
|
203
|
-
if (disabled || readOnly) return;
|
|
204
|
-
setTempDate(seed);
|
|
205
|
-
setShowPicker(true);
|
|
206
|
-
setShowTimePicker(false);
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
function cancel() {
|
|
210
|
-
closePicker();
|
|
211
|
-
blur?.();
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
/** Android commits on the dialog's own OK; datetime runs date then time. */
|
|
215
|
-
function handleAndroidChange(event: DateTimePickerEvent, selected?: Date) {
|
|
216
|
-
if (event.type === "dismissed") {
|
|
217
|
-
cancel();
|
|
218
|
-
return;
|
|
219
|
-
}
|
|
220
|
-
if (event.type !== "set" || !selected) return;
|
|
221
|
-
if (fieldType === "datetime" && !showTimePicker) {
|
|
222
|
-
setTempDate(selected);
|
|
223
|
-
setShowPicker(false);
|
|
224
|
-
setShowTimePicker(true);
|
|
225
|
-
setTimeout(() => setShowPicker(true), 100);
|
|
226
|
-
return;
|
|
227
|
-
}
|
|
228
|
-
const picked =
|
|
229
|
-
fieldType === "datetime" && tempDate
|
|
230
|
-
? new Date(
|
|
231
|
-
tempDate.getFullYear(),
|
|
232
|
-
tempDate.getMonth(),
|
|
233
|
-
tempDate.getDate(),
|
|
234
|
-
selected.getHours(),
|
|
235
|
-
selected.getMinutes(),
|
|
236
|
-
)
|
|
237
|
-
: selected;
|
|
238
|
-
emit(picked);
|
|
239
|
-
closePicker();
|
|
240
|
-
blur?.();
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
/** iOS stages into `tempDate`; the sheet's Done commits. */
|
|
244
|
-
function handleIOSChange(_event: DateTimePickerEvent, selected?: Date) {
|
|
245
|
-
if (!selected) return;
|
|
246
|
-
if (fieldType === "datetime" && showTimePicker && tempDate) {
|
|
247
|
-
setTempDate(
|
|
248
|
-
new Date(
|
|
249
|
-
tempDate.getFullYear(),
|
|
250
|
-
tempDate.getMonth(),
|
|
251
|
-
tempDate.getDate(),
|
|
252
|
-
selected.getHours(),
|
|
253
|
-
selected.getMinutes(),
|
|
254
|
-
),
|
|
255
|
-
);
|
|
256
|
-
return;
|
|
257
|
-
}
|
|
258
|
-
setTempDate(selected);
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
function confirm() {
|
|
262
|
-
emit(tempDate ?? seed);
|
|
263
|
-
closePicker();
|
|
264
|
-
blur?.();
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
return (
|
|
268
|
-
<YStack {...knobProps.gap}>
|
|
269
|
-
<Button
|
|
270
|
-
onPress={openPicker}
|
|
271
|
-
disabled={disabled || readOnly}
|
|
272
|
-
justifyContent="flex-start"
|
|
273
|
-
size={size || knobProps.sizeToken}
|
|
274
|
-
{...knobProps.borderRadius}
|
|
275
|
-
borderColor={hasError ? "$red8" : "$borderColor"}
|
|
276
|
-
backgroundColor={disabled ? "$color4" : "$background"}
|
|
277
|
-
aria-label={typeof label === "string" ? label : undefined}
|
|
278
|
-
aria-invalid={hasError || undefined}
|
|
279
|
-
aria-required={required || undefined}
|
|
280
|
-
>
|
|
281
|
-
<Text color={displayValue ? formCommonColors.text : formCommonColors.muted}>
|
|
282
|
-
{displayValue || resolvedPlaceholder}
|
|
283
|
-
</Text>
|
|
284
|
-
</Button>
|
|
285
|
-
|
|
286
|
-
{/* Android: the Material dialog is its own window. */}
|
|
287
|
-
{showPicker && !isIOS && (
|
|
288
|
-
<DateTimePicker
|
|
289
|
-
value={tempDate || seed}
|
|
290
|
-
mode={pickerMode}
|
|
291
|
-
display="default"
|
|
292
|
-
onChange={handleAndroidChange}
|
|
293
|
-
minimumDate={fieldType !== "time" ? minDate : undefined}
|
|
294
|
-
maximumDate={fieldType !== "time" ? maxDate : undefined}
|
|
295
|
-
/>
|
|
296
|
-
)}
|
|
297
|
-
|
|
298
|
-
{/* iOS: the picker has no chrome of its own, so it rides a sheet. */}
|
|
299
|
-
{showPicker && isIOS && (
|
|
300
|
-
<Modal transparent animationType="fade" visible={showPicker} onRequestClose={cancel}>
|
|
301
|
-
{/*
|
|
302
|
-
A plain padded column, not KeyboardAvoidingView: inside a Modal
|
|
303
|
-
the latter pads the container while the sheet keeps its own
|
|
304
|
-
fixed height, so the sheet overflows off the TOP instead of
|
|
305
|
-
shrinking (MPO-64). Fade keeps the scrim planted (MPO-62);
|
|
306
|
-
only the panel sits at the bottom, capped above the keyboard.
|
|
307
|
-
*/}
|
|
308
|
-
<RNView style={{ flex: 1, justifyContent: "flex-end", paddingBottom: keyboardInset }}>
|
|
309
|
-
<Pressable style={StyleSheet.absoluteFill} onPress={cancel}>
|
|
310
|
-
<View pointerEvents="none" flex={1} backgroundColor="$shadow6" />
|
|
311
|
-
</Pressable>
|
|
312
|
-
<Pressable onPress={(e) => e.stopPropagation()}>
|
|
313
|
-
<YStack
|
|
314
|
-
{...knobProps.elevatedSurface}
|
|
315
|
-
// Bottom sheet: the two off-screen corners eject from the
|
|
316
|
-
// surface fragment's radius, the visible pair keeps it.
|
|
317
|
-
borderBottomLeftRadius={0}
|
|
318
|
-
borderBottomRightRadius={0}
|
|
319
|
-
maxHeight={maxHeight}
|
|
320
|
-
flexShrink={1}
|
|
321
|
-
minHeight={0}
|
|
322
|
-
paddingBottom={sheetBottomPadding}
|
|
323
|
-
>
|
|
324
|
-
<XStack justifyContent="space-between" {...knobProps.panelPadding}>
|
|
325
|
-
<Button size="$3" chromeless onPress={cancel}>
|
|
326
|
-
<Text color={formCommonColors.text}>Cancel</Text>
|
|
327
|
-
</Button>
|
|
328
|
-
|
|
329
|
-
{fieldType === "datetime" && !showTimePicker && (
|
|
330
|
-
<Button size="$3" chromeless onPress={() => setShowTimePicker(true)}>
|
|
331
|
-
<Text color="$accentColor">Next</Text>
|
|
332
|
-
</Button>
|
|
333
|
-
)}
|
|
334
|
-
|
|
335
|
-
{(fieldType !== "datetime" || showTimePicker) && (
|
|
336
|
-
<Button size="$3" chromeless onPress={confirm}>
|
|
337
|
-
<Text color="$accentColor">Done</Text>
|
|
338
|
-
</Button>
|
|
339
|
-
)}
|
|
340
|
-
</XStack>
|
|
341
|
-
|
|
342
|
-
<YStack {...knobProps.panelPadding} flexShrink={1} minHeight={0}>
|
|
343
|
-
<DateTimePicker
|
|
344
|
-
value={tempDate || seed}
|
|
345
|
-
mode={pickerMode}
|
|
346
|
-
display={iosDisplay}
|
|
347
|
-
themeVariant={themeVariant}
|
|
348
|
-
accentColor={accentColor}
|
|
349
|
-
onChange={handleIOSChange}
|
|
350
|
-
minimumDate={fieldType !== "time" ? minDate : undefined}
|
|
351
|
-
maximumDate={fieldType !== "time" ? maxDate : undefined}
|
|
352
|
-
style={{
|
|
353
|
-
width: "100%",
|
|
354
|
-
height: datePickerHeight(pickerMode, maxHeight),
|
|
355
|
-
}}
|
|
356
|
-
/>
|
|
357
|
-
</YStack>
|
|
358
|
-
</YStack>
|
|
359
|
-
</Pressable>
|
|
360
|
-
</RNView>
|
|
361
|
-
</Modal>
|
|
362
|
-
)}
|
|
363
|
-
</YStack>
|
|
364
|
-
);
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
if (skeleton) {
|
|
368
|
-
return (
|
|
369
|
-
<FieldLayout id={id} label={label} size={size} knobProps={knobProps}>
|
|
370
|
-
<Skeleton variant="rounded" width="100%" height={knobProps.sizeToken} />
|
|
371
|
-
</FieldLayout>
|
|
372
|
-
);
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
if (!resolvedForm || !name) {
|
|
376
|
-
return (
|
|
377
|
-
<FieldLayout
|
|
378
|
-
id={id}
|
|
379
|
-
label={label}
|
|
380
|
-
labelProps={labelProps}
|
|
381
|
-
error={errorProp}
|
|
382
|
-
helperText={helperText}
|
|
383
|
-
required={required}
|
|
384
|
-
size={size}
|
|
385
|
-
knobProps={knobProps}
|
|
386
|
-
onBlur={onBlur}
|
|
387
|
-
// LC-40: FieldLayout owns the dimWhole assembly dim (keepLabel pins
|
|
388
|
-
// the sibling label/helper readable) — it needs the disabled state.
|
|
389
|
-
disabled={disabled}
|
|
390
|
-
>
|
|
391
|
-
{renderControl(toWireValue(value, fieldType), !!errorProp, undefined, onBlur)}
|
|
392
|
-
</FieldLayout>
|
|
393
|
-
);
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
return (
|
|
397
|
-
<Field
|
|
398
|
-
defaultValue={defaultValue}
|
|
399
|
-
form={resolvedForm}
|
|
400
|
-
mode={mode}
|
|
401
|
-
name={name as string}
|
|
402
|
-
preserveValue={preserveValue}
|
|
403
|
-
validators={resolvedValidators}
|
|
404
|
-
>
|
|
405
|
-
{(field) => {
|
|
406
|
-
const resolvedError = getFieldError(field, errorProp);
|
|
407
|
-
return (
|
|
408
|
-
<FieldLayout
|
|
409
|
-
id={id}
|
|
410
|
-
label={label}
|
|
411
|
-
labelProps={labelProps}
|
|
412
|
-
error={resolvedError}
|
|
413
|
-
helperText={helperText}
|
|
414
|
-
required={required}
|
|
415
|
-
size={size}
|
|
416
|
-
knobProps={knobProps}
|
|
417
|
-
disabled={disabled}
|
|
418
|
-
>
|
|
419
|
-
{renderControl(
|
|
420
|
-
toWireValue(value ?? field.state.value, fieldType),
|
|
421
|
-
!!resolvedError,
|
|
422
|
-
mergeFieldHandler(field, "handleChange"),
|
|
423
|
-
mergeFieldHandler(field, "handleBlur", onBlur),
|
|
424
|
-
)}
|
|
425
|
-
</FieldLayout>
|
|
426
|
-
);
|
|
427
|
-
}}
|
|
428
|
-
</Field>
|
|
429
|
-
);
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
/**
|
|
433
|
-
* Without the optional `@react-native-community/datetimepicker` peer the
|
|
434
|
-
* field keeps working as the catalog picker the web half renders.
|
|
435
|
-
*/
|
|
436
|
-
function DateField<
|
|
437
|
-
TData extends Record<string, unknown> = Record<string, unknown>,
|
|
438
|
-
TName extends string = string,
|
|
439
|
-
>(props: DateProps<TData, TName>) {
|
|
440
|
-
const DateTimePicker = loadDateTimePicker();
|
|
441
|
-
if (!DateTimePicker) return <CatalogDate {...props} />;
|
|
442
|
-
return <OsDateField {...props} DateTimePicker={DateTimePicker} />;
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
export { DateField as Date };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The native `Date` field without the optional
|
|
3
|
-
* `@react-native-community/datetimepicker` peer (FZ-7357): it renders the
|
|
4
|
-
* catalog half instead of an OS picker it cannot load.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
8
|
-
import { describe, expect, it, vi } from "vitest";
|
|
9
|
-
import { Date as DateField } from "./index.native";
|
|
10
|
-
|
|
11
|
-
vi.mock("./dateTimePickerLoader", () => ({ loadDateTimePicker: () => null }));
|
|
12
|
-
vi.mock("./catalog", () => ({
|
|
13
|
-
Date: ({ type }: { type?: string }) => <div data-testid="catalog-date" data-type={type} />,
|
|
14
|
-
}));
|
|
15
|
-
|
|
16
|
-
describe("native Date without the datetimepicker peer", () => {
|
|
17
|
-
it.each(["date", "datetime", "time"] as const)("renders the catalog %s field", (type) => {
|
|
18
|
-
const result = renderWithProviders(<DateField label="When" type={type} />);
|
|
19
|
-
expect(result.getByTestId("catalog-date").dataset.type).toBe(type);
|
|
20
|
-
});
|
|
21
|
-
});
|