@imperium/layout 7.3.0 → 8.0.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.
@@ -19,20 +19,20 @@ export interface CustomLayoutItem extends WeightedItem, VisibilityItem {
19
19
  * Describes a menu that displays a dropdown list of items
20
20
  */
21
21
  export interface DropdownLayoutItem extends BaseLayoutItem {
22
- dropdown: ((BaseLayoutItem & RouteItem) | CustomLayoutItem)[];
22
+ dropdown: ((BaseLayoutItem & RouteItem<Data>) | CustomLayoutItem)[];
23
23
  key?: string;
24
24
  }
25
25
  /**
26
26
  * Describes a menu that displays a sub menu (not a dropdown list)
27
27
  */
28
28
  export interface MenuLayoutItem extends BaseLayoutItem {
29
- menu: ((BaseLayoutItem & RouteItem) | CustomLayoutItem)[];
29
+ menu: ((BaseLayoutItem & RouteItem<Data>) | CustomLayoutItem)[];
30
30
  key?: string;
31
31
  }
32
32
  /**
33
33
  * Describes a horizontal menu item which is either a route item or dropdown menu
34
34
  */
35
- export declare type LayoutItem = (BaseLayoutItem & RouteItem) | DropdownLayoutItem | MenuLayoutItem | CustomLayoutItem;
35
+ export declare type LayoutItem = (BaseLayoutItem & RouteItem<Data>) | DropdownLayoutItem | MenuLayoutItem | CustomLayoutItem;
36
36
  export interface LayoutData {
37
37
  dataHooks?: DataHookItem[];
38
38
  primaryMenu?: (LayoutItem & HorizontalPositionedItem)[];
@@ -11,7 +11,7 @@ export declare function splitPositionedItems<T extends LayoutItem>(items: T[]):
11
11
  leftItems: T[];
12
12
  rightItems: T[];
13
13
  };
14
- export declare function linkParameters(item: BaseLayoutItem & RouteItem, data: Data): {
14
+ export declare function linkParameters(item: BaseLayoutItem & RouteItem<Data>, data: Data): {
15
15
  as: typeof Link;
16
16
  active: boolean;
17
17
  to: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imperium/layout",
3
- "version": "7.3.0",
3
+ "version": "8.0.0",
4
4
  "description": "Imperium Layout package",
5
5
  "bugs": {
6
6
  "url": "https://github.com/darkadept/imperium/issues"
@@ -32,10 +32,10 @@
32
32
  }
33
33
  },
34
34
  "dependencies": {
35
- "@imperium/client": "^7.1.0",
36
- "@imperium/router": "^7.3.0",
37
- "@imperium/state": "^7.3.0",
38
- "@thx/controls": "^14.2.0",
35
+ "@imperium/client": "^8.0.0",
36
+ "@imperium/router": "^8.0.0",
37
+ "@imperium/state": "^8.0.0",
38
+ "@thx/controls": "^15.1.1",
39
39
  "debug": "^4.3.2",
40
40
  "history": "^5.0.1",
41
41
  "lodash": "^4.17.21",
@@ -57,5 +57,5 @@
57
57
  "publishConfig": {
58
58
  "access": "public"
59
59
  },
60
- "gitHead": "f18fed7e197814a1deadcd62e054b3aa1d72a4dc"
60
+ "gitHead": "e1234231615207615a284030e54137957b9e8411"
61
61
  }
@@ -1,9 +0,0 @@
1
- /// <reference types="react" />
2
- import type { DefineRouteOptions } from '@imperium/router';
3
- import type { BaseSidebarItem, ContentData } from '../types';
4
- interface ActionLinkSidebarItemProps<T extends DefineRouteOptions, K extends keyof T> {
5
- item: BaseSidebarItem<T, K>;
6
- data: ContentData<T, K>;
7
- }
8
- export declare function ActionLinkSidebarItemComponent<T extends DefineRouteOptions, K extends keyof T>({ item, data }: ActionLinkSidebarItemProps<T, K>): JSX.Element;
9
- export {};
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- import type { DefineRouteOptions } from '@imperium/router';
3
- import type { ContentData, RouteParameters, SidebarItem } from '../types';
4
- interface ContentItemWrapperProps<T extends DefineRouteOptions, K extends keyof T> {
5
- item: SidebarItem<T, K>;
6
- as?: React.ComponentClass;
7
- vertical?: boolean;
8
- data?: ContentData<T, K>;
9
- params: RouteParameters<T[K]['params']>;
10
- }
11
- export declare function ContentItemWrapper<T extends DefineRouteOptions, K extends keyof T>({ item, data: parentData, params }: ContentItemWrapperProps<T, K>): JSX.Element | null;
12
- export {};
@@ -1,2 +0,0 @@
1
- import type { DividerSidebarItem } from '../types';
2
- export declare const dividerSidebarItem: DividerSidebarItem<any, any>;
@@ -1,12 +0,0 @@
1
- /// <reference types="react" />
2
- import type { DataHookItem } from './types';
3
- interface DataHooksProps {
4
- dataHooks: DataHookItem[];
5
- }
6
- /**
7
- * Renders layout data hooks. These hooks should return nothing. All interaction should be in side-effects, usually retrieving data and setting Redux state.
8
- * @param dataHooks
9
- * @constructor
10
- */
11
- export declare function DataHooks({ dataHooks }: DataHooksProps): JSX.Element;
12
- export {};
@@ -1,7 +0,0 @@
1
- import type { DataHook } from './types';
2
- interface ExecuteDataHookProps {
3
- dataHook: DataHook;
4
- routeParams?: any;
5
- }
6
- export declare function ExecuteDataHook({ dataHook, routeParams }: ExecuteDataHookProps): null;
7
- export {};
@@ -1,19 +0,0 @@
1
- /**
2
- * A simple hook, that doesn't return anything. If used together with a route match function, the returned route parameters are passed in.
3
- */
4
- export declare type DataHook = (routeParams?: any) => void;
5
- /**
6
- * A route match function that can be used by data hooks. Usually is the @imperium/router `routes.match.x()` functions.
7
- */
8
- export declare type DataHookRouteMatchFn = (route: string) => any;
9
- /**
10
- * An object that can specify one or more data hooks that can receive route parameters from one or more route match functions.
11
- */
12
- export declare type DataHookRoute = {
13
- routeMatch: DataHookRouteMatchFn | DataHookRouteMatchFn[];
14
- dataHook: DataHook | DataHook[];
15
- };
16
- /**
17
- * A datahook can either be a simple hook, or one or more hooks dependant on one or more route match functions.
18
- */
19
- export declare type DataHookItem = DataHook | DataHookRoute;
@@ -1,7 +0,0 @@
1
- /// <reference types="react" />
2
- import type { CustomItem } from '../../commonItems';
3
- interface CustomItemComponentProps {
4
- item: CustomItem;
5
- }
6
- export declare function CustomItemComponent({ item }: CustomItemComponentProps): JSX.Element | null;
7
- export {};
@@ -1,7 +0,0 @@
1
- /// <reference types="react" />
2
- import type { CustomLayoutItem } from '../types';
3
- interface CustomItemComponentProps {
4
- item: CustomLayoutItem;
5
- }
6
- export declare function CustomItemComponent({ item }: CustomItemComponentProps): JSX.Element | null;
7
- export {};
@@ -1,15 +0,0 @@
1
- /// <reference types="react" />
2
- import type { MenuProps } from 'semantic-ui-react';
3
- import type { LayoutItem } from '../types';
4
- interface ItemBarProps extends MenuProps {
5
- items: LayoutItem[];
6
- }
7
- /**
8
- * Renders a horizontal or vertical bar of menu items.
9
- * @param name
10
- * @param items
11
- * @param rest
12
- * @constructor
13
- */
14
- export declare function ItemBar({ items, ...rest }: ItemBarProps): JSX.Element;
15
- export {};
@@ -1,19 +0,0 @@
1
- import React from 'react';
2
- import type { LayoutItem } from '../types';
3
- import type { Data } from '../../types';
4
- interface ItemWrapperProps {
5
- item: LayoutItem;
6
- as?: React.ComponentClass;
7
- vertical?: boolean;
8
- data?: Data;
9
- }
10
- /**
11
- * Renders any type of Item. Gathers state, route and other data and checks for visibility.
12
- * @param item
13
- * @param as
14
- * @param vertical
15
- * @param parentData
16
- * @constructor
17
- */
18
- export declare function ItemWrapper({ item, as, vertical, data: parentData }: ItemWrapperProps): JSX.Element | null;
19
- export {};
@@ -1,7 +0,0 @@
1
- /// <reference types="react" />
2
- interface SidebarToggleMenuItemProps {
3
- menuOpen: boolean;
4
- setMenuOpen: (open: boolean) => void;
5
- }
6
- export declare function SidebarToggleMenuItem({ menuOpen, setMenuOpen }: SidebarToggleMenuItemProps): JSX.Element;
7
- export {};
@@ -1,3 +0,0 @@
1
- import type { LayoutItem } from '../types';
2
- import type { Data } from '../../types';
3
- export declare function useBuildData(item: LayoutItem, data?: Data): Data;
@@ -1,2 +0,0 @@
1
- import type { Data } from '../../types';
2
- export declare function useIsActiveRoute(data: Data, item?: any): boolean;
@@ -1,2 +0,0 @@
1
- import type { StateSelectorHook } from '../../types';
2
- export declare function useSelectState(stateSelectorHook?: StateSelectorHook | StateSelectorHook[]): any;
@@ -1,2 +0,0 @@
1
- import type { LayoutItem } from './types';
2
- export declare function mergeItems(items: LayoutItem[]): LayoutItem[];