@multiplatform.one/frappe-ui 7.11.0 → 7.16.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/README.md +2 -2
- package/dist/cjs/FrappeCalendar.cjs +1 -0
- package/dist/cjs/FrappeCalendar.native.js +1 -0
- package/dist/cjs/FrappeCalendar.native.js.map +1 -1
- package/dist/cjs/FrappeDashboard.cjs +8 -10
- package/dist/cjs/FrappeDashboard.native.js +8 -14
- package/dist/cjs/FrappeDashboard.native.js.map +1 -1
- package/dist/cjs/FrappeForm.cjs +465 -175
- package/dist/cjs/FrappeForm.native.js +611 -207
- package/dist/cjs/FrappeForm.native.js.map +1 -1
- package/dist/cjs/FrappeFormConnections.cjs +125 -0
- package/dist/cjs/FrappeFormConnections.native.js +149 -0
- package/dist/cjs/FrappeFormConnections.native.js.map +1 -0
- package/dist/cjs/FrappeImageView.cjs +7 -9
- package/dist/cjs/FrappeImageView.native.js +7 -13
- package/dist/cjs/FrappeImageView.native.js.map +1 -1
- package/dist/cjs/FrappeList.cjs +29 -4
- package/dist/cjs/FrappeList.native.js +37 -5
- package/dist/cjs/FrappeList.native.js.map +1 -1
- package/dist/cjs/FrappeListView.cjs +102 -29
- package/dist/cjs/FrappeListView.native.js +109 -29
- package/dist/cjs/FrappeListView.native.js.map +1 -1
- package/dist/cjs/FrappeProvider.cjs +7 -2
- package/dist/cjs/FrappeProvider.native.js +7 -2
- package/dist/cjs/FrappeProvider.native.js.map +1 -1
- package/dist/cjs/FrappeReportBuilder.cjs +10 -11
- package/dist/cjs/FrappeReportBuilder.native.js +10 -16
- package/dist/cjs/FrappeReportBuilder.native.js.map +1 -1
- package/dist/cjs/FrappeRowsReader.cjs +49 -0
- package/dist/cjs/FrappeRowsReader.native.js +53 -0
- package/dist/cjs/FrappeRowsReader.native.js.map +1 -0
- package/dist/cjs/FrappeTable.cjs +18 -6
- package/dist/cjs/FrappeTable.native.js +24 -6
- package/dist/cjs/FrappeTable.native.js.map +1 -1
- package/dist/cjs/fieldRegistry.cjs +36 -11
- package/dist/cjs/fieldRegistry.native.js +59 -11
- package/dist/cjs/fieldRegistry.native.js.map +1 -1
- package/dist/cjs/fields/Date/index.native.js +5 -2
- package/dist/cjs/fields/Date/index.native.js.map +1 -1
- package/dist/cjs/fields/Date/sheetKeyboard.cjs +2 -2
- package/dist/cjs/fields/Date/sheetKeyboard.native.js +2 -2
- package/dist/cjs/fields/Date/sheetKeyboard.native.js.map +1 -1
- package/dist/cjs/fields/DateRange/index.cjs +2 -1
- package/dist/cjs/fields/DateRange/index.native.js +4 -1
- package/dist/cjs/fields/DateRange/index.native.js.map +1 -1
- package/dist/cjs/fields/Password/index.cjs +1 -1
- package/dist/cjs/fields/Password/index.native.js +1 -1
- package/dist/cjs/formEngine/index.cjs +4 -2
- package/dist/cjs/formEngine/index.native.js +3 -1
- package/dist/cjs/formEngine/index.native.js.map +1 -1
- package/dist/cjs/formEngine/useSessionRoles.cjs +77 -0
- package/dist/cjs/formEngine/useSessionRoles.native.js +84 -0
- package/dist/cjs/formEngine/useSessionRoles.native.js.map +1 -0
- package/dist/cjs/frappeConnections.cjs +41 -0
- package/dist/cjs/frappeConnections.native.js +50 -0
- package/dist/cjs/frappeConnections.native.js.map +1 -0
- package/dist/cjs/frappeNavigation.cjs +107 -0
- package/dist/cjs/frappeNavigation.native.js +112 -0
- package/dist/cjs/frappeNavigation.native.js.map +1 -0
- package/dist/cjs/index.cjs +18 -1
- package/dist/cjs/index.native.js +18 -1
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/schemaForm/index.cjs +4 -1
- package/dist/cjs/schemaForm/index.native.js +4 -1
- package/dist/cjs/schemaForm/index.native.js.map +1 -1
- package/dist/cjs/useConnectionFilters.cjs +146 -0
- package/dist/cjs/useConnectionFilters.native.js +213 -0
- package/dist/cjs/useConnectionFilters.native.js.map +1 -0
- package/dist/cjs/useFrappePagination.cjs +37 -18
- package/dist/cjs/useFrappePagination.native.js +59 -23
- package/dist/cjs/useFrappePagination.native.js.map +1 -1
- package/dist/cjs/useFrappeRows.native.js.map +1 -1
- package/dist/esm/FrappeCalendar.mjs +1 -0
- package/dist/esm/FrappeCalendar.mjs.map +1 -1
- package/dist/esm/FrappeCalendar.native.js +1 -0
- package/dist/esm/FrappeCalendar.native.js.map +1 -1
- package/dist/esm/FrappeDashboard.mjs +9 -11
- package/dist/esm/FrappeDashboard.mjs.map +1 -1
- package/dist/esm/FrappeDashboard.native.js +9 -15
- package/dist/esm/FrappeDashboard.native.js.map +1 -1
- package/dist/esm/FrappeForm.mjs +471 -181
- package/dist/esm/FrappeForm.mjs.map +1 -1
- package/dist/esm/FrappeForm.native.js +599 -195
- package/dist/esm/FrappeForm.native.js.map +1 -1
- package/dist/esm/FrappeFormConnections.mjs +99 -0
- package/dist/esm/FrappeFormConnections.mjs.map +1 -0
- package/dist/esm/FrappeFormConnections.native.js +120 -0
- package/dist/esm/FrappeFormConnections.native.js.map +1 -0
- package/dist/esm/FrappeImageView.mjs +8 -10
- package/dist/esm/FrappeImageView.mjs.map +1 -1
- package/dist/esm/FrappeImageView.native.js +8 -14
- package/dist/esm/FrappeImageView.native.js.map +1 -1
- package/dist/esm/FrappeList.mjs +31 -6
- package/dist/esm/FrappeList.mjs.map +1 -1
- package/dist/esm/FrappeList.native.js +39 -7
- package/dist/esm/FrappeList.native.js.map +1 -1
- package/dist/esm/FrappeListView.mjs +103 -30
- package/dist/esm/FrappeListView.mjs.map +1 -1
- package/dist/esm/FrappeListView.native.js +110 -30
- package/dist/esm/FrappeListView.native.js.map +1 -1
- package/dist/esm/FrappeProvider.mjs +7 -2
- package/dist/esm/FrappeProvider.mjs.map +1 -1
- package/dist/esm/FrappeProvider.native.js +7 -2
- package/dist/esm/FrappeProvider.native.js.map +1 -1
- package/dist/esm/FrappeReportBuilder.mjs +11 -12
- package/dist/esm/FrappeReportBuilder.mjs.map +1 -1
- package/dist/esm/FrappeReportBuilder.native.js +11 -17
- package/dist/esm/FrappeReportBuilder.native.js.map +1 -1
- package/dist/esm/FrappeRowsReader.mjs +24 -0
- package/dist/esm/FrappeRowsReader.mjs.map +1 -0
- package/dist/esm/FrappeRowsReader.native.js +25 -0
- package/dist/esm/FrappeRowsReader.native.js.map +1 -0
- package/dist/esm/FrappeTable.mjs +18 -6
- package/dist/esm/FrappeTable.mjs.map +1 -1
- package/dist/esm/FrappeTable.native.js +24 -6
- package/dist/esm/FrappeTable.native.js.map +1 -1
- package/dist/esm/fieldRegistry.mjs +35 -12
- package/dist/esm/fieldRegistry.mjs.map +1 -1
- package/dist/esm/fieldRegistry.native.js +58 -12
- package/dist/esm/fieldRegistry.native.js.map +1 -1
- package/dist/esm/fields/Date/index.native.js +6 -3
- package/dist/esm/fields/Date/index.native.js.map +1 -1
- package/dist/esm/fields/Date/sheetKeyboard.mjs +2 -2
- package/dist/esm/fields/Date/sheetKeyboard.mjs.map +1 -1
- package/dist/esm/fields/Date/sheetKeyboard.native.js +2 -2
- package/dist/esm/fields/Date/sheetKeyboard.native.js.map +1 -1
- package/dist/esm/fields/DateRange/index.mjs +2 -1
- package/dist/esm/fields/DateRange/index.mjs.map +1 -1
- package/dist/esm/fields/DateRange/index.native.js +4 -1
- package/dist/esm/fields/DateRange/index.native.js.map +1 -1
- package/dist/esm/fields/Password/index.mjs +1 -1
- package/dist/esm/fields/Password/index.mjs.map +1 -1
- package/dist/esm/fields/Password/index.native.js +1 -1
- package/dist/esm/fields/Password/index.native.js.map +1 -1
- package/dist/esm/formEngine/index.mjs +2 -1
- package/dist/esm/formEngine/index.mjs.map +1 -1
- package/dist/esm/formEngine/index.native.js +2 -1
- package/dist/esm/formEngine/index.native.js.map +1 -1
- package/dist/esm/formEngine/useSessionRoles.mjs +52 -0
- package/dist/esm/formEngine/useSessionRoles.mjs.map +1 -0
- package/dist/esm/formEngine/useSessionRoles.native.js +56 -0
- package/dist/esm/formEngine/useSessionRoles.native.js.map +1 -0
- package/dist/esm/frappeConnections.mjs +15 -0
- package/dist/esm/frappeConnections.mjs.map +1 -0
- package/dist/esm/frappeConnections.native.js +21 -0
- package/dist/esm/frappeConnections.native.js.map +1 -0
- package/dist/esm/frappeNavigation.mjs +78 -0
- package/dist/esm/frappeNavigation.mjs.map +1 -0
- package/dist/esm/frappeNavigation.native.js +80 -0
- package/dist/esm/frappeNavigation.native.js.map +1 -0
- package/dist/esm/index.mjs +7 -3
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +7 -3
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/schemaForm/index.mjs +4 -1
- package/dist/esm/schemaForm/index.mjs.map +1 -1
- package/dist/esm/schemaForm/index.native.js +4 -1
- package/dist/esm/schemaForm/index.native.js.map +1 -1
- package/dist/esm/useConnectionFilters.mjs +121 -0
- package/dist/esm/useConnectionFilters.mjs.map +1 -0
- package/dist/esm/useConnectionFilters.native.js +185 -0
- package/dist/esm/useConnectionFilters.native.js.map +1 -0
- package/dist/esm/useFrappePagination.mjs +38 -19
- package/dist/esm/useFrappePagination.mjs.map +1 -1
- package/dist/esm/useFrappePagination.native.js +60 -24
- package/dist/esm/useFrappePagination.native.js.map +1 -1
- package/dist/esm/useFrappeRows.mjs.map +1 -1
- package/dist/esm/useFrappeRows.native.js.map +1 -1
- package/dist/jsx/FrappeCalendar.mjs +1 -0
- package/dist/jsx/FrappeCalendar.mjs.map +1 -1
- package/dist/jsx/FrappeCalendar.native.js +1 -0
- package/dist/jsx/FrappeCalendar.native.js.map +1 -1
- package/dist/jsx/FrappeDashboard.mjs +9 -11
- package/dist/jsx/FrappeDashboard.mjs.map +1 -1
- package/dist/jsx/FrappeDashboard.native.js +8 -14
- package/dist/jsx/FrappeDashboard.native.js.map +1 -1
- package/dist/jsx/FrappeForm.mjs +471 -181
- package/dist/jsx/FrappeForm.mjs.map +1 -1
- package/dist/jsx/FrappeForm.native.js +611 -207
- package/dist/jsx/FrappeForm.native.js.map +1 -1
- package/dist/jsx/FrappeFormConnections.mjs +99 -0
- package/dist/jsx/FrappeFormConnections.mjs.map +1 -0
- package/dist/jsx/FrappeFormConnections.native.js +149 -0
- package/dist/jsx/FrappeFormConnections.native.js.map +1 -0
- package/dist/jsx/FrappeImageView.mjs +8 -10
- package/dist/jsx/FrappeImageView.mjs.map +1 -1
- package/dist/jsx/FrappeImageView.native.js +7 -13
- package/dist/jsx/FrappeImageView.native.js.map +1 -1
- package/dist/jsx/FrappeList.mjs +31 -6
- package/dist/jsx/FrappeList.mjs.map +1 -1
- package/dist/jsx/FrappeList.native.js +37 -5
- package/dist/jsx/FrappeList.native.js.map +1 -1
- package/dist/jsx/FrappeListView.mjs +103 -30
- package/dist/jsx/FrappeListView.mjs.map +1 -1
- package/dist/jsx/FrappeListView.native.js +109 -29
- package/dist/jsx/FrappeListView.native.js.map +1 -1
- package/dist/jsx/FrappeProvider.mjs +7 -2
- package/dist/jsx/FrappeProvider.mjs.map +1 -1
- package/dist/jsx/FrappeProvider.native.js +7 -2
- package/dist/jsx/FrappeProvider.native.js.map +1 -1
- package/dist/jsx/FrappeReportBuilder.mjs +11 -12
- package/dist/jsx/FrappeReportBuilder.mjs.map +1 -1
- package/dist/jsx/FrappeReportBuilder.native.js +10 -16
- package/dist/jsx/FrappeReportBuilder.native.js.map +1 -1
- package/dist/jsx/FrappeRowsReader.mjs +24 -0
- package/dist/jsx/FrappeRowsReader.mjs.map +1 -0
- package/dist/jsx/FrappeRowsReader.native.js +53 -0
- package/dist/jsx/FrappeRowsReader.native.js.map +1 -0
- package/dist/jsx/FrappeTable.mjs +18 -6
- package/dist/jsx/FrappeTable.mjs.map +1 -1
- package/dist/jsx/FrappeTable.native.js +24 -6
- package/dist/jsx/FrappeTable.native.js.map +1 -1
- package/dist/jsx/fieldRegistry.mjs +35 -12
- package/dist/jsx/fieldRegistry.mjs.map +1 -1
- package/dist/jsx/fieldRegistry.native.js +59 -11
- package/dist/jsx/fieldRegistry.native.js.map +1 -1
- package/dist/jsx/fields/Date/index.native.js +5 -2
- package/dist/jsx/fields/Date/index.native.js.map +1 -1
- package/dist/jsx/fields/Date/sheetKeyboard.mjs +2 -2
- package/dist/jsx/fields/Date/sheetKeyboard.mjs.map +1 -1
- package/dist/jsx/fields/Date/sheetKeyboard.native.js +2 -2
- package/dist/jsx/fields/Date/sheetKeyboard.native.js.map +1 -1
- package/dist/jsx/fields/DateRange/index.mjs +2 -1
- package/dist/jsx/fields/DateRange/index.mjs.map +1 -1
- package/dist/jsx/fields/DateRange/index.native.js +4 -1
- package/dist/jsx/fields/DateRange/index.native.js.map +1 -1
- package/dist/jsx/fields/Password/index.mjs +1 -1
- package/dist/jsx/fields/Password/index.mjs.map +1 -1
- package/dist/jsx/fields/Password/index.native.js +1 -1
- package/dist/jsx/fields/Password/index.native.js.map +1 -1
- package/dist/jsx/formEngine/index.mjs +2 -1
- package/dist/jsx/formEngine/index.mjs.map +1 -1
- package/dist/jsx/formEngine/index.native.js +3 -1
- package/dist/jsx/formEngine/index.native.js.map +1 -1
- package/dist/jsx/formEngine/useSessionRoles.mjs +52 -0
- package/dist/jsx/formEngine/useSessionRoles.mjs.map +1 -0
- package/dist/jsx/formEngine/useSessionRoles.native.js +84 -0
- package/dist/jsx/formEngine/useSessionRoles.native.js.map +1 -0
- package/dist/jsx/frappeConnections.mjs +15 -0
- package/dist/jsx/frappeConnections.mjs.map +1 -0
- package/dist/jsx/frappeConnections.native.js +50 -0
- package/dist/jsx/frappeConnections.native.js.map +1 -0
- package/dist/jsx/frappeNavigation.mjs +78 -0
- package/dist/jsx/frappeNavigation.mjs.map +1 -0
- package/dist/jsx/frappeNavigation.native.js +112 -0
- package/dist/jsx/frappeNavigation.native.js.map +1 -0
- package/dist/jsx/index.js +7 -3
- package/dist/jsx/index.js.map +1 -1
- package/dist/jsx/index.mjs +7 -3
- package/dist/jsx/index.mjs.map +1 -1
- package/dist/jsx/index.native.js +18 -1
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/schemaForm/index.mjs +4 -1
- package/dist/jsx/schemaForm/index.mjs.map +1 -1
- package/dist/jsx/schemaForm/index.native.js +4 -1
- package/dist/jsx/schemaForm/index.native.js.map +1 -1
- package/dist/jsx/useConnectionFilters.mjs +121 -0
- package/dist/jsx/useConnectionFilters.mjs.map +1 -0
- package/dist/jsx/useConnectionFilters.native.js +213 -0
- package/dist/jsx/useConnectionFilters.native.js.map +1 -0
- package/dist/jsx/useFrappePagination.mjs +38 -19
- package/dist/jsx/useFrappePagination.mjs.map +1 -1
- package/dist/jsx/useFrappePagination.native.js +59 -23
- package/dist/jsx/useFrappePagination.native.js.map +1 -1
- package/dist/jsx/useFrappeRows.mjs.map +1 -1
- package/dist/jsx/useFrappeRows.native.js.map +1 -1
- package/package.json +24 -20
- package/src/FileBrowser/AttachLibrary.stories.tsx +23 -0
- package/src/FrappeCalendar.radius.spec.tsx +55 -0
- package/src/FrappeCalendar.tsx +1 -0
- package/src/FrappeDashboard.tsx +11 -16
- package/src/FrappeForm.connections.spec.tsx +280 -0
- package/src/FrappeForm.connections.stories.tsx +93 -0
- package/src/FrappeForm.deskSemantics.spec.tsx +284 -0
- package/src/FrappeForm.tsx +560 -145
- package/src/FrappeFormConnections.tsx +148 -0
- package/src/FrappeGuestMeta.spec.tsx +143 -0
- package/src/FrappeImageView.tsx +8 -12
- package/src/FrappeList.tsx +71 -15
- package/src/FrappeListView.cards.spec.tsx +175 -0
- package/src/FrappeListView.cards.stories.tsx +131 -0
- package/src/FrappeListView.connections.spec.tsx +192 -0
- package/src/FrappeListView.connections.stories.tsx +99 -0
- package/src/FrappeListView.seed.spec.tsx +228 -0
- package/src/FrappeListView.tsx +177 -31
- package/src/FrappeProvider.tsx +13 -1
- package/src/FrappeReportBuilder.tsx +11 -19
- package/src/FrappeRowsReader.tsx +38 -0
- package/src/FrappeTable.optionalProps.spec.tsx +249 -0
- package/src/FrappeTable.spec.tsx +32 -42
- package/src/FrappeTable.stories.spec.tsx +55 -0
- package/src/FrappeTable.stories.tsx +28 -37
- package/src/FrappeTable.tsx +108 -45
- package/src/childTableDependsOn.spec.tsx +85 -0
- package/src/desk/DeskFormSidebar.spec.tsx +20 -0
- package/src/desk/DeskFormSidebar.stories.tsx +42 -0
- package/src/fieldRegistry.spec.tsx +27 -64
- package/src/fieldRegistry.ts +71 -14
- package/src/fields/Date/index.native.tsx +4 -2
- package/src/fields/Date/sheetKeyboard.spec.ts +14 -5
- package/src/fields/Date/sheetKeyboard.ts +12 -4
- package/src/fields/DateRange/DateRange.spec.tsx +67 -0
- package/src/fields/DateRange/index.tsx +5 -1
- package/src/fields/LinkTree.spec.tsx +8 -0
- package/src/fields/LinkTree.stories.tsx +28 -5
- package/src/fields/Password/index.tsx +1 -1
- package/src/fields/Select/Select.hydration.spec.tsx +177 -0
- package/src/formEngine/doctypeMeta.ts +15 -114
- package/src/formEngine/index.ts +2 -0
- package/src/formEngine/seam.spec.ts +23 -4
- package/src/formEngine/useSessionRoles.ts +73 -0
- package/src/frappeConnections.ts +50 -0
- package/src/frappeNavigation.tsx +112 -0
- package/src/frappeRoutes.spec.tsx +335 -0
- package/src/index.ts +28 -1
- package/src/schemaForm/index.tsx +1 -0
- package/src/useConnectionFilters.tsx +157 -0
- package/src/useFrappePagination.ts +70 -26
- package/src/useFrappeRows.sharedPath.spec.tsx +206 -0
- package/src/useFrappeRows.ts +5 -4
- package/types/FrappeCalendar.d.ts.map +1 -1
- package/types/FrappeDashboard.d.ts +3 -4
- package/types/FrappeDashboard.d.ts.map +1 -1
- package/types/FrappeForm.d.ts +57 -5
- package/types/FrappeForm.d.ts.map +1 -1
- package/types/FrappeFormConnections.d.ts +18 -0
- package/types/FrappeFormConnections.d.ts.map +1 -0
- package/types/FrappeImageView.d.ts +2 -3
- package/types/FrappeImageView.d.ts.map +1 -1
- package/types/FrappeList.d.ts +20 -2
- package/types/FrappeList.d.ts.map +1 -1
- package/types/FrappeListView.d.ts +53 -3
- package/types/FrappeListView.d.ts.map +1 -1
- package/types/FrappeProvider.d.ts +8 -1
- package/types/FrappeProvider.d.ts.map +1 -1
- package/types/FrappeReportBuilder.d.ts.map +1 -1
- package/types/FrappeRowsReader.d.ts +26 -0
- package/types/FrappeRowsReader.d.ts.map +1 -0
- package/types/FrappeTable.d.ts +39 -8
- package/types/FrappeTable.d.ts.map +1 -1
- package/types/fieldRegistry.d.ts +17 -3
- package/types/fieldRegistry.d.ts.map +1 -1
- package/types/fields/Date/index.native.d.ts.map +1 -1
- package/types/fields/Date/sheetKeyboard.d.ts +4 -3
- package/types/fields/Date/sheetKeyboard.d.ts.map +1 -1
- package/types/fields/DateRange/index.d.ts.map +1 -1
- package/types/formEngine/doctypeMeta.d.ts +10 -114
- package/types/formEngine/doctypeMeta.d.ts.map +1 -1
- package/types/formEngine/index.d.ts +1 -0
- package/types/formEngine/index.d.ts.map +1 -1
- package/types/formEngine/useSessionRoles.d.ts +19 -0
- package/types/formEngine/useSessionRoles.d.ts.map +1 -0
- package/types/frappeConnections.d.ts +33 -0
- package/types/frappeConnections.d.ts.map +1 -0
- package/types/frappeNavigation.d.ts +49 -0
- package/types/frappeNavigation.d.ts.map +1 -0
- package/types/index.d.ts +7 -3
- package/types/index.d.ts.map +1 -1
- package/types/schemaForm/index.d.ts.map +1 -1
- package/types/useConnectionFilters.d.ts +34 -0
- package/types/useConnectionFilters.d.ts.map +1 -0
- package/types/useFrappePagination.d.ts +18 -5
- package/types/useFrappePagination.d.ts.map +1 -1
- package/types/useFrappeRows.d.ts +5 -4
- package/types/useFrappeRows.d.ts.map +1 -1
- package/src/FileBrowser/AttachLibrary.spec.tsx +0 -74
|
@@ -1,117 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* a lower-tier package must never reach up into backoffice for a type.
|
|
8
|
-
* `useDoctypeMeta` (the loader hook, which needs the backoffice app context)
|
|
9
|
-
* stays where it is and re-exports these.
|
|
10
|
-
*
|
|
11
|
-
* Deliberately loose: the server is the source of truth, `0 | 1` flags are
|
|
12
|
-
* what the RPC actually sends, and the index signature carries the keys no
|
|
13
|
-
* surface has needed yet. `fieldtype` stays `string` here; narrowing it to
|
|
14
|
-
* the `FrappeFieldType` union is the remaining half of MPO-15's meta-model
|
|
15
|
-
* criterion and is tracked there, not silently done in a move.
|
|
2
|
+
* The desk's names for the one DocType meta model, which
|
|
3
|
+
* `@multiplatform.one/frappe` declares (MPO-15). These are aliases, not
|
|
4
|
+
* shapes: the form engine, the backoffice surfaces and `useDocTypeMeta`
|
|
5
|
+
* all read the same `DocTypeField` / `DocTypeMeta`, so a field key the
|
|
6
|
+
* server sends reaches every one of them or none.
|
|
16
7
|
*/
|
|
17
|
-
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
options?: string;
|
|
23
|
-
reqd?: 0 | 1;
|
|
24
|
-
hidden?: 0 | 1;
|
|
25
|
-
read_only?: 0 | 1;
|
|
26
|
-
bold?: 0 | 1;
|
|
27
|
-
in_list_view?: 0 | 1;
|
|
28
|
-
in_standard_filter?: 0 | 1;
|
|
29
|
-
in_global_search?: 0 | 1;
|
|
30
|
-
allow_in_quick_entry?: 0 | 1;
|
|
31
|
-
allow_on_submit?: 0 | 1;
|
|
32
|
-
no_copy?: 0 | 1;
|
|
33
|
-
collapsible?: 0 | 1;
|
|
34
|
-
collapsible_depends_on?: string;
|
|
35
|
-
depends_on?: string;
|
|
36
|
-
mandatory_depends_on?: string;
|
|
37
|
-
read_only_depends_on?: string;
|
|
38
|
-
fetch_from?: string;
|
|
39
|
-
permlevel?: number;
|
|
40
|
-
length?: number;
|
|
41
|
-
default?: string;
|
|
42
|
-
description?: string;
|
|
43
|
-
precision?: string | number;
|
|
44
|
-
idx?: number;
|
|
45
|
-
[key: string]: unknown;
|
|
46
|
-
}
|
|
47
|
-
/** DocType Link child row (Connections tab). Probed: `group` arrives null when unset. */
|
|
48
|
-
export interface DocLinkMeta {
|
|
49
|
-
name?: string;
|
|
50
|
-
link_doctype: string;
|
|
51
|
-
link_fieldname: string;
|
|
52
|
-
group?: string | null;
|
|
53
|
-
hidden?: 0 | 1;
|
|
54
|
-
is_child_table?: 0 | 1;
|
|
55
|
-
parent_doctype?: string;
|
|
56
|
-
table_fieldname?: string;
|
|
57
|
-
[key: string]: unknown;
|
|
58
|
-
}
|
|
59
|
-
/** Role permission row from the DocType meta. */
|
|
60
|
-
export interface DocPermissionRule {
|
|
61
|
-
role?: string;
|
|
62
|
-
permlevel?: number;
|
|
63
|
-
read?: 0 | 1;
|
|
64
|
-
write?: 0 | 1;
|
|
65
|
-
create?: 0 | 1;
|
|
66
|
-
delete?: 0 | 1;
|
|
67
|
-
submit?: 0 | 1;
|
|
68
|
-
cancel?: 0 | 1;
|
|
69
|
-
amend?: 0 | 1;
|
|
70
|
-
print?: 0 | 1;
|
|
71
|
-
email?: 0 | 1;
|
|
72
|
-
share?: 0 | 1;
|
|
73
|
-
if_owner?: 0 | 1;
|
|
74
|
-
[key: string]: unknown;
|
|
75
|
-
}
|
|
76
|
-
/** DocType meta as returned by frappe.desk.form.load.getdoctype (loose). */
|
|
77
|
-
export interface DoctypeMeta {
|
|
78
|
-
doctype?: string;
|
|
79
|
-
name: string;
|
|
80
|
-
module?: string;
|
|
81
|
-
issingle?: 0 | 1;
|
|
82
|
-
istable?: 0 | 1;
|
|
83
|
-
is_submittable?: 0 | 1;
|
|
84
|
-
is_tree?: 0 | 1;
|
|
85
|
-
/** Desk treeview_settings asset (`{doctype}_tree.js`) — gates Tree. */
|
|
86
|
-
__tree_js?: string;
|
|
87
|
-
/** Desk calendar_settings asset (`{doctype}_calendar.js`) — gates Calendar. */
|
|
88
|
-
__calendar_js?: string;
|
|
89
|
-
is_virtual?: 0 | 1;
|
|
90
|
-
editable_grid?: 0 | 1;
|
|
91
|
-
track_changes?: 0 | 1;
|
|
92
|
-
quick_entry?: 0 | 1;
|
|
93
|
-
autoname?: string;
|
|
94
|
-
naming_rule?: string;
|
|
95
|
-
allow_rename?: 0 | 1;
|
|
96
|
-
allow_copy?: 0 | 1;
|
|
97
|
-
read_only?: 0 | 1;
|
|
98
|
-
in_create?: 0 | 1;
|
|
99
|
-
hide_toolbar?: 0 | 1;
|
|
100
|
-
max_attachments?: number;
|
|
101
|
-
title_field?: string;
|
|
102
|
-
image_field?: string;
|
|
103
|
-
search_fields?: string;
|
|
104
|
-
sort_field?: string;
|
|
105
|
-
sort_order?: string;
|
|
106
|
-
icon?: string;
|
|
107
|
-
document_type?: string;
|
|
108
|
-
fields: DocFieldMeta[];
|
|
109
|
-
permissions?: DocPermissionRule[];
|
|
110
|
-
links?: DocLinkMeta[];
|
|
111
|
-
states?: Array<{
|
|
112
|
-
title?: string;
|
|
113
|
-
color?: string;
|
|
114
|
-
} & Record<string, unknown>>;
|
|
115
|
-
[key: string]: unknown;
|
|
116
|
-
}
|
|
8
|
+
import type { DocTypeField, DocTypeLink, DocTypeMeta, DocTypePermission } from "@multiplatform.one/frappe";
|
|
9
|
+
export type DocFieldMeta = DocTypeField;
|
|
10
|
+
export type DocLinkMeta = DocTypeLink;
|
|
11
|
+
export type DocPermissionRule = DocTypePermission;
|
|
12
|
+
export type DoctypeMeta = DocTypeMeta;
|
|
117
13
|
//# sourceMappingURL=doctypeMeta.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctypeMeta.d.ts","sourceRoot":"","sources":["../../src/formEngine/doctypeMeta.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"doctypeMeta.d.ts","sourceRoot":"","sources":["../../src/formEngine/doctypeMeta.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EACV,YAAY,EACZ,WAAW,EACX,WAAW,EACX,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AAEnC,MAAM,MAAM,YAAY,GAAG,YAAY,CAAC;AACxC,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC;AACtC,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,CAAC;AAClD,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC"}
|
|
@@ -24,4 +24,5 @@ export { buildCopyValues, buildCreateDefaults, buildFormTabs, isPromptNamed } fr
|
|
|
24
24
|
export type { BuildTabsOptions, FormTab } from "./formLayout";
|
|
25
25
|
export { useFormEngine } from "./useFormEngine";
|
|
26
26
|
export type { FormEngine } from "./useFormEngine";
|
|
27
|
+
export { useSessionRoles } from "./useSessionRoles";
|
|
27
28
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/formEngine/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE/F,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACvF,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErE,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC/E,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEvD,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEhF,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEtE,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClG,YAAY,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE9D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/formEngine/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE/F,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACvF,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErE,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC/E,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEvD,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEhF,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEtE,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClG,YAAY,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE9D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session user's role list — the client-side half of desk's
|
|
3
|
+
* `frappe.user_roles` (bootinfo). Fetched once per site via the whitelisted
|
|
4
|
+
* `frappe.core.doctype.user.user.get_roles` RPC (probed:
|
|
5
|
+
* `?uid=<user>` → `{"message": ["Role", ...]}`), keyed off
|
|
6
|
+
* `frappe.auth.get_logged_user`.
|
|
7
|
+
*
|
|
8
|
+
* Undefined while loading, on a fixtures-only connection, or when the RPC
|
|
9
|
+
* fails. The permlevel matrix then takes the conservative
|
|
10
|
+
* "permlevel > 0 → read-only" rule (fieldPermissions.ts).
|
|
11
|
+
*/
|
|
12
|
+
import { type FrappeConnection } from "./formActions";
|
|
13
|
+
/** A connection that may not name a bench yet (a provider's config before it resolves). */
|
|
14
|
+
type SessionConnection = Omit<FrappeConnection, "baseURL"> & {
|
|
15
|
+
baseURL?: string;
|
|
16
|
+
};
|
|
17
|
+
export declare function useSessionRoles(connection: SessionConnection | undefined): string[] | undefined;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=useSessionRoles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSessionRoles.d.ts","sourceRoot":"","sources":["../../src/formEngine/useSessionRoles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAoB,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAuBxE,2FAA2F;AAC3F,KAAK,iBAAiB,GAAG,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAElF,wBAAgB,eAAe,CAAC,UAAU,EAAE,iBAAiB,GAAG,SAAS,GAAG,MAAM,EAAE,GAAG,SAAS,CAiC/F"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { DocTypeMeta } from "@multiplatform.one/frappe";
|
|
2
|
+
/**
|
|
3
|
+
* A doctype whose rows point at one record of another doctype through a Link
|
|
4
|
+
* field: the desk's Connections, one DocType Link row (`link_doctype` +
|
|
5
|
+
* `link_fieldname`). Pokemon's types, abilities and moves are three of them,
|
|
6
|
+
* each a standalone doctype with a `pokemon` Link, not a child table.
|
|
7
|
+
*/
|
|
8
|
+
export interface FrappeConnection {
|
|
9
|
+
/** The linked doctype (DocType Link `link_doctype`). */
|
|
10
|
+
doctype: string;
|
|
11
|
+
/** Its Link field naming the record (DocType Link `link_fieldname`). */
|
|
12
|
+
fieldname: string;
|
|
13
|
+
/** Columns to read from the linked rows; the link field is always read. */
|
|
14
|
+
fields?: readonly string[];
|
|
15
|
+
/** Section heading; defaults to the linked doctype. */
|
|
16
|
+
label?: string;
|
|
17
|
+
/** DocType Link `group`, for desk parity. */
|
|
18
|
+
group?: string;
|
|
19
|
+
/** Row ceiling per record; 0 (the default) reads every linked row. */
|
|
20
|
+
limit?: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* `meta.links` as connections. Hidden rows and links that resolve through a
|
|
24
|
+
* child table (`is_child_table`) are left out: neither names the record by a
|
|
25
|
+
* Link field on the linked doctype itself.
|
|
26
|
+
*/
|
|
27
|
+
export declare function connectionsFromMeta(meta: Pick<DocTypeMeta, "links"> | null | undefined): FrappeConnection[];
|
|
28
|
+
/**
|
|
29
|
+
* The fields a connection read asks for: `name`, the link field, then its
|
|
30
|
+
* own; every field (`*`) when it names none, as a meta.links row does.
|
|
31
|
+
*/
|
|
32
|
+
export declare function connectionFields(connection: FrappeConnection): string[];
|
|
33
|
+
//# sourceMappingURL=frappeConnections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frappeConnections.d.ts","sourceRoot":"","sources":["../src/frappeConnections.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE7D;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAC;IAChB,wEAAwE;IACxE,SAAS,EAAE,MAAM,CAAC;IAClB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sEAAsE;IACtE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,GAClD,gBAAgB,EAAE,CAUpB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,gBAAgB,GAAG,MAAM,EAAE,CAGvE"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* The host router as frappe-ui sees it. frappe-ui imports no router: the
|
|
4
|
+
* host app hands this to `FrappeProvider` once (`@multiplatform.one/core`
|
|
5
|
+
* does it from One's router), and a routed `FrappeListView` or `FrappeForm`
|
|
6
|
+
* (`route` prop) reads its record from the path and moves with it.
|
|
7
|
+
*
|
|
8
|
+
* Both members are hooks, called where the routed view renders, so they see
|
|
9
|
+
* that page's route. A host keeps the same navigation for the life of the
|
|
10
|
+
* tree.
|
|
11
|
+
*/
|
|
12
|
+
export interface FrappeNavigation {
|
|
13
|
+
/** The pathname of the route the caller renders in. */
|
|
14
|
+
usePathname(): string;
|
|
15
|
+
/** A function that pushes an href onto the history. */
|
|
16
|
+
useNavigate(): (href: string) => void;
|
|
17
|
+
}
|
|
18
|
+
/** A routed view's handle on the host router. */
|
|
19
|
+
export interface FrappeRouter {
|
|
20
|
+
pathname: string;
|
|
21
|
+
navigate(href: string): void;
|
|
22
|
+
}
|
|
23
|
+
export declare function FrappeNavigationProvider({ navigation, children, }: {
|
|
24
|
+
navigation: FrappeNavigation | undefined;
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare function useFrappeNavigation(): FrappeNavigation | undefined;
|
|
28
|
+
/** The host router for a routed view, or undefined when the host gave none. */
|
|
29
|
+
export declare function useFrappeRouter(): FrappeRouter | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* What a path under a doctype's route names, desk style: the list
|
|
32
|
+
* (`/route`), a new record (`/route/new`), a record (`/route/<name>`) or its
|
|
33
|
+
* edit form (`/route/<name>/edit`).
|
|
34
|
+
*/
|
|
35
|
+
export type FrappeRouteTarget = {
|
|
36
|
+
mode: "list";
|
|
37
|
+
} | {
|
|
38
|
+
mode: "create";
|
|
39
|
+
} | {
|
|
40
|
+
mode: "view";
|
|
41
|
+
name: string;
|
|
42
|
+
} | {
|
|
43
|
+
mode: "edit";
|
|
44
|
+
name: string;
|
|
45
|
+
};
|
|
46
|
+
export declare function frappeRouteTarget(route: string, pathname: string): FrappeRouteTarget | undefined;
|
|
47
|
+
/** The href of a doctype route's list, new record, record or record edit form. */
|
|
48
|
+
export declare function frappeRouteHref(route: string, target: FrappeRouteTarget): string;
|
|
49
|
+
//# sourceMappingURL=frappeNavigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frappeNavigation.d.ts","sourceRoot":"","sources":["../src/frappeNavigation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAElE;;;;;;;;;GASG;AACH,MAAM,WAAW,gBAAgB;IAC/B,uDAAuD;IACvD,WAAW,IAAI,MAAM,CAAC;IACtB,uDAAuD;IACvD,WAAW,IAAI,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC;AAED,iDAAiD;AACjD,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAID,wBAAgB,wBAAwB,CAAC,EACvC,UAAU,EACV,QAAQ,GACT,EAAE;IACD,UAAU,EAAE,gBAAgB,GAAG,SAAS,CAAC;IACzC,QAAQ,EAAE,SAAS,CAAC;CACrB,2CAOA;AAED,wBAAgB,mBAAmB,IAAI,gBAAgB,GAAG,SAAS,CAElE;AAED,+EAA+E;AAC/E,wBAAgB,eAAe,IAAI,YAAY,GAAG,SAAS,CAQ1D;AAED;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GACzB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAClB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC9B;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAenC,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAehG;AAED,kFAAkF;AAClF,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAYhF"}
|
package/types/index.d.ts
CHANGED
|
@@ -11,14 +11,17 @@
|
|
|
11
11
|
* - @multiplatform.one/table (FilterManager, SavedFilterDropdown, useSavedFilters)
|
|
12
12
|
*/
|
|
13
13
|
export { FrappeProvider, useFrappeConfig, useFrappeContext, type FrappeConfig, type FrappeProviderProps, } from "./FrappeProvider";
|
|
14
|
+
export { FrappeNavigationProvider, frappeRouteHref, frappeRouteTarget, useFrappeNavigation, useFrappeRouter, type FrappeNavigation, type FrappeRouter, type FrappeRouteTarget, } from "./frappeNavigation";
|
|
14
15
|
export { FrappeReconnectIndicator, type FrappeReconnectIndicatorProps, } from "./FrappeReconnectIndicator";
|
|
15
16
|
export { FrappeStoryProvider, frappeStoriesLive, frappeStoryBaseUrl, type FrappeStoryProviderProps, } from "./frappeStoryTarget";
|
|
16
17
|
export { FrappeTable, filterValueToFrappeTuple, type FrappeTableProps } from "./FrappeTable";
|
|
17
18
|
export { docFieldsToFilterFields } from "./filterFields";
|
|
18
|
-
export { FrappeForm, type FrappeFormProps } from "./FrappeForm";
|
|
19
|
+
export { FrappeForm, type FrappeConnectionRows, type FrappeFormProps } from "./FrappeForm";
|
|
20
|
+
export { FrappeFormConnectionSection, FrappeFormConnections, type FrappeFormConnectionSectionProps, type FrappeFormConnectionsProps, } from "./FrappeFormConnections";
|
|
19
21
|
export { FormSidebar, type FormSidebarProps, type SidebarSection, type SidebarMetadataEntry, type SidebarPerson, } from "./FormSidebar";
|
|
20
22
|
export { FrappeList, type FrappeListProps } from "./FrappeList";
|
|
21
23
|
export { FrappeListView, type FrappeListViewProps, type ListViewMode } from "./FrappeListView";
|
|
24
|
+
export { useConnectionFilters, type ConnectionFiltersResult, type FrappeDoctypeFilter, type FrappeFieldFilter, type FrappeFilters, } from "./useConnectionFilters";
|
|
22
25
|
export { FrappeKanban, type FrappeKanbanProps, type KanbanColumn, type KanbanCardRenderer, } from "./FrappeKanban";
|
|
23
26
|
export { FrappeCalendar, type FrappeCalendarProps, type CalendarViewType, type CalendarEventRenderer, } from "./FrappeCalendar";
|
|
24
27
|
export { FrappeGantt, type FrappeGanttProps } from "./FrappeGantt";
|
|
@@ -43,7 +46,7 @@ export { SchemaForm, applyFieldOrder, applyOrderToSchema } from "./schemaForm";
|
|
|
43
46
|
export type { SchemaFormProps, FormSchema, FormSection, FormColumn, FieldOverride, } from "./schemaForm";
|
|
44
47
|
export { SchemaWizard, schemaToWizardSteps } from "./schemaForm/SchemaWizard";
|
|
45
48
|
export type { SchemaWizardProps } from "./schemaForm/SchemaWizard";
|
|
46
|
-
export { registerField, getFieldComponent, initDefaultRegistry, childFieldsToColumns, fieldtypeToTableField, } from "./fieldRegistry";
|
|
49
|
+
export { registerField, getFieldComponent, initDefaultRegistry, childFieldsToColumns, childFieldsToDetailColumns, childCellHidden, fieldtypeToTableField, } from "./fieldRegistry";
|
|
47
50
|
export { FieldOverridesProvider, useFieldResolver } from "./fieldOverrides";
|
|
48
51
|
export type { FieldOverrides, FieldOverridesProviderProps } from "./fieldOverrides";
|
|
49
52
|
export type { FieldRenderProps, FieldSchema, ChildTableFieldDef } from "./fieldRegistry";
|
|
@@ -111,6 +114,7 @@ export { useFrappePagination, type UseFrappePaginationOptions, type UseFrappePag
|
|
|
111
114
|
export { useFrappeCollection, useLiveQuery } from "@multiplatform.one/frappe";
|
|
112
115
|
export type { DataTableColumn } from "@multiplatform.one/table";
|
|
113
116
|
export { FrappeReportView, useFrappeReport, compactFilterValues, normalizeReportColumn, normalizeReportPayload, normalizeReportRows, reportColumnToDataTableColumn, reportFieldtypeToTableField, reportRowLabel, scrubFieldname, type FrappeReportColumn, type FrappeReportConnection, type FrappeReportFilterDef, type FrappeReportFixture, type FrappeReportPayload, type FrappeReportRow, type FrappeReportRunResponse, type FrappeReportValues, type FrappeReportViewProps, type UseFrappeReportOptions, type UseFrappeReportResult, } from "./FrappeReportView";
|
|
114
|
-
export { applyFetchedValues, buildCopyValues, buildCreateDefaults, buildFetchMap, buildFormTabs, buildPermLevelMatrix, canReadLevel, canWriteLevel, computeDirtyFields, isEmptyValue, isFetchLocked, isPromptNamed, isSameValue, setCreatePrefill, takeCreatePrefill, useFormEngine, } from "./formEngine";
|
|
117
|
+
export { applyFetchedValues, buildCopyValues, buildCreateDefaults, buildFetchMap, buildFormTabs, buildPermLevelMatrix, canReadLevel, canWriteLevel, computeDirtyFields, isEmptyValue, isFetchLocked, isPromptNamed, isSameValue, setCreatePrefill, takeCreatePrefill, useFormEngine, useSessionRoles, } from "./formEngine";
|
|
115
118
|
export type { BuildTabsOptions, DocFieldMeta, DocLinkMeta, DocPermissionRule, DoctypeMeta, FetchMap, FetchRule, FormEngine, FormTab, LevelPerm, PermLevelMatrix, } from "./formEngine";
|
|
119
|
+
export { connectionFields, connectionsFromMeta, type FrappeConnection } from "./frappeConnections";
|
|
116
120
|
//# sourceMappingURL=index.d.ts.map
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAQH,OAAO,EACL,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,KAAK,YAAY,EACjB,KAAK,mBAAmB,GACzB,MAAM,kBAAkB,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+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAC1C,2BAA2B;IAC3B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,sCAAsC;IACtC,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B;;;OAGG;IACH,eAAe,CAAC,EAAE,oBAAoB,CAAC;IACvC;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,YAAY,CAAC;IACnC;;;;;;OAMG;IACH,kBAAkB,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,EAAE,WAAW,KAAK,KAAK,CAAC,SAAS,CAAC;IACxF;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAiCD,wBAAgB,UAAU,CAAC,EACzB,MAAM,EACN,GAAG,EACH,QAAQ,EACR,MAAW,EACX,QAAgB,EAChB,SAAc,EACd,UAAe,EACf,cAAmB,EACnB,eAAwB,EACxB,mBAAuB,EACvB,kBAAkB,EAClB,KAAK,GACN,EAAE,eAAe,2CAoKjB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { FrappeConnection } from "./frappeConnections";
|
|
3
|
+
import type { FrappeRowsConnection } from "./useFrappeRows";
|
|
4
|
+
/** `[field, operator, value]` on the doctype itself. */
|
|
5
|
+
export type FrappeFieldFilter = [string, string, unknown];
|
|
6
|
+
/** `[doctype, field, operator, value]`: Frappe's filter on another doctype's rows. */
|
|
7
|
+
export type FrappeDoctypeFilter = [string, string, string, unknown];
|
|
8
|
+
export type FrappeFilters = Record<string, unknown> | Array<FrappeFieldFilter | FrappeDoctypeFilter>;
|
|
9
|
+
export interface ConnectionFiltersResult {
|
|
10
|
+
/**
|
|
11
|
+
* The filters to send: the doctype's own, plus one `["name", "in", names]`
|
|
12
|
+
* per connection filtered on. A `[doctype, …]` filter on a doctype that is
|
|
13
|
+
* no declared connection passes through untouched (a child table, which
|
|
14
|
+
* the bench joins itself).
|
|
15
|
+
*/
|
|
16
|
+
filters: Record<string, unknown> | Array<FrappeFieldFilter | FrappeDoctypeFilter> | undefined;
|
|
17
|
+
/** A connection's rows are still being read; the result is not known yet. */
|
|
18
|
+
pending: boolean;
|
|
19
|
+
error: Error | null;
|
|
20
|
+
/** Mount these: one reader per connection filtered on. */
|
|
21
|
+
readers: React.ReactNode;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Resolves filters on a connection (Pokemon by `Pokemon Poke Type.poke_type`)
|
|
25
|
+
* into a filter on the doctype itself. Frappe's four-part filter joins child
|
|
26
|
+
* tables on the server; a standalone doctype linking back through a Link field
|
|
27
|
+
* is no child table, so the linked rows are read live here and their link
|
|
28
|
+
* values become `name in (...)`. Several conditions on one connection hold on
|
|
29
|
+
* the same linked row, as they do for a child table.
|
|
30
|
+
*/
|
|
31
|
+
export declare function useConnectionFilters(connection: FrappeRowsConnection | undefined, doctype: string, filters: FrappeFilters | undefined,
|
|
32
|
+
/** `undefined` while the declaration is still loading (meta.links). */
|
|
33
|
+
connections: readonly FrappeConnection[] | undefined): ConnectionFiltersResult;
|
|
34
|
+
//# sourceMappingURL=useConnectionFilters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useConnectionFilters.d.ts","sourceRoot":"","sources":["../src/useConnectionFilters.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE5D,wDAAwD;AACxD,MAAM,MAAM,iBAAiB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAC1D,sFAAsF;AACtF,MAAM,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AACpE,MAAM,MAAM,aAAa,GACrB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACvB,KAAK,CAAC,iBAAiB,GAAG,mBAAmB,CAAC,CAAC;AAEnD,MAAM,WAAW,uBAAuB;IACtC;;;;;OAKG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC,iBAAiB,GAAG,mBAAmB,CAAC,GAAG,SAAS,CAAC;IAC9F,6EAA6E;IAC7E,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,0DAA0D;IAC1D,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B;AASD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,oBAAoB,GAAG,SAAS,EAC5C,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,aAAa,GAAG,SAAS;AAClC,uEAAuE;AACvE,WAAW,EAAE,SAAS,gBAAgB,EAAE,GAAG,SAAS,GACnD,uBAAuB,CA0GzB"}
|
|
@@ -13,17 +13,30 @@
|
|
|
13
13
|
* return <List items={items} onLoadMore={onLoadMore} hasMore={hasMore} />;
|
|
14
14
|
* ```
|
|
15
15
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* the limit
|
|
20
|
-
*
|
|
16
|
+
* The read itself is {@link useFrappeRows} (MPO-251), so FrappeList shares
|
|
17
|
+
* the one implementation every other doctype view uses. On top of it this
|
|
18
|
+
* hook manages an increasing `limit` over the rows it returns. When the
|
|
19
|
+
* number of returned items equals the limit, `hasMore` is `true`. Calling
|
|
20
|
+
* `onLoadMore` increases the limit by `pageSize`.
|
|
21
21
|
*/
|
|
22
22
|
import type { UseFrappeCollectionConfig } from "@multiplatform.one/frappe";
|
|
23
|
+
import { type UseFrappeRowsOptions } from "./useFrappeRows";
|
|
23
24
|
export interface UseFrappePaginationOptions<TDoc> {
|
|
24
25
|
fields?: readonly (keyof TDoc & string)[];
|
|
25
26
|
filters?: Partial<TDoc> | Array<[keyof TDoc & string, string, unknown]>;
|
|
26
27
|
pageSize?: number;
|
|
28
|
+
/**
|
|
29
|
+
* Rows the subscription reads. Omitted, the bench's own page length
|
|
30
|
+
* applies (20 on a stock site), which truncates any longer list.
|
|
31
|
+
*/
|
|
32
|
+
limit?: number;
|
|
33
|
+
orderBy?: UseFrappeRowsOptions<TDoc>["orderBy"];
|
|
34
|
+
/**
|
|
35
|
+
* Rows a route loader rendered on the server for this same query. They
|
|
36
|
+
* stand in until the live collection's first sync lands, so the server
|
|
37
|
+
* page and the hydrated page match; the live rows replace them after.
|
|
38
|
+
*/
|
|
39
|
+
initialRows?: readonly TDoc[];
|
|
27
40
|
}
|
|
28
41
|
export interface UseFrappePaginationResult<TDoc> {
|
|
29
42
|
items: TDoc[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFrappePagination.d.ts","sourceRoot":"","sources":["../src/useFrappePagination.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;
|
|
1
|
+
{"version":3,"file":"useFrappePagination.d.ts","sourceRoot":"","sources":["../src/useFrappePagination.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAiB,KAAK,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE3E,MAAM,WAAW,0BAA0B,CAAC,IAAI;IAC9C,MAAM,CAAC,EAAE,SAAS,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,EAAE,CAAC;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,MAAM,IAAI,GAAG,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACxE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,oBAAoB,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC;IAChD;;;;OAIG;IACH,WAAW,CAAC,EAAE,SAAS,IAAI,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,yBAAyB,CAAC,IAAI;IAC7C,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC;IACd,oCAAoC;IACpC,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB;;;;OAIG;IACH,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB;AA6BD,wBAAgB,mBAAmB,CAAC,IAAI,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAChF,MAAM,EAAE,yBAAyB,GAAG,SAAS,EAC7C,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,0BAA0B,CAAC,IAAI,CAAC,GACzC,yBAAyB,CAAC,IAAI,CAAC,CAqDjC"}
|
package/types/useFrappeRows.d.ts
CHANGED
|
@@ -35,10 +35,11 @@
|
|
|
35
35
|
* that key, so passing a different error handler never splits a
|
|
36
36
|
* collection.
|
|
37
37
|
*
|
|
38
|
-
* The shipped
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
38
|
+
* The shipped doctype views read through this hook — FrappeTable,
|
|
39
|
+
* FrappeList (via useFrappePagination), FrappeTreeView, FrappeKanban,
|
|
40
|
+
* FrappeCalendar, FrappeGantt, FrappeImageView, FrappeDashboard and
|
|
41
|
+
* FrappeReportBuilder — so there is ONE implementation of the read rather
|
|
42
|
+
* than a reference one and N copies.
|
|
42
43
|
*
|
|
43
44
|
* @example
|
|
44
45
|
* ```tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFrappeRows.d.ts","sourceRoot":"","sources":["../src/useFrappeRows.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"useFrappeRows.d.ts","sourceRoot":"","sources":["../src/useFrappeRows.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AAEH,OAAO,EACL,mBAAmB,EAEnB,KAAK,KAAK,EACV,KAAK,eAAe,EACrB,MAAM,2BAA2B,CAAC;AAKnC;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oEAAoE;IACpE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE;QACL,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,KAAK,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;QAClD,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IACF,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,QAAQ,CAAC,EAAE,eAAe,CAAC;CAC5B;AAED,kFAAkF;AAClF,MAAM,WAAW,kBAAkB;IACjC,+EAA+E;IAC/E,UAAU,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,oBAAoB,CAAC,IAAI;IACxC,+EAA+E;IAC/E,MAAM,CAAC,EAAE,SAAS,CAAC,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AM,GACvC,mBAAmB,CAAC,IAAI,CAAC,CAyE3B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,CAAC,EAAE;IAC9C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAC;IACpC,WAAW,CAAC,EAAE,GAAG,CAAC;CACnB,GAAG,oBAAoB,GAAG,SAAS,CAgBnC"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { fireEvent, screen } from "@testing-library/react";
|
|
2
|
-
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
3
|
-
import i18next from "i18next";
|
|
4
|
-
import { initReactI18next } from "react-i18next";
|
|
5
|
-
import { beforeAll, describe, expect, it, vi } from "vitest";
|
|
6
|
-
import { AttachLibrary } from "./AttachLibrary";
|
|
7
|
-
import type { FileBrowserFile } from "./types";
|
|
8
|
-
|
|
9
|
-
const FIXTURE: FileBrowserFile[] = [
|
|
10
|
-
{ name: "Home", file_name: "Home", folder: "", is_folder: 1 },
|
|
11
|
-
{ name: "Home/Invoices", file_name: "Invoices", folder: "Home", is_folder: 1 },
|
|
12
|
-
{
|
|
13
|
-
name: "inv-1",
|
|
14
|
-
file_name: "invoice.pdf",
|
|
15
|
-
folder: "Home/Invoices",
|
|
16
|
-
file_size: 72400,
|
|
17
|
-
file_type: "pdf",
|
|
18
|
-
file_url: "/files/invoice.pdf",
|
|
19
|
-
modified: "2026-08-12",
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
name: "img-1",
|
|
23
|
-
file_name: "topology.png",
|
|
24
|
-
folder: "Home/Invoices",
|
|
25
|
-
file_size: 612000,
|
|
26
|
-
file_type: "png",
|
|
27
|
-
file_url: "/files/topology.png",
|
|
28
|
-
modified: "2026-08-09",
|
|
29
|
-
},
|
|
30
|
-
];
|
|
31
|
-
|
|
32
|
-
beforeAll(async () => {
|
|
33
|
-
await i18next.use(initReactI18next).init({
|
|
34
|
-
lng: "en",
|
|
35
|
-
interpolation: { escapeValue: false },
|
|
36
|
-
resources: { en: { translation: {} } },
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
describe("AttachLibrary (MPO-111)", () => {
|
|
41
|
-
it("opens the library tab onto FileBrowser and commits onPick", () => {
|
|
42
|
-
const onPick = vi.fn();
|
|
43
|
-
const onOpenChange = vi.fn();
|
|
44
|
-
renderWithProviders(
|
|
45
|
-
<AttachLibrary
|
|
46
|
-
open
|
|
47
|
-
onOpenChange={onOpenChange}
|
|
48
|
-
files={FIXTURE}
|
|
49
|
-
currentFolder="Home/Invoices"
|
|
50
|
-
onPick={onPick}
|
|
51
|
-
/>,
|
|
52
|
-
);
|
|
53
|
-
expect(screen.getByRole("dialog", { name: "Attach file" })).toBeTruthy();
|
|
54
|
-
expect(screen.getByRole("tab", { name: /From library/i })).toBeTruthy();
|
|
55
|
-
expect(document.querySelector("[data-filebrowser-attach-library]")).toBeTruthy();
|
|
56
|
-
expect(screen.getByText("invoice.pdf")).toBeTruthy();
|
|
57
|
-
fireEvent.click(screen.getByText("invoice.pdf"));
|
|
58
|
-
expect(onPick).toHaveBeenCalled();
|
|
59
|
-
expect(onOpenChange).toHaveBeenCalledWith(false);
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
it("renders nothing interactive when closed", () => {
|
|
63
|
-
renderWithProviders(
|
|
64
|
-
<AttachLibrary
|
|
65
|
-
open={false}
|
|
66
|
-
onOpenChange={vi.fn()}
|
|
67
|
-
files={FIXTURE}
|
|
68
|
-
currentFolder="Home/Invoices"
|
|
69
|
-
onPick={vi.fn()}
|
|
70
|
-
/>,
|
|
71
|
-
);
|
|
72
|
-
expect(screen.queryByRole("dialog")).toBeNull();
|
|
73
|
-
});
|
|
74
|
-
});
|