@admin-layout/client 4.0.1-alpha.2 → 5.0.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.
Files changed (37) hide show
  1. package/lib/components/ApplicationErrorFillWrapper.d.ts +2 -2
  2. package/lib/components/ApplicationErrorHandlerCommon.d.ts +2 -2
  3. package/lib/components/ErrorBoundaryCommon.d.ts +3 -3
  4. package/lib/config/defaultSettings.js +5 -5
  5. package/lib/config/defaultSettings.js.map +1 -1
  6. package/lib/config/env-config.d.ts +2 -1
  7. package/lib/config/env-config.js +11 -3
  8. package/lib/config/env-config.js.map +1 -1
  9. package/lib/constants/error.d.ts +5 -5
  10. package/lib/graphql/link/error-link.d.ts +1 -1
  11. package/lib/graphql/link/error-link.js.map +1 -1
  12. package/lib/interfaces/default-settings.d.ts +1 -1
  13. package/lib/interfaces/index.d.ts +0 -1
  14. package/lib/interfaces/index.js +1 -1
  15. package/lib/interfaces/index.js.map +1 -1
  16. package/lib/interfaces/layout/base-menu.d.ts +1 -1
  17. package/lib/interfaces/layout/basic-layout.d.ts +8 -4
  18. package/lib/interfaces/layout/global-header.d.ts +1 -1
  19. package/lib/interfaces/layout/sider-menu.d.ts +3 -3
  20. package/lib/interfaces/pure-settings.d.ts +3 -3
  21. package/lib/interfaces/typings.d.ts +1 -1
  22. package/lib/redux/actions/error-actions.d.ts +1 -1
  23. package/lib/redux/selectors/index.d.ts +1 -1
  24. package/lib/utils/componentSize.d.ts +7 -0
  25. package/lib/utils/componentSize.js +48 -0
  26. package/lib/utils/componentSize.js.map +1 -0
  27. package/lib/utils/index.d.ts +1 -0
  28. package/lib/utils/index.js +1 -0
  29. package/lib/utils/index.js.map +1 -1
  30. package/lib/utils/seperatedMenus.d.ts +1 -1
  31. package/package.json +2 -2
  32. package/lib/interfaces/generated/generated-models.d.ts +0 -2222
  33. package/lib/interfaces/generated/generated-models.js +0 -52
  34. package/lib/interfaces/generated/generated-models.js.map +0 -1
  35. package/lib/interfaces/generated/index.d.ts +0 -1
  36. package/lib/interfaces/generated/index.js +0 -2
  37. package/lib/interfaces/generated/index.js.map +0 -1
@@ -1,2 +1,2 @@
1
- /// <reference types="react" />
2
- export declare const ApplicationErrorFillWrapper: (props: any) => JSX.Element;
1
+ import * as React from 'react';
2
+ export declare const ApplicationErrorFillWrapper: (props: any) => React.JSX.Element;
@@ -9,11 +9,11 @@ interface ApplicationErrorHandlerCommonProps {
9
9
  plugins: Record<string, any>;
10
10
  children: ReactNode;
11
11
  }
