@mcurros2/microm 1.1.313-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 +46 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +305 -210
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AlertProps, DefaultMantineColor, ProgressProps, Variants, StepperProps, MantineTheme, TextareaProps, TextInputProps,
|
|
1
|
+
import { AlertProps, DefaultMantineColor, ProgressProps, Variants, StepperProps, MantineTheme, TextareaProps, TextInputProps, MantineNumberSize, MantineColor, PasswordInputProps, NotificationProps, CheckboxProps, ButtonProps, ActionIconProps, NumberInputProps, ImageProps, MultiSelectProps, SelectItem, BadgeVariant, MantineSize, CardProps, OverlayProps, TransitionProps, AccordionProps, PinInputProps, SwitchProps, Radio, SelectProps, GroupProps, AvatarProps, AnchorProps, AutocompleteItem, AutocompleteProps, DefaultProps, BadgeProps } from "@mantine/core";
|
|
2
2
|
import { JSX } from "react/jsx-runtime";
|
|
3
3
|
import React, { JSXElementConstructor, ReactElement, ReactNode, PropsWithChildren, ComponentType, RefAttributes, ForwardRefExoticComponent, MutableRefObject, useState, Dispatch, SetStateAction, KeyboardEvent, RefObject, CSSProperties, ComponentPropsWithoutRef, Context, ReactPortal } from "react";
|
|
4
4
|
import { hasLength, isNotEmpty, matches, UseFormReturnType } from "@mantine/form";
|
|
@@ -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 */
|
|
@@ -728,7 +728,6 @@ export interface ModalFormOptions {
|
|
|
728
728
|
onCancel: (entity: Entity<EntityDefinition>) => void;
|
|
729
729
|
}
|
|
730
730
|
export function ModalForm({ entity, onSaved, onCancel }: ModalFormOptions): JSX.Element;
|
|
731
|
-
export const ModalScrollArea: ForwardRefExoticComponent<Omit<Pick<ScrollAreaAutosizeProps, "title" | "p" | "slot" | "style" | "td" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "variant" | "sx" | "classNames" | "styles" | "unstyled" | "m" | "my" | "mx" | "mt" | "mb" | "ml" | "mr" | "py" | "px" | "pt" | "pb" | "pl" | "pr" | "bg" | "c" | "opacity" | "ff" | "fz" | "fw" | "lts" | "ta" | "lh" | "fs" | "tt" | "w" | "miw" | "maw" | "h" | "mih" | "mah" | "bgsz" | "bgp" | "bgr" | "bga" | "pos" | "top" | "left" | "bottom" | "right" | "inset" | "display" | "type" | "placeholder" | "onPointerEnterCapture" | "onPointerLeaveCapture" | "offsetScrollbars" | "scrollbarSize" | "scrollHideDelay" | "viewportRef" | "viewportProps" | "onScrollPositionChange"> & RefAttributes<HTMLDivElement>, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
732
731
|
export const ModalsManagerDefaultProps: {
|
|
733
732
|
closeLabel: string;
|
|
734
733
|
fullscreenLabel: string;
|
|
@@ -2900,6 +2899,11 @@ export interface LookupMultiSelectProps extends Omit<MultiSelectProps, 'data'> {
|
|
|
2900
2899
|
}
|
|
2901
2900
|
export const LookupMultiSelectDefaultProps: Partial<LookupMultiSelectProps>;
|
|
2902
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>);
|
|
2903
2907
|
export interface MenuItem {
|
|
2904
2908
|
ID: string;
|
|
2905
2909
|
link?: string;
|
|
@@ -2912,26 +2916,35 @@ export interface MenuItem {
|
|
|
2912
2916
|
rightSection?: ReactElement;
|
|
2913
2917
|
noActive?: boolean;
|
|
2914
2918
|
loadingComponent?: ReactNode;
|
|
2915
|
-
content?:
|
|
2916
|
-
onClick?: () => void
|
|
2919
|
+
content?: MenuItemContent;
|
|
2920
|
+
onClick?: (context?: MenuItemContext) => void | Promise<void>;
|
|
2917
2921
|
section: 'header' | 'items' | 'footer';
|
|
2918
2922
|
canShowAsShortcut?: boolean;
|
|
2919
2923
|
menuPath?: string;
|
|
2920
2924
|
menuPathDescription?: string;
|
|
2921
2925
|
parentKeys?: ValuesObject;
|
|
2926
|
+
menuId?: string;
|
|
2922
2927
|
}
|
|
2928
|
+
export function getMenuItemContext(item: MenuItem): MenuItemContext;
|
|
2929
|
+
export function resolveMenuItemContent(item: MenuItem): ReactNode | Promise<ReactNode> | undefined;
|
|
2923
2930
|
export interface NavigationState {
|
|
2924
2931
|
navigated: boolean;
|
|
2925
2932
|
route: string;
|
|
2926
2933
|
}
|
|
2927
2934
|
export interface MicroMRouterState {
|
|
2928
2935
|
path: string;
|
|
2936
|
+
route: string;
|
|
2937
|
+
searchParams: URLSearchParams;
|
|
2929
2938
|
navigate: (newPath: string) => void;
|
|
2930
2939
|
navigationState: NavigationState;
|
|
2931
2940
|
}
|
|
2932
2941
|
export const normalizeRoutePath: (path: string) => string;
|
|
2933
2942
|
export const navigateToRoute: (newPath: string) => void;
|
|
2934
2943
|
export const normalizeRouteURL: (path: string) => string;
|
|
2944
|
+
export function splitRoute(route: string): {
|
|
2945
|
+
path: string;
|
|
2946
|
+
searchParams: URLSearchParams;
|
|
2947
|
+
};
|
|
2935
2948
|
export const MicroMRouterContext: Context<MicroMRouterState | undefined>;
|
|
2936
2949
|
export const useMicroMRouter: () => MicroMRouterState;
|
|
2937
2950
|
export interface MenuItemsProps {
|
|
@@ -2987,12 +3000,14 @@ export interface MenuContentProps {
|
|
|
2987
3000
|
setIsLoggedIn: Dispatch<SetStateAction<boolean | undefined>>;
|
|
2988
3001
|
loggedInInfo?: Partial<MicroMClientClaimTypes>;
|
|
2989
3002
|
theme?: MantineTheme;
|
|
3003
|
+
parentKeys?: ValuesObject;
|
|
2990
3004
|
}
|
|
2991
3005
|
export interface UseMenuContentProps extends MenuContentProps {
|
|
2992
3006
|
menuContent: (props: MenuContentProps) => MenuItem[];
|
|
2993
3007
|
enableMenuSecurity?: boolean;
|
|
2994
3008
|
defaultLoadingComponent?: ReactNode;
|
|
2995
3009
|
searchMenuItemsWithContentOnly?: boolean;
|
|
3010
|
+
basePath?: string;
|
|
2996
3011
|
}
|
|
2997
3012
|
export const UseMenuContentDefaultProps: Partial<UseMenuContentProps>;
|
|
2998
3013
|
export interface MenuItemActionProps {
|
|
@@ -3011,6 +3026,7 @@ export function useMenuContent(props: UseMenuContentProps): {
|
|
|
3011
3026
|
items: MenuItem[];
|
|
3012
3027
|
actions: SpotlightAction[];
|
|
3013
3028
|
menuPathsDictionary: Record<string, MenuItem>;
|
|
3029
|
+
isLoading: boolean;
|
|
3014
3030
|
};
|
|
3015
3031
|
export type UseMenuContentReturnType = ReturnType<typeof useMenuContent>;
|
|
3016
3032
|
export function normalizeTextToLowercaseWithoutAccents(value: string): string;
|
|
@@ -3057,6 +3073,27 @@ export interface RouteProps {
|
|
|
3057
3073
|
children: React.ReactNode;
|
|
3058
3074
|
}
|
|
3059
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;
|
|
3060
3097
|
export const DEFAULT_MAP_CENTER: latLng;
|
|
3061
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';
|
|
3062
3099
|
export type AddressComponentValue = {
|