@oondemand/oon-core-front 0.3.61 → 0.3.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -422,6 +422,8 @@ interface CollectionViewDef {
422
422
  path?: string;
423
423
  icon?: ReactNode;
424
424
  section?: string;
425
+ /** Mantém a rota disponível, mas remove a coleção do menu lateral. */
426
+ hidden?: boolean;
425
427
  /** "dynamic" monta tudo a partir de /core/models/:model. */
426
428
  mode?: CollectionMode;
427
429
  /** modo "full": colunas explícitas. */
@@ -497,7 +499,7 @@ interface OonPageDef {
497
499
  hidden?: boolean;
498
500
  order?: number;
499
501
  }
500
- type OonBlockDef = OonCustomBlockDef | OonCollectionDataGridBlockDef | OonCollectionCardsBlockDef | OonSectionBlockDef | OonMarkdownBlockDef | OonGenericBlockDef;
502
+ type OonBlockDef = OonCustomBlockDef | OonCollectionDataGridBlockDef | OonCollectionCardsBlockDef | OonSectionBlockDef | OonMarkdownBlockDef | OonNavigationCardsBlockDef | OonGenericBlockDef;
501
503
  interface OonBaseBlockDef {
502
504
  id?: string;
503
505
  title?: string;
@@ -532,6 +534,18 @@ interface OonMarkdownBlockDef extends OonBaseBlockDef {
532
534
  type: "markdown";
533
535
  content: string;
534
536
  }
537
+ interface OonNavigationCardDef {
538
+ title: string;
539
+ description?: string;
540
+ href: string;
541
+ actionLabel?: string;
542
+ external?: boolean;
543
+ }
544
+ interface OonNavigationCardsBlockDef extends OonBaseBlockDef {
545
+ type: "navigation.cards";
546
+ cards: OonNavigationCardDef[];
547
+ columns?: 1 | 2 | 3 | 4;
548
+ }
535
549
  interface OonGenericBlockDef extends OonBaseBlockDef {
536
550
  type: "collection.form" | "pipeline.board" | "document.viewer" | "dashboard.kpi" | "tabs";
537
551
  [key: string]: unknown;
@@ -678,10 +692,28 @@ interface CentralFormFieldDef extends OonFormFieldDef {
678
692
  /** Mantém somente opções em que estes campos estejam vazios/nulos. */
679
693
  referenceEmptyFields?: string[];
680
694
  }
695
+ type DashboardFilterPrimitive$1 = string | number | boolean | null;
696
+ type DashboardFilterValue$1 = DashboardFilterPrimitive$1 | {
697
+ eq?: DashboardFilterPrimitive$1;
698
+ ne?: DashboardFilterPrimitive$1;
699
+ in?: DashboardFilterPrimitive$1[];
700
+ nin?: DashboardFilterPrimitive$1[];
701
+ gt?: DashboardFilterPrimitive$1;
702
+ gte?: DashboardFilterPrimitive$1;
703
+ lt?: DashboardFilterPrimitive$1;
704
+ lte?: DashboardFilterPrimitive$1;
705
+ exists?: boolean;
706
+ };
707
+ type CentralDashboardWidget = Omit<DashboardWidgetDef, "kind"> & {
708
+ description?: string;
709
+ kind?: "count" | "sum" | "groupCount" | "groupSum" | "custom";
710
+ groupBy?: string;
711
+ filters?: Record<string, DashboardFilterValue$1>;
712
+ format?: "number" | "currency";
713
+ };
681
714
  /**
682
- * Schema do `central.ui.json` (Seção 9 do escopo). É o que o frontend
683
- * consumidor gerado pelo `create-central-oon` carrega — declaração pura, sem
684
- * código de UI. O Core converte isto em `OonCoreFrontConfig`.
715
+ * Schema do `central.ui.json` (Seção 9). É o que o frontend consumidor
716
+ * carrega; a Central declara UI e o Core converte para rotas e componentes.
685
717
  */
686
718
  interface CentralUiManifest {
687
719
  name: string;
@@ -698,12 +730,22 @@ interface CentralUiManifest {
698
730
  registry?: OonComponentRegistry;
699
731
  navigation?: OonNavigationConfig;
700
732
  pages?: OonPageDef[];
733
+ dashboards?: Array<{
734
+ id?: string;
735
+ label?: string;
736
+ path?: string;
737
+ section?: string;
738
+ hidden?: boolean;
739
+ order?: number;
740
+ widgets?: CentralDashboardWidget[];
741
+ }>;
701
742
  collections?: Array<{
702
743
  model: string;
703
744
  mode?: CollectionMode;
704
745
  path?: string;
705
746
  label?: string;
706
747
  section?: string;
748
+ hidden?: boolean;
707
749
  /** Overrides pontuais de campos; os demais continuam vindo da metadata. */
708
750
  form?: CentralFormFieldDef[];
709
751
  list?: OonCollectionListConfig;
@@ -768,11 +810,8 @@ interface ManifestRuntime {
768
810
  /** Converte o manifesto declarativo + runtime em config do Core. */
769
811
  declare function manifestToConfig(manifest: CentralUiManifest, runtime: ManifestRuntime): OonCoreFrontConfig;
770
812
  /**
771
- * Bootstrap a partir do `central.ui.json`. É a única linha que o `main.tsx` de
772
- * uma Central gerada precisa:
773
- *
774
- * import manifest from "../central.ui.json";
775
- * startFromManifest(manifest, { apiBaseUrl: import.meta.env.VITE_API_URL });
813
+ * Bootstrap a partir do `central.ui.json`. É a única linha que o frontend
814
+ * consumidor precisa para carregar o manifesto da Central.
776
815
  */
777
816
  declare function startFromManifest(manifest: CentralUiManifest, runtime: ManifestRuntime): void;
778
817
 
@@ -965,14 +1004,30 @@ interface CoreAssistantProps {
965
1004
  */
966
1005
  declare function CoreAssistant({ assistantCode, label, entity, endpoint }: CoreAssistantProps): react.JSX.Element;
967
1006
 
1007
+ type DashboardFilterPrimitive = string | number | boolean | null;
1008
+ type DashboardFilterValue = DashboardFilterPrimitive | {
1009
+ eq?: DashboardFilterPrimitive;
1010
+ ne?: DashboardFilterPrimitive;
1011
+ in?: DashboardFilterPrimitive[];
1012
+ nin?: DashboardFilterPrimitive[];
1013
+ gt?: DashboardFilterPrimitive;
1014
+ gte?: DashboardFilterPrimitive;
1015
+ lt?: DashboardFilterPrimitive;
1016
+ lte?: DashboardFilterPrimitive;
1017
+ exists?: boolean;
1018
+ };
1019
+ type CoreDashboardWidget = Omit<DashboardWidgetDef, "kind"> & {
1020
+ description?: string;
1021
+ kind?: "count" | "sum" | "groupCount" | "groupSum" | "custom";
1022
+ groupBy?: string;
1023
+ filters?: Record<string, DashboardFilterValue>;
1024
+ format?: "number" | "currency";
1025
+ };
968
1026
  interface CoreDashboardProps {
969
1027
  label?: string;
970
- widgets?: DashboardWidgetDef[];
1028
+ widgets?: CoreDashboardWidget[];
971
1029
  }
972
- /**
973
- * Dashboard do Core: renderiza widgets registrados (count/sum por model ou
974
- * render custom). Cache, loading e erro ficam no Core; a Central só declara.
975
- */
1030
+ /** Dashboard declarativo com agregações executadas integralmente no backend. */
976
1031
  declare function CoreDashboard({ label, widgets }: CoreDashboardProps): react.JSX.Element;
977
1032
 
978
1033
  declare function CorePage({ page, registry }: {