robobyte-front-builder 1.0.19 → 1.0.23
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/INTEGRATION.md +1586 -0
- package/README.md +928 -0
- package/RoboByteBuilder_User_Manual.docx +0 -0
- package/next.config.js +19 -48
- package/package.json +42 -86
- package/src/context/BuilderContext.jsx +191 -7
- package/src/context/SystemContext.js +2 -2
- package/src/hooks/useGlobalStore.js +36 -0
- package/src/hooks/useTimerEngine.js +54 -0
- package/src/lib/index.js +11 -3
- package/src/lib/layouts/BlankLayout.jsx +13 -0
- package/src/lib/providers/RoboByteFrontBuilderProvider.jsx +61 -7
- package/src/lib/themes/builderTheme.js +41 -0
- package/src/pages/_app.js +32 -134
- package/src/pages/api/ai.js +107 -0
- package/src/pages/builders/report/index.js +1 -0
- package/src/pages/builders/report/list/index.js +1 -0
- package/src/pages/builders/report/viewer/index.js +1 -0
- package/src/pages/index.js +88 -37
- package/src/pages/printBuilder/index.jsx +263 -0
- package/src/pages/printBuilder/layouts/index.jsx +298 -0
- package/src/pages/reportModule/reportBuilder/index.js +8 -6
- package/src/pages/reportModule/reportBuilder/reportViewer/index.js +92 -25
- package/src/pages/reportModule/reportBuilder/reports/index.js +3 -5
- package/src/pages/reportModule/reportBuilder/reportsPermissions/index.js +2 -3
- package/src/pages/viewBuilder/index.jsx +117 -32
- package/src/pages/viewBuilder/views/index.js +3 -3
- package/src/pages/viewer/[id]/index.js +2 -1
- package/src/services/DeleteService.js +31 -60
- package/src/services/Endpoints/PrintLayoutEndpoints.js +42 -0
- package/src/services/Endpoints/ReportBuilderEndpoints.js +7 -7
- package/src/services/Endpoints.js +2 -0
- package/src/services/GetService.js +33 -54
- package/src/services/PatchService.js +38 -65
- package/src/services/PostService.js +37 -63
- package/src/services/UpdateService.js +39 -65
- package/src/services/builderHelper/actionExecutor.js +141 -25
- package/src/services/builderHelper/builderHelper.js +92 -0
- package/src/services/builderHelper/colorSchema.js +95 -0
- package/src/services/builderHelper/iconResolver.js +50 -0
- package/src/services/builderHelper/jsExecutor.js +212 -46
- package/src/services/builderHelper/nodeFactory.js +32 -15
- package/src/services/builderHelper/numberFormat.js +123 -0
- package/src/services/builderHelper/resolveProps.js +73 -4
- package/src/services/builderHelper/thresholdEngine.js +77 -0
- package/src/services/builderHelper/tree.js +31 -0
- package/src/services/components/agGridAutoComplete.js +5 -9
- package/src/services/config.js +9 -1
- package/src/services/globalStore.js +80 -0
- package/src/services/helper/multiSelectEditor.js +5 -9
- package/src/services/helper/multiSelectEditorByBuilder.js +5 -9
- package/src/services/reportData/fetchReportData.js +69 -28
- package/src/services/routerRef.js +35 -0
- package/src/services/sessionLog.js +171 -0
- package/src/views/ConfirmDialog.js +2 -2
- package/src/views/builder/JSEditor.js +105 -107
- package/src/views/builder/SessionLogDialog.jsx +350 -0
- package/src/views/builder/UnsavedChangesGuard.jsx +103 -0
- package/src/views/builder/inspector/Inspector.jsx +6 -9
- package/src/views/builder/inspector/Tabs/ComponentActionsTab.jsx +7 -13
- package/src/views/builder/inspector/Tabs/MainTab.jsx +143 -25
- package/src/views/builder/inspector/Tabs/RulesTab.jsx +9 -24
- package/src/views/builder/inspector/Tabs/StyleTab.jsx +9 -24
- package/src/views/builder/inspector/definitions/autocomplete/main.js +4 -6
- package/src/views/builder/inspector/definitions/banner/actions.js +7 -0
- package/src/views/builder/inspector/definitions/banner/main.js +22 -0
- package/src/views/builder/inspector/definitions/banner/rules.js +1 -0
- package/src/views/builder/inspector/definitions/banner/style.js +1 -0
- package/src/views/builder/inspector/definitions/breadcrumb/main.js +43 -6
- package/src/views/builder/inspector/definitions/button/main.js +11 -12
- package/src/views/builder/inspector/definitions/button/style.js +18 -30
- package/src/views/builder/inspector/definitions/checkbox/actions.js +3 -1
- package/src/views/builder/inspector/definitions/checkbox/main.js +4 -6
- package/src/views/builder/inspector/definitions/common/main.js +13 -2
- package/src/views/builder/inspector/definitions/dataGrid/main.js +23 -0
- package/src/views/builder/inspector/definitions/dataTableViewer/main.js +46 -0
- package/src/views/builder/inspector/definitions/datepicker/actions.js +3 -1
- package/src/views/builder/inspector/definitions/datepicker/main.js +6 -14
- package/src/views/builder/inspector/definitions/dialog/main.js +36 -0
- package/src/views/builder/inspector/definitions/dropdown/main.js +5 -8
- package/src/views/builder/inspector/definitions/excelUpload/actions.js +23 -0
- package/src/views/builder/inspector/definitions/excelUpload/main.js +17 -0
- package/src/views/builder/inspector/definitions/excelUpload/rules.js +1 -0
- package/src/views/builder/inspector/definitions/excelUpload/style.js +45 -0
- package/src/views/builder/inspector/definitions/header/main.js +10 -1
- package/src/views/builder/inspector/definitions/index.js +106 -19
- package/src/views/builder/inspector/definitions/input/actions.js +4 -1
- package/src/views/builder/inspector/definitions/input/main.js +20 -11
- package/src/views/builder/inspector/definitions/kpi/avatarGroup.js +22 -0
- package/src/views/builder/inspector/definitions/kpi/badge.js +17 -0
- package/src/views/builder/inspector/definitions/kpi/bulletChart.js +47 -0
- package/src/views/builder/inspector/definitions/kpi/chart.js +55 -0
- package/src/views/builder/inspector/definitions/kpi/colorScale.js +60 -0
- package/src/views/builder/inspector/definitions/kpi/comparisonBars.js +41 -0
- package/src/views/builder/inspector/definitions/kpi/countdown.js +46 -0
- package/src/views/builder/inspector/definitions/kpi/donut.js +51 -0
- package/src/views/builder/inspector/definitions/kpi/funnel.js +25 -0
- package/src/views/builder/inspector/definitions/kpi/gauge.js +39 -0
- package/src/views/builder/inspector/definitions/kpi/heatmapGrid.js +96 -0
- package/src/views/builder/inspector/definitions/kpi/iconBox.js +20 -0
- package/src/views/builder/inspector/definitions/kpi/metric.js +45 -0
- package/src/views/builder/inspector/definitions/kpi/rating.js +27 -0
- package/src/views/builder/inspector/definitions/kpi/statusDot.js +18 -0
- package/src/views/builder/inspector/definitions/kpi/stepStage.js +65 -0
- package/src/views/builder/inspector/definitions/kpi/tagList.js +32 -0
- package/src/views/builder/inspector/definitions/kpi/timeline.js +80 -0
- package/src/views/builder/inspector/definitions/kpi/trend.js +20 -0
- package/src/views/builder/inspector/definitions/label/main.js +10 -1
- package/src/views/builder/inspector/definitions/layout/main.js +27 -3
- package/src/views/builder/inspector/definitions/number/main.js +6 -14
- package/src/views/builder/inspector/definitions/pageNumber/main.js +21 -0
- package/src/views/builder/inspector/definitions/popover/main.js +71 -0
- package/src/views/builder/inspector/definitions/radio/main.js +5 -8
- package/src/views/builder/inspector/definitions/repeater/main.js +31 -0
- package/src/views/builder/inspector/definitions/reportViewer/main.js +28 -1
- package/src/views/builder/inspector/definitions/richtext/main.js +5 -8
- package/src/views/builder/inspector/definitions/signature/main.js +4 -1
- package/src/views/builder/inspector/definitions/tag/main.js +5 -8
- package/src/views/builder/inspector/definitions/textarea/actions.js +4 -1
- package/src/views/builder/inspector/definitions/textarea/main.js +5 -7
- package/src/views/builder/inspector/definitions/time/main.js +5 -8
- package/src/views/builder/inspector/definitions/toggle/main.js +5 -19
- package/src/views/builder/inspector/definitions/treeView/main.js +61 -0
- package/src/views/builder/inspector/definitions/viewRenderer/main.js +53 -0
- package/src/views/builder/inspector/definitions/wizard/main.js +68 -0
- package/src/views/builder/inspector/definitions/wizard-step/main.js +25 -0
- package/src/views/builder/inspector/fields/ActionsConfigEditor.jsx +426 -0
- package/src/views/builder/inspector/fields/ColorSchemaField.jsx +140 -0
- package/src/views/builder/inspector/fields/ColumnFunctionEditor.jsx +238 -0
- package/src/views/builder/inspector/fields/ColumnMappingEditor.jsx +105 -0
- package/src/views/builder/inspector/fields/ColumnsConfigEditor.jsx +506 -0
- package/src/views/builder/inspector/fields/DonutRingsEditorField.jsx +337 -0
- package/src/views/builder/inspector/fields/ExtraColsEditor.jsx +618 -0
- package/src/views/builder/inspector/fields/FunctionHelpPopover.jsx +295 -0
- package/src/views/builder/inspector/fields/IconEditor.jsx +64 -0
- package/src/views/builder/inspector/fields/KpiActionField.jsx +223 -0
- package/src/views/builder/inspector/fields/MarkersEditorField.jsx +173 -0
- package/src/views/builder/inspector/fields/SelectEditor.jsx +9 -5
- package/src/views/builder/inspector/fields/SeriesEditorField.jsx +363 -0
- package/src/views/builder/inspector/fields/TableColumnsEditor.jsx +104 -0
- package/src/views/builder/inspector/fields/ThresholdsEditor.jsx +247 -0
- package/src/views/builder/inspector/fields/ValueFunctionsRefPanel.jsx +217 -0
- package/src/views/builder/inspector/fields/columnEditorShared.jsx +217 -0
- package/src/views/builder/sidebar/Sidebar.jsx +4 -2
- package/src/views/builder/sidebar/SidebarTabs.jsx +28 -17
- package/src/views/builder/sidebar/tabs/ActionsTab.jsx +7 -3
- package/src/views/builder/sidebar/tabs/AiTab/AiPreviewDialog.jsx +193 -0
- package/src/views/builder/sidebar/tabs/AiTab/aiProvider.js +53 -0
- package/src/views/builder/sidebar/tabs/AiTab/index.jsx +409 -0
- package/src/views/builder/sidebar/tabs/AiTab/schemaTransformer.js +167 -0
- package/src/views/builder/sidebar/tabs/AiTab/schemaValidator.js +64 -0
- package/src/views/builder/sidebar/tabs/AiTab/systemPrompt.js +1151 -0
- package/src/views/builder/sidebar/tabs/AiTab/trainingExport.js +131 -0
- package/src/views/builder/sidebar/tabs/Components/ComponentsTab.jsx +31 -31
- package/src/views/builder/sidebar/tabs/Components/componentCatalog.js +43 -21
- package/src/views/builder/sidebar/tabs/Components/printComponentCatalog.js +81 -0
- package/src/views/builder/sidebar/tabs/TimersTab.jsx +338 -0
- package/src/views/builder/sidebar/tabs/TreeTab.jsx +13 -4
- package/src/views/builder/sidebar/tabs/ViewTab.jsx +173 -13
- package/src/views/builder/viewer/AdornedLabel.jsx +82 -0
- package/src/views/builder/viewer/ComponentRenderer.jsx +98 -24
- package/src/views/builder/viewer/DialogsZone.jsx +259 -0
- package/src/views/builder/viewer/FieldLabel.jsx +106 -0
- package/src/views/builder/viewer/PrintDialog.jsx +481 -0
- package/src/views/builder/viewer/ProductionViewer.jsx +80 -5
- package/src/views/builder/viewer/Viewer.jsx +106 -8
- package/src/views/builder/viewer/ViewerComponentWrapper.jsx +70 -9
- package/src/views/builder/viewer/ViewerToolbar.jsx +285 -56
- package/src/views/builder/viewer/renderers/AutoCompleteRenderer.jsx +26 -22
- package/src/views/builder/viewer/renderers/AvatarGroupRenderer.jsx +112 -0
- package/src/views/builder/viewer/renderers/BadgeRenderer.jsx +79 -0
- package/src/views/builder/viewer/renderers/BannerRenderer.jsx +62 -0
- package/src/views/builder/viewer/renderers/BreadcrumbRenderer.jsx +203 -15
- package/src/views/builder/viewer/renderers/BulletChartRenderer.jsx +147 -0
- package/src/views/builder/viewer/renderers/ButtonRenderer.jsx +98 -39
- package/src/views/builder/viewer/renderers/CardRenderer.jsx +1 -1
- package/src/views/builder/viewer/renderers/ChartRenderer.jsx +388 -0
- package/src/views/builder/viewer/renderers/CheckboxRenderer.jsx +17 -9
- package/src/views/builder/viewer/renderers/ColorScaleRenderer.jsx +300 -0
- package/src/views/builder/viewer/renderers/ComparisonBarsRenderer.jsx +133 -0
- package/src/views/builder/viewer/renderers/ContainerRenderer.jsx +3 -1
- package/src/views/builder/viewer/renderers/CountdownRenderer.jsx +249 -0
- package/src/views/builder/viewer/renderers/DataGridRenderer.jsx +380 -0
- package/src/views/builder/viewer/renderers/DataTableViewerRenderer.jsx +240 -0
- package/src/views/builder/viewer/renderers/DatePickerRenderer.jsx +25 -24
- package/src/views/builder/viewer/renderers/DialogRenderer.jsx +327 -0
- package/src/views/builder/viewer/renderers/DividerRenderer.jsx +1 -1
- package/src/views/builder/viewer/renderers/DonutRenderer.jsx +294 -0
- package/src/views/builder/viewer/renderers/DropdownRenderer.jsx +36 -44
- package/src/views/builder/viewer/renderers/ExcelUploadRenderer.jsx +639 -0
- package/src/views/builder/viewer/renderers/FunnelRenderer.jsx +93 -0
- package/src/views/builder/viewer/renderers/GaugeRenderer.jsx +159 -0
- package/src/views/builder/viewer/renderers/HeaderRenderer.jsx +31 -9
- package/src/views/builder/viewer/renderers/HeatmapGridRenderer.jsx +432 -0
- package/src/views/builder/viewer/renderers/IconBoxRenderer.jsx +59 -0
- package/src/views/builder/viewer/renderers/ImageRenderer.jsx +1 -1
- package/src/views/builder/viewer/renderers/InputRenderer.jsx +75 -18
- package/src/views/builder/viewer/renderers/LabelRenderer.jsx +35 -9
- package/src/views/builder/viewer/renderers/LayoutCellRenderer.jsx +102 -40
- package/src/views/builder/viewer/renderers/LayoutContextMenu.jsx +8 -8
- package/src/views/builder/viewer/renderers/LayoutRenderer.jsx +48 -6
- package/src/views/builder/viewer/renderers/LinkRenderer.jsx +1 -1
- package/src/views/builder/viewer/renderers/MenuRenderer.jsx +2 -2
- package/src/views/builder/viewer/renderers/MetricRenderer.jsx +80 -0
- package/src/views/builder/viewer/renderers/NumberFormatRenderer.jsx +21 -30
- package/src/views/builder/viewer/renderers/PageNumberRenderer.jsx +76 -0
- package/src/views/builder/viewer/renderers/PopoverRenderer.jsx +350 -0
- package/src/views/builder/viewer/renderers/ProgressCircleRenderer.jsx +1 -1
- package/src/views/builder/viewer/renderers/ProgressLineRenderer.jsx +1 -1
- package/src/views/builder/viewer/renderers/RadioGroupRenderer.jsx +28 -39
- package/src/views/builder/viewer/renderers/RatingRenderer.jsx +80 -0
- package/src/views/builder/viewer/renderers/RepeaterRenderer.jsx +297 -38
- package/src/views/builder/viewer/renderers/ReportViewerRenderer.jsx +263 -5
- package/src/views/builder/viewer/renderers/RichTextRenderer.jsx +60 -66
- package/src/views/builder/viewer/renderers/RowActionsCell.jsx +308 -0
- package/src/views/builder/viewer/renderers/SignatureRenderer.jsx +33 -62
- package/src/views/builder/viewer/renderers/StatusDotRenderer.jsx +75 -0
- package/src/views/builder/viewer/renderers/StepStageRenderer.jsx +348 -0
- package/src/views/builder/viewer/renderers/TagListRenderer.jsx +115 -0
- package/src/views/builder/viewer/renderers/TagPickerRenderer.jsx +31 -45
- package/src/views/builder/viewer/renderers/TextAreaRenderer.jsx +25 -18
- package/src/views/builder/viewer/renderers/TextRenderer.jsx +7 -1
- package/src/views/builder/viewer/renderers/TimePickerRenderer.jsx +25 -24
- package/src/views/builder/viewer/renderers/TimelineRenderer.jsx +525 -0
- package/src/views/builder/viewer/renderers/ToggleRenderer.jsx +21 -27
- package/src/views/builder/viewer/renderers/TreeViewRenderer.jsx +832 -0
- package/src/views/builder/viewer/renderers/TrendRenderer.jsx +66 -0
- package/src/views/builder/viewer/renderers/ViewRendererRenderer.jsx +315 -0
- package/src/views/builder/viewer/renderers/WizardRenderer.jsx +380 -64
- package/src/views/builder/viewer/renderers/WizardStepRenderer.jsx +21 -12
- package/src/views/builder/viewer/renderers/dataGridComponents.jsx +824 -0
- package/src/views/customFilter/CustomFilterDialog.js +1023 -660
- package/src/views/customFilter/FixedFilterDialog.js +649 -0
- package/src/views/customFilter/SearchFilterDialog.js +248 -0
- package/src/views/genericTable/BuilderExpressionParams.js +3 -3
- package/src/views/genericTable/ColumnConfiguratorDialog.js +33 -24
- package/src/views/genericTable/FixedFilterDialog.js +3 -2
- package/src/views/genericTable/FormattingSettingsDialog.js +8 -3
- package/src/views/genericTable/SGrid.js +821 -448
- package/src/views/genericTable/SearchFilterDialog.js +3 -2
- package/src/views/genericTable/cellEditors/autocompleteEditor.js +5 -9
- package/src/views/genericTable/convertStringFunctions.js +274 -138
- package/src/views/genericTable/statusBar/rowCountStatusBar.js +3 -1
- package/src/views/genericTable/updateRefHelpers.js +9 -6
- package/src/views/printBuilder/PrintBuilderViewer.jsx +627 -0
- package/src/views/printBuilder/PrintPreviewCanvas.jsx +157 -0
- package/src/views/rolePermissions/UpdateReportPermissionDialog.js +3 -2
- package/src/@core/components/auth/AclGuard.js +0 -55
- package/src/@core/components/auth/AuthGuard.js +0 -40
- package/src/@core/components/auth/GuestGuard.js +0 -30
- package/src/@core/components/custom-inputs/Horizontal.jsx +0 -143
- package/src/@core/components/custom-inputs/Image.jsx +0 -78
- package/src/@core/components/custom-inputs/Vertical.jsx +0 -113
- package/src/@core/components/customizer/index.jsx +0 -470
- package/src/@core/components/customizer/styles.module.css +0 -169
- package/src/@core/components/mui/Avatar.jsx +0 -41
- package/src/@core/components/mui/Badge.jsx +0 -20
- package/src/@core/components/mui/IconButton.jsx +0 -74
- package/src/@core/components/mui/TabList.jsx +0 -60
- package/src/@core/components/option-menu/index.jsx +0 -137
- package/src/@core/components/scroll-to-top/index.jsx +0 -43
- package/src/@core/components/spinner/index.js +0 -26
- package/src/@core/components/window-wrapper/index.js +0 -27
- package/src/@core/contexts/settingsContext.jsx +0 -98
- package/src/@core/hooks/useBgColor.js +0 -63
- package/src/@core/hooks/useImageVariant.js +0 -27
- package/src/@core/hooks/useLayoutInit.js +0 -37
- package/src/@core/hooks/useObjectCookie.js +0 -18
- package/src/@core/hooks/useSettings.jsx +0 -15
- package/src/@core/layouts/BlankLayout.js +0 -37
- package/src/@core/layouts/BlankLayoutWithAppBar.js +0 -51
- package/src/@core/layouts/HorizontalLayout.jsx +0 -151
- package/src/@core/layouts/Layout.js +0 -39
- package/src/@core/layouts/VerticalLayout.jsx +0 -124
- package/src/@core/layouts/components/blank-layout-with-appBar/index.js +0 -115
- package/src/@core/layouts/components/horizontal/app-bar-content/index.js +0 -67
- package/src/@core/layouts/components/horizontal/navigation/HorizontalNavGroup.js +0 -352
- package/src/@core/layouts/components/horizontal/navigation/HorizontalNavItems.js +0 -21
- package/src/@core/layouts/components/horizontal/navigation/HorizontalNavLink.js +0 -195
- package/src/@core/layouts/components/horizontal/navigation/index.js +0 -31
- package/src/@core/layouts/components/shared-components/LanguageDropdown.js +0 -96
- package/src/@core/layouts/components/shared-components/ModeToggler.js +0 -32
- package/src/@core/layouts/components/shared-components/NotificationDropdown.js +0 -226
- package/src/@core/layouts/components/shared-components/UserDropdown.js +0 -177
- package/src/@core/layouts/components/shared-components/footer/FooterContent.js +0 -46
- package/src/@core/layouts/components/shared-components/footer/index.js +0 -61
- package/src/@core/layouts/components/vertical/appBar/index.js +0 -74
- package/src/@core/layouts/components/vertical/navigation/Drawer.js +0 -122
- package/src/@core/layouts/components/vertical/navigation/VerticalNavGroup.js +0 -435
- package/src/@core/layouts/components/vertical/navigation/VerticalNavHeader.js +0 -180
- package/src/@core/layouts/components/vertical/navigation/VerticalNavItems.js +0 -26
- package/src/@core/layouts/components/vertical/navigation/VerticalNavLink.js +0 -258
- package/src/@core/layouts/components/vertical/navigation/VerticalNavSectionTitle.js +0 -102
- package/src/@core/layouts/components/vertical/navigation/index.js +0 -169
- package/src/@core/layouts/utils.js +0 -69
- package/src/@core/styles/Table.module.css +0 -93
- package/src/@core/styles/horizontal/menuItemStyles.js +0 -100
- package/src/@core/styles/horizontal/menuRootStyles.js +0 -19
- package/src/@core/styles/libs/fullcalendar/index.js +0 -461
- package/src/@core/styles/libs/keen-slider/index.js +0 -111
- package/src/@core/styles/libs/react-apexcharts/index.js +0 -107
- package/src/@core/styles/libs/react-cleave/index.js +0 -33
- package/src/@core/styles/libs/react-credit-cards/index.js +0 -11
- package/src/@core/styles/libs/react-datepicker/index.js +0 -388
- package/src/@core/styles/libs/react-draft-wysiwyg/index.js +0 -144
- package/src/@core/styles/libs/react-dropzone/index.js +0 -76
- package/src/@core/styles/libs/react-hot-toast/index.js +0 -37
- package/src/@core/styles/libs/recharts/index.js +0 -47
- package/src/@core/styles/stepper.js +0 -103
- package/src/@core/styles/vertical/menuItemStyles.js +0 -138
- package/src/@core/styles/vertical/menuSectionStyles.js +0 -54
- package/src/@core/styles/vertical/navigationCustomStyles.js +0 -62
- package/src/@core/svg/ContentCompact.jsx +0 -17
- package/src/@core/svg/ContentWide.jsx +0 -17
- package/src/@core/svg/DirectionLtr.jsx +0 -93
- package/src/@core/svg/DirectionRtl.jsx +0 -93
- package/src/@core/svg/LayoutCollapsed.jsx +0 -59
- package/src/@core/svg/LayoutHorizontal.jsx +0 -42
- package/src/@core/svg/LayoutVertical.jsx +0 -59
- package/src/@core/svg/Logo.jsx +0 -76
- package/src/@core/svg/SkinBordered.jsx +0 -54
- package/src/@core/svg/SkinDefault.jsx +0 -59
- package/src/@core/tailwind/plugin.js +0 -78
- package/src/@core/theme/ThemeComponent.js +0 -63
- package/src/@core/theme/ThemeOptions.js +0 -71
- package/src/@core/theme/breakpoints/index.js +0 -11
- package/src/@core/theme/colorSchemes.js +0 -326
- package/src/@core/theme/customShadows.js +0 -11
- package/src/@core/theme/globalStyles.js +0 -81
- package/src/@core/theme/index.js +0 -42
- package/src/@core/theme/overrides/accordion.js +0 -51
- package/src/@core/theme/overrides/accordion.jsx +0 -85
- package/src/@core/theme/overrides/alerts.js +0 -110
- package/src/@core/theme/overrides/alerts.jsx +0 -180
- package/src/@core/theme/overrides/autocomplete.js +0 -14
- package/src/@core/theme/overrides/autocomplete.jsx +0 -68
- package/src/@core/theme/overrides/avatar.js +0 -38
- package/src/@core/theme/overrides/avatars.js +0 -27
- package/src/@core/theme/overrides/backdrop.js +0 -22
- package/src/@core/theme/overrides/badges.js +0 -16
- package/src/@core/theme/overrides/breadcrumbs.js +0 -11
- package/src/@core/theme/overrides/button-group.js +0 -84
- package/src/@core/theme/overrides/button.js +0 -93
- package/src/@core/theme/overrides/buttonGroup.js +0 -9
- package/src/@core/theme/overrides/card.js +0 -83
- package/src/@core/theme/overrides/checkbox.jsx +0 -95
- package/src/@core/theme/overrides/chip.js +0 -72
- package/src/@core/theme/overrides/dataGrid.js +0 -114
- package/src/@core/theme/overrides/dateTimePicker.js +0 -65
- package/src/@core/theme/overrides/dialog.js +0 -120
- package/src/@core/theme/overrides/divider.js +0 -13
- package/src/@core/theme/overrides/drawer.js +0 -20
- package/src/@core/theme/overrides/fab.js +0 -13
- package/src/@core/theme/overrides/form-control-label.js +0 -19
- package/src/@core/theme/overrides/icon-button.js +0 -145
- package/src/@core/theme/overrides/index.js +0 -103
- package/src/@core/theme/overrides/input.js +0 -72
- package/src/@core/theme/overrides/link.js +0 -9
- package/src/@core/theme/overrides/list.js +0 -44
- package/src/@core/theme/overrides/menu.js +0 -25
- package/src/@core/theme/overrides/pagination.js +0 -41
- package/src/@core/theme/overrides/paper.js +0 -9
- package/src/@core/theme/overrides/popover.js +0 -16
- package/src/@core/theme/overrides/progress.js +0 -38
- package/src/@core/theme/overrides/radio.jsx +0 -80
- package/src/@core/theme/overrides/rating.js +0 -16
- package/src/@core/theme/overrides/rating.jsx +0 -32
- package/src/@core/theme/overrides/select.js +0 -19
- package/src/@core/theme/overrides/select.jsx +0 -52
- package/src/@core/theme/overrides/slider.js +0 -97
- package/src/@core/theme/overrides/snackbar.js +0 -19
- package/src/@core/theme/overrides/switch.js +0 -73
- package/src/@core/theme/overrides/switches.js +0 -25
- package/src/@core/theme/overrides/table-pagination.js +0 -39
- package/src/@core/theme/overrides/table.js +0 -81
- package/src/@core/theme/overrides/tabs.js +0 -30
- package/src/@core/theme/overrides/timeline.js +0 -80
- package/src/@core/theme/overrides/toggle-button.js +0 -33
- package/src/@core/theme/overrides/toggleButton.js +0 -16
- package/src/@core/theme/overrides/tooltip.js +0 -21
- package/src/@core/theme/overrides/typography.js +0 -13
- package/src/@core/theme/palette/index.js +0 -107
- package/src/@core/theme/shadows/index.js +0 -61
- package/src/@core/theme/shadows.js +0 -12
- package/src/@core/theme/spacing/index.js +0 -3
- package/src/@core/theme/spacing.js +0 -5
- package/src/@core/theme/typography/index.js +0 -65
- package/src/@core/theme/typography.js +0 -84
- package/src/@core/utils/create-emotion-cache.js +0 -5
- package/src/@core/utils/hex-to-rgba.js +0 -11
- package/src/@core/utils/serverHelpers.js +0 -45
- package/src/@menu/components/RouterLink.jsx +0 -18
- package/src/@menu/components/horizontal-menu/HorizontalNav.jsx +0 -88
- package/src/@menu/components/horizontal-menu/Menu.jsx +0 -83
- package/src/@menu/components/horizontal-menu/MenuButton.jsx +0 -100
- package/src/@menu/components/horizontal-menu/MenuItem.jsx +0 -183
- package/src/@menu/components/horizontal-menu/SubMenu.jsx +0 -418
- package/src/@menu/components/horizontal-menu/SubMenuContent.jsx +0 -41
- package/src/@menu/components/horizontal-menu/VerticalNavInHorizontal.jsx +0 -20
- package/src/@menu/components/vertical-menu/Menu.jsx +0 -161
- package/src/@menu/components/vertical-menu/MenuButton.jsx +0 -95
- package/src/@menu/components/vertical-menu/MenuItem.jsx +0 -180
- package/src/@menu/components/vertical-menu/MenuSection.jsx +0 -124
- package/src/@menu/components/vertical-menu/NavCollapseIcons.jsx +0 -70
- package/src/@menu/components/vertical-menu/NavHeader.jsx +0 -39
- package/src/@menu/components/vertical-menu/SubMenu.jsx +0 -420
- package/src/@menu/components/vertical-menu/SubMenuContent.jsx +0 -101
- package/src/@menu/components/vertical-menu/VerticalNav.jsx +0 -216
- package/src/@menu/contexts/horizontalNavContext.jsx +0 -29
- package/src/@menu/contexts/verticalNavContext.jsx +0 -65
- package/src/@menu/defaultConfigs.js +0 -12
- package/src/@menu/hooks/useHorizontalMenu.jsx +0 -19
- package/src/@menu/hooks/useHorizontalNav.jsx +0 -19
- package/src/@menu/hooks/useMediaQuery.jsx +0 -29
- package/src/@menu/hooks/useVerticalMenu.jsx +0 -19
- package/src/@menu/hooks/useVerticalNav.jsx +0 -19
- package/src/@menu/horizontal-menu/index.jsx +0 -8
- package/src/@menu/styles/StyledBackdrop.jsx +0 -15
- package/src/@menu/styles/StyledMenuIcon.jsx +0 -12
- package/src/@menu/styles/StyledMenuLabel.jsx +0 -16
- package/src/@menu/styles/StyledMenuPrefix.jsx +0 -10
- package/src/@menu/styles/StyledMenuSectionLabel.jsx +0 -21
- package/src/@menu/styles/StyledMenuSuffix.jsx +0 -10
- package/src/@menu/styles/StyledSubMenuContent.jsx +0 -43
- package/src/@menu/styles/horizontal/StyledHorizontalMenu.jsx +0 -13
- package/src/@menu/styles/horizontal/StyledHorizontalMenuItem.jsx +0 -26
- package/src/@menu/styles/horizontal/StyledHorizontalNav.jsx +0 -11
- package/src/@menu/styles/horizontal/StyledHorizontalNavExpandIcon.jsx +0 -33
- package/src/@menu/styles/horizontal/StyledHorizontalSubMenuContent.jsx +0 -18
- package/src/@menu/styles/horizontal/StyledHorizontalSubMenuContentWrapper.jsx +0 -10
- package/src/@menu/styles/horizontal/horizontalUl.module.css +0 -15
- package/src/@menu/styles/styles.module.css +0 -5
- package/src/@menu/styles/vertical/StyledVerticalMenu.jsx +0 -16
- package/src/@menu/styles/vertical/StyledVerticalMenuItem.jsx +0 -28
- package/src/@menu/styles/vertical/StyledVerticalMenuSection.jsx +0 -23
- package/src/@menu/styles/vertical/StyledVerticalNav.jsx +0 -67
- package/src/@menu/styles/vertical/StyledVerticalNavBgColorContainer.jsx +0 -15
- package/src/@menu/styles/vertical/StyledVerticalNavContainer.jsx +0 -23
- package/src/@menu/styles/vertical/StyledVerticalNavExpandIcon.jsx +0 -25
- package/src/@menu/styles/vertical/verticalNavBgImage.module.css +0 -10
- package/src/@menu/svg/ChevronRight.jsx +0 -9
- package/src/@menu/svg/Close.jsx +0 -12
- package/src/@menu/svg/RadioCircle.jsx +0 -12
- package/src/@menu/svg/RadioCircleMarked.jsx +0 -13
- package/src/@menu/utils/menuClasses.js +0 -44
- package/src/@menu/utils/menuUtils.jsx +0 -145
- package/src/@menu/vertical-menu/index.jsx +0 -11
- package/src/configs/acl.js +0 -115
- package/src/configs/auth.js +0 -5
- package/src/configs/aws-exports.js +0 -30
- package/src/configs/firebase.js +0 -25
- package/src/configs/i18n.js +0 -34
- package/src/configs/primaryColorConfig.js +0 -35
- package/src/configs/themeConfig.js +0 -44
- package/src/layouts/UserLayout.js +0 -94
- package/src/layouts/UserThemeOptions.js +0 -191
- package/src/layouts/components/Direction.js +0 -30
- package/src/layouts/components/HtmlTooltip.js +0 -15
- package/src/layouts/components/Translations.js +0 -11
- package/src/layouts/components/UserDropdown.js +0 -217
- package/src/layouts/components/UserIcon.js +0 -40
- package/src/layouts/components/acl/Can.js +0 -6
- package/src/layouts/components/acl/CanViewNavGroup.js +0 -36
- package/src/layouts/components/acl/CanViewNavLink.js +0 -17
- package/src/layouts/components/acl/CanViewNavSectionTitle.js +0 -17
- package/src/layouts/components/horizontal/AppBarContent.js +0 -39
- package/src/layouts/components/horizontal/ServerSideNavItems.js +0 -44
- package/src/layouts/components/mui/StepperComps.js +0 -55
- package/src/layouts/components/vertical/AppBarContent.js +0 -35
- package/src/layouts/components/vertical/ServerSideNavItems.js +0 -44
- package/src/libs/ApexCharts.jsx +0 -5
- package/src/libs/ReactPlayer.jsx +0 -5
- package/src/libs/Recharts.jsx +0 -4
- package/src/libs/auth.js +0 -124
- package/src/libs/styles/AppFullCalendar.js +0 -505
- package/src/libs/styles/AppKeenSlider.js +0 -116
- package/src/libs/styles/AppReactApexCharts.jsx +0 -110
- package/src/libs/styles/AppReactDatepicker.jsx +0 -470
- package/src/libs/styles/AppReactDropzone.js +0 -76
- package/src/libs/styles/AppReactToastify.jsx +0 -108
- package/src/libs/styles/AppRecharts.js +0 -55
- package/src/libs/styles/inputOtp.module.css +0 -39
- package/src/libs/styles/tiptapEditor.css +0 -72
- package/src/navigation/horizontal/index.js +0 -246
- package/src/navigation/vertical/index.js +0 -253
- package/src/pages/401.js +0 -70
- package/src/pages/404.js +0 -67
- package/src/pages/500.js +0 -68
- package/src/pages/[slug].js +0 -115
- package/src/pages/_document.js +0 -72
- package/src/pages/api/navigation/regenerate-registry.js +0 -116
- package/src/pages/api/navigation/save.js +0 -218
- package/src/pages/authModule/acl/index.js +0 -48
- package/src/pages/authModule/forgot-password/index.js +0 -228
- package/src/pages/authModule/permissions/rolePermissions/[id]/rolePermissionsUser/index.js +0 -392
- package/src/pages/authModule/permissions/rolePermissions/index.js +0 -343
- package/src/pages/authModule/permissions/systemPermissions/index.js +0 -354
- package/src/pages/authModule/privacy/index.js +0 -721
- package/src/pages/authModule/users/index.js +0 -210
- package/src/pages/login/index.js +0 -328
- package/src/pages/mainHome/index.js +0 -181
- package/src/views/builder/inspector/definitions/cell/main.js +0 -4
- package/src/views/builder/inspector/definitions/column/main.js +0 -9
- package/src/views/builder/inspector/definitions/column-group/main.js +0 -18
- package/src/views/builder/inspector/definitions/header-cell/main.js +0 -5
- package/src/views/builder/inspector/definitions/table/main.js +0 -9
- package/src/views/builder/viewer/renderers/CellRenderer.jsx +0 -71
- package/src/views/builder/viewer/renderers/ColumnGroupRenderer.jsx +0 -96
- package/src/views/builder/viewer/renderers/ColumnRenderer.jsx +0 -71
- package/src/views/builder/viewer/renderers/HeaderCellRenderer.jsx +0 -78
- package/src/views/builder/viewer/renderers/TabRenderer.jsx +0 -82
- package/src/views/builder/viewer/renderers/TableRenderer.jsx +0 -92
- package/src/views/pages/auth/FooterIllustrationsV2.js +0 -40
- package/src/views/pages/misc/FooterIllustrations.js +0 -47
- package/src/views/pages/misc/muiTable/CustomPagination.js +0 -34
- package/src/views/pages/users/UserManageDialog.js +0 -283
- package/src/views/pages/users/UserViewPage.js +0 -199
- package/src/views/users/AddUserNameDialog.js +0 -162
- package/src/views/users/ContactManage.js +0 -449
- package/src/views/users/ResetPasswordDialog.js +0 -242
package/INTEGRATION.md
ADDED
|
@@ -0,0 +1,1586 @@
|
|
|
1
|
+
# robobyte-front-builder — Integration Guide
|
|
2
|
+
|
|
3
|
+
This package exposes the **UI Builder**, **Report Builder**, **Navigator Builder**, and a **Navigation Extension API** so any host Next.js application can embed them and extend the sidebar navigation without forking this repo.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Prerequisites
|
|
8
|
+
|
|
9
|
+
| Requirement | Version |
|
|
10
|
+
|---|---|
|
|
11
|
+
| Node.js | ≥ 18 |
|
|
12
|
+
| React / React DOM | ≥ 18 |
|
|
13
|
+
| Next.js | ≥ 13 |
|
|
14
|
+
| @mui/material | ≥ 5 |
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 2. Peer dependencies
|
|
19
|
+
|
|
20
|
+
Only the libraries that **must be shared as a single instance** are declared as `peerDependencies` — React, MUI, Emotion, and AG Grid. Everything else ships as regular `dependencies` inside the package so the host app doesn't need to install them manually.
|
|
21
|
+
|
|
22
|
+
### Must be installed in the host app
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm install \
|
|
26
|
+
react react-dom next \
|
|
27
|
+
@mui/material @mui/icons-material @mui/lab @mui/system \
|
|
28
|
+
@mui/x-data-grid @mui/x-date-pickers @mui/x-internals @mui/x-virtualizer \
|
|
29
|
+
@emotion/react @emotion/styled \
|
|
30
|
+
ag-grid-community ag-grid-enterprise ag-grid-react \
|
|
31
|
+
xlsx
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
> **Why only these?**
|
|
35
|
+
> React and MUI use context and module registries that break if two copies exist in the same app (hooks errors, theme not applied, AG Grid license warnings). `xlsx` is required by the Excel Upload component and is resolved from the host app's `node_modules` because the builder source is transpiled in the host's webpack context. Everything else — `dayjs`, `lodash`, `recharts`, etc. — can safely run from the package's own `node_modules` copy with no side effects.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## 3. Installation
|
|
40
|
+
|
|
41
|
+
### Local development (file: link — no publish needed)
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
// package.json
|
|
45
|
+
"robobyte-front-builder": "file:../../RoboByteFrontBuilder"
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Run `npm install` once to create the `node_modules` copy. After that, sync
|
|
49
|
+
changed files manually — Next.js hot-reload picks up the changes without
|
|
50
|
+
restarting, except when `next.config.js` itself changes.
|
|
51
|
+
|
|
52
|
+
### Published registry
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npm install robobyte-front-builder
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## 4. Publishing to npm
|
|
61
|
+
|
|
62
|
+
### One-time setup
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
npm login
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Publish / update
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
npm version patch # 1.0.0 → 1.0.1 (bug fixes)
|
|
72
|
+
npm version minor # 1.0.0 → 1.1.0 (new features)
|
|
73
|
+
npm version major # 1.0.0 → 2.0.0 (breaking changes)
|
|
74
|
+
npm publish
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Dry run
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
npm publish --dry-run
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## 5. `next.config.js` setup
|
|
86
|
+
|
|
87
|
+
Two things are required: **transpile** the package, and set up the
|
|
88
|
+
**context-aware bare-alias webpack plugin** so that bare imports like
|
|
89
|
+
`services/*`, `views/*`, etc. resolve to the correct source tree (host vs.
|
|
90
|
+
package) based on where the importing file lives.
|
|
91
|
+
|
|
92
|
+
```js
|
|
93
|
+
const path = require('path')
|
|
94
|
+
const withTM = require('next-transpile-modules')(['robobyte-front-builder'])
|
|
95
|
+
|
|
96
|
+
const hostSrc = path.resolve(__dirname, 'src')
|
|
97
|
+
const builderSrc = path.resolve(__dirname, 'node_modules/robobyte-front-builder/src')
|
|
98
|
+
|
|
99
|
+
module.exports = withTM({
|
|
100
|
+
webpack(config, { isServer }) {
|
|
101
|
+
// Force CJS on server to avoid ESM directory-import errors
|
|
102
|
+
if (isServer) {
|
|
103
|
+
config.resolve.conditionNames = ['require', 'node', 'default']
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const { NormalModuleReplacementPlugin } = require('webpack')
|
|
107
|
+
|
|
108
|
+
// ── Package-owned services ─────────────────────────────────────────────
|
|
109
|
+
// These modules are canonical in the package. Every caller — host or
|
|
110
|
+
// package — always resolves to the same single implementation.
|
|
111
|
+
// This plugin must be registered BEFORE the general alias plugin.
|
|
112
|
+
const packageOwnedServices = [
|
|
113
|
+
'services/reportData/fetchReportData',
|
|
114
|
+
// add more here as needed
|
|
115
|
+
]
|
|
116
|
+
packageOwnedServices.forEach(mod => {
|
|
117
|
+
config.plugins.push(
|
|
118
|
+
new NormalModuleReplacementPlugin(
|
|
119
|
+
new RegExp(`^${mod.replace(/\//g, '\\/')}(\\.js)?$`),
|
|
120
|
+
resource => {
|
|
121
|
+
resource.request = path.join(builderSrc, mod)
|
|
122
|
+
}
|
|
123
|
+
)
|
|
124
|
+
)
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
// ── Context-aware bare alias routing ──────────────────────────────────
|
|
128
|
+
// services/*, views/*, context/*, src/*, pages/* each route to the
|
|
129
|
+
// correct source tree depending on where the importing file lives.
|
|
130
|
+
config.plugins.push(
|
|
131
|
+
new NormalModuleReplacementPlugin(
|
|
132
|
+
/^(services|views|context|src|pages)(\/|$)/,
|
|
133
|
+
resource => {
|
|
134
|
+
const isBuilder =
|
|
135
|
+
resource.context.includes('robobyte-front-builder') ||
|
|
136
|
+
resource.context.includes('RoboByteFrontBuilder')
|
|
137
|
+
const root = isBuilder ? builderSrc : hostSrc
|
|
138
|
+
resource.request = resource.request.replace(
|
|
139
|
+
/^(services|views|context|src|pages)(\/|$)/,
|
|
140
|
+
(_, prefix, sep) =>
|
|
141
|
+
prefix === 'src'
|
|
142
|
+
? root + sep
|
|
143
|
+
: path.join(root, prefix) + sep
|
|
144
|
+
)
|
|
145
|
+
}
|
|
146
|
+
)
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
return config
|
|
150
|
+
},
|
|
151
|
+
})
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
> **Restart the dev server** whenever `next.config.js` changes — hot-reload
|
|
155
|
+
> does not apply to webpack plugin changes.
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## 6. Provider setup (`_app.js`)
|
|
160
|
+
|
|
161
|
+
Wrap the component tree with `RoboByteFrontBuilderProvider`. Bridge your host
|
|
162
|
+
auth context into it so the package can attach auth headers to every API call.
|
|
163
|
+
|
|
164
|
+
```jsx
|
|
165
|
+
import { RoboByteFrontBuilderProvider } from 'robobyte-front-builder'
|
|
166
|
+
|
|
167
|
+
function RoboByteBridge({ children }) {
|
|
168
|
+
const auth = useContext(YourAuthContext) // your own auth context
|
|
169
|
+
return (
|
|
170
|
+
<RoboByteFrontBuilderProvider
|
|
171
|
+
baseURL={process.env.NEXT_PUBLIC_API_BASE_URL}
|
|
172
|
+
apiURL={process.env.NEXT_PUBLIC_API_URL}
|
|
173
|
+
user={auth.user}
|
|
174
|
+
accessToken={auth.accessToken}
|
|
175
|
+
agGridLicenseKey={process.env.NEXT_PUBLIC_AG_GRID_LICENSE_KEY}
|
|
176
|
+
>
|
|
177
|
+
{children}
|
|
178
|
+
</RoboByteFrontBuilderProvider>
|
|
179
|
+
)
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export default function App({ Component, pageProps }) {
|
|
183
|
+
const getLayout = Component.getLayout ?? (page => page)
|
|
184
|
+
return (
|
|
185
|
+
<YourAuthProvider>
|
|
186
|
+
<RoboByteBridge>
|
|
187
|
+
{getLayout(<Component {...pageProps} />)}
|
|
188
|
+
</RoboByteBridge>
|
|
189
|
+
</YourAuthProvider>
|
|
190
|
+
)
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### Provider props
|
|
195
|
+
|
|
196
|
+
| Prop | Type | Description |
|
|
197
|
+
|--------------------|----------|-------------|
|
|
198
|
+
| `baseURL` | string | Root API server URL, e.g. `https://api.example.com/` |
|
|
199
|
+
| `apiURL` | string | `/api` prefix URL, e.g. `https://api.example.com/api/` |
|
|
200
|
+
| `user` | object | Current user object from your auth context |
|
|
201
|
+
| `accessToken` | string | Bearer token — attached to every robobyte service call |
|
|
202
|
+
| `agGridLicenseKey` | string | AG Grid Enterprise license key. The provider calls `LicenseManager.setLicenseKey()` and registers `AllEnterpriseModule` + `IntegratedChartsModule.with(AgChartsEnterpriseModule)` internally. |
|
|
203
|
+
| `navExtensions` | array | Static nav items to inject into the sidebar (optional) |
|
|
204
|
+
| `endpoints` | object | Full-URL overrides per endpoint group + name (optional) |
|
|
205
|
+
|
|
206
|
+
> **AG Grid note:** Do not call `LicenseManager` or `ModuleRegistry` in the
|
|
207
|
+
> host app — the provider handles it entirely via `agGridLicenseKey`.
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## 7. Builder pages — `/builders/...` path schema
|
|
212
|
+
|
|
213
|
+
All builder routes live under the `/builders/` prefix. Create a thin wrapper
|
|
214
|
+
page in your host app for each route that imports from the package and assigns
|
|
215
|
+
the required static properties.
|
|
216
|
+
|
|
217
|
+
### Required pages
|
|
218
|
+
|
|
219
|
+
| Route | Package export |
|
|
220
|
+
|-------|----------------|
|
|
221
|
+
| `/builders/ui` | `UIBuilderPage` |
|
|
222
|
+
| `/builders/ui/views` | `ViewsList` |
|
|
223
|
+
| `/builders/report` | `ReportBuilderPage` |
|
|
224
|
+
| `/builders/report/list` | `ReportsList` |
|
|
225
|
+
| `/builders/report/viewer` | `ReportViewer` |
|
|
226
|
+
| `/builders/report/reportsPermissions` | `ReportsCard` |
|
|
227
|
+
| `/builders/navigator` | `NavigatorBuilderPage` |
|
|
228
|
+
| `/viewer/[id]` | `ViewerPage` |
|
|
229
|
+
|
|
230
|
+
### Page wrapper pattern
|
|
231
|
+
|
|
232
|
+
Use an explicit import + static property assignment. A bare `export { X as default }`
|
|
233
|
+
does **not** reliably carry `getLayout`, `acl`, `authGuard` across package
|
|
234
|
+
boundaries in Next.js.
|
|
235
|
+
|
|
236
|
+
```jsx
|
|
237
|
+
// pages/builders/report/viewer/index.jsx
|
|
238
|
+
import { ReportViewer } from 'robobyte-front-builder'
|
|
239
|
+
import BlankLayout from 'src/@core/layouts/BlankLayout'
|
|
240
|
+
import PermissionsSubjects from 'src/configs/Permissions/PermissionsSubjects.json'
|
|
241
|
+
|
|
242
|
+
ReportViewer.getLayout = page => <BlankLayout>{page}</BlankLayout>
|
|
243
|
+
ReportViewer.acl = { action: 'view', subject: PermissionsSubjects.Free }
|
|
244
|
+
ReportViewer.authGuard = true
|
|
245
|
+
ReportViewer.guestGuard = false
|
|
246
|
+
export default ReportViewer
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
Apply the same pattern for every builder page, adjusting `acl.subject` and
|
|
250
|
+
`getLayout` as appropriate.
|
|
251
|
+
|
|
252
|
+
### Viewer page (`/viewer/[id]`)
|
|
253
|
+
|
|
254
|
+
The viewer bridges your host nav context into `SystemContext` so the package
|
|
255
|
+
can resolve view metadata:
|
|
256
|
+
|
|
257
|
+
```jsx
|
|
258
|
+
// pages/viewer/[id].jsx
|
|
259
|
+
import { useContext } from 'react'
|
|
260
|
+
import { ViewerPage, SystemContext } from 'robobyte-front-builder'
|
|
261
|
+
import { YourNavContext } from 'src/context/YourNavContext'
|
|
262
|
+
|
|
263
|
+
function SystemContextBridge({ children }) {
|
|
264
|
+
const { nav } = useContext(YourNavContext)
|
|
265
|
+
return (
|
|
266
|
+
<SystemContext.Provider value={{ nav }}>
|
|
267
|
+
{children}
|
|
268
|
+
</SystemContext.Provider>
|
|
269
|
+
)
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export default function ViewerRoute() {
|
|
273
|
+
return (
|
|
274
|
+
<SystemContextBridge>
|
|
275
|
+
<ViewerPage />
|
|
276
|
+
</SystemContextBridge>
|
|
277
|
+
)
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
ViewerRoute.authGuard = true
|
|
281
|
+
ViewerRoute.guestGuard = false
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
The viewer reads the view id from `router.query.id` (path segment), so always
|
|
285
|
+
navigate to it as `/viewer/${id}` — not `/viewer?viewId=...`.
|
|
286
|
+
|
|
287
|
+
### Deprecated routes — 404 stubs
|
|
288
|
+
|
|
289
|
+
Old paths must return a proper 404, not a redirect. Add a stub at each old path:
|
|
290
|
+
|
|
291
|
+
```js
|
|
292
|
+
// e.g. pages/reportModule/reportBuilder/reportViewer/index.js
|
|
293
|
+
export const getServerSideProps = () => ({ notFound: true })
|
|
294
|
+
export default function Page() { return null }
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
Paths to stub out:
|
|
298
|
+
|
|
299
|
+
- `/uiBuilder`, `/viewBuilder`, `/viewBuilder/views`, `/viewBuilder/viewPage`
|
|
300
|
+
- `/reportModule/reportBuilder`, `/reportModule/reportBuilder/reportViewer`, `/reportModule/reportBuilder/reports`
|
|
301
|
+
- `/reportBuilder`, `/reportBuilder/reports`, `/reportBuilder/reportViewer`, `/reportBuilder/reportsPermissions`
|
|
302
|
+
- `/navigatorBuilder`
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
## 8. `fetchReportDataByPageId`
|
|
307
|
+
|
|
308
|
+
Fetches report data by `pageId` without any AG Grid dependency. The canonical
|
|
309
|
+
implementation lives in the package at `services/reportData/fetchReportData`.
|
|
310
|
+
|
|
311
|
+
### Sourcing — always from the package
|
|
312
|
+
|
|
313
|
+
The `packageOwnedServices` entry in `next.config.js` (§4) routes every import
|
|
314
|
+
of `services/reportData/fetchReportData` — from any file, host or package — to
|
|
315
|
+
the package's copy via `NormalModuleReplacementPlugin`. The host app's local
|
|
316
|
+
copy (if any) should be emptied out and never executed.
|
|
317
|
+
|
|
318
|
+
### Usage
|
|
319
|
+
|
|
320
|
+
```js
|
|
321
|
+
import fetchReportDataByPageId from 'services/reportData/fetchReportData'
|
|
322
|
+
|
|
323
|
+
const result = await fetchReportDataByPageId({
|
|
324
|
+
pageId, // string | number — required
|
|
325
|
+
filter, // { Tfilter, TFilter, customFilterCode, ... } — optional
|
|
326
|
+
isDataOnly, // return raw rows only (default false)
|
|
327
|
+
dataAsObject, // key rows by unique id (default false)
|
|
328
|
+
isPagination, // server-side pagination (default true)
|
|
329
|
+
isSingle, // return first row only (default false)
|
|
330
|
+
globalParams, // override selectionParams by index (default null)
|
|
331
|
+
page, // page number (default 1)
|
|
332
|
+
pageSize, // page size (default 50)
|
|
333
|
+
authContext, // passed into customFilterCode sandbox (default null)
|
|
334
|
+
context, // passed into customFilterCode sandbox (default null)
|
|
335
|
+
})
|
|
336
|
+
|
|
337
|
+
if (result.success) {
|
|
338
|
+
console.log(result.rows) // array of row objects
|
|
339
|
+
console.log(result.total) // total count (when isPagination: true)
|
|
340
|
+
} else {
|
|
341
|
+
console.error(result.error)
|
|
342
|
+
}
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
### `customFilterCode`
|
|
346
|
+
|
|
347
|
+
Pass a JS string in `filter.customFilterCode`. It runs in a sandboxed
|
|
348
|
+
`new Function` with `authContext`, `context`, and `filters` in scope. The
|
|
349
|
+
function must push objects to the `customFilter` array — these are merged with
|
|
350
|
+
the formatted `tFilter` before the API call.
|
|
351
|
+
|
|
352
|
+
```js
|
|
353
|
+
const filter = {
|
|
354
|
+
customFilterCode: `
|
|
355
|
+
if (authContext?.user?.shopId) {
|
|
356
|
+
customFilter.push({ field: 'ShopId', value: authContext.user.shopId, operation: 'Equal' })
|
|
357
|
+
}
|
|
358
|
+
`
|
|
359
|
+
}
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
---
|
|
363
|
+
|
|
364
|
+
## 9. Embedding `ReportViewer` as a component
|
|
365
|
+
|
|
366
|
+
`ReportViewer` can be rendered inline anywhere — not only as a full page:
|
|
367
|
+
|
|
368
|
+
```jsx
|
|
369
|
+
import { ReportViewer } from 'robobyte-front-builder'
|
|
370
|
+
|
|
371
|
+
<ReportViewer
|
|
372
|
+
pageId="your-page-id"
|
|
373
|
+
minimized={true}
|
|
374
|
+
noHeader={true}
|
|
375
|
+
filter={{ Tfilter: [...] }}
|
|
376
|
+
height="400px"
|
|
377
|
+
/>
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
### Props
|
|
381
|
+
|
|
382
|
+
| Prop | Type | Description |
|
|
383
|
+
|-----------------|----------|-------------|
|
|
384
|
+
| `id` | string | Report ID |
|
|
385
|
+
| `pageId` | string | Report page ID (alternative to `id`) |
|
|
386
|
+
| `filter` | object | External filter (`Tfilter`, `TFilter`, `customFilterCode`) |
|
|
387
|
+
| `minimized` | bool | Removes padding and box shadow |
|
|
388
|
+
| `noHeader` | bool | Hides the report title and studio button |
|
|
389
|
+
| `height` | string | Grid height (default `85vh`) |
|
|
390
|
+
| `isSingle` | bool | Return only the first row |
|
|
391
|
+
| `dataAsObject` | bool | Key rows by unique id |
|
|
392
|
+
| `setData` | function | Callback receiving the loaded rows |
|
|
393
|
+
| `setOutGridApi` | function | Callback receiving the AG Grid API instance |
|
|
394
|
+
| `refresh` | any | Change this value to force a data reload |
|
|
395
|
+
| `actions` | array | Custom row action buttons |
|
|
396
|
+
| `columnsConfig` | array | Column overrides |
|
|
397
|
+
| `globalParams` | array | Override report selectionParams by index |
|
|
398
|
+
| `sessionId` | string | Load filter payload from localStorage by session key |
|
|
399
|
+
| `updateRef` | ref | Ref for triggering programmatic updates |
|
|
400
|
+
|
|
401
|
+
---
|
|
402
|
+
|
|
403
|
+
## 10. Navigation extension API
|
|
404
|
+
|
|
405
|
+
### Option A — Static items via the Provider
|
|
406
|
+
|
|
407
|
+
```jsx
|
|
408
|
+
<RoboByteFrontBuilderProvider
|
|
409
|
+
navExtensions={[
|
|
410
|
+
{
|
|
411
|
+
id: 'host-analytics',
|
|
412
|
+
title: 'Analytics',
|
|
413
|
+
icon: 'ChartBar',
|
|
414
|
+
type: 'static',
|
|
415
|
+
path: '/analytics',
|
|
416
|
+
insertAt: 'end',
|
|
417
|
+
},
|
|
418
|
+
]}
|
|
419
|
+
>
|
|
420
|
+
...
|
|
421
|
+
</RoboByteFrontBuilderProvider>
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
### Option B — Dynamic items via `useNavExtension` hook
|
|
425
|
+
|
|
426
|
+
```jsx
|
|
427
|
+
import { useNavExtension } from 'robobyte-front-builder'
|
|
428
|
+
|
|
429
|
+
function MyFeaturePlugin() {
|
|
430
|
+
useNavExtension(
|
|
431
|
+
[{ id: 'my-feature', title: 'My Feature', icon: 'StarOutline', type: 'static', path: '/my-feature', insertAt: 'start' }],
|
|
432
|
+
'my-feature-plugin' // stable plugin ID — prevents duplicates on re-renders
|
|
433
|
+
)
|
|
434
|
+
return null
|
|
435
|
+
}
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
### Nav item shape
|
|
439
|
+
|
|
440
|
+
| Field | Type | Required | Description |
|
|
441
|
+
|---|---|---|---|
|
|
442
|
+
| `id` | string | yes | Stable unique identifier |
|
|
443
|
+
| `title` | string | yes | Display label |
|
|
444
|
+
| `icon` | string | no | mdi-material-ui icon name |
|
|
445
|
+
| `type` | `'static'` \| `'dynamic'` \| `'external'` | yes | Route type |
|
|
446
|
+
| `path` | string | for `static` | Absolute path |
|
|
447
|
+
| `viewId` | number | for `dynamic` | Registered view ID |
|
|
448
|
+
| `externalUrl` | string | for `external` | Full URL, opens in new tab |
|
|
449
|
+
| `insertAt` | `'start'` \| `'end'` \| number \| `{ afterId }` \| `{ beforeId }` | no | Placement rule (default `'end'`) |
|
|
450
|
+
| `children` | NavItem[] | no | Collapsible group |
|
|
451
|
+
| `action` / `subject` | string | no | CASL ACL visibility |
|
|
452
|
+
|
|
453
|
+
---
|
|
454
|
+
|
|
455
|
+
## 11. Public API summary
|
|
456
|
+
|
|
457
|
+
```js
|
|
458
|
+
// Configuration
|
|
459
|
+
configureRoboByte, getBaseURL, getApiURL, getAccessToken, getUser
|
|
460
|
+
|
|
461
|
+
// Provider
|
|
462
|
+
RoboByteFrontBuilderProvider
|
|
463
|
+
|
|
464
|
+
// Navigation extension
|
|
465
|
+
NavigationExtensionProvider, useNavigationExtensionContext, useNavExtension
|
|
466
|
+
|
|
467
|
+
// Page components
|
|
468
|
+
UIBuilderPage, ViewsList
|
|
469
|
+
ReportBuilderPage, ReportsList, ReportViewer, ReportsCard
|
|
470
|
+
NavigatorBuilderPage
|
|
471
|
+
ViewerPage
|
|
472
|
+
|
|
473
|
+
// Contexts
|
|
474
|
+
AuthContext, SystemContext, SystemProvider
|
|
475
|
+
BuilderProvider, useBuilder
|
|
476
|
+
|
|
477
|
+
// Global data store (cross-route reactive state)
|
|
478
|
+
useGlobalStore // React hook — { globalData, setGlobalData }
|
|
479
|
+
getGlobalData // read snapshot from non-React code
|
|
480
|
+
setGlobalData // write from non-React code (e.g. Calculation functions)
|
|
481
|
+
subscribeGlobal // subscribe to changes (returns unsubscribe fn)
|
|
482
|
+
resetGlobalData // clear store on logout / session reset
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
---
|
|
486
|
+
|
|
487
|
+
## 12. Syncing local changes to `node_modules`
|
|
488
|
+
|
|
489
|
+
When using `file:` path, `node_modules/robobyte-front-builder` is a **copy**,
|
|
490
|
+
not a symlink. After editing source files, sync manually:
|
|
491
|
+
|
|
492
|
+
```bash
|
|
493
|
+
SRC=RoboByteFrontBuilder/src
|
|
494
|
+
PKG=YourApp/node_modules/robobyte-front-builder/src
|
|
495
|
+
|
|
496
|
+
cp $SRC/views/genericTable/SGrid.js $PKG/views/genericTable/SGrid.js
|
|
497
|
+
cp $SRC/views/genericTable/TAGGrid.js $PKG/views/genericTable/TAGGrid.js
|
|
498
|
+
cp $SRC/pages/reportModule/reportBuilder/reports/index.js $PKG/pages/reportModule/reportBuilder/reports/index.js
|
|
499
|
+
cp $SRC/pages/reportModule/reportBuilder/reportViewer/index.js $PKG/pages/reportModule/reportBuilder/reportViewer/index.js
|
|
500
|
+
cp $SRC/pages/reportModule/reportBuilder/reportsPermissions/index.js $PKG/pages/reportModule/reportBuilder/reportsPermissions/index.js
|
|
501
|
+
cp $SRC/services/reportData/fetchReportData.js $PKG/services/reportData/fetchReportData.js
|
|
502
|
+
cp $SRC/lib/providers/RoboByteFrontBuilderProvider.jsx $PKG/lib/providers/RoboByteFrontBuilderProvider.jsx
|
|
503
|
+
cp $SRC/lib/index.js $PKG/lib/index.js
|
|
504
|
+
```
|
|
505
|
+
|
|
506
|
+
Hot-reload picks up all file changes automatically. Only `next.config.js`
|
|
507
|
+
changes require a full dev server restart.
|
|
508
|
+
|
|
509
|
+
---
|
|
510
|
+
|
|
511
|
+
## 13. Data Grid component
|
|
512
|
+
|
|
513
|
+
The **Data Grid** component wraps AG Grid Enterprise and is configurable entirely from the builder inspector — no code required for common cases.
|
|
514
|
+
|
|
515
|
+
### Inspector — Main tab
|
|
516
|
+
|
|
517
|
+
| Field | Description |
|
|
518
|
+
|-------|-------------|
|
|
519
|
+
| `Key` | Component reference key for `reportRefs` access |
|
|
520
|
+
| `Data Key` | Key under which row data is read from / written to page `data` |
|
|
521
|
+
| `Columns` | Expression returning an AG Grid `colDef[]` array |
|
|
522
|
+
| `Extra Columns` | Visual editor for adding new columns on top of the data-driven ones (see below) |
|
|
523
|
+
| `Columns Config` | Visual editor for overriding properties of existing columns matched by `field` name (see below) |
|
|
524
|
+
| `Row Actions` | Visual editor for per-row action buttons shown in a popover |
|
|
525
|
+
| `Add Button Label` | Label for the add-row button (default `"Add"`) |
|
|
526
|
+
| `New Row Template` | Code returning the default object for a newly added row |
|
|
527
|
+
| `Read Only` | Expression — when truthy, disables all editing, hides add/delete controls |
|
|
528
|
+
| `Show Add Button` | Toggle the add-row button |
|
|
529
|
+
| `Show Delete Col` | Toggle the delete-row column |
|
|
530
|
+
| `Height` | Grid height expression (e.g. `'400px'`, `'60vh'`) |
|
|
531
|
+
| `Row Selection` | `none` / `single` / `multiple` |
|
|
532
|
+
| `Pagination` | Enable client-side pagination |
|
|
533
|
+
| `Page Size` | Rows per page when pagination is on |
|
|
534
|
+
|
|
535
|
+
### Extra Columns editor
|
|
536
|
+
|
|
537
|
+
Adds **new columns** that don't exist in the data source. Each column is a full AG Grid `colDef`:
|
|
538
|
+
|
|
539
|
+
| Field | Description |
|
|
540
|
+
|-------|-------------|
|
|
541
|
+
| Header Name | Column header label |
|
|
542
|
+
| Field | Property name to read/write on the row object |
|
|
543
|
+
| Pinned | `left` / `right` / none |
|
|
544
|
+
| Width | Fixed pixel width |
|
|
545
|
+
| Editable | Whether the cell can be edited |
|
|
546
|
+
| Cell Renderer | Built-in or custom renderer (Chip, Link, Icon, Boolean, Currency, Date, Progress, Avatar, Sparkline…) |
|
|
547
|
+
| Cell Editor | Built-in or custom editor (text, number, checkbox, select, date, MultiSelect…) |
|
|
548
|
+
| Value Getter | JS expression to derive the displayed value |
|
|
549
|
+
| Value Formatter | JS expression to format the display string |
|
|
550
|
+
| Value Setter | JS expression called on commit — must return `true` to accept |
|
|
551
|
+
| Cell Editor Params | JS expression returning params passed to the editor |
|
|
552
|
+
| Cell Style | JS expression returning a CSS object |
|
|
553
|
+
| Tooltip | JS expression returning tooltip text |
|
|
554
|
+
|
|
555
|
+
### Columns Config editor
|
|
556
|
+
|
|
557
|
+
**Overrides properties of existing columns** from the `Columns` expression, matched by `field` name. Useful for attaching renderers, editors, or functions to API-driven columns without touching the column definition source.
|
|
558
|
+
|
|
559
|
+
Same per-column fields as Extra Columns, plus the match is done by `field` so the override is applied only to that column.
|
|
560
|
+
|
|
561
|
+
### Row Actions editor
|
|
562
|
+
|
|
563
|
+
Each action button has:
|
|
564
|
+
|
|
565
|
+
| Field | Description |
|
|
566
|
+
|-------|-------------|
|
|
567
|
+
| Label | Button label |
|
|
568
|
+
| Color | MUI palette color |
|
|
569
|
+
| Variant | `text` / `outlined` / `contained` |
|
|
570
|
+
| Icon | MUI icon name |
|
|
571
|
+
| Code | JS action code — `row` and `rowIndex` are available in scope |
|
|
572
|
+
| Confirmation | Optional confirmation message shown before executing |
|
|
573
|
+
| Disabled | Expression — when truthy the button is hidden for that row |
|
|
574
|
+
|
|
575
|
+
### Read Only mode
|
|
576
|
+
|
|
577
|
+
`readOnly` is an **expression** field, so it can be driven by data:
|
|
578
|
+
|
|
579
|
+
```js
|
|
580
|
+
// always read-only:
|
|
581
|
+
true
|
|
582
|
+
|
|
583
|
+
// driven by page state:
|
|
584
|
+
data.viewMode === 'preview'
|
|
585
|
+
```
|
|
586
|
+
|
|
587
|
+
When `readOnly` is truthy: editing is disabled on all cells, the add-row button is hidden, and the delete column is hidden. No full re-render occurs — the grid updates in place via `defaultColDef`.
|
|
588
|
+
|
|
589
|
+
### `reportRefs` API
|
|
590
|
+
|
|
591
|
+
```js
|
|
592
|
+
const grid = reportRefs['myGridKey']
|
|
593
|
+
|
|
594
|
+
grid.getRows() // current row data array
|
|
595
|
+
grid.setRows(arr) // replace all rows
|
|
596
|
+
grid.addRow(obj) // append a row
|
|
597
|
+
grid.updateRow(index, obj) // update a row by index
|
|
598
|
+
grid.deleteRow(index) // delete a row by index
|
|
599
|
+
grid.getGridApi() // raw AG Grid API instance
|
|
600
|
+
```
|
|
601
|
+
|
|
602
|
+
---
|
|
603
|
+
|
|
604
|
+
## 14. Dialog component
|
|
605
|
+
|
|
606
|
+
The **Dialog** component renders a hidden MUI Dialog that is opened and closed programmatically from any action, button, or column function via `openDialog(key)` / `closeDialog(key)`.
|
|
607
|
+
|
|
608
|
+
### Inspector — Main tab
|
|
609
|
+
|
|
610
|
+
| Field | Description |
|
|
611
|
+
|-------|-------------|
|
|
612
|
+
| `Key` | The identifier used to open/close this dialog — must be unique on the page |
|
|
613
|
+
| `View ID` | When set, renders a full embedded view inside the dialog body. Leave blank to use dropped child components instead |
|
|
614
|
+
| `Title` | Dialog title bar text (expression) |
|
|
615
|
+
| `Hide Title Bar` | Hides the entire title bar including the close button |
|
|
616
|
+
| `Max Width` | `xs` / `sm` / `md` / `lg` / `xl` |
|
|
617
|
+
| `Full Width` | Stretches the dialog to the max width breakpoint |
|
|
618
|
+
| `Full Screen` | Full-screen mode |
|
|
619
|
+
| `Show Close Button` | Shows the × icon in the title bar |
|
|
620
|
+
| `Close on Backdrop` | Closes the dialog when the user clicks outside it |
|
|
621
|
+
| `Action Buttons` | Buttons rendered in a footer bar — each has its own Calculation code |
|
|
622
|
+
|
|
623
|
+
### Opening and closing
|
|
624
|
+
|
|
625
|
+
From any action or Calculation on the page:
|
|
626
|
+
|
|
627
|
+
```js
|
|
628
|
+
// Open — key matches the dialog's Key field
|
|
629
|
+
openDialog('confirmDelete')
|
|
630
|
+
|
|
631
|
+
// Open with data — merged into the dialog's isolated data store
|
|
632
|
+
openDialog('editUser', { userId: row.id, name: row.name })
|
|
633
|
+
|
|
634
|
+
// Close
|
|
635
|
+
closeDialog('confirmDelete')
|
|
636
|
+
```
|
|
637
|
+
|
|
638
|
+
### Isolated data store
|
|
639
|
+
|
|
640
|
+
Each dialog gets its own isolated `data` / `setData` scope. When `openDialog(key, data)` is called the optional data object is merged into the dialog's initial state, making it immediately available inside the dialog via the normal `data` variable:
|
|
641
|
+
|
|
642
|
+
```js
|
|
643
|
+
// Caller (e.g. a row action):
|
|
644
|
+
openDialog('editUser', { userId: row.id })
|
|
645
|
+
|
|
646
|
+
// Inside the dialog's Calculation or child component:
|
|
647
|
+
data.userId // the value passed from the caller
|
|
648
|
+
```
|
|
649
|
+
|
|
650
|
+
The dialog's `data` is separate from the parent page's `data`. To read or write the parent page state from inside a dialog use `pageData` and `pageSetData`:
|
|
651
|
+
|
|
652
|
+
```js
|
|
653
|
+
// Inside a dialog action:
|
|
654
|
+
pageSetData(prev => ({ ...prev, lastEdited: data.userId }))
|
|
655
|
+
```
|
|
656
|
+
|
|
657
|
+
### Action buttons
|
|
658
|
+
|
|
659
|
+
Buttons in the `Action Buttons` editor are rendered in a `DialogActions` footer bar. Each button's Calculation runs in the dialog's isolated child context, so `data`, `setData`, `form`, and `reportRefs` all refer to the dialog's own scope. `closeDialog(key)` is pre-wired and available without extra setup:
|
|
660
|
+
|
|
661
|
+
```js
|
|
662
|
+
// Example: Save button action inside the dialog
|
|
663
|
+
async function Calculation(form, data, setData, ...) {
|
|
664
|
+
await saveUser(data.userId, form)
|
|
665
|
+
closeDialog('editUser')
|
|
666
|
+
}
|
|
667
|
+
```
|
|
668
|
+
|
|
669
|
+
### `openDialog` / `closeDialog` availability
|
|
670
|
+
|
|
671
|
+
Both are available in every Calculation scope on the page — button actions, row actions, column functions, field `onChange`, and `onMapped`. They are also passed down into embedded views rendered via `View ID`.
|
|
672
|
+
|
|
673
|
+
---
|
|
674
|
+
|
|
675
|
+
## 15. Popover component
|
|
676
|
+
|
|
677
|
+
The **Popover** component renders a self-contained trigger (button, icon button, or text) that opens a floating panel containing dropped child components. No `openDialog` call needed — the trigger and the panel are a single unit.
|
|
678
|
+
|
|
679
|
+
### Inspector — Main tab
|
|
680
|
+
|
|
681
|
+
#### Trigger
|
|
682
|
+
|
|
683
|
+
| Field | Description |
|
|
684
|
+
|-------|-------------|
|
|
685
|
+
| `Key` | Optional reference key |
|
|
686
|
+
| `Trigger Type` | `button` / `icon-button` / `text` |
|
|
687
|
+
| `Trigger Label` | Label text for button and text triggers |
|
|
688
|
+
| `Trigger Variant` | `text` / `outlined` / `contained` |
|
|
689
|
+
| `Trigger Color` | MUI palette color |
|
|
690
|
+
| `Trigger Size` | `small` / `medium` / `large` |
|
|
691
|
+
| `Trigger Icon` | Icon shown on the trigger (MoreVertOutlined, SettingsOutlined, etc.) |
|
|
692
|
+
| `Trigger Full Width` | Stretches the trigger to full container width |
|
|
693
|
+
|
|
694
|
+
#### Popover panel
|
|
695
|
+
|
|
696
|
+
| Field | Description |
|
|
697
|
+
|-------|-------------|
|
|
698
|
+
| `Popover Title` | Optional title shown at the top of the panel |
|
|
699
|
+
| `Placement` | Anchor position — `bottom-start`, `bottom`, `bottom-end`, `top-start`, `top`, `top-end`, `left`, `right` |
|
|
700
|
+
| `Trigger On` | `click` (default) or `hover` |
|
|
701
|
+
| `Controlled Open` | Expression — when provided, overrides the internal open/close state |
|
|
702
|
+
| `Max Width (px)` | Maximum panel width |
|
|
703
|
+
| `Max Height (px)` | Maximum panel height (scrolls if content overflows) |
|
|
704
|
+
| `Content Padding` | Padding inside the panel |
|
|
705
|
+
| `Close On Content Click` | Closes the panel when any child inside is clicked |
|
|
706
|
+
|
|
707
|
+
### When to use Popover vs Dialog
|
|
708
|
+
|
|
709
|
+
| | Popover | Dialog |
|
|
710
|
+
|---|---|---|
|
|
711
|
+
| Trigger | Self-contained (button lives inside the component) | External — any action calls `openDialog(key)` |
|
|
712
|
+
| Content | Inline child components dropped in the builder | Child components or an embedded view via `viewId` |
|
|
713
|
+
| Layout | Floating panel anchored to the trigger | Centred modal overlay |
|
|
714
|
+
| Use case | Menus, filters, quick-edit panels, info cards | Confirmations, forms, detail views |
|
|
715
|
+
|
|
716
|
+
---
|
|
717
|
+
|
|
718
|
+
## 16. Excel Upload component
|
|
719
|
+
|
|
720
|
+
The **Excel Upload** component lets users upload `.xlsx`, `.xls`, or `.csv` files, map the file's columns to field names, and access the resulting data in actions or via `reportRefs`.
|
|
721
|
+
|
|
722
|
+
### Display variants
|
|
723
|
+
|
|
724
|
+
Set via **Display Style** in the inspector Main tab:
|
|
725
|
+
|
|
726
|
+
| Variant | Description |
|
|
727
|
+
|---------|-------------|
|
|
728
|
+
| `dropzone` | Large dashed drop zone with drag & drop support (default) |
|
|
729
|
+
| `button` | Compact outlined button — dashed when empty, solid on success |
|
|
730
|
+
| `icon` | Icon-only button with a tooltip showing upload status |
|
|
731
|
+
|
|
732
|
+
### Inspector — Main tab
|
|
733
|
+
|
|
734
|
+
| Field | Description |
|
|
735
|
+
|-------|-------------|
|
|
736
|
+
| `Key` | Component reference key for `reportRefs` access |
|
|
737
|
+
| `Data Key` | Key under which mapped rows are stored in `data` |
|
|
738
|
+
| `Display Style` | `dropzone` / `button` / `icon` |
|
|
739
|
+
| `Column Mapping` | Pre-configured column → field name pairs (see below) |
|
|
740
|
+
| `Sheet Index` | Zero-based index of the sheet to read (default `0`) |
|
|
741
|
+
| `Button Label` | Upload button label text (default `"Upload Excel"`) |
|
|
742
|
+
| `Show Preview` | Whether to render a preview table after import |
|
|
743
|
+
| `Max Preview Rows` | How many rows to show in the preview (default `5`) |
|
|
744
|
+
|
|
745
|
+
### Inspector — Style tab
|
|
746
|
+
|
|
747
|
+
| Field | Description |
|
|
748
|
+
|-------|-------------|
|
|
749
|
+
| `Color` | MUI palette color applied to the button / icon |
|
|
750
|
+
| `Button Style` | `outlined` / `contained` / `text` |
|
|
751
|
+
| `Size` | `small` / `medium` / `large` |
|
|
752
|
+
| `Border Radius` | Custom border radius expression |
|
|
753
|
+
| `Font Size` / `Font Weight` | Typography overrides |
|
|
754
|
+
| `Width` / `Height` / `Margin` / `Padding` | Layout |
|
|
755
|
+
|
|
756
|
+
### Column mapping
|
|
757
|
+
|
|
758
|
+
Mapping can be configured in two ways:
|
|
759
|
+
|
|
760
|
+
**1. Pre-configured in the inspector (Column Mapping field)**
|
|
761
|
+
Add rows of `Excel Column → Field Name` pairs. When a file is uploaded, the dialog opens with these values pre-filled. The user can still adjust before confirming.
|
|
762
|
+
|
|
763
|
+
**2. At runtime via the mapping dialog**
|
|
764
|
+
If no mapping is configured, the dialog opens after upload showing every Excel column as a row. The field name input is pre-filled with the column header — the user edits or clears each one, then confirms.
|
|
765
|
+
|
|
766
|
+
Clearing a field name in the dialog skips that column entirely.
|
|
767
|
+
|
|
768
|
+
### Actions
|
|
769
|
+
|
|
770
|
+
| Event | `newValue` | Notes |
|
|
771
|
+
|-------|-----------|-------|
|
|
772
|
+
| `onUpload` | `{ fileName, headers, rowCount }` | Fires after parsing, before the mapping dialog opens |
|
|
773
|
+
| `onMapped` | `Array<object>` — the mapped rows | Fires before data is saved. **Return a modified array** to override what gets stored. |
|
|
774
|
+
| `onClear` | `[]` | Fires when the user clears the uploaded data |
|
|
775
|
+
|
|
776
|
+
#### Transforming data in `onMapped`
|
|
777
|
+
|
|
778
|
+
```js
|
|
779
|
+
async function Calculation(form, data, setData, ...) {
|
|
780
|
+
// newValue = mapped rows array, e.g. [{ name: 'John', email: '...' }]
|
|
781
|
+
// Return a modified array to override what gets stored:
|
|
782
|
+
return newValue.map(row => ({
|
|
783
|
+
...row,
|
|
784
|
+
importedAt: new Date().toISOString(),
|
|
785
|
+
}))
|
|
786
|
+
}
|
|
787
|
+
```
|
|
788
|
+
|
|
789
|
+
If the action returns nothing (or a non-array), the original mapped rows are stored unchanged.
|
|
790
|
+
|
|
791
|
+
### Accessing data via `reportRefs`
|
|
792
|
+
|
|
793
|
+
```js
|
|
794
|
+
// Inside any action on the same page:
|
|
795
|
+
const uploader = reportRefs['myUploaderKey']
|
|
796
|
+
|
|
797
|
+
uploader.rows // current mapped rows array
|
|
798
|
+
uploader.storageKey // the data key used in page state
|
|
799
|
+
uploader.setRows(arr) // replace the stored rows
|
|
800
|
+
uploader.clear() // clear all stored rows
|
|
801
|
+
```
|
|
802
|
+
|
|
803
|
+
---
|
|
804
|
+
|
|
805
|
+
## 17. Dark / Light theme for builder pages
|
|
806
|
+
|
|
807
|
+
Both the **UI Builder** (`/viewBuilder`) and the **Print Layout Builder** (`/printBuilder`) support dark and light modes. The default is dark.
|
|
808
|
+
|
|
809
|
+
A toggle button (☀️ / 🌙) is available in each builder's toolbar. Clicking it switches modes and persists the choice in `localStorage` under the key `rbb:builderThemeMode`.
|
|
810
|
+
|
|
811
|
+
The theme is scoped to the builder pages only — it does not affect the rest of the host application. MUI `ThemeProvider` wraps each builder page independently.
|
|
812
|
+
|
|
813
|
+
**Theme palette summary (dark mode)**
|
|
814
|
+
|
|
815
|
+
| Token | Value |
|
|
816
|
+
|---|---|
|
|
817
|
+
| `background.default` | `#141618` |
|
|
818
|
+
| `background.paper` | `#1e2227` |
|
|
819
|
+
| `divider` | `#3a3f45` |
|
|
820
|
+
| `primary.main` | `#9c27b0` (purple) |
|
|
821
|
+
| `secondary.main` | `#f5a623` (amber) |
|
|
822
|
+
|
|
823
|
+
> The canvas drop zone and paper page zones remain white in both modes because they represent the actual document surface.
|
|
824
|
+
|
|
825
|
+
---
|
|
826
|
+
|
|
827
|
+
## 18. Print Layout Builder ⚠️ Preview — needs more testing
|
|
828
|
+
|
|
829
|
+
> **Status:** Functional but not production-ready. This feature is under active development. Expect edge cases and visual glitches. Do not rely on it for production print workflows yet.
|
|
830
|
+
|
|
831
|
+
The **Print Layout Builder** (`/printBuilder`) lets you design reusable print layouts with configurable headers, footers, multi-page bodies, watermarks, and page numbering. Layouts are saved server-side and can be loaded from any form view via `openPrintLayout(layoutId, data)` in action code.
|
|
832
|
+
|
|
833
|
+
### Step 1 — Add the `/printBuilder` host page
|
|
834
|
+
|
|
835
|
+
`PrintBuilderPage` is exported from the package. Create a single file in the host app:
|
|
836
|
+
|
|
837
|
+
```js
|
|
838
|
+
// host-app/pages/printBuilder/index.jsx
|
|
839
|
+
export { default } from 'robobyte-front-builder/PrintBuilderPage'
|
|
840
|
+
// or named import:
|
|
841
|
+
// import { PrintBuilderPage } from 'robobyte-front-builder'
|
|
842
|
+
// export default PrintBuilderPage
|
|
843
|
+
```
|
|
844
|
+
|
|
845
|
+
That is all the routing configuration needed. The page includes its own `BuilderProvider`, sidebar, canvas, inspector, and theme toggle.
|
|
846
|
+
|
|
847
|
+
### Step 2 — Backend API endpoints
|
|
848
|
+
|
|
849
|
+
The print builder persists layouts via four REST endpoints. The host API must implement all four under `UiBuilderModule/PrintLayout`:
|
|
850
|
+
|
|
851
|
+
| Method | URL | Description |
|
|
852
|
+
|--------|-----|-------------|
|
|
853
|
+
| `POST` | `UiBuilderModule/PrintLayout` | Create a new layout. Returns `{ data: { id, title, value } }`. |
|
|
854
|
+
| `PUT` | `UiBuilderModule/PrintLayout` | Update an existing layout (pass `id` in the body). |
|
|
855
|
+
| `GET` | `UiBuilderModule/PrintLayout/GetAll` | List all layouts. Returns `{ data: [{ id, title, value, createdBy, createDate }] }`. |
|
|
856
|
+
| `GET` | `UiBuilderModule/PrintLayout/GetById?id=<id>` | Fetch a layout by ID. Returns `{ data: { id, title, value } }` where `value` is the JSON-stringified schema. |
|
|
857
|
+
| `DELETE` | `UiBuilderModule/PrintLayout?id=<id>` | Delete a layout. |
|
|
858
|
+
|
|
859
|
+
The `value` field is the schema serialised with `JSON.stringify`. The print builder deserialises it with `JSON.parse` after fetching.
|
|
860
|
+
|
|
861
|
+
### Step 3 — Trigger print from a view
|
|
862
|
+
|
|
863
|
+
Inside any action code (button `onClick`, row action, etc.) in a UI Builder view:
|
|
864
|
+
|
|
865
|
+
```js
|
|
866
|
+
openPrintLayout('your-layout-id', {
|
|
867
|
+
// data object passed into the print layout — available as data.* inside it
|
|
868
|
+
invoiceNumber: data.invoiceNumber,
|
|
869
|
+
customerName: data.customer.name,
|
|
870
|
+
lines: data.lines,
|
|
871
|
+
})
|
|
872
|
+
```
|
|
873
|
+
|
|
874
|
+
`openPrintLayout` is injected into every action's execution scope automatically by `ProductionViewer`. No import is needed.
|
|
875
|
+
|
|
876
|
+
### Step 4 — Build the layout
|
|
877
|
+
|
|
878
|
+
Navigate to `/printBuilder` in the host app. Use the **Components** sidebar to drop components into the header, body pages, or footer zones. Switch zones by clicking the zone label in the canvas. Configure page size, margins, watermark, and page numbers in the **Settings** tab.
|
|
879
|
+
|
|
880
|
+
Save the layout (toolbar Save button). Copy the returned `id` and use it in `openPrintLayout('id', data)` calls.
|
|
881
|
+
|
|
882
|
+
### Routes
|
|
883
|
+
|
|
884
|
+
| Route | Behaviour |
|
|
885
|
+
|-------|-----------|
|
|
886
|
+
| `/printBuilder` | New blank layout |
|
|
887
|
+
| `/printBuilder?id=<layoutId>` | Load existing layout |
|
|
888
|
+
| `/printBuilder/layouts` | Browse, preview, and delete all saved layouts |
|
|
889
|
+
|
|
890
|
+
### Step 1b — Add the layouts list host page
|
|
891
|
+
|
|
892
|
+
```js
|
|
893
|
+
// host-app/pages/printBuilder/layouts/index.jsx
|
|
894
|
+
export { default } from 'robobyte-front-builder/PrintLayoutsList'
|
|
895
|
+
// or named import:
|
|
896
|
+
// import { PrintLayoutsList } from 'robobyte-front-builder'
|
|
897
|
+
// export default PrintLayoutsList
|
|
898
|
+
```
|
|
899
|
+
|
|
900
|
+
The list page shows all saved layouts in a card grid. Each card displays the layout title, page size, orientation, number of body pages, creator, and creation date. Available actions per card: **Preview** (scaled read-only canvas in a dialog), **Edit** (navigates to `/printBuilder?id=...`), **Delete** (confirm dialog, removes from list immediately).
|
|
901
|
+
|
|
902
|
+
### Layout zones
|
|
903
|
+
|
|
904
|
+
| Zone | Description |
|
|
905
|
+
|------|-------------|
|
|
906
|
+
| **Header** | Repeats at the top of every printed page. Enabled / disabled and height configurable in Settings. |
|
|
907
|
+
| **Body pages** | One or more pages of content. Pages can be added and deleted. |
|
|
908
|
+
| **Footer** | Repeats at the bottom of every printed page. Supports automatic page number insertion. |
|
|
909
|
+
|
|
910
|
+
### Settings tab
|
|
911
|
+
|
|
912
|
+
| Setting | Description |
|
|
913
|
+
|---------|-------------|
|
|
914
|
+
| Page Size | A4 / US Letter / US Legal |
|
|
915
|
+
| Orientation | Portrait / Landscape |
|
|
916
|
+
| Body Margins | Top, right, bottom, left in mm |
|
|
917
|
+
| Header | Enable, height (mm), inner margins (mm) |
|
|
918
|
+
| Footer | Enable, height (mm), inner margins (mm), page numbers, alignment, format |
|
|
919
|
+
| Watermark | Enable, text, font size, angle, opacity, color |
|
|
920
|
+
| Test Data | JSON object injected as print data when using Test Print |
|
|
921
|
+
|
|
922
|
+
### Page numbering format
|
|
923
|
+
|
|
924
|
+
Use `{page}` and `{pages}` tokens in the **Format** field:
|
|
925
|
+
|
|
926
|
+
```
|
|
927
|
+
Page {page} of {pages} → Page 1 of 4
|
|
928
|
+
{page} / {pages} → 1 / 4
|
|
929
|
+
```
|
|
930
|
+
|
|
931
|
+
### Watermark
|
|
932
|
+
|
|
933
|
+
The watermark renders as a `position: fixed` element in print CSS so it repeats on every physical page. It is always on top of content and does not interfere with layout flow.
|
|
934
|
+
|
|
935
|
+
### Triggering print from a view
|
|
936
|
+
|
|
937
|
+
```js
|
|
938
|
+
// In any action code (button, row action, etc.):
|
|
939
|
+
openPrintLayout('your-layout-id', {
|
|
940
|
+
// data object — available as `data.*` inside the print layout
|
|
941
|
+
invoiceNumber: data.invoiceNumber,
|
|
942
|
+
customerName: data.customer.name,
|
|
943
|
+
lines: data.lines,
|
|
944
|
+
})
|
|
945
|
+
```
|
|
946
|
+
|
|
947
|
+
### DataTableViewer component
|
|
948
|
+
|
|
949
|
+
A print-optimised table component that renders a flat array as a plain HTML table — no AG Grid, no API fetch. Ideal for embedding tabular data in a print layout.
|
|
950
|
+
|
|
951
|
+
**Inspector — Main tab**
|
|
952
|
+
|
|
953
|
+
| Field | Description |
|
|
954
|
+
|-------|-------------|
|
|
955
|
+
| `Data Key` | Key in the print data object holding the rows array |
|
|
956
|
+
| `Columns` | Column definitions — each has a **Header Label** and a **Data Field** name |
|
|
957
|
+
| `Test Data (JSON)` | Static rows shown when no live data is present (for preview / Test Print) |
|
|
958
|
+
| `Font Size` | Table font size in px (default 12) |
|
|
959
|
+
| `Header Background` | Header row background color (default `#f0f0f0`) |
|
|
960
|
+
| `Striped Rows` | Alternate row shading |
|
|
961
|
+
| `Bordered` | Show cell borders (default on) |
|
|
962
|
+
|
|
963
|
+
### Known limitations / pending work
|
|
964
|
+
|
|
965
|
+
- Print portal timing is sensitive: the dialog closes before `window.print()` fires; a 350 ms delay is used. This may fail on slow machines.
|
|
966
|
+
- ReportViewer in print context fetches all data (NoPagination) but column mapping depends on `selectFields` being present in the model — layouts may show empty columns if the report model lacks explicit field selection.
|
|
967
|
+
- Zone switching (clicking header/body/footer to open Inspector) has an edge case where `selectedId` may not update if the schema update and `setSelectedId` race.
|
|
968
|
+
- Page number counter (`counter(page)` / `counter(pages)`) is CSS-only and may not render in all browsers when using the table-based layout strategy.
|
|
969
|
+
- Ctrl+P support (without clicking the Print button) is functional but depends on the print CSS being injected at the right time; test this in your target browser.
|
|
970
|
+
|
|
971
|
+
---
|
|
972
|
+
|
|
973
|
+
## 19. Calculation Scope Reference
|
|
974
|
+
|
|
975
|
+
Every Calculation function — whether in a button action, row action, KPI event, field `onChange`, or expression — receives the same set of variables. This is the full reference.
|
|
976
|
+
|
|
977
|
+
### Core state
|
|
978
|
+
|
|
979
|
+
| Variable | Type | Description |
|
|
980
|
+
|---|---|---|
|
|
981
|
+
| `form` | object | Form field values (read-only snapshot) |
|
|
982
|
+
| `data` | object | Reactive page state — reads reflect the most recent `setData` call within the same execution |
|
|
983
|
+
| `setData` | function | Write page state — `setData(prev => ({ ...prev, key: value }))` or `setData({ ... })` |
|
|
984
|
+
| `dataRef` | object | Mutable non-reactive store — reads and writes don't trigger a re-render |
|
|
985
|
+
| `reportRefs` | object | Map of `{ [key]: ref }` for every Data Grid / Excel Upload on the page |
|
|
986
|
+
|
|
987
|
+
### Dialog / layout
|
|
988
|
+
|
|
989
|
+
| Variable | Type | Description |
|
|
990
|
+
|---|---|---|
|
|
991
|
+
| `openDialog` | function | `openDialog(key, data?)` — open a dialog, optionally seeding its isolated state |
|
|
992
|
+
| `closeDialog` | function | `closeDialog(key)` — close a dialog |
|
|
993
|
+
| `openPrintLayout` | function | `openPrintLayout(layoutId, data?)` — open the print preview for a layout |
|
|
994
|
+
| `closePrintLayout` | function | Close the active print preview |
|
|
995
|
+
|
|
996
|
+
### Parent page scope (inside dialogs / embedded views)
|
|
997
|
+
|
|
998
|
+
| Variable | Type | Description |
|
|
999
|
+
|---|---|---|
|
|
1000
|
+
| `page.data` | object | Parent page's reactive state |
|
|
1001
|
+
| `page.setData` | function | Write to the parent page's state |
|
|
1002
|
+
| `page.dataRef` | object | Parent page's non-reactive store |
|
|
1003
|
+
| `page.reportRefs` | object | Parent page's grid refs |
|
|
1004
|
+
|
|
1005
|
+
### Navigation & routing
|
|
1006
|
+
|
|
1007
|
+
| Variable | Type | Description |
|
|
1008
|
+
|---|---|---|
|
|
1009
|
+
| `router` | NextRouter | Next.js router — `router.push('/path')`, `router.replace(...)`, `router.back()`, `router.query` |
|
|
1010
|
+
| `urlParams` | object | `{ query, pathname, asPath }` — snapshot of the current URL, computed at execution time |
|
|
1011
|
+
|
|
1012
|
+
### Global store
|
|
1013
|
+
|
|
1014
|
+
| Variable | Type | Description |
|
|
1015
|
+
|---|---|---|
|
|
1016
|
+
| `globalData` | object | Cross-route global state (read) — persists across client-side navigations |
|
|
1017
|
+
| `setGlobalData` | function | Write global state — `setGlobalData(prev => ({ ...prev, key: value }))` — shallow-merges by default |
|
|
1018
|
+
|
|
1019
|
+
### Services
|
|
1020
|
+
|
|
1021
|
+
| Variable | Type | Description |
|
|
1022
|
+
|---|---|---|
|
|
1023
|
+
| `GetService` | function | Authenticated GET |
|
|
1024
|
+
| `PostService` | function | Authenticated POST |
|
|
1025
|
+
| `UpdateService` | function | Authenticated PUT |
|
|
1026
|
+
| `PatchService` | function | Authenticated PATCH |
|
|
1027
|
+
| `DeleteService` | function | Authenticated DELETE |
|
|
1028
|
+
| `fetchReportData` | function | Fetch report data by `pageId` (see §8) |
|
|
1029
|
+
|
|
1030
|
+
### Helpers
|
|
1031
|
+
|
|
1032
|
+
| Variable | Type | Description |
|
|
1033
|
+
|---|---|---|
|
|
1034
|
+
| `showToast` | function | `showToast(message, type?)` — `'success' \| 'error' \| 'warning' \| 'info' \| 'loading'` |
|
|
1035
|
+
|
|
1036
|
+
### Repeater-only
|
|
1037
|
+
|
|
1038
|
+
| Variable | Type | Description |
|
|
1039
|
+
|---|---|---|
|
|
1040
|
+
| `dataItem` | object | The current repeated item (null outside a Repeater) |
|
|
1041
|
+
| `itemIndex` | number | The current iteration index — 0-based (null outside a Repeater) |
|
|
1042
|
+
|
|
1043
|
+
### KPI event extras
|
|
1044
|
+
|
|
1045
|
+
Click-context variables (e.g. `clickedItem`, `clickedValue`) are available as bare names in KPI event actions. See §20 for the full list per event.
|
|
1046
|
+
|
|
1047
|
+
---
|
|
1048
|
+
|
|
1049
|
+
## 20. KPI Component Actions
|
|
1050
|
+
|
|
1051
|
+
KPI components support user-interaction events. Each event has a dedicated **Action** field in the inspector (Main tab → Actions section). The editor is a slide-up code panel identical to the column function editor, with a helper popover listing all available variables including the click-context extras injected for that specific event.
|
|
1052
|
+
|
|
1053
|
+
### Supported components and events
|
|
1054
|
+
|
|
1055
|
+
| Component | Event | Trigger |
|
|
1056
|
+
|---|---|---|
|
|
1057
|
+
| **Metric** | `onClick` | User clicks the metric card |
|
|
1058
|
+
| **Rating** | `onChange` | User clicks a star |
|
|
1059
|
+
| **Chart** | `onDataClick` | User clicks a data point or bar segment |
|
|
1060
|
+
| **HeatmapGrid** | `onCellClick` | User clicks a heatmap cell |
|
|
1061
|
+
| **Timeline** | `onItemClick` | User clicks a timeline item |
|
|
1062
|
+
| **StepStage** | `onStepClick` | User clicks a step dot or label |
|
|
1063
|
+
| **TagList** | `onTagClick` | User clicks a tag chip |
|
|
1064
|
+
|
|
1065
|
+
### Click-context variables per event
|
|
1066
|
+
|
|
1067
|
+
Each event injects additional bare-name variables into the Calculation scope on top of the standard ones (§19).
|
|
1068
|
+
|
|
1069
|
+
**Metric — `onClick`**
|
|
1070
|
+
|
|
1071
|
+
| Variable | Description |
|
|
1072
|
+
|---|---|
|
|
1073
|
+
| `clickedValue` | The metric's current display value |
|
|
1074
|
+
|
|
1075
|
+
**Rating — `onChange`**
|
|
1076
|
+
|
|
1077
|
+
| Variable | Description |
|
|
1078
|
+
|---|---|
|
|
1079
|
+
| `newValue` | The rating value the user clicked (1–max) |
|
|
1080
|
+
| `clickedValue` | Same as `newValue` |
|
|
1081
|
+
|
|
1082
|
+
**Chart — `onDataClick`**
|
|
1083
|
+
|
|
1084
|
+
| Variable | Description |
|
|
1085
|
+
|---|---|
|
|
1086
|
+
| `clickedItem` | The full data row object that was clicked |
|
|
1087
|
+
| `clickedValue` | The numeric value of the clicked point |
|
|
1088
|
+
| `clickedField` | The field name (data key) of the series |
|
|
1089
|
+
| `clickedLabel` | The x-axis label of the clicked point |
|
|
1090
|
+
| `clickedIndex` | Index of the point in the data array |
|
|
1091
|
+
|
|
1092
|
+
**HeatmapGrid — `onCellClick`**
|
|
1093
|
+
|
|
1094
|
+
| Variable | Description |
|
|
1095
|
+
|---|---|
|
|
1096
|
+
| `clickedItem` | The full data row object |
|
|
1097
|
+
| `clickedValue` | The value in the clicked cell |
|
|
1098
|
+
| `clickedLabel` | Formatted label of the cell value |
|
|
1099
|
+
| `clickedRow` | The row label |
|
|
1100
|
+
| `clickedCol` | The column label |
|
|
1101
|
+
| `clickedRowIndex` | Row index |
|
|
1102
|
+
| `clickedColIndex` | Column index |
|
|
1103
|
+
|
|
1104
|
+
**Timeline — `onItemClick`**
|
|
1105
|
+
|
|
1106
|
+
| Variable | Description |
|
|
1107
|
+
|---|---|
|
|
1108
|
+
| `clickedItem` | The full timeline item object |
|
|
1109
|
+
| `clickedIndex` | Index of the item in the timeline array |
|
|
1110
|
+
| `clickedLabel` | The item's label field value |
|
|
1111
|
+
| `clickedStatus` | The item's status field value |
|
|
1112
|
+
| `clickedValue` | The item's value field value (if configured) |
|
|
1113
|
+
|
|
1114
|
+
**StepStage — `onStepClick`**
|
|
1115
|
+
|
|
1116
|
+
| Variable | Description |
|
|
1117
|
+
|---|---|
|
|
1118
|
+
| `clickedItem` | The full step object |
|
|
1119
|
+
| `clickedIndex` | Index of the step |
|
|
1120
|
+
| `clickedId` | The step's `id` field value |
|
|
1121
|
+
| `clickedLabel` | The step's label field value |
|
|
1122
|
+
| `clickedStatus` | The step's status field value |
|
|
1123
|
+
|
|
1124
|
+
**TagList — `onTagClick`**
|
|
1125
|
+
|
|
1126
|
+
| Variable | Description |
|
|
1127
|
+
|---|---|
|
|
1128
|
+
| `clickedItem` | The full tag item object |
|
|
1129
|
+
| `clickedTag` | The raw tag value |
|
|
1130
|
+
| `clickedLabel` | Resolved display label |
|
|
1131
|
+
| `clickedValue` | The tag's value field (if configured) |
|
|
1132
|
+
| `clickedIndex` | Index of the tag in the array |
|
|
1133
|
+
|
|
1134
|
+
### Example — open a dialog with clicked data
|
|
1135
|
+
|
|
1136
|
+
```js
|
|
1137
|
+
// Chart onDataClick — open a detail dialog seeded with the clicked row
|
|
1138
|
+
async function Calculation(form, data, setData, dataRef, reportRefs, openDialog, closeDialog, ...) {
|
|
1139
|
+
openDialog('chartDetail', {
|
|
1140
|
+
selectedItem: clickedItem,
|
|
1141
|
+
selectedValue: clickedValue,
|
|
1142
|
+
})
|
|
1143
|
+
}
|
|
1144
|
+
```
|
|
1145
|
+
|
|
1146
|
+
### Example — navigate using the router
|
|
1147
|
+
|
|
1148
|
+
```js
|
|
1149
|
+
// Metric onClick — push to a detail page
|
|
1150
|
+
async function Calculation(..., urlParams, page) {
|
|
1151
|
+
router.push(`/detail/${data.selectedId}`)
|
|
1152
|
+
}
|
|
1153
|
+
```
|
|
1154
|
+
|
|
1155
|
+
### Example — update global state on step click
|
|
1156
|
+
|
|
1157
|
+
```js
|
|
1158
|
+
// StepStage onStepClick — store the active step globally so another page can read it
|
|
1159
|
+
async function Calculation(...) {
|
|
1160
|
+
setGlobalData(prev => ({ ...prev, activeStep: clickedId, activeStepIndex: clickedIndex }))
|
|
1161
|
+
}
|
|
1162
|
+
```
|
|
1163
|
+
|
|
1164
|
+
---
|
|
1165
|
+
|
|
1166
|
+
## 21. Global Data Store
|
|
1167
|
+
|
|
1168
|
+
The global store is a module-level reactive singleton that survives client-side navigations. It is the recommended way to pass data between routes without URL params or server round-trips.
|
|
1169
|
+
|
|
1170
|
+
### In Calculation functions (action code)
|
|
1171
|
+
|
|
1172
|
+
`globalData` and `setGlobalData` are always in scope — no import needed:
|
|
1173
|
+
|
|
1174
|
+
```js
|
|
1175
|
+
async function Calculation(form, data, setData, ...) {
|
|
1176
|
+
// Read
|
|
1177
|
+
console.log(globalData.selectedUser)
|
|
1178
|
+
|
|
1179
|
+
// Write — shallow-merges with previous state
|
|
1180
|
+
setGlobalData(prev => ({ ...prev, selectedUser: clickedItem }))
|
|
1181
|
+
setGlobalData({ theme: 'dark', locale: 'en' }) // full replace also works
|
|
1182
|
+
|
|
1183
|
+
// Navigate — globalData.selectedUser is still there on the next page
|
|
1184
|
+
router.push('/user-detail')
|
|
1185
|
+
}
|
|
1186
|
+
```
|
|
1187
|
+
|
|
1188
|
+
### In React components
|
|
1189
|
+
|
|
1190
|
+
```jsx
|
|
1191
|
+
import { useGlobalStore } from 'robobyte-front-builder'
|
|
1192
|
+
|
|
1193
|
+
function MyComponent() {
|
|
1194
|
+
const { globalData, setGlobalData } = useGlobalStore()
|
|
1195
|
+
|
|
1196
|
+
return (
|
|
1197
|
+
<div>
|
|
1198
|
+
<p>Selected: {globalData.selectedUser?.name}</p>
|
|
1199
|
+
<button onClick={() => setGlobalData({ selectedUser: null })}>Clear</button>
|
|
1200
|
+
</div>
|
|
1201
|
+
)
|
|
1202
|
+
}
|
|
1203
|
+
```
|
|
1204
|
+
|
|
1205
|
+
Components that call `useGlobalStore()` re-render whenever any part of `globalData` changes — whether the update came from another component, a Calculation function, or any other source.
|
|
1206
|
+
|
|
1207
|
+
### Resetting on logout
|
|
1208
|
+
|
|
1209
|
+
Call `resetGlobalData()` when the user logs out to prevent stale data leaking between sessions:
|
|
1210
|
+
|
|
1211
|
+
```js
|
|
1212
|
+
import { resetGlobalData } from 'robobyte-front-builder'
|
|
1213
|
+
|
|
1214
|
+
function handleLogout() {
|
|
1215
|
+
resetGlobalData()
|
|
1216
|
+
// ... your auth logout
|
|
1217
|
+
}
|
|
1218
|
+
```
|
|
1219
|
+
|
|
1220
|
+
### API
|
|
1221
|
+
|
|
1222
|
+
| Export | Description |
|
|
1223
|
+
|---|---|
|
|
1224
|
+
| `useGlobalStore()` | React hook — returns `{ globalData, setGlobalData }`. Component re-renders on any change. |
|
|
1225
|
+
| `getGlobalData()` | Synchronous read from non-React code (returns current snapshot) |
|
|
1226
|
+
| `setGlobalData(updater)` | Write from anywhere — accepts a plain object (shallow-merged) or an updater function |
|
|
1227
|
+
| `subscribeGlobal(fn)` | Subscribe to changes — returns an unsubscribe function for `useEffect` cleanup |
|
|
1228
|
+
| `resetGlobalData()` | Reset to `{}` and notify all subscribers |
|
|
1229
|
+
|
|
1230
|
+
---
|
|
1231
|
+
|
|
1232
|
+
## 22. Troubleshooting
|
|
1233
|
+
|
|
1234
|
+
**"Module not found: Can't resolve 'xlsx'"**
|
|
1235
|
+
→ Install `xlsx` in the host app: `npm install xlsx --legacy-peer-deps`. The Excel Upload component imports it at runtime and webpack resolves it from the host's `node_modules`.
|
|
1236
|
+
|
|
1237
|
+
**"Cannot find module 'services/...'"**
|
|
1238
|
+
→ Ensure the `NormalModuleReplacementPlugin` is configured in `next.config.js` (§4).
|
|
1239
|
+
|
|
1240
|
+
**"Module not found: Can't resolve 'pages/builders/...'"**
|
|
1241
|
+
→ Add `pages` to the alias regex in the webpack plugin and ensure the `pages/*`
|
|
1242
|
+
path resolves to `builderSrc/pages/*` for package files.
|
|
1243
|
+
|
|
1244
|
+
**AG Grid table not showing / license warning**
|
|
1245
|
+
→ Pass `agGridLicenseKey` to `RoboByteFrontBuilderProvider`. Do not call
|
|
1246
|
+
`LicenseManager` or `ModuleRegistry` in the host app.
|
|
1247
|
+
|
|
1248
|
+
**AG Grid error #200 — IntegratedChartsModule not registered**
|
|
1249
|
+
→ The provider registers `IntegratedChartsModule.with(AgChartsEnterpriseModule)`
|
|
1250
|
+
automatically. Ensure `ag-charts-enterprise` is installed in the package.
|
|
1251
|
+
|
|
1252
|
+
**ReportViewer renders at half width**
|
|
1253
|
+
→ The outer `Box` in `reportViewer/index.js` must use `display: 'block'`, not
|
|
1254
|
+
`display: 'flex'`.
|
|
1255
|
+
|
|
1256
|
+
**Old routes return 404 instead of the builder**
|
|
1257
|
+
→ Check that host-app pages exist under `/builders/...` and that the old paths
|
|
1258
|
+
have `getServerSideProps = () => ({ notFound: true })` stubs.
|
|
1259
|
+
|
|
1260
|
+
**Static props (`getLayout`, `acl`) not picked up from package exports**
|
|
1261
|
+
→ Use the explicit import + assignment pattern (§6). Bare `export { X as default }`
|
|
1262
|
+
does not carry static properties across package boundaries.
|
|
1263
|
+
|
|
1264
|
+
**Duplicate React / MUI hook errors**
|
|
1265
|
+
→ Pin `react`, `react-dom`, and `@mui/material` to the host app's copies via
|
|
1266
|
+
`config.resolve.alias` in `next.config.js`.
|
|
1267
|
+
|
|
1268
|
+
---
|
|
1269
|
+
|
|
1270
|
+
## 23. Layout Grid component
|
|
1271
|
+
|
|
1272
|
+
The `layout` / `layout-cell` pair provides a **CSS Grid** container whose column count, gap, and per-cell styling are configured entirely inside the builder inspector — no hand-written CSS required.
|
|
1273
|
+
|
|
1274
|
+
### How it works
|
|
1275
|
+
|
|
1276
|
+
Drop a **Layout Grid** onto the canvas. The builder auto-initialises it with a 2×2 grid of `layout-cell` children. You can add more cells from the sidebar or adjust the column count in the inspector; cells reflow automatically. Each `layout-cell` is an independent drop-zone that accepts any component.
|
|
1277
|
+
|
|
1278
|
+
### Inspector props — Layout Grid (`layout`)
|
|
1279
|
+
|
|
1280
|
+
| Prop | Type | Default | Description |
|
|
1281
|
+
|------|------|---------|-------------|
|
|
1282
|
+
| `cols` | number | `2` | Number of equal-width columns. |
|
|
1283
|
+
| `gap` | number px | `8` | Column gap between cells. |
|
|
1284
|
+
| `rowGap` | number px | same as `gap` | Row gap — defaults to `gap` when not set. |
|
|
1285
|
+
| `cellMinHeight` | number/string | — | Applied to every cell as a grid-level default. |
|
|
1286
|
+
| `cellPadding` | number/string | — | Inner padding for every cell. |
|
|
1287
|
+
| `cellBackgroundColor` | color | — | Background color applied to every cell. |
|
|
1288
|
+
| `cellBorder` | string | — | CSS border shorthand applied to every cell (e.g. `1px solid #ccc`). |
|
|
1289
|
+
| `cellBorderRadius` | number/string | — | Border radius applied to every cell. |
|
|
1290
|
+
| `cellBoxShadow` | string | — | Box-shadow applied to every cell. |
|
|
1291
|
+
| `cellJustifyContent` | string | — | Flexbox `justify-content` inside every cell. |
|
|
1292
|
+
| `cellAlignItems` | string | — | Flexbox `align-items` inside every cell. |
|
|
1293
|
+
| `cellElementStyle` | object | — | Extra React style object merged last (overrides the above). |
|
|
1294
|
+
| `cellElementCss` | string | — | Extra CSS string merged last (overrides the above). |
|
|
1295
|
+
|
|
1296
|
+
Individual cells can override any of the above via their own **Style** tab in the inspector.
|
|
1297
|
+
|
|
1298
|
+
### Schema example
|
|
1299
|
+
|
|
1300
|
+
```json
|
|
1301
|
+
{
|
|
1302
|
+
"type": "layout",
|
|
1303
|
+
"props": {
|
|
1304
|
+
"main": {
|
|
1305
|
+
"cols": { "valueType": "value", "value": 3 },
|
|
1306
|
+
"gap": { "valueType": "value", "value": 16 }
|
|
1307
|
+
}
|
|
1308
|
+
},
|
|
1309
|
+
"children": [
|
|
1310
|
+
{ "type": "layout-cell", "props": {}, "children": [] },
|
|
1311
|
+
{ "type": "layout-cell", "props": {}, "children": [] },
|
|
1312
|
+
{ "type": "layout-cell", "props": {}, "children": [] }
|
|
1313
|
+
]
|
|
1314
|
+
}
|
|
1315
|
+
```
|
|
1316
|
+
|
|
1317
|
+
---
|
|
1318
|
+
|
|
1319
|
+
## 24. Wizard component
|
|
1320
|
+
|
|
1321
|
+
The `wizard` / `wizard-step` pair renders a **MUI Stepper** with optional validation, async lifecycle hooks, and controlled or uncontrolled step state. Drop a **Wizard** onto the canvas; each direct `wizard-step` child becomes one step.
|
|
1322
|
+
|
|
1323
|
+
### Inspector props — Wizard (`wizard`)
|
|
1324
|
+
|
|
1325
|
+
| Prop | Type | Default | Description |
|
|
1326
|
+
|------|------|---------|-------------|
|
|
1327
|
+
| `orientation` | `'horizontal'` \| `'vertical'` | `'horizontal'` | Stepper orientation. |
|
|
1328
|
+
| `variant` | `'alternativeLabel'` \| — | — | MUI alternativeLabel layout (label below icon). |
|
|
1329
|
+
| `linear` | boolean | `true` | When `true` the user cannot skip ahead. |
|
|
1330
|
+
| `hideNavigation` | boolean | `false` | Hide the Back / Next / Finish button row. |
|
|
1331
|
+
| `key` | string | `'wizardStep'` | `data` key written with the current step index when controlled mode is active. |
|
|
1332
|
+
| `activeStep` | number \| expression | — | When set, the wizard is **controlled** — step state is driven by `data[key]`. |
|
|
1333
|
+
| `backLabel` | string | `'Back'` | Label for the Back button. |
|
|
1334
|
+
| `nextLabel` | string | `'Next'` | Label for the Next button. |
|
|
1335
|
+
| `finishLabel` | string | `'Finish'` | Label for the Finish button. |
|
|
1336
|
+
| `nextColor` | MUI color | `'primary'` | Color of the Next/Finish button. |
|
|
1337
|
+
| `nextVariant` | string | `'contained'` | Variant of the Next/Finish button. |
|
|
1338
|
+
| `backColor` | MUI color | `'inherit'` | Color of the Back button. |
|
|
1339
|
+
| `backVariant` | string | `'text'` | Variant of the Back button. |
|
|
1340
|
+
| `onStepChange` | JS action | — | Runs on every step transition. Receives `{ from, to, direction, goToStep, nextStep, prevStep }`. |
|
|
1341
|
+
| `onFinish` | JS action | — | Runs when the user clicks Finish on the last step. Receives `{ goToStep, nextStep, prevStep }`. |
|
|
1342
|
+
|
|
1343
|
+
### Inspector props — Wizard Step (`wizard-step`)
|
|
1344
|
+
|
|
1345
|
+
| Prop | Type | Description |
|
|
1346
|
+
|------|------|-------------|
|
|
1347
|
+
| `label` | string | Step label shown in the stepper header. |
|
|
1348
|
+
| `optional` | boolean | Marks the step as optional (shows "Optional" sub-label). |
|
|
1349
|
+
| `onEnter` | JS action | Fires when this step becomes active. Receives `{ stepIndex, goToStep, nextStep, prevStep }`. |
|
|
1350
|
+
| `onNext` | JS action | Fires when the user clicks Next/Finish **from** this step. Return `false` to block navigation (validation). Receives `{ stepIndex, goToStep, nextStep, prevStep }`. |
|
|
1351
|
+
|
|
1352
|
+
### Navigation helpers available in all wizard JS actions
|
|
1353
|
+
|
|
1354
|
+
```js
|
|
1355
|
+
goToStep(n) // jump to step n (0-based)
|
|
1356
|
+
nextStep() // advance one step
|
|
1357
|
+
prevStep() // go back one step
|
|
1358
|
+
```
|
|
1359
|
+
|
|
1360
|
+
### Controlled mode example
|
|
1361
|
+
|
|
1362
|
+
Set `activeStep` to an expression `data.currentStep` and `key` to `"currentStep"`. The wizard will now read and write `data.currentStep` instead of keeping its own internal state — useful when the host app needs to save progress.
|
|
1363
|
+
|
|
1364
|
+
---
|
|
1365
|
+
|
|
1366
|
+
## 25. Repeater component
|
|
1367
|
+
|
|
1368
|
+
The `Repeater` renders a list of identical template items from a static array, a dynamic count, or a fetched API endpoint. It supports three iteration modes and automatically scopes each item's form state so inputs inside the Repeater don't share values.
|
|
1369
|
+
|
|
1370
|
+
### Iteration modes
|
|
1371
|
+
|
|
1372
|
+
| Mode | How to configure | When to use |
|
|
1373
|
+
|------|-----------------|-------------|
|
|
1374
|
+
| **Static items** | Set `items` to a static or expression array | Known, enumerable values |
|
|
1375
|
+
| **Count** | Set `count` to a number; optionally `dataKey` to store values | Dynamic N-row form arrays |
|
|
1376
|
+
| **Endpoint / Widget** | Set `endpoint` + `serviceId` or `widgetId` | Server-fetched lists |
|
|
1377
|
+
|
|
1378
|
+
### Inspector props
|
|
1379
|
+
|
|
1380
|
+
| Prop | Type | Default | Description |
|
|
1381
|
+
|------|------|---------|-------------|
|
|
1382
|
+
| `items` | array \| expression | — | Static item array. Each element is available as `dataItem` inside children. |
|
|
1383
|
+
| `count` | number \| expression | — | Number of slots to render (used when `items` is empty). |
|
|
1384
|
+
| `dataKey` | string | — | `data` key where per-item values are stored (`data[dataKey][index]`). Enables full scoping — form inputs write to `data[dataKey][index][fieldKey]`. |
|
|
1385
|
+
| `direction` | `'vertical'` \| `'horizontal'` \| `'wrap'` | `'vertical'` | Flex direction of the item list. |
|
|
1386
|
+
| `gap` | number | `1` | Gap between items (MUI spacing units). |
|
|
1387
|
+
| `endpoint` | string | — | API endpoint ID to fetch items from (used with `serviceId`). |
|
|
1388
|
+
| `serviceId` | string | — | Service ID that owns the endpoint. |
|
|
1389
|
+
| `widgetId` | string | — | ID of a saved Widget to use as the item template instead of inline children. |
|
|
1390
|
+
|
|
1391
|
+
### Expressions inside a Repeater
|
|
1392
|
+
|
|
1393
|
+
Inside a Repeater's children the following variables are injected into every expression context:
|
|
1394
|
+
|
|
1395
|
+
| Variable | Value |
|
|
1396
|
+
|----------|-------|
|
|
1397
|
+
| `dataItem` | The current array element |
|
|
1398
|
+
| `itemIndex` | Zero-based item index |
|
|
1399
|
+
| `form[key]` | The current item's scoped form value for `key` |
|
|
1400
|
+
|
|
1401
|
+
### Form-array pattern
|
|
1402
|
+
|
|
1403
|
+
```json
|
|
1404
|
+
{
|
|
1405
|
+
"type": "repeater",
|
|
1406
|
+
"props": {
|
|
1407
|
+
"main": {
|
|
1408
|
+
"count": { "valueType": "value", "value": 3 },
|
|
1409
|
+
"dataKey": { "valueType": "value", "value": "contacts" },
|
|
1410
|
+
"direction": { "valueType": "value", "value": "vertical" }
|
|
1411
|
+
}
|
|
1412
|
+
},
|
|
1413
|
+
"children": [
|
|
1414
|
+
{ "type": "input", "props": { "main": { "key": { "valueType": "value", "value": "name" }, "label": { "valueType": "value", "value": "Name" } } }, "children": [] }
|
|
1415
|
+
]
|
|
1416
|
+
}
|
|
1417
|
+
```
|
|
1418
|
+
|
|
1419
|
+
After filling in 3 rows the submitted `data` will contain:
|
|
1420
|
+
|
|
1421
|
+
```json
|
|
1422
|
+
{ "contacts": [{ "name": "Alice" }, { "name": "Bob" }, { "name": "Carol" }] }
|
|
1423
|
+
```
|
|
1424
|
+
|
|
1425
|
+
---
|
|
1426
|
+
|
|
1427
|
+
## 26. Menu component
|
|
1428
|
+
|
|
1429
|
+
The `menu` component renders a **MUI Tabs** bar that can operate in two modes: **navigation mode** (items-based, each tab is a link/action with no drop zone) and **tab-panel mode** (tabs-based, each tab owns a drop zone for child components).
|
|
1430
|
+
|
|
1431
|
+
### Mode comparison
|
|
1432
|
+
|
|
1433
|
+
| Feature | Navigation mode | Tab-panel mode |
|
|
1434
|
+
|---------|----------------|----------------|
|
|
1435
|
+
| Config prop | `items` array | `tabs` array |
|
|
1436
|
+
| Children | None | One drop zone per tab |
|
|
1437
|
+
| Typical use | App-level routing tabs, wizard menus | Sectioned forms, content panels |
|
|
1438
|
+
|
|
1439
|
+
### Inspector props
|
|
1440
|
+
|
|
1441
|
+
| Prop | Type | Default | Description |
|
|
1442
|
+
|------|------|---------|-------------|
|
|
1443
|
+
| `items` | array | `[]` | Navigation items. Each item: `{ title, icon?, iconPosition?, disabled?, href? }`. Setting this enables navigation mode. |
|
|
1444
|
+
| `tabs` | array | `[]` | Tab panel items. Each tab: `{ label, icon?, iconPosition?, disabled? }`. Setting this enables tab-panel mode. |
|
|
1445
|
+
| `activeKey` | string | first item title | Active tab key (navigation mode). |
|
|
1446
|
+
| `vertical` | boolean | `false` | Render tabs vertically. |
|
|
1447
|
+
| `justified` | boolean | `false` | Stretch tabs to fill the full width (`fullWidth` variant). |
|
|
1448
|
+
| `reversed` | boolean | `false` | Reverse the order of navigation items. |
|
|
1449
|
+
|
|
1450
|
+
### Tab-panel mode example
|
|
1451
|
+
|
|
1452
|
+
```json
|
|
1453
|
+
{
|
|
1454
|
+
"type": "menu",
|
|
1455
|
+
"props": {
|
|
1456
|
+
"main": {
|
|
1457
|
+
"tabs": {
|
|
1458
|
+
"valueType": "value",
|
|
1459
|
+
"value": [
|
|
1460
|
+
{ "label": "General" },
|
|
1461
|
+
{ "label": "Advanced" },
|
|
1462
|
+
{ "label": "Permissions" }
|
|
1463
|
+
]
|
|
1464
|
+
}
|
|
1465
|
+
}
|
|
1466
|
+
},
|
|
1467
|
+
"children": [
|
|
1468
|
+
{ "type": "input", "props": {}, "children": [] }
|
|
1469
|
+
]
|
|
1470
|
+
}
|
|
1471
|
+
```
|
|
1472
|
+
|
|
1473
|
+
Children are distributed across tabs in the order they appear. Drag-and-drop in the builder assigns each dropped component to the currently active tab.
|
|
1474
|
+
|
|
1475
|
+
---
|
|
1476
|
+
|
|
1477
|
+
## 27. View Renderer component
|
|
1478
|
+
|
|
1479
|
+
The `viewRenderer` component **embeds a saved builder view inline** inside another view. It fetches the target view's schema at runtime and renders it as a fully functional sub-page. This is useful for shared sub-forms, reusable panels, and composition patterns.
|
|
1480
|
+
|
|
1481
|
+
### Inspector props
|
|
1482
|
+
|
|
1483
|
+
| Prop | Type | Default | Description |
|
|
1484
|
+
|------|------|---------|-------------|
|
|
1485
|
+
| `viewId` | string | — | **Required.** ID of the saved view to embed. |
|
|
1486
|
+
| `isolated` | boolean | `true` | When `true` the embedded view gets its own `data`/`form`/`ref` stores. When `false` it shares the parent page's state (useful for sub-forms where field values should appear in the parent `data` object). |
|
|
1487
|
+
| `initialData` | expression | — | Seed data passed into the child view on mount (isolated mode only). Re-evaluated reactively — a new seed resets child state. |
|
|
1488
|
+
| `externalData` | expression | — | Additional data merged into child state on every parent re-render without resetting existing child state (isolated mode only). |
|
|
1489
|
+
| `heightMode` | `'auto'` \| `'fixed'` | `'auto'` | `'fixed'` enables an explicit pixel height with scroll. |
|
|
1490
|
+
| `height` | number | `400` | Pixel height when `heightMode` is `'fixed'`. |
|
|
1491
|
+
|
|
1492
|
+
### State isolation
|
|
1493
|
+
|
|
1494
|
+
```
|
|
1495
|
+
isolated = true (default)
|
|
1496
|
+
Child view: own data, own form, own refs
|
|
1497
|
+
Parent data: unchanged
|
|
1498
|
+
Use when: embeddable widgets, preview panels, independent sub-pages
|
|
1499
|
+
|
|
1500
|
+
isolated = false
|
|
1501
|
+
Child view: shares parent setData / data / form
|
|
1502
|
+
All field keys from the child view appear in the parent's data object
|
|
1503
|
+
Use when: large form split across multiple saved views
|
|
1504
|
+
```
|
|
1505
|
+
|
|
1506
|
+
### onLoad actions
|
|
1507
|
+
|
|
1508
|
+
If the embedded view schema has `actions` with an `onLoad` event, those actions fire automatically when the schema is resolved — using the child's own data/form context when isolated, or the parent's when shared.
|
|
1509
|
+
|
|
1510
|
+
---
|
|
1511
|
+
|
|
1512
|
+
## 28. Container and Card components
|
|
1513
|
+
|
|
1514
|
+
### Container (`container`)
|
|
1515
|
+
|
|
1516
|
+
A basic **flex column** wrapper. Use it to group components, control spacing, and apply shared styling (background colour, border, padding, etc.) via the Style tab. Containers are drop targets and can be nested arbitrarily.
|
|
1517
|
+
|
|
1518
|
+
There are no required inspector props. All visual configuration is done through the Style tab.
|
|
1519
|
+
|
|
1520
|
+
### Card (`card`)
|
|
1521
|
+
|
|
1522
|
+
A **MUI Card** wrapper. Behaves like a Container but renders with a card surface (shadow, rounded corners, optional header/subheader). Use when you need a visually distinct panel grouping components.
|
|
1523
|
+
|
|
1524
|
+
Both `container` and `card` appear in the `CONTAINER_TYPES` set in `builderHelper.js`, so the paste-as-child heuristic applies — pasting a node while a container or card is selected inserts the node as a child rather than a sibling.
|
|
1525
|
+
|
|
1526
|
+
---
|
|
1527
|
+
|
|
1528
|
+
## 29. Breadcrumb component
|
|
1529
|
+
|
|
1530
|
+
The `breadcrumb` component renders a **MUI Breadcrumbs** navigation trail. Items are configured as a static or expression-driven array in the inspector.
|
|
1531
|
+
|
|
1532
|
+
### Inspector props
|
|
1533
|
+
|
|
1534
|
+
| Prop | Type | Description |
|
|
1535
|
+
|------|------|-------------|
|
|
1536
|
+
| `items` | array \| expression | Breadcrumb items. Each item: `{ label, href?, icon? }`. The last item is the current page (non-clickable). |
|
|
1537
|
+
| `separator` | string | Custom separator character (default `/`). |
|
|
1538
|
+
| `maxItems` | number | Maximum number of items before collapsing (MUI default is 8). |
|
|
1539
|
+
|
|
1540
|
+
### Example
|
|
1541
|
+
|
|
1542
|
+
```json
|
|
1543
|
+
{
|
|
1544
|
+
"type": "breadcrumb",
|
|
1545
|
+
"props": {
|
|
1546
|
+
"main": {
|
|
1547
|
+
"items": {
|
|
1548
|
+
"valueType": "value",
|
|
1549
|
+
"value": [
|
|
1550
|
+
{ "label": "Home", "href": "/" },
|
|
1551
|
+
{ "label": "Reports", "href": "/reports" },
|
|
1552
|
+
{ "label": "Q1 2025" }
|
|
1553
|
+
]
|
|
1554
|
+
}
|
|
1555
|
+
}
|
|
1556
|
+
}
|
|
1557
|
+
}
|
|
1558
|
+
```
|
|
1559
|
+
|
|
1560
|
+
---
|
|
1561
|
+
|
|
1562
|
+
## 30. Planned / TODO Components
|
|
1563
|
+
|
|
1564
|
+
The following component types appear in earlier schema drafts or were removed from the catalog because they are not yet fully implemented. They are preserved here as a backlog reference.
|
|
1565
|
+
|
|
1566
|
+
| Component | Type string | Notes |
|
|
1567
|
+
|-----------|-------------|-------|
|
|
1568
|
+
| Calendar | `calendar` | Date/range calendar field. Placeholder only — no renderer or inspector definition. |
|
|
1569
|
+
| Google Map | `google-map` | Embedded map with marker/search support. Requires Maps JS API key integration. |
|
|
1570
|
+
| QR Code | `qrcode` | Barcode/QR generator. Removed from the main catalog; still present in the print catalog as a valid print-time use case. Needs a renderer. |
|
|
1571
|
+
| Tooltip | `tooltip` | Hover tooltip wrapper for arbitrary children. Removed pending a design decision on how it wraps other components in the tree. |
|
|
1572
|
+
|
|
1573
|
+
### Removed (superseded)
|
|
1574
|
+
|
|
1575
|
+
The following structure components were removed because the Layout Grid (`layout` / `layout-cell`) and Data Grid (`data-grid`) cover their use cases with a better UX:
|
|
1576
|
+
|
|
1577
|
+
| Component | Type string | Superseded by |
|
|
1578
|
+
|-----------|-------------|---------------|
|
|
1579
|
+
| Table | `table` | `data-grid` |
|
|
1580
|
+
| Cell | `cell` | `layout-cell` / `data-grid` |
|
|
1581
|
+
| Header Cell | `header-cell` | `data-grid` |
|
|
1582
|
+
| Column Group | `column-group` | `layout` / `data-grid` |
|
|
1583
|
+
| Column | `column` | `layout-cell` / `data-grid` |
|
|
1584
|
+
| Tab | `tab` | `menu` (supports icons, orientation, disabled tabs, per-tab drop zones, and more) |
|
|
1585
|
+
|
|
1586
|
+
The `upload` component was removed in favour of `excel-upload`, which provides Excel-native parsing, column mapping, and AG Grid preview out of the box.
|