forlogic-core 2.1.4 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.note/memory/features/import/attachment-idempotency-registry.md +8 -8
- package/.note/memory/features/import/attachment-strategy.md +30 -30
- package/.note/memory/patterns/admin-i18n-policy.md +20 -20
- package/.note/memory/patterns/alias-url-resolution.md +69 -69
- package/.note/memory/patterns/doc-sync-rule.md +35 -35
- package/.note/memory/patterns/documentation-standard.md +17 -17
- package/.note/memory/patterns/dynamic-supabase-config.md +4 -4
- package/.note/memory/patterns/environment-detection-logic.md +35 -35
- package/.note/memory/patterns/i18n-architecture.md +3 -3
- package/README.md +120 -68
- package/dist/action-plans/components/ActionPlanAttachmentsTab.d.ts +3 -0
- package/dist/action-plans/components/ActionPlanCommentsTab.d.ts +3 -0
- package/dist/action-plans/components/ActionPlanCostTab.d.ts +5 -0
- package/dist/action-plans/components/ActionPlanGeneralTab.d.ts +3 -0
- package/dist/action-plans/components/ActionPlanHistoryTab.d.ts +3 -0
- package/dist/action-plans/components/ActionPlanPredecessorsTab.d.ts +5 -0
- package/dist/action-plans/components/ActionPlanProgressDialog.d.ts +3 -0
- package/dist/action-plans/components/ActionPlanProgressTab.d.ts +5 -0
- package/dist/action-plans/components/ActionPlanStatusBadge.d.ts +9 -2
- package/dist/action-plans/constants.d.ts +24 -0
- package/dist/action-plans/hooks/useActionPlan.d.ts +5 -0
- package/dist/action-plans/hooks/useActionPlanProgress.d.ts +5 -0
- package/dist/action-plans/types.d.ts +60 -0
- package/dist/action-plans/utils/formatTime.d.ts +9 -0
- package/dist/audit-trail/components/AuditTrailDetails.d.ts +10 -0
- package/dist/audit-trail/components/AuditTrailFilter.d.ts +10 -0
- package/dist/audit-trail/components/AuditTrailPage.d.ts +10 -0
- package/dist/audit-trail/types.d.ts +58 -0
- package/dist/audit-trail/utils.d.ts +18 -2
- package/dist/auth/components/EditProfileDialog.d.ts +1 -0
- package/dist/auth/components/ProtectedRoute.d.ts +5 -0
- package/dist/auth/contexts/AuthContext.d.ts +5 -0
- package/dist/auth/pages/CallbackPage.d.ts +5 -0
- package/dist/auth/services/AuthService.d.ts +5 -0
- package/dist/auth/services/TokenManager.d.ts +5 -0
- package/dist/auth/services/TokenService.d.ts +10 -0
- package/dist/auth/utils/ErrorInterceptor.d.ts +5 -0
- package/dist/components/dashboards/dashboard-form.d.ts +15 -0
- package/dist/components/dashboards/dashboard-general-view.d.ts +15 -0
- package/dist/components/dashboards/dashboard-grid.d.ts +25 -0
- package/dist/components/dashboards/dashboard-list.d.ts +10 -0
- package/dist/components/dashboards/dashboard-panel-renderer.d.ts +10 -0
- package/dist/components/dashboards/dashboard-view.d.ts +10 -0
- package/dist/components/dashboards/helpers.d.ts +44 -5
- package/dist/components/dashboards/panels/burndown-panel.d.ts +15 -0
- package/dist/components/dashboards/panels/cartesian-panel.d.ts +20 -0
- package/dist/components/dashboards/panels/list-panel.d.ts +15 -0
- package/dist/components/dashboards/panels/matrix-risk-panel.d.ts +25 -0
- package/dist/components/dashboards/panels/numeric-panel.d.ts +10 -0
- package/dist/components/dashboards/panels/panel-error.d.ts +10 -0
- package/dist/components/dashboards/panels/panel-header.d.ts +10 -0
- package/dist/components/dashboards/panels/panel-loader.d.ts +10 -0
- package/dist/components/dashboards/panels/panel-no-data.d.ts +10 -0
- package/dist/components/dashboards/panels/panel-unavailable.d.ts +10 -0
- package/dist/components/dashboards/panels/pareto-panel.d.ts +10 -0
- package/dist/components/dashboards/panels/performance-panel.d.ts +15 -0
- package/dist/components/dashboards/panels/pie-panel.d.ts +10 -0
- package/dist/components/dashboards/panels/text-panel.d.ts +10 -0
- package/dist/components/dashboards/types.d.ts +230 -0
- package/dist/components/modules/AccessDeniedDialog.d.ts +3 -1
- package/dist/components/modules/ModuleAccessGuard.d.ts +3 -1
- package/dist/components/modules/ModulesContent.d.ts +3 -1
- package/dist/components/modules/ModulesDialog.d.ts +1 -1
- package/dist/components/modules/ModulesFooterCards.d.ts +3 -1
- package/dist/components/modules/types.d.ts +2 -0
- package/dist/components/ui/accordion.d.ts +35 -0
- package/dist/components/ui/action-button.d.ts +5 -0
- package/dist/components/ui/alert-dialog.d.ts +82 -0
- package/dist/components/ui/alert.d.ts +32 -0
- package/dist/components/ui/avatar.d.ts +30 -0
- package/dist/components/ui/badge.d.ts +32 -0
- package/dist/components/ui/breadcrumb.d.ts +54 -0
- package/dist/components/ui/button-group.d.ts +15 -0
- package/dist/components/ui/button.d.ts +55 -0
- package/dist/components/ui/calendar.d.ts +16 -0
- package/dist/components/ui/card.d.ts +49 -0
- package/dist/components/ui/chart.d.ts +35 -0
- package/dist/components/ui/checkbox.d.ts +11 -0
- package/dist/components/ui/collapsible.d.ts +15 -0
- package/dist/components/ui/color-picker.d.ts +5 -0
- package/dist/components/ui/combo-tree.d.ts +23 -0
- package/dist/components/ui/combobox.d.ts +28 -0
- package/dist/components/ui/command.d.ts +66 -0
- package/dist/components/ui/context-menu.d.ts +95 -0
- package/dist/components/ui/date-picker.d.ts +10 -0
- package/dist/components/ui/dialog-wizard.d.ts +22 -4
- package/dist/components/ui/dialog.d.ts +181 -0
- package/dist/components/ui/drawer.d.ts +72 -0
- package/dist/components/ui/dropdown-menu.d.ts +153 -0
- package/dist/components/ui/electronic-signature-dialog.d.ts +10 -0
- package/dist/components/ui/export-dialog.d.ts +20 -0
- package/dist/components/ui/form.d.ts +96 -0
- package/dist/components/ui/hover-card.d.ts +15 -0
- package/dist/components/ui/icon-picker.d.ts +5 -0
- package/dist/components/ui/iframe-dialog.d.ts +10 -0
- package/dist/components/ui/input-group.d.ts +16 -0
- package/dist/components/ui/input.d.ts +5 -0
- package/dist/components/ui/menubar.d.ts +80 -0
- package/dist/components/ui/multiselect-permissions.d.ts +25 -0
- package/dist/components/ui/navigation-menu.d.ts +45 -0
- package/dist/components/ui/onboarding-dialog.d.ts +15 -0
- package/dist/components/ui/online-editor-dialog.d.ts +10 -0
- package/dist/components/ui/pagination.d.ts +53 -0
- package/dist/components/ui/popover.d.ts +8 -0
- package/dist/components/ui/radio-group.d.ts +3 -0
- package/dist/components/ui/report-request-list.d.ts +20 -0
- package/dist/components/ui/resizable.d.ts +15 -0
- package/dist/components/ui/rich-text-editor.d.ts +13 -0
- package/dist/components/ui/scroll-area.d.ts +3 -0
- package/dist/components/ui/select.d.ts +71 -0
- package/dist/components/ui/separator.d.ts +13 -0
- package/dist/components/ui/sheet.d.ts +76 -0
- package/dist/components/ui/sidebar.d.ts +203 -0
- package/dist/components/ui/skeleton-variants.d.ts +25 -0
- package/dist/components/ui/skeleton.d.ts +12 -0
- package/dist/components/ui/slider.d.ts +5 -0
- package/dist/components/ui/sonner.d.ts +5 -0
- package/dist/components/ui/spinner.d.ts +5 -0
- package/dist/components/ui/split-button.d.ts +6 -0
- package/dist/components/ui/stack.d.ts +5 -0
- package/dist/components/ui/status-badge.d.ts +52 -0
- package/dist/components/ui/step-selector.d.ts +5 -0
- package/dist/components/ui/stimulsoft-viewer.d.ts +8 -0
- package/dist/components/ui/switch.d.ts +21 -0
- package/dist/components/ui/tab-page-layout.d.ts +33 -0
- package/dist/components/ui/table-resize-handle.d.ts +10 -3
- package/dist/components/ui/table.d.ts +102 -0
- package/dist/components/ui/tabs.d.ts +59 -0
- package/dist/components/ui/terms-of-use-dialog.d.ts +50 -4
- package/dist/components/ui/textarea.d.ts +27 -0
- package/dist/components/ui/timepicker.d.ts +23 -0
- package/dist/components/ui/toggle-group.d.ts +25 -0
- package/dist/components/ui/toggle.d.ts +21 -0
- package/dist/components/ui/tooltip.d.ts +48 -0
- package/dist/components/ui/truncated-cell.d.ts +13 -0
- package/dist/components/ui/typography.d.ts +119 -0
- package/dist/components/ui/updates-notification.d.ts +33 -0
- package/dist/components/ui/users-groups-selector.d.ts +43 -0
- package/dist/components/ui/viewer-dialog.d.ts +107 -0
- package/dist/crud/components/ActionMenuItems.d.ts +5 -0
- package/dist/crud/components/BaseForm.d.ts +46 -0
- package/dist/crud/components/ColumnSettingsPopover.d.ts +10 -0
- package/dist/crud/components/CrudActionBar.d.ts +20 -0
- package/dist/crud/components/CrudGrid.d.ts +10 -0
- package/dist/crud/components/CrudPagination.d.ts +5 -0
- package/dist/crud/components/CrudTable.d.ts +5 -0
- package/dist/crud/components/TableRowActions.d.ts +5 -0
- package/dist/crud/createCrudPage.d.ts +41 -8
- package/dist/crud/generateCrudConfig.d.ts +13 -8
- package/dist/crud/hooks/useBaseForm.d.ts +39 -0
- package/dist/crud/hooks/useColumnManager.d.ts +25 -0
- package/dist/crud/hooks/useCrud.d.ts +35 -0
- package/dist/crud/primitives/ActionMenu.d.ts +41 -0
- package/dist/crud/primitives/FilterBar.d.ts +45 -0
- package/dist/crud/primitives/Pagination.d.ts +5 -0
- package/dist/crud/primitives/Table.d.ts +6 -1
- package/dist/crud/primitives/TreeTable.d.ts +5 -0
- package/dist/crud/primitives/types.d.ts +63 -0
- package/dist/crud/utils/routingHelpers.d.ts +11 -0
- package/dist/custom-form-fields/components/CustomFormFields.d.ts +3 -0
- package/dist/custom-form-fields/fields/FormDateField.d.ts +3 -0
- package/dist/custom-form-fields/fields/FormMultiSelectionField.d.ts +3 -0
- package/dist/custom-form-fields/fields/FormNumericField.d.ts +3 -0
- package/dist/custom-form-fields/fields/FormQuestionsField.d.ts +3 -0
- package/dist/custom-form-fields/fields/FormSingleSelectionField.d.ts +3 -0
- package/dist/custom-form-fields/fields/FormTextField.d.ts +3 -0
- package/dist/custom-form-fields/fields/FormTimeField.d.ts +3 -0
- package/dist/custom-form-fields/fields/FormUrlField.d.ts +3 -0
- package/dist/custom-form-fields/fields/ReadOnlyTextField.d.ts +3 -0
- package/dist/custom-form-fields/types.d.ts +84 -21
- package/dist/exports/crud.d.ts +5 -0
- package/dist/exports/integrations.d.ts +1 -0
- package/dist/exports/ui.d.ts +1 -0
- package/dist/file-upload/components/SingleFileUpload.d.ts +59 -0
- package/dist/file-upload/types.d.ts +15 -0
- package/dist/file-upload/utils/formatBytes.d.ts +5 -0
- package/dist/file-upload/utils/getFileExtension.d.ts +5 -0
- package/dist/hooks/useColumnResize.d.ts +24 -0
- package/dist/hooks/useRowResize.d.ts +18 -0
- package/dist/hooks/useSidebarResize.d.ts +18 -0
- package/dist/hooks/useUpdatesNotification.d.ts +16 -0
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/integrations/clarity/clarityTracking.d.ts +31 -0
- package/dist/integrations/clarity/index.d.ts +3 -0
- package/dist/integrations/clarity/types.d.ts +46 -0
- package/dist/integrations/clarity/useClarity.d.ts +34 -0
- package/dist/integrations/index.d.ts +5 -0
- package/dist/providers/CoreProviders.d.ts +16 -1
- package/dist/qualiex/components/QualiexUserField.d.ts +8 -0
- package/dist/qualiex/hooks/useQualiexUsers.d.ts +16 -26
- package/dist/qualiex/services/qualiexApi.d.ts +38 -2
- package/dist/qualiex/utils/QualiexErrorInterceptor.d.ts +5 -0
- package/dist/supabase/SupabaseSingleton.d.ts +34 -0
- package/dist/types.d.ts +51 -2
- package/dist/utils/color.d.ts +26 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/vite/index.esm.js +4 -1
- package/dist/vite/index.js +4 -1
- package/docs/PUBLISH.md +168 -0
- package/docs/STORAGE_BUCKETS.md +384 -0
- package/docs/WORKSPACE_KNOWLEDGE.md +120 -119
- package/docs/design-system/README.md +1 -1
- package/docs/design-system/buttons-actions.md +130 -130
- package/docs/design-system/charts-dashboards.md +340 -301
- package/docs/design-system/crud.md +174 -114
- package/docs/design-system/data-display.md +108 -103
- package/docs/design-system/dialogs.md +212 -212
- package/docs/design-system/domain.md +317 -317
- package/docs/design-system/examples.md +275 -275
- package/docs/design-system/foundation.md +1 -1
- package/docs/design-system/inputs.md +131 -131
- package/docs/design-system/layout.md +202 -154
- package/docs/design-system/navigation.md +271 -325
- package/docs/design-system/notifications-feedback.md +34 -34
- package/docs/design-system/patterns/README.md +53 -53
- package/docs/design-system/patterns/action-button.md +22 -22
- package/docs/design-system/patterns/alertdialog-deletion.md +46 -46
- package/docs/design-system/patterns/baseform-custom-fields.md +59 -59
- package/docs/design-system/patterns/baseform-usage.md +42 -42
- package/docs/design-system/patterns/body-content-scroll.md +56 -56
- package/docs/design-system/patterns/combo-tree.md +23 -23
- package/docs/design-system/patterns/components-registry.md +17 -17
- package/docs/design-system/patterns/core-providers.md +41 -39
- package/docs/design-system/patterns/crud-bulk-actions.md +12 -12
- package/docs/design-system/patterns/crud-config-props.md +16 -16
- package/docs/design-system/patterns/crud-defaults.md +17 -17
- package/docs/design-system/patterns/crud-toolbar.md +28 -28
- package/docs/design-system/patterns/delete-confirmation.md +40 -40
- package/docs/design-system/patterns/dialog-body-scroll.md +26 -26
- package/docs/design-system/patterns/dialog-structure.md +32 -32
- package/docs/design-system/patterns/dialog-variants.md +41 -41
- package/docs/design-system/patterns/feature-flags.md +24 -20
- package/docs/design-system/patterns/header-metadata.md +57 -57
- package/docs/design-system/patterns/i18n-setup.md +117 -117
- package/docs/design-system/patterns/pagination.md +27 -27
- package/docs/design-system/patterns/single-scroll.md +39 -39
- package/docs/design-system/patterns/vite-tailwind-setup.md +48 -48
- package/docs/design-system/platform.md +18 -18
- package/docs/design-system/selectors.md +240 -236
- package/docs/design-system/tables-grids.md +95 -38
- package/package.json +150 -144
- package/dist/README.md +0 -1079
- package/dist/bin/bootstrap.js +0 -40
- package/dist/bin/pull-docs.js +0 -186
- package/dist/docs/KNOWLEDGE.md +0 -109
|
@@ -11,24 +11,24 @@ Sistema de gráficos baseado em Recharts com suporte a temas e tooltips customiz
|
|
|
11
11
|
|
|
12
12
|
**Uso:**
|
|
13
13
|
```tsx
|
|
14
|
-
import { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent } from "forlogic-core"
|
|
15
|
-
import { Bar, BarChart, XAxis, YAxis, CartesianGrid } from "recharts"
|
|
16
|
-
|
|
17
|
-
const chartConfig = {
|
|
18
|
-
desktop: { label: "Desktop", color: "hsl(var(--primary))" },
|
|
19
|
-
mobile: { label: "Mobile", color: "hsl(var(--secondary))" },
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
<ChartContainer config={chartConfig} className="h-[300px]">
|
|
23
|
-
<BarChart data={data}>
|
|
24
|
-
<CartesianGrid strokeDasharray="3 3" vertical={false} />
|
|
25
|
-
<XAxis dataKey="month" tickLine={false} axisLine={false} />
|
|
26
|
-
<YAxis tickLine={false} axisLine={false} />
|
|
27
|
-
<ChartTooltip content={<ChartTooltipContent />} />
|
|
28
|
-
<ChartLegend content={<ChartLegendContent />} />
|
|
29
|
-
<Bar dataKey="desktop" fill="var(--color-desktop)" radius={4} />
|
|
30
|
-
<Bar dataKey="mobile" fill="var(--color-mobile)" radius={4} />
|
|
31
|
-
</BarChart>
|
|
14
|
+
import { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent } from "forlogic-core"
|
|
15
|
+
import { Bar, BarChart, XAxis, YAxis, CartesianGrid } from "recharts"
|
|
16
|
+
|
|
17
|
+
const chartConfig = {
|
|
18
|
+
desktop: { label: "Desktop", color: "hsl(var(--primary))" },
|
|
19
|
+
mobile: { label: "Mobile", color: "hsl(var(--secondary))" },
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
<ChartContainer config={chartConfig} className="h-[300px]">
|
|
23
|
+
<BarChart data={data}>
|
|
24
|
+
<CartesianGrid strokeDasharray="3 3" vertical={false} />
|
|
25
|
+
<XAxis dataKey="month" tickLine={false} axisLine={false} />
|
|
26
|
+
<YAxis tickLine={false} axisLine={false} />
|
|
27
|
+
<ChartTooltip content={<ChartTooltipContent />} />
|
|
28
|
+
<ChartLegend content={<ChartLegendContent />} />
|
|
29
|
+
<Bar dataKey="desktop" fill="var(--color-desktop)" radius={4} />
|
|
30
|
+
<Bar dataKey="mobile" fill="var(--color-mobile)" radius={4} />
|
|
31
|
+
</BarChart>
|
|
32
32
|
</ChartContainer>
|
|
33
33
|
```
|
|
34
34
|
|
|
@@ -44,7 +44,7 @@ const chartConfig = {
|
|
|
44
44
|
|
|
45
45
|
**Exemplos:**
|
|
46
46
|
```tsx
|
|
47
|
-
<BarChart data={data}>
|
|
47
|
+
<BarChart data={data}>
|
|
48
48
|
<Bar dataKey=
|
|
49
49
|
```
|
|
50
50
|
|
|
@@ -69,7 +69,7 @@ const chartConfig = {
|
|
|
69
69
|
- e
|
|
70
70
|
- para visual mais moderno
|
|
71
71
|
|
|
72
|
-
> Fonte: `src
|
|
72
|
+
> Fonte: `src/design-system/docs/components/ChartDoc.tsx`
|
|
73
73
|
|
|
74
74
|
---
|
|
75
75
|
|
|
@@ -79,30 +79,30 @@ Módulo completo de dashboards portado do qex-dashboards Angular. Inclui 14 tipo
|
|
|
79
79
|
|
|
80
80
|
**Uso:**
|
|
81
81
|
```tsx
|
|
82
|
-
import {
|
|
83
|
-
// Orquestrador principal
|
|
84
|
-
DashboardGeneralView,
|
|
85
|
-
|
|
86
|
-
// Componentes de página
|
|
87
|
-
DashboardView,
|
|
88
|
-
DashboardList,
|
|
89
|
-
DashboardForm,
|
|
90
|
-
DashboardGrid,
|
|
91
|
-
DashboardPanelRenderer,
|
|
92
|
-
|
|
93
|
-
// Painéis individuais
|
|
94
|
-
NumericPanel, TextPanel, ListPanel,
|
|
95
|
-
CartesianPanel, PiePanel, ParetoPanel,
|
|
96
|
-
BurndownPanel, PerformancePanel, MatrixRiskPanel,
|
|
97
|
-
|
|
98
|
-
// Shared de painel
|
|
99
|
-
PanelHeader, PanelError, PanelLoader, PanelNoData, PanelUnavailable,
|
|
100
|
-
|
|
101
|
-
// Types & Helpers
|
|
102
|
-
DashboardPanelType, PanelState, AggregationType,
|
|
103
|
-
type PanelConfig, type Dashboard, type DashboardPanel,
|
|
104
|
-
getDefaultPanelSize, getMinPanelSize,
|
|
105
|
-
currencyFormatter, processUrl, getLinkFromRow,
|
|
82
|
+
import {
|
|
83
|
+
// Orquestrador principal
|
|
84
|
+
DashboardGeneralView,
|
|
85
|
+
|
|
86
|
+
// Componentes de página
|
|
87
|
+
DashboardView,
|
|
88
|
+
DashboardList,
|
|
89
|
+
DashboardForm,
|
|
90
|
+
DashboardGrid,
|
|
91
|
+
DashboardPanelRenderer,
|
|
92
|
+
|
|
93
|
+
// Painéis individuais
|
|
94
|
+
NumericPanel, TextPanel, ListPanel,
|
|
95
|
+
CartesianPanel, PiePanel, ParetoPanel,
|
|
96
|
+
BurndownPanel, PerformancePanel, MatrixRiskPanel,
|
|
97
|
+
|
|
98
|
+
// Shared de painel
|
|
99
|
+
PanelHeader, PanelError, PanelLoader, PanelNoData, PanelUnavailable,
|
|
100
|
+
|
|
101
|
+
// Types & Helpers
|
|
102
|
+
DashboardPanelType, PanelState, AggregationType,
|
|
103
|
+
type PanelConfig, type Dashboard, type DashboardPanel,
|
|
104
|
+
getDefaultPanelSize, getMinPanelSize,
|
|
105
|
+
currencyFormatter, processUrl, getLinkFromRow,
|
|
106
106
|
} from 'forlogic-core';
|
|
107
107
|
```
|
|
108
108
|
|
|
@@ -120,15 +120,15 @@ import {
|
|
|
120
120
|
|
|
121
121
|
**Exemplos:**
|
|
122
122
|
```tsx
|
|
123
|
-
// O renderer mapeia typeId → componente automaticamente
|
|
124
|
-
<DashboardPanelRenderer
|
|
125
|
-
config={{ ...panelConfig, typeId: DashboardPanelType.Column }}
|
|
126
|
-
state={PanelState.Loaded}
|
|
127
|
-
cartesianData={chartData}
|
|
123
|
+
// O renderer mapeia typeId → componente automaticamente
|
|
124
|
+
<DashboardPanelRenderer
|
|
125
|
+
config={{ ...panelConfig, typeId: DashboardPanelType.Column }}
|
|
126
|
+
state={PanelState.Loaded}
|
|
127
|
+
cartesianData={chartData}
|
|
128
128
|
cartesianSeries={[{ dataKey:
|
|
129
129
|
```
|
|
130
130
|
|
|
131
|
-
> Fonte: `src
|
|
131
|
+
> Fonte: `src/design-system/docs/components/dashboards/DashboardOverviewDoc.tsx`
|
|
132
132
|
|
|
133
133
|
---
|
|
134
134
|
|
|
@@ -138,49 +138,49 @@ Componente orquestrador que gerencia todo o ciclo de vida do módulo de Dashboar
|
|
|
138
138
|
|
|
139
139
|
**Uso:**
|
|
140
140
|
```tsx
|
|
141
|
-
import { DashboardGeneralView } from 'forlogic-core';
|
|
142
|
-
|
|
143
|
-
// Uso básico (uncontrolled — gerencia estado internamente)
|
|
144
|
-
<DashboardGeneralView
|
|
145
|
-
dashboards={dashboards}
|
|
146
|
-
limit={{ maxDashboards: 50, countDashboards: 12 }}
|
|
147
|
-
canAdd canEdit canRemove
|
|
148
|
-
activePanels={panels}
|
|
149
|
-
activePages={pages}
|
|
150
|
-
getPanelData={(panelId) => ({
|
|
151
|
-
state: PanelState.Loaded,
|
|
152
|
-
data: panelData[panelId],
|
|
153
|
-
})}
|
|
154
|
-
onOpen={(d) => loadPanels(d.id)}
|
|
155
|
-
onSave={(values) => createDashboard(values)}
|
|
156
|
-
onUpdate={(id, values) => updateDashboard(id, values)}
|
|
157
|
-
onRemove={(d) => removeDashboard(d.id)}
|
|
158
|
-
onToggleFavorite={(d) => toggleFav(d.id)}
|
|
159
|
-
/>
|
|
160
|
-
|
|
161
|
-
// Uso controlado (com react-router)
|
|
162
|
-
const [viewState, setViewState] = useState({ mode: 'list' });
|
|
163
|
-
|
|
164
|
-
<DashboardGeneralView
|
|
165
|
-
dashboards={dashboards}
|
|
166
|
-
viewState={viewState}
|
|
167
|
-
onViewStateChange={(state) => {
|
|
168
|
-
setViewState(state);
|
|
169
|
-
if (state.mode === 'view') navigate(\`/dashboards/\${state.dashboardId}\`);
|
|
170
|
-
if (state.mode === 'list') navigate('/dashboards');
|
|
171
|
-
}}
|
|
172
|
-
// ... demais props
|
|
141
|
+
import { DashboardGeneralView } from 'forlogic-core';
|
|
142
|
+
|
|
143
|
+
// Uso básico (uncontrolled — gerencia estado internamente)
|
|
144
|
+
<DashboardGeneralView
|
|
145
|
+
dashboards={dashboards}
|
|
146
|
+
limit={{ maxDashboards: 50, countDashboards: 12 }}
|
|
147
|
+
canAdd canEdit canRemove
|
|
148
|
+
activePanels={panels}
|
|
149
|
+
activePages={pages}
|
|
150
|
+
getPanelData={(panelId) => ({
|
|
151
|
+
state: PanelState.Loaded,
|
|
152
|
+
data: panelData[panelId],
|
|
153
|
+
})}
|
|
154
|
+
onOpen={(d) => loadPanels(d.id)}
|
|
155
|
+
onSave={(values) => createDashboard(values)}
|
|
156
|
+
onUpdate={(id, values) => updateDashboard(id, values)}
|
|
157
|
+
onRemove={(d) => removeDashboard(d.id)}
|
|
158
|
+
onToggleFavorite={(d) => toggleFav(d.id)}
|
|
159
|
+
/>
|
|
160
|
+
|
|
161
|
+
// Uso controlado (com react-router)
|
|
162
|
+
const [viewState, setViewState] = useState({ mode: 'list' });
|
|
163
|
+
|
|
164
|
+
<DashboardGeneralView
|
|
165
|
+
dashboards={dashboards}
|
|
166
|
+
viewState={viewState}
|
|
167
|
+
onViewStateChange={(state) => {
|
|
168
|
+
setViewState(state);
|
|
169
|
+
if (state.mode === 'view') navigate(\`/dashboards/\${state.dashboardId}\`);
|
|
170
|
+
if (state.mode === 'list') navigate('/dashboards');
|
|
171
|
+
}}
|
|
172
|
+
// ... demais props
|
|
173
173
|
/>
|
|
174
174
|
```
|
|
175
175
|
|
|
176
176
|
**Exemplos:**
|
|
177
177
|
```tsx
|
|
178
|
-
// DashboardViewState
|
|
179
|
-
type DashboardViewState =
|
|
178
|
+
// DashboardViewState
|
|
179
|
+
type DashboardViewState =
|
|
180
180
|
| { mode:
|
|
181
181
|
```
|
|
182
182
|
|
|
183
|
-
> Fonte: `src
|
|
183
|
+
> Fonte: `src/design-system/docs/components/dashboards/DashboardGeneralViewDoc.tsx`
|
|
184
184
|
|
|
185
185
|
---
|
|
186
186
|
|
|
@@ -190,105 +190,144 @@ Lista/tabela de dashboards com busca integrada, filtros rápidos (Todos / Meus /
|
|
|
190
190
|
|
|
191
191
|
**Uso:**
|
|
192
192
|
```tsx
|
|
193
|
-
import { DashboardList, QuickFilterDashboard } from 'forlogic-core';
|
|
194
|
-
|
|
195
|
-
<DashboardList
|
|
196
|
-
dashboards={dashboards}
|
|
197
|
-
limit={{ maxDashboards: 50, countDashboards: 12 }}
|
|
198
|
-
language={DashboardLanguage.PtBr}
|
|
199
|
-
canAdd canEdit canRemove
|
|
200
|
-
onOpen={(d) => navigate(\`/dashboards/\${d.id}\`)}
|
|
201
|
-
onEdit={(d) => navigate(\`/dashboards/\${d.id}/edit\`)}
|
|
202
|
-
onShare={(d) => openShareDialog(d)}
|
|
203
|
-
onDuplicate={(d) => duplicateDashboard(d.id)}
|
|
204
|
-
onRemove={(d) => removeDashboard(d.id)}
|
|
205
|
-
onAdd={() => navigate('/dashboards/new')}
|
|
206
|
-
onToggleFavorite={(d) => toggleFavorite(d.id)}
|
|
207
|
-
onSearch={(q) => setSearch(q)}
|
|
208
|
-
onQuickFilterChange={(f) => setFilter(f)}
|
|
193
|
+
import { DashboardList, QuickFilterDashboard } from 'forlogic-core';
|
|
194
|
+
|
|
195
|
+
<DashboardList
|
|
196
|
+
dashboards={dashboards}
|
|
197
|
+
limit={{ maxDashboards: 50, countDashboards: 12 }}
|
|
198
|
+
language={DashboardLanguage.PtBr}
|
|
199
|
+
canAdd canEdit canRemove
|
|
200
|
+
onOpen={(d) => navigate(\`/dashboards/\${d.id}\`)}
|
|
201
|
+
onEdit={(d) => navigate(\`/dashboards/\${d.id}/edit\`)}
|
|
202
|
+
onShare={(d) => openShareDialog(d)}
|
|
203
|
+
onDuplicate={(d) => duplicateDashboard(d.id)}
|
|
204
|
+
onRemove={(d) => removeDashboard(d.id)}
|
|
205
|
+
onAdd={() => navigate('/dashboards/new')}
|
|
206
|
+
onToggleFavorite={(d) => toggleFavorite(d.id)}
|
|
207
|
+
onSearch={(q) => setSearch(q)}
|
|
208
|
+
onQuickFilterChange={(f) => setFilter(f)}
|
|
209
209
|
/>
|
|
210
210
|
```
|
|
211
211
|
|
|
212
212
|
**Exemplos:**
|
|
213
213
|
```tsx
|
|
214
|
-
<DashboardList
|
|
215
|
-
dashboards={dashboards}
|
|
216
|
-
limit={{ maxDashboards: 50, countDashboards: 12 }}
|
|
217
|
-
canAdd canEdit canRemove
|
|
218
|
-
onOpen={(d) => openDashboard(d)}
|
|
219
|
-
onToggleFavorite={(d) => toggleFav(d.id)}
|
|
220
|
-
onSearch={(q) => fetchFiltered(q)}
|
|
221
|
-
onQuickFilterChange={(filter) => {
|
|
222
|
-
// QuickFilterDashboard.All | OnlyMine | Favorites
|
|
223
|
-
refetch(filter);
|
|
224
|
-
}}
|
|
214
|
+
<DashboardList
|
|
215
|
+
dashboards={dashboards}
|
|
216
|
+
limit={{ maxDashboards: 50, countDashboards: 12 }}
|
|
217
|
+
canAdd canEdit canRemove
|
|
218
|
+
onOpen={(d) => openDashboard(d)}
|
|
219
|
+
onToggleFavorite={(d) => toggleFav(d.id)}
|
|
220
|
+
onSearch={(q) => fetchFiltered(q)}
|
|
221
|
+
onQuickFilterChange={(filter) => {
|
|
222
|
+
// QuickFilterDashboard.All | OnlyMine | Favorites
|
|
223
|
+
refetch(filter);
|
|
224
|
+
}}
|
|
225
225
|
/>
|
|
226
226
|
```
|
|
227
227
|
```tsx
|
|
228
|
-
// As ações são controladas por callbacks
|
|
229
|
-
<DashboardList
|
|
230
|
-
canEdit={true}
|
|
231
|
-
canRemove={true}
|
|
228
|
+
// As ações são controladas por callbacks
|
|
229
|
+
<DashboardList
|
|
230
|
+
canEdit={true}
|
|
231
|
+
canRemove={true}
|
|
232
232
|
onOpen={(d) => navigate(\
|
|
233
233
|
```
|
|
234
234
|
|
|
235
|
-
> Fonte: `src
|
|
235
|
+
> Fonte: `src/design-system/docs/components/dashboards/DashboardListDoc.tsx`
|
|
236
236
|
|
|
237
237
|
---
|
|
238
238
|
|
|
239
|
-
###
|
|
239
|
+
### Form
|
|
240
240
|
|
|
241
|
-
|
|
241
|
+
Construindo formulários com React Hook Form e Zod.
|
|
242
242
|
|
|
243
243
|
**Uso:**
|
|
244
244
|
```tsx
|
|
245
|
-
import {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
245
|
+
import { zodResolver } from "@hookform/resolvers/zod"
|
|
246
|
+
import { useForm } from "react-hook-form"
|
|
247
|
+
import * as z from "zod"
|
|
248
|
+
import {
|
|
249
|
+
Form,
|
|
250
|
+
FormControl,
|
|
251
|
+
FormDescription,
|
|
252
|
+
FormField,
|
|
253
|
+
FormItem,
|
|
254
|
+
FormLabel,
|
|
255
|
+
FormMessage,
|
|
256
|
+
} from "forlogic-core"
|
|
257
|
+
|
|
258
|
+
const formSchema = z.object({
|
|
259
|
+
username: z.string().min(2).max(50),
|
|
260
|
+
})
|
|
261
|
+
|
|
262
|
+
function MyForm() {
|
|
263
|
+
const form = useForm<z.infer<typeof formSchema>>({
|
|
264
|
+
resolver: zodResolver(formSchema),
|
|
265
|
+
})
|
|
266
|
+
|
|
267
|
+
function onSubmit(values: z.infer<typeof formSchema>) {
|
|
268
|
+
console.log(values)
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
return (
|
|
272
|
+
<Form {...form}>
|
|
273
|
+
<form onSubmit={form.handleSubmit(onSubmit)}>
|
|
274
|
+
<FormField
|
|
275
|
+
control={form.control}
|
|
276
|
+
name="username"
|
|
277
|
+
render={({ field }) => (
|
|
278
|
+
<FormItem>
|
|
279
|
+
<FormLabel>Username</FormLabel>
|
|
280
|
+
<FormControl>
|
|
281
|
+
<Input placeholder="shadcn" {...field} />
|
|
282
|
+
</FormControl>
|
|
283
|
+
<FormDescription>
|
|
284
|
+
This is your public display name.
|
|
285
|
+
</FormDescription>
|
|
286
|
+
<FormMessage />
|
|
287
|
+
</FormItem>
|
|
288
|
+
)}
|
|
289
|
+
/>
|
|
290
|
+
<Button type="submit">Submit</Button>
|
|
291
|
+
</form>
|
|
292
|
+
</Form>
|
|
293
|
+
)
|
|
294
|
+
}
|
|
269
295
|
```
|
|
270
296
|
|
|
271
297
|
**Props:**
|
|
272
298
|
| Prop | Tipo | Padrão | Descrição |
|
|
273
299
|
|------|------|--------|-----------|
|
|
274
|
-
| `
|
|
275
|
-
| `
|
|
276
|
-
| `
|
|
277
|
-
| `
|
|
278
|
-
| `
|
|
279
|
-
| `
|
|
280
|
-
| `
|
|
281
|
-
| `
|
|
300
|
+
| `Form` | `FormProvider props` | - | Wrapper que provê o contexto do formulário via React Hook Form |
|
|
301
|
+
| `FormField.control` | `Control` | - | Objeto control do useForm para gerenciar o campo |
|
|
302
|
+
| `FormField.name` | `string` | - | Nome do campo no schema do formulário |
|
|
303
|
+
| `FormField.render` | `(field) => ReactNode` | - | Função de renderização do campo com acesso ao field object |
|
|
304
|
+
| `FormItem` | `HTMLDivElement` | - | Container que agrupa label, controle, descrição e mensagem de erro |
|
|
305
|
+
| `FormLabel` | `LabelProps` | - | Label associado ao campo do formulário |
|
|
306
|
+
| `FormControl` | `SlotProps` | - | Wrapper que conecta o controle ao contexto do campo |
|
|
307
|
+
| `FormDescription` | `HTMLParagraphElement` | - | Texto de ajuda exibido abaixo do controle |
|
|
308
|
+
| `FormMessage` | `HTMLParagraphElement` | - | Exibe mensagens de erro de validação automaticamente |
|
|
282
309
|
|
|
283
310
|
**Exemplos:**
|
|
284
311
|
```tsx
|
|
285
|
-
<
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
312
|
+
<FormField
|
|
313
|
+
control={form.control}
|
|
314
|
+
name=
|
|
315
|
+
```
|
|
316
|
+
```tsx
|
|
317
|
+
const formSchema = z.object({
|
|
318
|
+
username: z.string().min(3, {
|
|
319
|
+
message:
|
|
289
320
|
```
|
|
290
321
|
|
|
291
|
-
|
|
322
|
+
**Acessibilidade:**
|
|
323
|
+
- Labels são automaticamente associados aos controles via aria-describedby
|
|
324
|
+
- Mensagens de erro são anunciadas por leitores de tela
|
|
325
|
+
- Suporta navegação por teclado nativa dos controles
|
|
326
|
+
- Estados de erro são indicados visualmente e semanticamente
|
|
327
|
+
- Usa React Hook Form para gerenciamento de estado de formulário
|
|
328
|
+
- Integra com Zod para validação de schema
|
|
329
|
+
|
|
330
|
+
> Fonte: `src/design-system/docs/components/FormDoc.tsx`
|
|
292
331
|
|
|
293
332
|
---
|
|
294
333
|
|
|
@@ -304,32 +343,32 @@ Grid de 8 colunas com posicionamento por col/row e dimensão por sizeX/sizeY. Su
|
|
|
304
343
|
|
|
305
344
|
**Uso:**
|
|
306
345
|
```tsx
|
|
307
|
-
import { DashboardGrid, getDefaultPanelSize, getMinPanelSize } from 'forlogic-core';
|
|
308
|
-
|
|
309
|
-
<DashboardGrid
|
|
310
|
-
panels={[
|
|
311
|
-
{ id: 'p1', col: 0, row: 0, sizeX: 4, sizeY: 2 },
|
|
312
|
-
{ id: 'p2', col: 4, row: 0, sizeX: 4, sizeY: 2 },
|
|
313
|
-
{ id: 'p3', col: 0, row: 2, sizeX: 8, sizeY: 2 },
|
|
314
|
-
]}
|
|
315
|
-
columns={8} // padrão: 8
|
|
316
|
-
cellHeight={160} // padrão: 160px
|
|
317
|
-
cellGap={10} // padrão: 10px
|
|
318
|
-
allowDragging={canEdit}
|
|
319
|
-
showGridLines={canEdit}
|
|
320
|
-
renderPanel={(panelId) => <MyPanelComponent id={panelId} />}
|
|
321
|
-
onLayoutChange={(updatedPanels) => saveLayout(updatedPanels)}
|
|
346
|
+
import { DashboardGrid, getDefaultPanelSize, getMinPanelSize } from 'forlogic-core';
|
|
347
|
+
|
|
348
|
+
<DashboardGrid
|
|
349
|
+
panels={[
|
|
350
|
+
{ id: 'p1', col: 0, row: 0, sizeX: 4, sizeY: 2 },
|
|
351
|
+
{ id: 'p2', col: 4, row: 0, sizeX: 4, sizeY: 2 },
|
|
352
|
+
{ id: 'p3', col: 0, row: 2, sizeX: 8, sizeY: 2 },
|
|
353
|
+
]}
|
|
354
|
+
columns={8} // padrão: 8
|
|
355
|
+
cellHeight={160} // padrão: 160px
|
|
356
|
+
cellGap={10} // padrão: 10px
|
|
357
|
+
allowDragging={canEdit}
|
|
358
|
+
showGridLines={canEdit}
|
|
359
|
+
renderPanel={(panelId) => <MyPanelComponent id={panelId} />}
|
|
360
|
+
onLayoutChange={(updatedPanels) => saveLayout(updatedPanels)}
|
|
322
361
|
/>
|
|
323
362
|
```
|
|
324
363
|
|
|
325
364
|
**Exemplos:**
|
|
326
365
|
```tsx
|
|
327
|
-
<DashboardGrid
|
|
328
|
-
panels={[
|
|
366
|
+
<DashboardGrid
|
|
367
|
+
panels={[
|
|
329
368
|
{ id:
|
|
330
369
|
```
|
|
331
370
|
|
|
332
|
-
> Fonte: `src
|
|
371
|
+
> Fonte: `src/design-system/docs/components/dashboards/DashboardGridDoc.tsx`
|
|
333
372
|
|
|
334
373
|
---
|
|
335
374
|
|
|
@@ -339,37 +378,37 @@ Componente de roteamento que mapeia DashboardPanelType para o componente React c
|
|
|
339
378
|
|
|
340
379
|
**Uso:**
|
|
341
380
|
```tsx
|
|
342
|
-
import { DashboardPanelRenderer, PanelState, DashboardPanelType } from 'forlogic-core';
|
|
343
|
-
|
|
344
|
-
// O renderer resolve automaticamente qual componente usar
|
|
345
|
-
<DashboardPanelRenderer
|
|
346
|
-
config={{
|
|
347
|
-
id: 'p1',
|
|
348
|
-
title: 'Ocorrências por Mês',
|
|
349
|
-
typeId: DashboardPanelType.Column,
|
|
350
|
-
// ... demais campos de PanelConfig
|
|
351
|
-
}}
|
|
352
|
-
state={PanelState.Loaded}
|
|
353
|
-
cartesianData={[
|
|
354
|
-
{ key: 'Jan', value: 42 },
|
|
355
|
-
{ key: 'Fev', value: 58 },
|
|
356
|
-
]}
|
|
357
|
-
cartesianSeries={[{ dataKey: 'value', name: 'Total' }]}
|
|
358
|
-
/>
|
|
359
|
-
|
|
360
|
-
// Para NumericPanel, use numericValue:
|
|
361
|
-
<DashboardPanelRenderer
|
|
362
|
-
config={{ ...config, typeId: DashboardPanelType.Numeric }}
|
|
363
|
-
state={PanelState.Loaded}
|
|
364
|
-
numericValue={1247}
|
|
365
|
-
/>
|
|
366
|
-
|
|
367
|
-
// Para MatrixRisk, use matrixRule + matrixRisks:
|
|
368
|
-
<DashboardPanelRenderer
|
|
369
|
-
config={{ ...config, typeId: DashboardPanelType.RiskMatrix }}
|
|
370
|
-
state={PanelState.Loaded}
|
|
371
|
-
matrixRule={rule}
|
|
372
|
-
matrixRisks={risks}
|
|
381
|
+
import { DashboardPanelRenderer, PanelState, DashboardPanelType } from 'forlogic-core';
|
|
382
|
+
|
|
383
|
+
// O renderer resolve automaticamente qual componente usar
|
|
384
|
+
<DashboardPanelRenderer
|
|
385
|
+
config={{
|
|
386
|
+
id: 'p1',
|
|
387
|
+
title: 'Ocorrências por Mês',
|
|
388
|
+
typeId: DashboardPanelType.Column,
|
|
389
|
+
// ... demais campos de PanelConfig
|
|
390
|
+
}}
|
|
391
|
+
state={PanelState.Loaded}
|
|
392
|
+
cartesianData={[
|
|
393
|
+
{ key: 'Jan', value: 42 },
|
|
394
|
+
{ key: 'Fev', value: 58 },
|
|
395
|
+
]}
|
|
396
|
+
cartesianSeries={[{ dataKey: 'value', name: 'Total' }]}
|
|
397
|
+
/>
|
|
398
|
+
|
|
399
|
+
// Para NumericPanel, use numericValue:
|
|
400
|
+
<DashboardPanelRenderer
|
|
401
|
+
config={{ ...config, typeId: DashboardPanelType.Numeric }}
|
|
402
|
+
state={PanelState.Loaded}
|
|
403
|
+
numericValue={1247}
|
|
404
|
+
/>
|
|
405
|
+
|
|
406
|
+
// Para MatrixRisk, use matrixRule + matrixRisks:
|
|
407
|
+
<DashboardPanelRenderer
|
|
408
|
+
config={{ ...config, typeId: DashboardPanelType.RiskMatrix }}
|
|
409
|
+
state={PanelState.Loaded}
|
|
410
|
+
matrixRule={rule}
|
|
411
|
+
matrixRisks={risks}
|
|
373
412
|
/>
|
|
374
413
|
```
|
|
375
414
|
|
|
@@ -379,7 +418,7 @@ import { DashboardPanelRenderer, PanelState, DashboardPanelType } from 'forlogic
|
|
|
379
418
|
| `config` | `PanelConfig` | - | Configuração do painel — inclui typeId que determina qual componente renderizar. |
|
|
380
419
|
| `state` | `PanelState` | - | Estado atual do painel (Loading, Loaded, Error, NoData, Unavailable). |
|
|
381
420
|
|
|
382
|
-
> Fonte: `src
|
|
421
|
+
> Fonte: `src/design-system/docs/components/dashboards/DashboardPanelRendererDoc.tsx`
|
|
383
422
|
|
|
384
423
|
---
|
|
385
424
|
|
|
@@ -389,31 +428,31 @@ Os três painéis não-gráficos do módulo de dashboards: NumericPanel (valor n
|
|
|
389
428
|
|
|
390
429
|
**Uso:**
|
|
391
430
|
```tsx
|
|
392
|
-
import { NumericPanel, TextPanel, ListPanel, PanelState } from 'forlogic-core';
|
|
393
|
-
|
|
394
|
-
// Painel Numérico
|
|
395
|
-
<NumericPanel
|
|
396
|
-
config={panelConfig}
|
|
397
|
-
state={PanelState.Loaded}
|
|
398
|
-
value={1247}
|
|
399
|
-
label="Contagem" // override do label automático
|
|
400
|
-
onClick={() => openPopover()}
|
|
401
|
-
/>
|
|
402
|
-
|
|
403
|
-
// Painel de Texto
|
|
404
|
-
<TextPanel
|
|
405
|
-
config={{ ...panelConfig, textTypeString: '<h3>Título</h3><p>Conteúdo</p>' }}
|
|
406
|
-
state={PanelState.Loaded}
|
|
407
|
-
/>
|
|
408
|
-
|
|
409
|
-
// Painel de Lista
|
|
410
|
-
<ListPanel
|
|
411
|
-
config={panelConfig}
|
|
412
|
-
state={PanelState.Loaded}
|
|
413
|
-
data={rows}
|
|
414
|
-
columns={columnDefinitions}
|
|
415
|
-
enableRowLinks={true}
|
|
416
|
-
onRowClick={(row) => openDetail(row)}
|
|
431
|
+
import { NumericPanel, TextPanel, ListPanel, PanelState } from 'forlogic-core';
|
|
432
|
+
|
|
433
|
+
// Painel Numérico
|
|
434
|
+
<NumericPanel
|
|
435
|
+
config={panelConfig}
|
|
436
|
+
state={PanelState.Loaded}
|
|
437
|
+
value={1247}
|
|
438
|
+
label="Contagem" // override do label automático
|
|
439
|
+
onClick={() => openPopover()}
|
|
440
|
+
/>
|
|
441
|
+
|
|
442
|
+
// Painel de Texto
|
|
443
|
+
<TextPanel
|
|
444
|
+
config={{ ...panelConfig, textTypeString: '<h3>Título</h3><p>Conteúdo</p>' }}
|
|
445
|
+
state={PanelState.Loaded}
|
|
446
|
+
/>
|
|
447
|
+
|
|
448
|
+
// Painel de Lista
|
|
449
|
+
<ListPanel
|
|
450
|
+
config={panelConfig}
|
|
451
|
+
state={PanelState.Loaded}
|
|
452
|
+
data={rows}
|
|
453
|
+
columns={columnDefinitions}
|
|
454
|
+
enableRowLinks={true}
|
|
455
|
+
onRowClick={(row) => openDetail(row)}
|
|
417
456
|
/>
|
|
418
457
|
```
|
|
419
458
|
|
|
@@ -427,29 +466,29 @@ import { NumericPanel, TextPanel, ListPanel, PanelState } from 'forlogic-core';
|
|
|
427
466
|
|
|
428
467
|
**Exemplos:**
|
|
429
468
|
```tsx
|
|
430
|
-
// Contagem simples
|
|
431
|
-
<NumericPanel config={config} state={PanelState.Loaded} value={1247} />
|
|
432
|
-
|
|
469
|
+
// Contagem simples
|
|
470
|
+
<NumericPanel config={config} state={PanelState.Loaded} value={1247} />
|
|
471
|
+
|
|
433
472
|
// Com formatação de moeda (detectado pelo campo
|
|
434
473
|
```
|
|
435
474
|
```tsx
|
|
436
|
-
<TextPanel
|
|
437
|
-
config={{
|
|
438
|
-
...config,
|
|
475
|
+
<TextPanel
|
|
476
|
+
config={{
|
|
477
|
+
...config,
|
|
439
478
|
textTypeString:
|
|
440
479
|
```
|
|
441
480
|
```tsx
|
|
442
|
-
<ListPanel
|
|
443
|
-
config={config}
|
|
444
|
-
state={PanelState.Loaded}
|
|
445
|
-
data={[
|
|
481
|
+
<ListPanel
|
|
482
|
+
config={config}
|
|
483
|
+
state={PanelState.Loaded}
|
|
484
|
+
data={[
|
|
446
485
|
{ code:
|
|
447
486
|
```
|
|
448
487
|
```tsx
|
|
449
488
|
OC-002
|
|
450
489
|
```
|
|
451
490
|
|
|
452
|
-
> Fonte: `src
|
|
491
|
+
> Fonte: `src/design-system/docs/components/dashboards/DashboardPanelsBasicDoc.tsx`
|
|
453
492
|
|
|
454
493
|
---
|
|
455
494
|
|
|
@@ -459,43 +498,43 @@ CartesianPanel é um componente unificado que renderiza 6 variantes de gráfico
|
|
|
459
498
|
|
|
460
499
|
**Uso:**
|
|
461
500
|
```tsx
|
|
462
|
-
import { CartesianPanel, PanelState, type CartesianSeries } from 'forlogic-core';
|
|
463
|
-
|
|
464
|
-
// Uso básico — série única
|
|
465
|
-
<CartesianPanel
|
|
466
|
-
config={panelConfig}
|
|
467
|
-
variant="column" // 'bar' | 'column' | 'stacked-column' | 'area' | 'line' | 'evolution-line'
|
|
468
|
-
state={PanelState.Loaded}
|
|
469
|
-
data={[
|
|
470
|
-
{ key: 'Jan', value: 42 },
|
|
471
|
-
{ key: 'Fev', value: 58 },
|
|
472
|
-
]}
|
|
473
|
-
/>
|
|
474
|
-
|
|
475
|
-
// Múltiplas séries
|
|
476
|
-
<CartesianPanel
|
|
477
|
-
config={panelConfig}
|
|
478
|
-
variant="column"
|
|
479
|
-
state={PanelState.Loaded}
|
|
480
|
-
data={data}
|
|
481
|
-
series={[
|
|
482
|
-
{ dataKey: 'opened', name: 'Abertas', color: '#4e79a7' },
|
|
483
|
-
{ dataKey: 'closed', name: 'Fechadas', color: '#59a14f' },
|
|
484
|
-
]}
|
|
485
|
-
categoryKey="month" // chave do eixo X (default: 'key')
|
|
486
|
-
yAxisFormat="R$ {value}" // formato do eixo Y
|
|
487
|
-
onPointClick={(data, index) => openDetail(data)}
|
|
501
|
+
import { CartesianPanel, PanelState, type CartesianSeries } from 'forlogic-core';
|
|
502
|
+
|
|
503
|
+
// Uso básico — série única
|
|
504
|
+
<CartesianPanel
|
|
505
|
+
config={panelConfig}
|
|
506
|
+
variant="column" // 'bar' | 'column' | 'stacked-column' | 'area' | 'line' | 'evolution-line'
|
|
507
|
+
state={PanelState.Loaded}
|
|
508
|
+
data={[
|
|
509
|
+
{ key: 'Jan', value: 42 },
|
|
510
|
+
{ key: 'Fev', value: 58 },
|
|
511
|
+
]}
|
|
512
|
+
/>
|
|
513
|
+
|
|
514
|
+
// Múltiplas séries
|
|
515
|
+
<CartesianPanel
|
|
516
|
+
config={panelConfig}
|
|
517
|
+
variant="column"
|
|
518
|
+
state={PanelState.Loaded}
|
|
519
|
+
data={data}
|
|
520
|
+
series={[
|
|
521
|
+
{ dataKey: 'opened', name: 'Abertas', color: '#4e79a7' },
|
|
522
|
+
{ dataKey: 'closed', name: 'Fechadas', color: '#59a14f' },
|
|
523
|
+
]}
|
|
524
|
+
categoryKey="month" // chave do eixo X (default: 'key')
|
|
525
|
+
yAxisFormat="R$ {value}" // formato do eixo Y
|
|
526
|
+
onPointClick={(data, index) => openDetail(data)}
|
|
488
527
|
/>
|
|
489
528
|
```
|
|
490
529
|
|
|
491
530
|
**Exemplos:**
|
|
492
531
|
```tsx
|
|
493
|
-
<CartesianPanel
|
|
494
|
-
config={config}
|
|
532
|
+
<CartesianPanel
|
|
533
|
+
config={config}
|
|
495
534
|
variant=
|
|
496
535
|
```
|
|
497
536
|
|
|
498
|
-
> Fonte: `src
|
|
537
|
+
> Fonte: `src/design-system/docs/components/dashboards/DashboardPanelsCartesianDoc.tsx`
|
|
499
538
|
|
|
500
539
|
---
|
|
501
540
|
|
|
@@ -505,43 +544,43 @@ Cinco painéis especializados: PiePanel (pizza com percentuais), ParetoPanel (ba
|
|
|
505
544
|
|
|
506
545
|
**Uso:**
|
|
507
546
|
```tsx
|
|
508
|
-
import {
|
|
509
|
-
PiePanel, ParetoPanel, BurndownPanel,
|
|
510
|
-
PerformancePanel, MatrixRiskPanel,
|
|
511
|
-
PanelState, MatrixViewType,
|
|
512
|
-
} from 'forlogic-core';
|
|
513
|
-
|
|
514
|
-
// Pie
|
|
515
|
-
<PiePanel config={config} state={PanelState.Loaded} data={pieData} />
|
|
516
|
-
|
|
517
|
-
// Pareto
|
|
518
|
-
<ParetoPanel config={config} state={PanelState.Loaded} data={paretoData} />
|
|
519
|
-
|
|
520
|
-
// Burndown
|
|
521
|
-
<BurndownPanel config={config} state={PanelState.Loaded} data={burndownData} />
|
|
522
|
-
|
|
523
|
-
// Performance
|
|
524
|
-
<PerformancePanel config={config} state={PanelState.Loaded} data={performanceData} />
|
|
525
|
-
|
|
526
|
-
// Matrix Risk
|
|
527
|
-
<MatrixRiskPanel
|
|
528
|
-
config={config}
|
|
529
|
-
state={PanelState.Loaded}
|
|
530
|
-
rule={matrixRule}
|
|
531
|
-
risks={risks}
|
|
532
|
-
matrixViewType={MatrixViewType.Quantity}
|
|
547
|
+
import {
|
|
548
|
+
PiePanel, ParetoPanel, BurndownPanel,
|
|
549
|
+
PerformancePanel, MatrixRiskPanel,
|
|
550
|
+
PanelState, MatrixViewType,
|
|
551
|
+
} from 'forlogic-core';
|
|
552
|
+
|
|
553
|
+
// Pie
|
|
554
|
+
<PiePanel config={config} state={PanelState.Loaded} data={pieData} />
|
|
555
|
+
|
|
556
|
+
// Pareto
|
|
557
|
+
<ParetoPanel config={config} state={PanelState.Loaded} data={paretoData} />
|
|
558
|
+
|
|
559
|
+
// Burndown
|
|
560
|
+
<BurndownPanel config={config} state={PanelState.Loaded} data={burndownData} />
|
|
561
|
+
|
|
562
|
+
// Performance
|
|
563
|
+
<PerformancePanel config={config} state={PanelState.Loaded} data={performanceData} />
|
|
564
|
+
|
|
565
|
+
// Matrix Risk
|
|
566
|
+
<MatrixRiskPanel
|
|
567
|
+
config={config}
|
|
568
|
+
state={PanelState.Loaded}
|
|
569
|
+
rule={matrixRule}
|
|
570
|
+
risks={risks}
|
|
571
|
+
matrixViewType={MatrixViewType.Quantity}
|
|
533
572
|
/>
|
|
534
573
|
```
|
|
535
574
|
|
|
536
575
|
**Exemplos:**
|
|
537
576
|
```tsx
|
|
538
|
-
<PiePanel
|
|
539
|
-
config={config}
|
|
540
|
-
state={PanelState.Loaded}
|
|
541
|
-
data={[
|
|
577
|
+
<PiePanel
|
|
578
|
+
config={config}
|
|
579
|
+
state={PanelState.Loaded}
|
|
580
|
+
data={[
|
|
542
581
|
{ key:
|
|
543
582
|
```
|
|
544
583
|
|
|
545
|
-
> Fonte: `src
|
|
584
|
+
> Fonte: `src/design-system/docs/components/dashboards/DashboardPanelsSpecialDoc.tsx`
|
|
546
585
|
|
|
547
586
|
---
|