@mcurros2/microm 1.1.314-0 → 1.1.317-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 +43 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +302 -161
- 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, context?: MenuItemContext): MenuItemContext;
|
|
2929
|
+
export function resolveMenuItemContent(item: MenuItem, context?: MenuItemContext): 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 {
|
|
@@ -3010,6 +3024,7 @@ export function useMenuContent(props: UseMenuContentProps): {
|
|
|
3010
3024
|
items: MenuItem[];
|
|
3011
3025
|
actions: SpotlightAction[];
|
|
3012
3026
|
menuPathsDictionary: Record<string, MenuItem>;
|
|
3027
|
+
isLoading: boolean;
|
|
3013
3028
|
};
|
|
3014
3029
|
export type UseMenuContentReturnType = ReturnType<typeof useMenuContent>;
|
|
3015
3030
|
export function normalizeTextToLowercaseWithoutAccents(value: string): string;
|
|
@@ -3056,6 +3071,27 @@ export interface RouteProps {
|
|
|
3056
3071
|
children: React.ReactNode;
|
|
3057
3072
|
}
|
|
3058
3073
|
export function Route(props: RouteProps): JSX.Element | null;
|
|
3074
|
+
export const CONTEXTUAL_MENU_ROUTE_VERSION: 1;
|
|
3075
|
+
export const CONTEXTUAL_MENU_ROUTE_PREFIX = "/contextual";
|
|
3076
|
+
export interface ContextualMenuRoutePayload {
|
|
3077
|
+
version: typeof CONTEXTUAL_MENU_ROUTE_VERSION;
|
|
3078
|
+
parentKeys: ValuesObject;
|
|
3079
|
+
contextLabel: string;
|
|
3080
|
+
originPath: string;
|
|
3081
|
+
}
|
|
3082
|
+
export interface ContextualMenuRoute {
|
|
3083
|
+
menuId: string;
|
|
3084
|
+
itemPath: string;
|
|
3085
|
+
payload: ContextualMenuRoutePayload;
|
|
3086
|
+
}
|
|
3087
|
+
export interface CreateContextualMenuRouteProps extends Omit<ContextualMenuRoutePayload, 'version'> {
|
|
3088
|
+
menuId: string;
|
|
3089
|
+
itemPath?: string;
|
|
3090
|
+
}
|
|
3091
|
+
export function mergeParentKeys(parentKeys?: ValuesObject, selectedKeys?: ValuesObject): ValuesObject;
|
|
3092
|
+
export const getContextualMenuBasePath: (menuId: string) => string;
|
|
3093
|
+
export function createContextualMenuRoute(props: CreateContextualMenuRouteProps): string;
|
|
3094
|
+
export function parseContextualMenuRoute(route: string): ContextualMenuRoute | null;
|
|
3059
3095
|
export const DEFAULT_MAP_CENTER: latLng;
|
|
3060
3096
|
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
3097
|
export type AddressComponentValue = {
|