@admin-layout/client 3.0.0-alpha.97 → 3.1.1-alpha.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/lib/components/ApplicationErrorFillWrapper.d.ts +2 -2
- package/lib/components/ApplicationErrorHandlerCommon.d.ts +2 -2
- package/lib/components/ErrorBoundaryCommon.d.ts +3 -3
- package/lib/constants/error.d.ts +5 -5
- package/lib/graphql/link/error-link.d.ts +1 -1
- package/lib/graphql/link/error-link.js.map +1 -1
- package/lib/interfaces/default-settings.d.ts +1 -1
- package/lib/interfaces/generated/generated-models.d.ts +311 -377
- package/lib/interfaces/generated/generated-models.js +2 -1
- package/lib/interfaces/generated/generated-models.js.map +1 -1
- package/lib/interfaces/layout/base-menu.d.ts +1 -1
- package/lib/interfaces/layout/basic-layout.d.ts +7 -3
- package/lib/interfaces/layout/global-header.d.ts +1 -1
- package/lib/interfaces/layout/sider-menu.d.ts +3 -3
- package/lib/interfaces/pure-settings.d.ts +3 -3
- package/lib/interfaces/typings.d.ts +1 -1
- package/lib/redux/actions/error-actions.d.ts +1 -1
- package/lib/redux/selectors/index.d.ts +1 -1
- package/lib/utils/componentSize.d.ts +7 -0
- package/lib/utils/componentSize.js +48 -0
- package/lib/utils/componentSize.js.map +1 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +1 -0
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/seperatedMenus.d.ts +1 -1
- package/package.json +2 -2
|
@@ -14,6 +14,7 @@ const defaultOptions = {};
|
|
|
14
14
|
;
|
|
15
15
|
;
|
|
16
16
|
;
|
|
17
|
+
;
|
|
17
18
|
export const OrgNameInContextFragmentDoc = gql `
|
|
18
19
|
fragment OrgNameInContext on Context {
|
|
19
20
|
orgName
|
|
@@ -21,7 +22,7 @@ export const OrgNameInContextFragmentDoc = gql `
|
|
|
21
22
|
`;
|
|
22
23
|
export const GetOrgNameFromContextDocument = gql `
|
|
23
24
|
query GetOrgNameFromContext {
|
|
24
|
-
getOrgNameFromContext
|
|
25
|
+
getOrgNameFromContext {
|
|
25
26
|
...OrgNameInContext
|
|
26
27
|
}
|
|
27
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generated-models.js","sourceRoot":"","sources":["../../../src/interfaces/generated/generated-models.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AAOzC,MAAM,cAAc,GAAI,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"generated-models.js","sourceRoot":"","sources":["../../../src/interfaces/generated/generated-models.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AAOzC,MAAM,cAAc,GAAI,EAAE,CAAA;AAoEzB,CAAC;AA+BD,CAAC;AAeD,CAAC;AAQD,CAAC;AAiED,CAAC;AAeD,CAAC;AA+JD,CAAC;AAwVD,CAAC;AA0GD,CAAC;AAMD,CAAC;AAgBD,CAAC;AAyCD,CAAC;AAmSD,CAAC;AA2DD,CAAC;AAqIF,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,CAAA;;;;KAIzC,CAAC;AACN,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,CAAA;;;;;;MAM1C,2BAA2B,EAAE,CAAC;AAEpC;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,6BAA6B,CAAC,WAAwG;IAC9I,MAAM,OAAO,mCAAO,cAAc,GAAK,WAAW,CAAC,CAAA;IACnD,OAAO,MAAM,CAAC,QAAQ,CAAoE,6BAA6B,EAAE,OAAO,CAAC,CAAC;AACpI,CAAC;AACP,MAAM,UAAU,iCAAiC,CAAC,WAA4G;IACpJ,MAAM,OAAO,mCAAO,cAAc,GAAK,WAAW,CAAC,CAAA;IACnD,OAAO,MAAM,CAAC,YAAY,CAAoE,6BAA6B,EAAE,OAAO,CAAC,CAAC;AACxI,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { MenuTheme, PureSettings } from "../pure-settings";
|
|
3
3
|
import { MenuDataItem, MessageDescriptor, Route, RouterTypes, WithFalse } from "../typings";
|
|
4
4
|
import { MenuProps } from "./menu";
|
|
5
|
-
export
|
|
5
|
+
export type MenuMode = 'vertical' | 'horizontal' | 'inline';
|
|
6
6
|
export interface BaseMenuProps extends Partial<RouterTypes<Route>>, Omit<MenuProps, 'openKeys' | 'onOpenChange' | 'title'>, Partial<PureSettings> {
|
|
7
7
|
className?: string;
|
|
8
8
|
/**
|
|
@@ -7,7 +7,7 @@ import { GetPageTitleProps } from './page';
|
|
|
7
7
|
import { SiderMenuProps } from './sider-menu';
|
|
8
8
|
import { ProSettings } from '../pure-settings';
|
|
9
9
|
import { IPermissionType } from '@adminide-stack/core';
|
|
10
|
-
export
|
|
10
|
+
export type LocaleType = {
|
|
11
11
|
'zh-CN': {
|
|
12
12
|
[key: string]: string;
|
|
13
13
|
};
|
|
@@ -21,11 +21,14 @@ export declare type LocaleType = {
|
|
|
21
21
|
[key: string]: string;
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
|
-
|
|
24
|
+
type MergerSettingsType<T> = Partial<T> & {
|
|
25
25
|
primaryColor?: string;
|
|
26
26
|
colorWeak?: boolean;
|
|
27
27
|
};
|
|
28
|
-
|
|
28
|
+
interface MainHeaderPropsInterface {
|
|
29
|
+
picture: string;
|
|
30
|
+
}
|
|
31
|
+
export type BasicLayoutProps = Partial<RouterTypes<Route>> & SiderMenuProps & HeaderViewProps & {
|
|
29
32
|
pure?: boolean;
|
|
30
33
|
/**
|
|
31
34
|
*@name logo url
|
|
@@ -64,5 +67,6 @@ export declare type BasicLayoutProps = Partial<RouterTypes<Route>> & SiderMenuPr
|
|
|
64
67
|
* Use both content margin
|
|
65
68
|
*/
|
|
66
69
|
disableContentMargin?: boolean;
|
|
70
|
+
mainHeaderProps?: MainHeaderPropsInterface;
|
|
67
71
|
};
|
|
68
72
|
export {};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { PureSettings } from '../pure-settings';
|
|
3
3
|
import { MenuDataItem, WithFalse } from '../typings';
|
|
4
4
|
import { PrivateSiderMenuProps, SiderMenuProps } from './sider-menu';
|
|
5
|
-
export
|
|
5
|
+
export type HeaderViewProps = GlobalHeaderProps & {
|
|
6
6
|
isMobile?: boolean;
|
|
7
7
|
collapsed?: boolean;
|
|
8
8
|
logo?: React.ReactNode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { WithFalse } from "../typings";
|
|
3
3
|
import { BaseMenuProps } from "./base-menu";
|
|
4
|
-
export
|
|
4
|
+
export type PrivateSiderMenuProps = {
|
|
5
5
|
matchMenuKeys: string[];
|
|
6
6
|
};
|
|
7
7
|
export interface SiderMenuProps extends Pick<BaseMenuProps, Exclude<keyof BaseMenuProps, ['onCollapse']>> {
|
|
@@ -21,8 +21,8 @@ export interface SiderMenuProps extends Pick<BaseMenuProps, Exclude<keyof BaseMe
|
|
|
21
21
|
onOpenChange?: (openKeys: WithFalse<string[]>) => void;
|
|
22
22
|
getContainer?: false;
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
type SiderTheme = 'light' | 'dark';
|
|
25
|
+
type CollapseType = 'clickTrigger' | 'responsive';
|
|
26
26
|
export interface SiderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
27
27
|
prefixCls?: string;
|
|
28
28
|
collapsible?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type ContentWidth = 'Fluid' | 'Fixed';
|
|
2
|
+
export type MenuTheme = 'light' | 'dark';
|
|
3
3
|
export interface RenderSetting {
|
|
4
4
|
showHeader?: boolean | any;
|
|
5
5
|
headerRender?: boolean | any;
|
|
@@ -75,4 +75,4 @@ export interface PureSettings {
|
|
|
75
75
|
splitMenus?: boolean;
|
|
76
76
|
siderMenuType?: string;
|
|
77
77
|
}
|
|
78
|
-
export
|
|
78
|
+
export type ProSettings = PureSettings & RenderSetting;
|
|
@@ -64,7 +64,7 @@ export interface Route extends MenuDataItem {
|
|
|
64
64
|
routes?: Route[];
|
|
65
65
|
breadcrumbName: string;
|
|
66
66
|
}
|
|
67
|
-
export
|
|
67
|
+
export type WithFalse<T> = T | false;
|
|
68
68
|
export interface RouterTypes<P> extends Omit<BasicRouteProps, 'location'> {
|
|
69
69
|
computedMatch?: match<P>;
|
|
70
70
|
route?: Route;
|
|
@@ -14,7 +14,7 @@ export declare const restoreApplicationError: (payload: ApplicationErrorState[])
|
|
|
14
14
|
type: "@platform/RESTORE_APPLICATION_ERRORS";
|
|
15
15
|
payload: ApplicationErrorState[];
|
|
16
16
|
};
|
|
17
|
-
export
|
|
17
|
+
export type ErrorActions = {
|
|
18
18
|
type: LOG_APPLICATION_ERROR;
|
|
19
19
|
payload: Omit<ApplicationErrorState, 'date'>;
|
|
20
20
|
} | {
|
|
@@ -2,7 +2,7 @@ import { ApplicationErrorState } from '../../interfaces';
|
|
|
2
2
|
interface Store {
|
|
3
3
|
applicationErrors: ApplicationErrorState[];
|
|
4
4
|
}
|
|
5
|
-
export declare const backendErrorSelector: ((state: Store) => ApplicationErrorState | undefined) & import("reselect").OutputSelectorFields<(args_0: ApplicationErrorState[]) => ApplicationErrorState
|
|
5
|
+
export declare const backendErrorSelector: ((state: Store) => ApplicationErrorState | undefined) & import("reselect").OutputSelectorFields<(args_0: ApplicationErrorState[]) => ApplicationErrorState | undefined, {
|
|
6
6
|
clearCache: () => void;
|
|
7
7
|
}> & {
|
|
8
8
|
clearCache: () => void;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
import { useState, useRef, useCallback, useLayoutEffect, useEffect } from 'react';
|
|
3
|
+
export const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;
|
|
4
|
+
const getSize = (el) => {
|
|
5
|
+
if (!el) {
|
|
6
|
+
return {
|
|
7
|
+
width: 0,
|
|
8
|
+
height: 0
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
width: el.offsetWidth,
|
|
13
|
+
height: el.offsetHeight
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export const useComponentSize = () => {
|
|
17
|
+
let ref = useRef(null);
|
|
18
|
+
const [componentSize, setComponentSize] = useState(getSize(ref ? ref.current : {}));
|
|
19
|
+
const handleResize = useCallback(() => {
|
|
20
|
+
if (ref.current) {
|
|
21
|
+
setComponentSize(getSize(ref.current));
|
|
22
|
+
}
|
|
23
|
+
}, [ref]);
|
|
24
|
+
useIsomorphicLayoutEffect(() => {
|
|
25
|
+
if (!ref.current) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
handleResize();
|
|
29
|
+
if (typeof ResizeObserver === 'function') {
|
|
30
|
+
let resizeObserver = new ResizeObserver(() => {
|
|
31
|
+
handleResize();
|
|
32
|
+
});
|
|
33
|
+
resizeObserver.observe(ref.current);
|
|
34
|
+
return () => {
|
|
35
|
+
resizeObserver.disconnect();
|
|
36
|
+
resizeObserver = null;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
window.addEventListener('resize', handleResize);
|
|
41
|
+
return () => {
|
|
42
|
+
window.removeEventListener('resize', handleResize);
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}, [ref.current]);
|
|
46
|
+
return Object.assign({ ref }, componentSize);
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=componentSize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"componentSize.js","sourceRoot":"","sources":["../../src/utils/componentSize.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE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EAAE;gBACV,cAAc,CAAC,UAAU,EAAE,CAAC;gBAC3B,cAAsB,GAAG,IAAI,CAAC;YACjC,CAAC,CAAC;SACH;aAAM;YACL,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;YAEhD,OAAO,GAAG,EAAE;gBACV,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;YACrD,CAAC,CAAC;SACH;IACH,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;IAElB,uBAAS,GAAG,IAAK,aAAa,EAAG;AACnC,CAAC,CAAA"}
|
package/lib/utils/index.d.ts
CHANGED
package/lib/utils/index.js
CHANGED
package/lib/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@admin-layout/client",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.1-alpha.0",
|
|
4
4
|
"description": "Sample client for higher packages to depend on",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"typescript": {
|
|
35
35
|
"definition": "lib/index.d.ts"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "bb8717ece27d520364691007ab79162d82fc6f13"
|
|
38
38
|
}
|