@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.
- package/README.md +4 -0
- package/dist/client.js +81 -52
- package/dist/client.min.js +1 -1
- package/dist/client.min.js.map +1 -1
- package/dist/commonItems.d.ts +4 -4
- package/dist/content/types.d.ts +4 -2
- package/dist/content/utils.d.ts +1 -1
- package/dist/layout/types.d.ts +3 -3
- package/dist/layout/utils.d.ts +1 -1
- package/package.json +6 -6
- package/dist/content/components/ActionLinkSidebarItemComponent.d.ts +0 -9
- package/dist/content/components/ContentItemWrapper.d.ts +0 -12
- package/dist/content/components/dividerSidebarItem.d.ts +0 -2
- package/dist/hooks/DataHooks.d.ts +0 -12
- package/dist/hooks/ExecuteDataHook.d.ts +0 -7
- package/dist/hooks/types.d.ts +0 -19
- package/dist/layout/components/CustomItem.d.ts +0 -7
- package/dist/layout/components/CustomItemComponent.d.ts +0 -7
- package/dist/layout/components/ItemBar.d.ts +0 -15
- package/dist/layout/components/ItemWrapper.d.ts +0 -19
- package/dist/layout/components/SidebarToggleMenuItem.d.ts +0 -7
- package/dist/layout/hooks/useBuildData.d.ts +0 -3
- package/dist/layout/hooks/useIsActiveRoute.d.ts +0 -2
- package/dist/layout/hooks/useSelectState.d.ts +0 -2
- package/dist/layout/mergeItems.d.ts +0 -2
package/dist/layout/types.d.ts
CHANGED
|
@@ -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)[];
|
package/dist/layout/utils.d.ts
CHANGED
|
@@ -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
|
|
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": "
|
|
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": "^
|
|
36
|
-
"@imperium/router": "^
|
|
37
|
-
"@imperium/state": "^
|
|
38
|
-
"@thx/controls": "^
|
|
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": "
|
|
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,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 {};
|
package/dist/hooks/types.d.ts
DELETED
|
@@ -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 { 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 {};
|