@mcurros2/microm 1.1.314-0 → 1.1.316-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/dist/index.d.ts +45 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +304 -162
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -241,12 +241,13 @@ export interface IDefaultColumns extends ColumnsObject {
|
|
|
241
241
|
export const DefaultColumnsNames: string[];
|
|
242
242
|
export const DefaultColumns: () => IDefaultColumns;
|
|
243
243
|
export function hasValue(value: Value): boolean;
|
|
244
|
-
export function
|
|
244
|
+
export function copyValuesObject(obj: ValuesObject): ValuesObject;
|
|
245
|
+
export function mergeValuesObject(source?: ValuesObject, mergeAndOverride?: ValuesObject): ValuesObject;
|
|
246
|
+
export function areValuesEqual(values1: ValuesObject, values2: ValuesObject): boolean;
|
|
247
|
+
export function areValuesObjectsEqual(objA: ValuesObject | undefined, objB: ValuesObject | undefined): boolean;
|
|
245
248
|
export function areArraysContentsEqual(a: string[] | undefined, b: string[] | undefined): boolean;
|
|
246
249
|
export function arrayToObject<T, TValue>(values: T[], onGetKey: (item: T) => string, onGetValue?: (item: T) => TValue): Record<string, TValue>;
|
|
247
250
|
export function cloneColumns(source_columns: Record<string, EntityColumn<Value>>): Record<string, EntityColumn<Value>>;
|
|
248
|
-
export function areValuesEqual(values1: ValuesObject, values2: ValuesObject): boolean;
|
|
249
|
-
export function areValuesObjectsEqual(objA: ValuesObject | undefined, objB: ValuesObject | undefined): boolean;
|
|
250
251
|
/**
|
|
251
252
|
* Get a filtered columns array (without duplicates)
|
|
252
253
|
*/
|
|
@@ -292,8 +293,6 @@ export function clearValues(columns: ColumnsObject, useColumnDefaultValue?: bool
|
|
|
292
293
|
*/
|
|
293
294
|
export function fillParentKeys(columns: ColumnsObject, parentKeys: ColumnsObject, ignoreEmptyParentKeys?: boolean, filters?: ColumnsFilter | null): void;
|
|
294
295
|
export function namesOf<T>(): { [P in keyof T]: P; };
|
|
295
|
-
export function copyValuesObject(obj: ValuesObject): ValuesObject;
|
|
296
|
-
export function mergeValuesObject(source?: ValuesObject, mergeAndOverride?: ValuesObject): ValuesObject;
|
|
297
296
|
export type ValidationRule = (value: unknown, values?: Record<string, unknown>) => string | number | true | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | null;
|
|
298
297
|
export type ValidatorFunction = (...args: any[]) => ValidationRule;
|
|
299
298
|
export const isURL: ValidatorFunction;
|
|
@@ -623,6 +622,7 @@ export class Entity<T extends EntityDefinition> {
|
|
|
623
622
|
constructor(client: MicroMClient, def: T, parentKeys?: ValuesObject);
|
|
624
623
|
static clone(entity: Entity<EntityDefinition>): Entity<EntityDefinition>;
|
|
625
624
|
}
|
|
625
|
+
export function convertValueFromString(col: EntityColumn<Value>, value: string): Value;
|
|
626
626
|
export type MappingBehavior = 'lax' | 'enforceObject' | 'enforceDataResult' | 'exactMatch';
|
|
627
627
|
export function toCamelCase(str: string): string;
|
|
628
628
|
/** function to convert a record array to a values object */
|
|
@@ -2899,6 +2899,11 @@ export interface LookupMultiSelectProps extends Omit<MultiSelectProps, 'data'> {
|
|
|
2899
2899
|
}
|
|
2900
2900
|
export const LookupMultiSelectDefaultProps: Partial<LookupMultiSelectProps>;
|
|
2901
2901
|
export function LookupMultiSelect(props: LookupMultiSelectProps): JSX.Element;
|
|
2902
|
+
export interface MenuItemContext {
|
|
2903
|
+
menuId: string;
|
|
2904
|
+
parentKeys: ValuesObject;
|
|
2905
|
+
}
|
|
2906
|
+
export type MenuItemContent = ReactNode | Promise<ReactNode> | ((context: MenuItemContext) => ReactNode | Promise<ReactNode>);
|
|
2902
2907
|
export interface MenuItem {
|
|
2903
2908
|
ID: string;
|
|
2904
2909
|
link?: string;
|
|
@@ -2911,26 +2916,35 @@ export interface MenuItem {
|
|
|
2911
2916
|
rightSection?: ReactElement;
|
|
2912
2917
|
noActive?: boolean;
|
|
2913
2918
|
loadingComponent?: ReactNode;
|
|
2914
|
-
content?:
|
|
2915
|
-
onClick?: () => void
|
|
2919
|
+
content?: MenuItemContent;
|
|
2920
|
+
onClick?: (context?: MenuItemContext) => void | Promise<void>;
|
|
2916
2921
|
section: 'header' | 'items' | 'footer';
|
|
2917
2922
|
canShowAsShortcut?: boolean;
|
|
2918
2923
|
menuPath?: string;
|
|
2919
2924
|
menuPathDescription?: string;
|
|
2920
2925
|
parentKeys?: ValuesObject;
|
|
2926
|
+
menuId?: string;
|
|
2921
2927
|
}
|
|
2928
|
+
export function getMenuItemContext(item: MenuItem): MenuItemContext;
|
|
2929
|
+
export function resolveMenuItemContent(item: MenuItem): ReactNode | Promise<ReactNode> | undefined;
|
|
2922
2930
|
export interface NavigationState {
|
|
2923
2931
|
navigated: boolean;
|
|
2924
2932
|
route: string;
|
|
2925
2933
|
}
|
|
2926
2934
|
export interface MicroMRouterState {
|
|
2927
2935
|
path: string;
|
|
2936
|
+
route: string;
|
|
2937
|
+
searchParams: URLSearchParams;
|
|
2928
2938
|
navigate: (newPath: string) => void;
|
|
2929
2939
|
navigationState: NavigationState;
|
|
2930
2940
|
}
|
|
2931
2941
|
export const normalizeRoutePath: (path: string) => string;
|
|
2932
2942
|
export const navigateToRoute: (newPath: string) => void;
|
|
2933
2943
|
export const normalizeRouteURL: (path: string) => string;
|
|
2944
|
+
export function splitRoute(route: string): {
|
|
2945
|
+
path: string;
|
|
2946
|
+
searchParams: URLSearchParams;
|
|
2947
|
+
};
|
|
2934
2948
|
export const MicroMRouterContext: Context<MicroMRouterState | undefined>;
|
|
2935
2949
|
export const useMicroMRouter: () => MicroMRouterState;
|
|
2936
2950
|
export interface MenuItemsProps {
|
|
@@ -2986,12 +3000,14 @@ export interface MenuContentProps {
|
|
|
2986
3000
|
setIsLoggedIn: Dispatch<SetStateAction<boolean | undefined>>;
|
|
2987
3001
|
loggedInInfo?: Partial<MicroMClientClaimTypes>;
|
|
2988
3002
|
theme?: MantineTheme;
|
|
3003
|
+
parentKeys?: ValuesObject;
|
|
2989
3004
|
}
|
|
2990
3005
|
export interface UseMenuContentProps extends MenuContentProps {
|
|
2991
3006
|
menuContent: (props: MenuContentProps) => MenuItem[];
|
|
2992
3007
|
enableMenuSecurity?: boolean;
|
|
2993
3008
|
defaultLoadingComponent?: ReactNode;
|
|
2994
3009
|
searchMenuItemsWithContentOnly?: boolean;
|
|
3010
|
+
basePath?: string;
|
|
2995
3011
|
}
|
|
2996
3012
|
export const UseMenuContentDefaultProps: Partial<UseMenuContentProps>;
|
|
2997
3013
|
export interface MenuItemActionProps {
|
|
@@ -3010,6 +3026,7 @@ export function useMenuContent(props: UseMenuContentProps): {
|
|
|
3010
3026
|
items: MenuItem[];
|
|
3011
3027
|
actions: SpotlightAction[];
|
|
3012
3028
|
menuPathsDictionary: Record<string, MenuItem>;
|
|
3029
|
+
isLoading: boolean;
|
|
3013
3030
|
};
|
|
3014
3031
|
export type UseMenuContentReturnType = ReturnType<typeof useMenuContent>;
|
|
3015
3032
|
export function normalizeTextToLowercaseWithoutAccents(value: string): string;
|
|
@@ -3056,6 +3073,27 @@ export interface RouteProps {
|
|
|
3056
3073
|
children: React.ReactNode;
|
|
3057
3074
|
}
|
|
3058
3075
|
export function Route(props: RouteProps): JSX.Element | null;
|
|
3076
|
+
export const CONTEXTUAL_MENU_ROUTE_VERSION: 1;
|
|
3077
|
+
export const CONTEXTUAL_MENU_ROUTE_PREFIX = "/contextual";
|
|
3078
|
+
export interface ContextualMenuRoutePayload {
|
|
3079
|
+
version: typeof CONTEXTUAL_MENU_ROUTE_VERSION;
|
|
3080
|
+
parentKeys: ValuesObject;
|
|
3081
|
+
contextLabel: string;
|
|
3082
|
+
originPath: string;
|
|
3083
|
+
}
|
|
3084
|
+
export interface ContextualMenuRoute {
|
|
3085
|
+
menuId: string;
|
|
3086
|
+
itemPath: string;
|
|
3087
|
+
payload: ContextualMenuRoutePayload;
|
|
3088
|
+
}
|
|
3089
|
+
export interface CreateContextualMenuRouteProps extends Omit<ContextualMenuRoutePayload, 'version'> {
|
|
3090
|
+
menuId: string;
|
|
3091
|
+
itemPath?: string;
|
|
3092
|
+
}
|
|
3093
|
+
export function mergeParentKeys(parentKeys?: ValuesObject, selectedKeys?: ValuesObject): ValuesObject;
|
|
3094
|
+
export const getContextualMenuBasePath: (menuId: string) => string;
|
|
3095
|
+
export function createContextualMenuRoute(props: CreateContextualMenuRouteProps): string;
|
|
3096
|
+
export function parseContextualMenuRoute(route: string): ContextualMenuRoute | null;
|
|
3059
3097
|
export const DEFAULT_MAP_CENTER: latLng;
|
|
3060
3098
|
export type GoogleMapsAddressComponentType = 'street_address' | 'route' | 'intersection' | 'political' | 'country' | 'administrative_area_level_1' | 'administrative_area_level_2' | 'administrative_area_level_3' | 'administrative_area_level_4' | 'administrative_area_level_5' | 'administrative_area_level_6' | 'administrative_area_level_7' | 'colloquial_area' | 'locality' | 'sublocality' | 'sublocality_level_1' | 'sublocality_level_2' | 'sublocality_level_3' | 'sublocality_level_4' | 'sublocality_level_5' | 'neighborhood' | 'premise' | 'subpremise' | 'plus_code' | 'postal_code' | 'natural_feature' | 'airport' | 'park' | 'point_of_interest' | 'floor' | 'establishment' | 'landmark' | 'parking' | 'post_box' | 'postal_town' | 'room' | 'street_number' | 'bus_station' | 'train_station' | 'transit_station';
|
|
3061
3099
|
export type AddressComponentValue = {
|