12
- declare type IRendererComponentType = (props: {
12
+ type IRendererComponentType = (props: {
13
13
  applicationErrors: ApplicationErrorState[];
14
14
  backendError: ApplicationErrorState;
15
15
  }) => ReactElement;
16
- declare type IApplicationErrorSlotType = (props: {
16
+ type IApplicationErrorSlotType = (props: {
17
17
  name: string;
18
18
  fillProps: {
19
19
  active: boolean;
@@ -1,9 +1,9 @@
1
1
  import React, { ReactElement } from 'react';
2
- declare type IErrorBoundryState = {
2
+ type IErrorBoundryState = {
3
3
  hasError: boolean;
4
4
  error: Error | null;
5
5
  };
6
- declare type IErrorBoundryProps = {
6
+ type IErrorBoundryProps = {
7
7
  children: ReactElement;
8
8
  fallbackComponent: (props: {
9
9
  error: Error;
@@ -16,6 +16,6 @@ export declare class ErrorBoundaryCommon extends React.Component<IErrorBoundryPr
16
16
  error: Error;
17
17
  };
18
18
  componentDidCatch(error: Error): void;
19
- render(): JSX.Element;
19
+ render(): React.JSX.Element;
20
20
  }
21
21
  export {};
@@ -1,11 +1,11 @@
1
1
  export const defaultSettings = {
2
2
  logo: 'https://cdmbase.s3.ca-central-1.amazonaws.com/favicon-new-128.svg',
3
3
  navTheme: 'light',
4
- primaryColor: '#3FA541C',
5
- colorPrimary: '#3FA541C',
6
- layout: 'side',
4
+ primaryColor: '#1890ff',
5
+ colorPrimary: '#1677FF',
6
+ layout: 'mix',
7
7
  contentWidth: 'Fluid',
8
- fixedHeader: false,
8
+ fixedHeader: true,
9
9
  fixSiderbar: true,
10
10
  searchBarRender: true,
11
11
  colorWeak: false,
@@ -27,6 +27,6 @@ export const defaultSettings = {
27
27
  headerHeight: undefined,
28
28
  menu: undefined,
29
29
  splitMenus: false,
30
- siderMenuType: 'group'
30
+ siderMenuType: 'sub'
31
31
  };
32
32
  //# sourceMappingURL=defaultSettings.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"defaultSettings.js","sourceRoot":"","sources":["../../src/config/defaultSettings.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAUxB;IACA,IAAI,EAAE,mEAAmE;IACzE,QAAQ,EAAE,OAAO;IACjB,YAAY,EAAE,UAAU;IACxB,YAAY,EAAE,UAAU;IACxB,MAAM,EAAE,MAAM;IACd,YAAY,EAAE,OAAO;IACrB,WAAW,EAAE,KAAK;IAClB,WAAW,EAAE,IAAI;IACjB,eAAe,EAAE,IAAI;IACrB,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,EAAE;IACf,gBAAgB,EAAE,IAAI;IACtB,UAAU,EAAE,SAAS;IACrB,QAAQ,EAAE,OAAO;IACjB,UAAU,EAAE,qBAAqB;IACjC,eAAe,EAAE,KAAK;IACtB,WAAW,EAAE,MAAM;IACnB,aAAa,EAAE,QAAQ;IACvB,cAAc,EAAE,KAAK;IACrB,UAAU,EAAE,IAAI;IAChB,UAAU,EAAE,IAAI;IAChB,QAAQ,EAAE,KAAK;IACf,oBAAoB;IACpB,WAAW,EAAE,SAAS;IACtB,YAAY,EAAE,SAAS;IACvB,IAAI,EAAE,SAAS;IACf,UAAU,EAAE,KAAK;IACjB,aAAa,EAAE,OAAO;CACzB,CAAC"}
1
+ {"version":3,"file":"defaultSettings.js","sourceRoot":"","sources":["../../src/config/defaultSettings.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAUxB;IACA,IAAI,EAAE,mEAAmE;IACzE,QAAQ,EAAE,OAAO;IACjB,YAAY,EAAE,SAAS;IACvB,YAAY,EAAE,SAAS;IACvB,MAAM,EAAE,KAAK;IACb,YAAY,EAAE,OAAO;IACrB,WAAW,EAAE,IAAI;IACjB,WAAW,EAAE,IAAI;IACjB,eAAe,EAAE,IAAI;IACrB,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,EAAE;IACf,gBAAgB,EAAE,IAAI;IACtB,UAAU,EAAE,SAAS;IACrB,QAAQ,EAAE,OAAO;IACjB,UAAU,EAAE,qBAAqB;IACjC,eAAe,EAAE,KAAK;IACtB,WAAW,EAAE,MAAM;IACnB,aAAa,EAAE,QAAQ;IACvB,cAAc,EAAE,KAAK;IACrB,UAAU,EAAE,IAAI;IAChB,UAAU,EAAE,IAAI;IAChB,QAAQ,EAAE,KAAK;IACf,oBAAoB;IACpB,WAAW,EAAE,SAAS;IACtB,YAAY,EAAE,SAAS;IACvB,IAAI,EAAE,SAAS;IACf,UAAU,EAAE,KAAK;IACjB,aAAa,EAAE,KAAK;CACvB,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import * as envalid from 'envalid';
2
2
  import { DefaultSettings } from '../interfaces';
3
- export declare const config: Readonly<{
3
+ declare let config: Readonly<{
4
4
  LAYOUT_SETTINGS: DefaultSettings;
5
5
  } & envalid.CleanedEnvAccessors>;
6
+ export { config };
@@ -2,10 +2,18 @@ import * as envalid from 'envalid';
2
2
  import { defaultSettings } from './defaultSettings';
3
3
  const { json } = envalid;
4
4
  const env = process.APP_ENV || process.env;
5
- export const config = envalid.cleanEnv(env,
6
- /* start */ {
5
+ const preConfig = envalid.cleanEnv(env, {
7
6
  LAYOUT_SETTINGS: json({
8
7
  default: JSON.stringify(defaultSettings),
9
8
  }),
10
- } /* end */);
9
+ });
10
+ let config = {};
11
+ // overwrite the layout settings with environment
12
+ if (env.LAYOUT_SETTINGS) {
13
+ config = Object.assign(Object.assign({}, preConfig), { LAYOUT_SETTINGS: Object.assign(Object.assign({}, defaultSettings), preConfig.LAYOUT_SETTINGS) });
14
+ }
15
+ else {
16
+ config = preConfig;
17
+ }
18
+ export { config };
11
19
  //# sourceMappingURL=env-config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"env-config.js","sourceRoot":"","sources":["../../src/config/env-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAEnC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;AACzB,MAAM,GAAG,GAAI,OAAe,CAAC,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC;AAEpD,MAAM,CAAC,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG;AACtC,WAAW,CAAC;IACZ,eAAe,EAAE,IAAI,CAAkB;QACnC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,eAAe,CAAQ;KAClD,CAAC;CACL,CAAC,SAAS,CACV,CAAC"}
1
+ {"version":3,"file":"env-config.js","sourceRoot":"","sources":["../../src/config/env-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAEnC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;AACzB,MAAM,GAAG,GAAI,OAAe,CAAC,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC;AAEpD,MAAM,SAAS,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,EAClC;IACI,eAAe,EAAE,IAAI,CAAkB;QACnC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,eAAe,CAAQ;KAClD,CAAC;CACL,CACJ,CAAC;AACF,IAAI,MAAM,GAAG,EAAsB,CAAC;AACpC,kDAAkD;AAClD,IAAI,GAAG,CAAC,eAAe,EAAE;IACrB,MAAM,mCAAQ,SAAS,KAAE,eAAe,kCAAO,eAAe,GAAK,SAAS,CAAC,eAAe,IAAI,CAAC;CACpG;KAAM;IACH,MAAM,GAAG,SAAS,CAAC;CACtB;AAED,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -1,10 +1,10 @@
1
- export declare type BACKEND_ERROR = '@platform/BACKEND_ERROR';
1
+ export type BACKEND_ERROR = '@platform/BACKEND_ERROR';
2
2
  export declare const BACKEND_ERROR: BACKEND_ERROR;
3
- export declare type DISMISS_APPLICATION_ERROR = '@platform/DISMISS_APPLICATION_ERROR';
3
+ export type DISMISS_APPLICATION_ERROR = '@platform/DISMISS_APPLICATION_ERROR';
4
4
  export declare const DISMISS_APPLICATION_ERROR: DISMISS_APPLICATION_ERROR;
5
- export declare type CLEAR_APPLICATION_ERRORS = '@platform/CLEAR_APPLICATION_ERRORS';
5
+ export type CLEAR_APPLICATION_ERRORS = '@platform/CLEAR_APPLICATION_ERRORS';
6
6
  export declare const CLEAR_APPLICATION_ERRORS: CLEAR_APPLICATION_ERRORS;
7
- export declare type RESTORE_APPLICATION_ERRORS = '@platform/RESTORE_APPLICATION_ERRORS';
7
+ export type RESTORE_APPLICATION_ERRORS = '@platform/RESTORE_APPLICATION_ERRORS';
8
8
  export declare const RESTORE_APPLICATION_ERRORS: RESTORE_APPLICATION_ERRORS;
9
- export declare type LOG_APPLICATION_ERROR = '@platform/LOG_APPLICATION_ERROR';
9
+ export type LOG_APPLICATION_ERROR = '@platform/LOG_APPLICATION_ERROR';
10
10
  export declare const LOG_APPLICATION_ERROR: LOG_APPLICATION_ERROR;
@@ -1,6 +1,6 @@
1
1
  import { ApolloLink } from '@apollo/client';
2
2
  import { interfaces } from 'inversify';
3
- declare type IGetErrorLink = (container: interfaces.Container) => ApolloLink;
3
+ type IGetErrorLink = (container: interfaces.Container) => ApolloLink;
4
4
  interface IErrorLink {
5
5
  getErrorLink: IGetErrorLink;
6
6
  }
@@ -1 +1 @@
1
- {"version":3,"file":"error-link.js","sourceRoot":"","sources":["../../../src/graphql/link/error-link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAA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oBACnB,OAAO,EAAE,cAAc,CAAC,KAAK,CAAC;iBAC/B;aACF,CAAA;SACF;QACD,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;IAC7B,CAAC;IAED,YAAY,CAAC,SAA+B;QAC1C,OAAO,OAAO,CAAC,GAAG,CAAC,EAAE;;YACnB,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,GAAG,GAAG,CAAC;YAC5C,IAAI,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,MAAM,EAAE;gBACzB,aAAa,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;oBAC9B,IAAI,CAAC,mBAAmB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;gBAC7C,CAAC,CAAC,CAAA;aACH;YACD,IAAI,YAAY,EAAE;gBAChB,MAAM,YAAY,GAAG,MAAC,YAA6D,aAA7D,YAAY,uBAAZ,YAAY,CAAmD,MAAM,0CAAE,MAAM,CAAA;gBACnG,IAAI,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,MAAM,EAAE;oBACxB,YAAY,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;wBACzB,IAAI,CAAC,mBAAmB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;oBAC5C,CAAC,CAAC,CAAA;iBACH;qBAAM;oBACL,IAAI,CAAC,mBAAmB,CAAC,SAAS,EAAE,YAAY,CAAC,CAAA;iBAClD;aACF;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;CACF;AAGD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,SAA+B,EAAE,EAAE;IAChE,OAAO,IAAI,SAAS,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC,CAAA;AAChD,CAAC,CAAA"}
@@ -1,4 +1,4 @@
1
1
  import { ProSettings } from './pure-settings';
2
- export declare type DefaultSettings = Partial<ProSettings> & {
2
+ export type DefaultSettings = Partial<ProSettings> & {
3
3
  language?: string;
4
4
  };
@@ -1,4 +1,3 @@
1
- export * from './generated';
2
1
  export * from './default-settings';
3
2
  export * from './pure-settings';
4
3
  export * from './typings';
@@ -1,4 +1,4 @@
1
- export * from './generated';
1
+ // export * from './generated';
2
2
  export * from './default-settings';
3
3
  export * from './pure-settings';
4
4
  export * from './typings';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,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 declare type MenuMode = 'vertical' | 'horizontal' | 'inline';
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 declare type LocaleType = {
10
+ export type LocaleType = {
11
11
  'zh-CN': {
12
12
  [key: string]: string;
13
13
  };
@@ -21,16 +21,19 @@ export declare type LocaleType = {
21
21
  [key: string]: string;
22
22
  };
23
23
  };
24
- declare type MergerSettingsType<T> = Partial<T> & {
24
+ type MergerSettingsType<T> = Partial<T> & {
25
25
  primaryColor?: string;
26
26
  colorWeak?: boolean;
27
27
  };
28
- export declare type BasicLayoutProps = Partial<RouterTypes<Route>> & SiderMenuProps & HeaderViewProps & {
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
32
35
  */
33
- logo?: React.ReactNode | WithFalse<() => React.ReactNode>;
36
+ logo?: React.ReactNode | WithFalse<() => React.ReactNode> | (() => React.ReactElement);
34
37
  /**
35
38
  *@name Triggered when the page is switched
36
39
  */
@@ -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 declare type HeaderViewProps = GlobalHeaderProps & {
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 declare type PrivateSiderMenuProps = {
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
- declare type SiderTheme = 'light' | 'dark';
25
- declare type CollapseType = 'clickTrigger' | 'responsive';
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 declare type ContentWidth = 'Fluid' | 'Fixed';
2
- export declare type MenuTheme = 'light' | 'dark';
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 declare type ProSettings = PureSettings & RenderSetting;
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 declare type WithFalse<T> = T | false;
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 declare type ErrorActions = {
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,7 @@
1
+ import { useLayoutEffect } from 'react';
2
+ export declare const useIsomorphicLayoutEffect: typeof useLayoutEffect;
3
+ export declare const useComponentSize: () => {
4
+ width: any;
5
+ height: any;
6
+ ref: import("react").MutableRefObject<null>;
7
+ };
@@ -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":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E,CAAC;YACjB,CAAC,CAAC,CAAC;YACH,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAEpC,OAAO,GAAG,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"}
@@ -1 +1,2 @@
1
1
  export * from './seperatedMenus';
2
+ export * from './componentSize';
@@ -1,2 +1,3 @@
1
1
  export * from './seperatedMenus';
2
+ export * from './componentSize';
2
3
  //# sourceMappingURL=index.js.map
@@ -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"}
@@ -1,5 +1,5 @@
1
1
  import { MenuDataItem } from '../interfaces';
2
- export declare type SeparateMenusTypes = {
2
+ export type SeparateMenusTypes = {
3
3
  upperMenus?: MenuDataItem[];
4
4
  middleMenus?: MenuDataItem[];
5
5
  lowerMenus?: MenuDataItem[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@admin-layout/client",
3
- "version": "4.0.1-alpha.2",
3
+ "version": "5.0.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": "6a488a99328bd14887ccb2386170de83dffa2454"
37
+ "gitHead": "9d126e98d4d350532dcb5da56fd6d282e4360c9b"
38
38
  }