@hybridcore/ui 1.4.9 → 1.4.11
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.
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { a as
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { a as m } from "../../helpers-B4UL9NMD.js";
|
|
3
3
|
import n from "lodash";
|
|
4
4
|
import { Loading as d } from "../loading/index.js";
|
|
5
|
-
|
|
5
|
+
function x({
|
|
6
6
|
pagePath: s,
|
|
7
7
|
feature: o,
|
|
8
8
|
appRoles: t,
|
|
9
9
|
fallback: i,
|
|
10
10
|
loading: e = !1,
|
|
11
11
|
children: r
|
|
12
|
-
})
|
|
12
|
+
}) {
|
|
13
|
+
return s && (s = s.split("/").slice(1)[0] || "dashboard", s === "dashboard" ? o = "MAIN" : s === "agent-based-simulations" ? o = "SIMULATION" : o = n.toUpper(n.snakeCase(s))), s && e ? /* @__PURE__ */ f(d, { show: !0, position: "fixed", top: 0, left: 0, zIndex: 99999 }) : o && m(o, t) && r ? r : i || null;
|
|
14
|
+
}
|
|
13
15
|
export {
|
|
14
|
-
|
|
16
|
+
x as Access
|
|
15
17
|
};
|
package/dist/main.d.ts
CHANGED
|
@@ -15,15 +15,17 @@ import { Feature } from 'ol';
|
|
|
15
15
|
import { Geometry } from 'ol/geom';
|
|
16
16
|
import { GridActionsCellItemProps } from '@mui/x-data-grid';
|
|
17
17
|
import { IconButtonProps } from '@mui/material/IconButton';
|
|
18
|
+
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
18
19
|
import { LocalizationProvider } from '@mui/x-date-pickers';
|
|
19
20
|
import { Pixel } from 'ol/pixel';
|
|
21
|
+
import { ReactNode } from 'react';
|
|
20
22
|
import { Size } from 'ol/size';
|
|
21
23
|
import { SxProps } from '@mui/material';
|
|
22
24
|
import { SxProps as SxProps_2 } from '@mui/material/styles';
|
|
23
25
|
import { Theme } from '@mui/material/styles';
|
|
24
26
|
import { View } from 'ol';
|
|
25
27
|
|
|
26
|
-
export declare
|
|
28
|
+
export declare function Access<T extends string>({ pagePath, feature, appRoles, fallback, loading, children, }: Props<T>): string | number | true | Iterable<ReactNode> | JSX_2.Element | null;
|
|
27
29
|
|
|
28
30
|
declare type AccessType = "READ" | "ALL" | "SUPER_ADMIN";
|
|
29
31
|
|
|
@@ -219,7 +221,7 @@ declare const hasAccess: (path: string, access: AccessType, permissions: AUTH.Pe
|
|
|
219
221
|
*/
|
|
220
222
|
declare const hasDataAccess: (role: string, access: AccessType, permissions: AUTH.PermissionType) => boolean;
|
|
221
223
|
|
|
222
|
-
declare const hasUIAccess: (feature: FeatureType, permissions?: AUTH.PermissionType) => boolean;
|
|
224
|
+
declare const hasUIAccess: <T extends string>(feature: FeatureType | T, permissions?: AUTH.PermissionType) => boolean;
|
|
223
225
|
|
|
224
226
|
export declare const IconButton: default_2.FC<Props_6>;
|
|
225
227
|
|
|
@@ -512,7 +514,7 @@ declare type OrientationType_2 = "portrait" | "landscape";
|
|
|
512
514
|
|
|
513
515
|
export declare const PhoneInput: React.FC<Props_9>;
|
|
514
516
|
|
|
515
|
-
declare interface Props {
|
|
517
|
+
declare interface Props<T extends string> {
|
|
516
518
|
/**
|
|
517
519
|
*
|
|
518
520
|
*/
|
|
@@ -528,7 +530,7 @@ declare interface Props {
|
|
|
528
530
|
/**
|
|
529
531
|
*
|
|
530
532
|
*/
|
|
531
|
-
feature?:
|
|
533
|
+
feature?: FeatureType | T;
|
|
532
534
|
/**
|
|
533
535
|
*
|
|
534
536
|
*/
|