@juicemantics/veloiq-ui 0.3.0 → 0.6.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 JuiceMantics
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.d.mts CHANGED
@@ -152,7 +152,7 @@ interface FieldDef {
152
152
  /** Roles allowed to write this field (absent = all roles). Emitted by veloiq_field(write_roles=…). */
153
153
  writeRoles?: string[];
154
154
  }
155
- type RelationViewType = "table" | "editable-table" | "editable-list" | "list" | "csv" | "read-and-edit-list" | "read-and-edit-csv" | "editable-csv" | "gallery" | "calendar" | "primary" | "totals-details" | "tree" | "tree-details";
155
+ type RelationViewType = "table" | "editable-table" | "crosstab" | "editable-crosstab" | "editable-list" | "list" | "csv" | "read-and-edit-list" | "read-and-edit-csv" | "editable-csv" | "gallery" | "calendar" | "primary" | "totals-details" | "tree" | "tree-details";
156
156
  interface MillerLeafConfig {
157
157
  relationPath: string;
158
158
  targetKey: string;
@@ -289,7 +289,11 @@ declare const ModelHeading: React__default.FC<{
289
289
  actionLabel?: string;
290
290
  }>;
291
291
 
292
- declare const useShowActionsPreferences: (model: ModelDef, allModels?: ModelDef[], record?: any, saveButtonProps?: any) => {
292
+ declare const useShowActionsPreferences: (model: ModelDef, allModels?: ModelDef[], record?: any, saveButtonProps?: any, configureLayoutButtonRef?: {
293
+ current: React__default.ReactNode;
294
+ }, saveLayoutRef?: {
295
+ current: () => void;
296
+ }) => {
293
297
  actionsState: {
294
298
  showActions: boolean;
295
299
  showCreate: boolean;
@@ -343,10 +347,19 @@ declare const useStandardShowTabs: (model: ModelDef | undefined, record: any, al
343
347
  formProps?: any;
344
348
  effectiveFields?: FieldDef[];
345
349
  }, overrideConfigRows?: ViewConfigRow[]) => {
346
- key: string;
347
- label: React__default.ReactNode;
348
- children: React__default.ReactNode;
349
- }[];
350
+ tabs: {
351
+ key: string;
352
+ label: React__default.ReactNode;
353
+ children: React__default.ReactNode;
354
+ }[];
355
+ layoutConfig: {
356
+ isConfiguring: boolean;
357
+ enterConfigMode: () => void;
358
+ saveLayout: () => void;
359
+ cancelLayout: () => void;
360
+ hasConfig: boolean;
361
+ };
362
+ };
350
363
 
351
364
  declare const renderRelationBlock: ({ rel, relationModel, relatedModel, record, mode, parentResource, allModels, showLabel, showActions, showCreate, relationViewTypeDefaults, labelStyle, valueStyle, fieldLayoutStyle, }: {
352
365
  rel: RelationDef;
@@ -377,7 +390,7 @@ declare const DynamicList: React__default.FC<{
377
390
  showActions?: boolean;
378
391
  showCreate?: boolean;
379
392
  layoutPreferenceType?: "ShowLayout" | "EditLayout";
380
- listViewType?: "table" | "gallery" | "calendar" | "totals-details";
393
+ listViewType?: "table" | "gallery" | "calendar" | "totals-details" | "crosstab" | "editable-crosstab";
381
394
  rowSelection?: any;
382
395
  extraHeaderButtons?: React__default.ReactNode;
383
396
  bulkActions?: BulkActionDef[];
@@ -449,6 +462,19 @@ interface ResourceContextValue {
449
462
  }
450
463
  declare const ResourceContext: React$1.Context<ResourceContextValue>;
451
464
 
465
+ /**
466
+ * Makes the app's navigation.config.json available to any component rendered
467
+ * inside LayoutWrapper (including extension-contributed routes). This is the
468
+ * authoritative list of modules ("module:{name}" entries) and their labels.
469
+ */
470
+ declare const NavConfigContext: React$1.Context<NavConfig>;
471
+ declare const useNavConfig: () => NavConfig;
472
+ /** Convenience: module entries from the nav config as {value, label} options. */
473
+ declare function useNavModules(): {
474
+ value: string;
475
+ label: string;
476
+ }[];
477
+
452
478
  interface LoginPageProps {
453
479
  /** App title shown on the login card. Defaults to "VeloIQ". */
454
480
  appTitle?: string;
@@ -459,10 +485,11 @@ declare const LoginPage: React__default.FC<LoginPageProps>;
459
485
 
460
486
  declare const DashboardPage: React__default.FC;
461
487
 
488
+ type CellSourceType = "model" | "named_query" | "field" | "relation" | "custom";
462
489
  interface DashboardCell {
463
490
  id: string;
464
491
  model: string;
465
- source_type: "model";
492
+ source_type: CellSourceType;
466
493
  row: number;
467
494
  col: number;
468
495
  view_type: string | null;
@@ -471,6 +498,8 @@ interface DashboardCell {
471
498
  max_width: string | null;
472
499
  min_height: string | null;
473
500
  max_height: string | null;
501
+ section_name?: string;
502
+ section_id?: string;
474
503
  }
475
504
  interface DashboardTab {
476
505
  id: string;
@@ -482,12 +511,22 @@ interface DashboardConfig {
482
511
  tabs: DashboardTab[];
483
512
  }
484
513
 
485
- interface Props {
514
+ interface Props$1 {
486
515
  config: DashboardConfig;
487
516
  allModels: ModelDef[];
488
517
  onConfigChange: (next: DashboardConfig) => void;
489
518
  }
490
- declare const ViewsGrid: React__default.FC<Props>;
519
+ declare const ViewsGrid: React__default.FC<Props$1>;
520
+
521
+ interface Props {
522
+ cells: DashboardCell[];
523
+ config: DashboardConfig;
524
+ tabId: string;
525
+ renderContent: (cell: DashboardCell) => React__default.ReactNode;
526
+ onConfigChange: (next: DashboardConfig) => void;
527
+ isConfiguring?: boolean;
528
+ }
529
+ declare const SectionsGrid: React__default.FC<Props>;
491
530
 
492
531
  declare const RecentActivityPanel: React__default.FC;
493
532
 
@@ -522,6 +561,24 @@ type ShortcutDef = {
522
561
  };
523
562
  declare function useKeyboardShortcuts(shortcuts: ShortcutDef[]): void;
524
563
 
564
+ interface RecordResult {
565
+ id: number | string;
566
+ label: string;
567
+ }
568
+ interface ModelSearchResult {
569
+ modelName: string;
570
+ modelLabel: string;
571
+ resource: string;
572
+ records: RecordResult[];
573
+ }
574
+ interface UseRecordSearchReturn {
575
+ results: ModelSearchResult[];
576
+ searching: boolean;
577
+ search: (query: string) => void;
578
+ clear: () => void;
579
+ }
580
+ declare function useRecordSearch(): UseRecordSearchReturn;
581
+
525
582
  interface ResourceDef {
526
583
  name: string;
527
584
  list: string;
@@ -579,4 +636,4 @@ declare const getModelTone: (modelLike?: string | {
579
636
 
580
637
  declare const authSystemModels: ModelDef[];
581
638
 
582
- export { API_URL, AllModelsProvider, type BulkActionDef, ColorModeContext, ColorModeContextProvider, CommandCenterPortal, type CommandCenterPortalProps, CustomSider, type DashboardCell, type DashboardConfig, DashboardPage, type DashboardTab, DynamicCreate, DynamicEdit, DynamicList, DynamicShow, ExecutableHtml, type FieldDef, GlobalSearch, HierarchyView, HorizontalMenu, InlinePlotlyHtml, LayoutWrapper, type LayoutWrapperProps, LoginPage, type LoginPageProps, type MillerLeafConfig, type ModelDef, ModelHeading, MultiPaneLayout, type NavConfig, type NavConfigEntry, PaneNavigationContext, PinnedRecordsPanel, PrimaryShowContext, type PrimaryShowRendererProps, type RecentActivityData, type RecentActivityGroup, RecentActivityPanel, type RecentRecord, ReferenceField, type RelationDef, ResourceContext, type ResourceDef, ShowFooterButtons, StandardList, StandardShow, type ViewConfigRow, ViewsGrid, accessControlProvider, authProvider, authSystemModels, authenticatedFetch, buildShowTabFormOptions, generateResources, getModelTone, getNavEntry, guessIcon, httpClient, normalizeToneKey, renderRelationBlock, resolveIcon, setColorSchemas, sortItemsByNavConfig, useAllModels, useKeyboardShortcuts, useMetadataModal, usePaneNavigation, useShowActionsPreferences, useShowEditableForm, useStandardShowTabs };
639
+ export { API_URL, AllModelsProvider, type BulkActionDef, type CellSourceType, ColorModeContext, ColorModeContextProvider, CommandCenterPortal, type CommandCenterPortalProps, CustomSider, type DashboardCell, type DashboardConfig, DashboardPage, type DashboardTab, DynamicCreate, DynamicEdit, DynamicList, DynamicShow, ExecutableHtml, type FieldDef, GlobalSearch, HierarchyView, HorizontalMenu, InlinePlotlyHtml, LayoutWrapper, type LayoutWrapperProps, LoginPage, type LoginPageProps, type MillerLeafConfig, type ModelDef, ModelHeading, type ModelSearchResult, MultiPaneLayout, type NavConfig, NavConfigContext, type NavConfigEntry, PaneNavigationContext, PinnedRecordsPanel, PrimaryShowContext, type PrimaryShowRendererProps, type RecentActivityData, type RecentActivityGroup, RecentActivityPanel, type RecentRecord, type RecordResult, ReferenceField, type RelationDef, ResourceContext, type ResourceDef, SectionsGrid, ShowFooterButtons, StandardList, StandardShow, type UseRecordSearchReturn, type ViewConfigRow, ViewsGrid, accessControlProvider, authProvider, authSystemModels, authenticatedFetch, buildShowTabFormOptions, generateResources, getModelTone, getNavEntry, guessIcon, httpClient, normalizeToneKey, renderRelationBlock, resolveIcon, setColorSchemas, sortItemsByNavConfig, useAllModels, useKeyboardShortcuts, useMetadataModal, useNavConfig, useNavModules, usePaneNavigation, useRecordSearch, useShowActionsPreferences, useShowEditableForm, useStandardShowTabs };
package/dist/index.d.ts CHANGED
@@ -152,7 +152,7 @@ interface FieldDef {
152
152
  /** Roles allowed to write this field (absent = all roles). Emitted by veloiq_field(write_roles=…). */
153
153
  writeRoles?: string[];
154
154
  }
155
- type RelationViewType = "table" | "editable-table" | "editable-list" | "list" | "csv" | "read-and-edit-list" | "read-and-edit-csv" | "editable-csv" | "gallery" | "calendar" | "primary" | "totals-details" | "tree" | "tree-details";
155
+ type RelationViewType = "table" | "editable-table" | "crosstab" | "editable-crosstab" | "editable-list" | "list" | "csv" | "read-and-edit-list" | "read-and-edit-csv" | "editable-csv" | "gallery" | "calendar" | "primary" | "totals-details" | "tree" | "tree-details";
156
156
  interface MillerLeafConfig {
157
157
  relationPath: string;
158
158
  targetKey: string;
@@ -289,7 +289,11 @@ declare const ModelHeading: React__default.FC<{
289
289
  actionLabel?: string;
290
290
  }>;
291
291
 
292
- declare const useShowActionsPreferences: (model: ModelDef, allModels?: ModelDef[], record?: any, saveButtonProps?: any) => {
292
+ declare const useShowActionsPreferences: (model: ModelDef, allModels?: ModelDef[], record?: any, saveButtonProps?: any, configureLayoutButtonRef?: {
293
+ current: React__default.ReactNode;
294
+ }, saveLayoutRef?: {
295
+ current: () => void;
296
+ }) => {
293
297
  actionsState: {
294
298
  showActions: boolean;
295
299
  showCreate: boolean;
@@ -343,10 +347,19 @@ declare const useStandardShowTabs: (model: ModelDef | undefined, record: any, al
343
347
  formProps?: any;
344
348
  effectiveFields?: FieldDef[];
345
349
  }, overrideConfigRows?: ViewConfigRow[]) => {
346
- key: string;
347
- label: React__default.ReactNode;
348
- children: React__default.ReactNode;
349
- }[];
350
+ tabs: {
351
+ key: string;
352
+ label: React__default.ReactNode;
353
+ children: React__default.ReactNode;
354
+ }[];
355
+ layoutConfig: {
356
+ isConfiguring: boolean;
357
+ enterConfigMode: () => void;
358
+ saveLayout: () => void;
359
+ cancelLayout: () => void;
360
+ hasConfig: boolean;
361
+ };
362
+ };
350
363
 
351
364
  declare const renderRelationBlock: ({ rel, relationModel, relatedModel, record, mode, parentResource, allModels, showLabel, showActions, showCreate, relationViewTypeDefaults, labelStyle, valueStyle, fieldLayoutStyle, }: {
352
365
  rel: RelationDef;
@@ -377,7 +390,7 @@ declare const DynamicList: React__default.FC<{
377
390
  showActions?: boolean;
378
391
  showCreate?: boolean;
379
392
  layoutPreferenceType?: "ShowLayout" | "EditLayout";
380
- listViewType?: "table" | "gallery" | "calendar" | "totals-details";
393
+ listViewType?: "table" | "gallery" | "calendar" | "totals-details" | "crosstab" | "editable-crosstab";
381
394
  rowSelection?: any;
382
395
  extraHeaderButtons?: React__default.ReactNode;
383
396
  bulkActions?: BulkActionDef[];
@@ -449,6 +462,19 @@ interface ResourceContextValue {
449
462
  }
450
463
  declare const ResourceContext: React$1.Context<ResourceContextValue>;
451
464
 
465
+ /**
466
+ * Makes the app's navigation.config.json available to any component rendered
467
+ * inside LayoutWrapper (including extension-contributed routes). This is the
468
+ * authoritative list of modules ("module:{name}" entries) and their labels.
469
+ */
470
+ declare const NavConfigContext: React$1.Context<NavConfig>;
471
+ declare const useNavConfig: () => NavConfig;
472
+ /** Convenience: module entries from the nav config as {value, label} options. */
473
+ declare function useNavModules(): {
474
+ value: string;
475
+ label: string;
476
+ }[];
477
+
452
478
  interface LoginPageProps {
453
479
  /** App title shown on the login card. Defaults to "VeloIQ". */
454
480
  appTitle?: string;
@@ -459,10 +485,11 @@ declare const LoginPage: React__default.FC<LoginPageProps>;
459
485
 
460
486
  declare const DashboardPage: React__default.FC;
461
487
 
488
+ type CellSourceType = "model" | "named_query" | "field" | "relation" | "custom";
462
489
  interface DashboardCell {
463
490
  id: string;
464
491
  model: string;
465
- source_type: "model";
492
+ source_type: CellSourceType;
466
493
  row: number;
467
494
  col: number;
468
495
  view_type: string | null;
@@ -471,6 +498,8 @@ interface DashboardCell {
471
498
  max_width: string | null;
472
499
  min_height: string | null;
473
500
  max_height: string | null;
501
+ section_name?: string;
502
+ section_id?: string;
474
503
  }
475
504
  interface DashboardTab {
476
505
  id: string;
@@ -482,12 +511,22 @@ interface DashboardConfig {
482
511
  tabs: DashboardTab[];
483
512
  }
484
513
 
485
- interface Props {
514
+ interface Props$1 {
486
515
  config: DashboardConfig;
487
516
  allModels: ModelDef[];
488
517
  onConfigChange: (next: DashboardConfig) => void;
489
518
  }
490
- declare const ViewsGrid: React__default.FC<Props>;
519
+ declare const ViewsGrid: React__default.FC<Props$1>;
520
+
521
+ interface Props {
522
+ cells: DashboardCell[];
523
+ config: DashboardConfig;
524
+ tabId: string;
525
+ renderContent: (cell: DashboardCell) => React__default.ReactNode;
526
+ onConfigChange: (next: DashboardConfig) => void;
527
+ isConfiguring?: boolean;
528
+ }
529
+ declare const SectionsGrid: React__default.FC<Props>;
491
530
 
492
531
  declare const RecentActivityPanel: React__default.FC;
493
532
 
@@ -522,6 +561,24 @@ type ShortcutDef = {
522
561
  };
523
562
  declare function useKeyboardShortcuts(shortcuts: ShortcutDef[]): void;
524
563
 
564
+ interface RecordResult {
565
+ id: number | string;
566
+ label: string;
567
+ }
568
+ interface ModelSearchResult {
569
+ modelName: string;
570
+ modelLabel: string;
571
+ resource: string;
572
+ records: RecordResult[];
573
+ }
574
+ interface UseRecordSearchReturn {
575
+ results: ModelSearchResult[];
576
+ searching: boolean;
577
+ search: (query: string) => void;
578
+ clear: () => void;
579
+ }
580
+ declare function useRecordSearch(): UseRecordSearchReturn;
581
+
525
582
  interface ResourceDef {
526
583
  name: string;
527
584
  list: string;
@@ -579,4 +636,4 @@ declare const getModelTone: (modelLike?: string | {
579
636
 
580
637
  declare const authSystemModels: ModelDef[];
581
638
 
582
- export { API_URL, AllModelsProvider, type BulkActionDef, ColorModeContext, ColorModeContextProvider, CommandCenterPortal, type CommandCenterPortalProps, CustomSider, type DashboardCell, type DashboardConfig, DashboardPage, type DashboardTab, DynamicCreate, DynamicEdit, DynamicList, DynamicShow, ExecutableHtml, type FieldDef, GlobalSearch, HierarchyView, HorizontalMenu, InlinePlotlyHtml, LayoutWrapper, type LayoutWrapperProps, LoginPage, type LoginPageProps, type MillerLeafConfig, type ModelDef, ModelHeading, MultiPaneLayout, type NavConfig, type NavConfigEntry, PaneNavigationContext, PinnedRecordsPanel, PrimaryShowContext, type PrimaryShowRendererProps, type RecentActivityData, type RecentActivityGroup, RecentActivityPanel, type RecentRecord, ReferenceField, type RelationDef, ResourceContext, type ResourceDef, ShowFooterButtons, StandardList, StandardShow, type ViewConfigRow, ViewsGrid, accessControlProvider, authProvider, authSystemModels, authenticatedFetch, buildShowTabFormOptions, generateResources, getModelTone, getNavEntry, guessIcon, httpClient, normalizeToneKey, renderRelationBlock, resolveIcon, setColorSchemas, sortItemsByNavConfig, useAllModels, useKeyboardShortcuts, useMetadataModal, usePaneNavigation, useShowActionsPreferences, useShowEditableForm, useStandardShowTabs };
639
+ export { API_URL, AllModelsProvider, type BulkActionDef, type CellSourceType, ColorModeContext, ColorModeContextProvider, CommandCenterPortal, type CommandCenterPortalProps, CustomSider, type DashboardCell, type DashboardConfig, DashboardPage, type DashboardTab, DynamicCreate, DynamicEdit, DynamicList, DynamicShow, ExecutableHtml, type FieldDef, GlobalSearch, HierarchyView, HorizontalMenu, InlinePlotlyHtml, LayoutWrapper, type LayoutWrapperProps, LoginPage, type LoginPageProps, type MillerLeafConfig, type ModelDef, ModelHeading, type ModelSearchResult, MultiPaneLayout, type NavConfig, NavConfigContext, type NavConfigEntry, PaneNavigationContext, PinnedRecordsPanel, PrimaryShowContext, type PrimaryShowRendererProps, type RecentActivityData, type RecentActivityGroup, RecentActivityPanel, type RecentRecord, type RecordResult, ReferenceField, type RelationDef, ResourceContext, type ResourceDef, SectionsGrid, ShowFooterButtons, StandardList, StandardShow, type UseRecordSearchReturn, type ViewConfigRow, ViewsGrid, accessControlProvider, authProvider, authSystemModels, authenticatedFetch, buildShowTabFormOptions, generateResources, getModelTone, getNavEntry, guessIcon, httpClient, normalizeToneKey, renderRelationBlock, resolveIcon, setColorSchemas, sortItemsByNavConfig, useAllModels, useKeyboardShortcuts, useMetadataModal, useNavConfig, useNavModules, usePaneNavigation, useRecordSearch, useShowActionsPreferences, useShowEditableForm, useStandardShowTabs };