@mcurros2/microm 1.1.292-0 → 1.1.294-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 +83 -42
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +851 -295
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -551,11 +551,19 @@ export interface EntityLookup {
|
|
|
551
551
|
view?: string;
|
|
552
552
|
proc?: string;
|
|
553
553
|
bindingColumnKey?: string;
|
|
554
|
+
compoundKeyGroupName?: string;
|
|
554
555
|
viewMapping?: ViewMapping;
|
|
555
556
|
}
|
|
557
|
+
export const DefaultKeySeparator = "-";
|
|
558
|
+
export interface CompoundKeyGroup {
|
|
559
|
+
viewIndex: number;
|
|
560
|
+
keyMappings: Record<string, number>;
|
|
561
|
+
keySeparator?: string;
|
|
562
|
+
}
|
|
556
563
|
export interface EntityView {
|
|
557
564
|
name: string;
|
|
558
565
|
keyMappings: Record<string, number>;
|
|
566
|
+
compoundKeyGroups?: Record<string, CompoundKeyGroup>;
|
|
559
567
|
Card?: Promise<ComponentType<EntityCardProps<ValuesObject>>> | null;
|
|
560
568
|
FiltersEntity?: EntityConstructor;
|
|
561
569
|
gridColumnsOverrides?: (theme: MantineTheme) => GridColumnsOverrides;
|
|
@@ -659,6 +667,17 @@ export class ColumnsMapper<T extends Entity<EntityDefinition>, V extends ValuesO
|
|
|
659
667
|
mapValuesToColumns(columns: ColumnsObject, values: V, ignoreInvalidMappings?: boolean, ignoreInexistentValues?: boolean): void;
|
|
660
668
|
mapColumnsToValues(columns: ColumnsObject, ignoreInvalidMappings?: boolean, ignoreInexistentValues?: boolean): Partial<V>;
|
|
661
669
|
}
|
|
670
|
+
export const MaxCompoundKeyValues = 10;
|
|
671
|
+
export type OrderedCompoundKeyMapping = readonly [columnName: string, position: number];
|
|
672
|
+
export function getOrderedCompoundKeyMappings(group: CompoundKeyGroup): OrderedCompoundKeyMapping[];
|
|
673
|
+
export function resolveCompoundKeyGroup(view: EntityView, groupName: string): CompoundKeyGroup;
|
|
674
|
+
export function splitCompoundKey(rawValue: string, group: CompoundKeyGroup): {
|
|
675
|
+
values: string[];
|
|
676
|
+
complete: boolean;
|
|
677
|
+
};
|
|
678
|
+
export function composeCompoundKey(values: readonly Value[], group: CompoundKeyGroup): string;
|
|
679
|
+
export function extractCompoundKeyValues(keys: ValuesObject, group: CompoundKeyGroup): Value[] | undefined;
|
|
680
|
+
export function extractCompoundRecordKeys(record: object, group: CompoundKeyGroup): ValuesObject | undefined;
|
|
662
681
|
export interface useTextTransformProps {
|
|
663
682
|
entityForm: UseEntityFormReturnType;
|
|
664
683
|
column: EntityColumn<Value>;
|
|
@@ -2443,42 +2462,6 @@ export function useViewState(search?: string[], limit?: DataViewLimit): {
|
|
|
2443
2462
|
filtersDescription: ValuesObject | undefined;
|
|
2444
2463
|
setFiltersDescription: Dispatch<SetStateAction<ValuesObject | undefined>>;
|
|
2445
2464
|
};
|
|
2446
|
-
export interface LookupProps extends Omit<useTextTransformProps, 'entityForm' | 'column'> {
|
|
2447
|
-
parentKeys?: ValuesObject;
|
|
2448
|
-
column: EntityColumn<Value>;
|
|
2449
|
-
autoFocus?: 'autoFocusOnAdd' | 'autoFocusOnEdit' | boolean;
|
|
2450
|
-
entityForm: UseEntityFormReturnType;
|
|
2451
|
-
entity: Entity<EntityDefinition>;
|
|
2452
|
-
lookupDefName: string;
|
|
2453
|
-
required?: boolean;
|
|
2454
|
-
readonly?: boolean;
|
|
2455
|
-
disabled?: boolean;
|
|
2456
|
-
label?: string;
|
|
2457
|
-
idMaxWidth?: string;
|
|
2458
|
-
icon?: React.ReactNode;
|
|
2459
|
-
iconVariant?: ActionIconVariant;
|
|
2460
|
-
requiredLabel?: string;
|
|
2461
|
-
description?: string;
|
|
2462
|
-
size?: MantineSize;
|
|
2463
|
-
onLookupPerformed?: (lookupResult: LookupResultState) => void;
|
|
2464
|
-
enableAdd?: boolean;
|
|
2465
|
-
enableEdit?: boolean;
|
|
2466
|
-
enableDelete?: boolean;
|
|
2467
|
-
enableView?: boolean;
|
|
2468
|
-
}
|
|
2469
|
-
export const LookupDefaultProps: Partial<LookupProps>;
|
|
2470
|
-
export function Lookup(props: LookupProps): JSX.Element;
|
|
2471
|
-
export interface LookupFormProps {
|
|
2472
|
-
dataGridProps: DataGridProps;
|
|
2473
|
-
onOK: (selectedKeys: DataGridSelectionKeys) => void;
|
|
2474
|
-
onCancel?: () => void;
|
|
2475
|
-
helpMessage?: string;
|
|
2476
|
-
okLabel?: string;
|
|
2477
|
-
cancelLabel?: string;
|
|
2478
|
-
breadCrumbs?: ReactNode;
|
|
2479
|
-
}
|
|
2480
|
-
export const LookupFormDefaultProps: Partial<LookupFormProps>;
|
|
2481
|
-
export function LookupForm(props: LookupFormProps): JSX.Element;
|
|
2482
2465
|
export interface LookupResultState {
|
|
2483
2466
|
columnName: string;
|
|
2484
2467
|
key: Value;
|
|
@@ -2509,16 +2492,29 @@ export interface UseLookupReturnType {
|
|
|
2509
2492
|
onBlur: (bindingColumn: string, force?: boolean, event?: React.FocusEvent | null) => void;
|
|
2510
2493
|
}
|
|
2511
2494
|
export const useLookup: ({ entityForm, entity, lookupDefName, column, parentKeys, required, HTMLDescriptionRef, enableAdd, enableEdit, enableDelete, enableView, transform }: UseLookupOptions) => UseLookupReturnType;
|
|
2512
|
-
|
|
2495
|
+
interface LookupCommonProps extends Omit<useTextTransformProps, 'entityForm' | 'column'> {
|
|
2513
2496
|
parentKeys?: ValuesObject;
|
|
2497
|
+
autoFocus?: 'autoFocusOnAdd' | 'autoFocusOnEdit' | boolean;
|
|
2498
|
+
entityForm: UseEntityFormReturnType;
|
|
2514
2499
|
entity: Entity<EntityDefinition>;
|
|
2515
2500
|
lookupDefName: string;
|
|
2501
|
+
required?: boolean;
|
|
2502
|
+
readonly?: boolean;
|
|
2503
|
+
disabled?: boolean;
|
|
2504
|
+
label?: string;
|
|
2505
|
+
idMaxWidth?: string;
|
|
2506
|
+
icon?: React.ReactNode;
|
|
2507
|
+
iconVariant?: ActionIconVariant;
|
|
2508
|
+
requiredLabel?: string;
|
|
2509
|
+
description?: string;
|
|
2510
|
+
size?: MantineSize;
|
|
2511
|
+
onLookupPerformed?: (lookupResult: LookupResultState) => void;
|
|
2512
|
+
enableAdd?: boolean;
|
|
2513
|
+
enableEdit?: boolean;
|
|
2514
|
+
enableDelete?: boolean;
|
|
2515
|
+
enableView?: boolean;
|
|
2516
2516
|
}
|
|
2517
|
-
export
|
|
2518
|
-
lookupEntity: Entity<EntityDefinition> | undefined;
|
|
2519
|
-
lookupDef: EntityLookup | undefined;
|
|
2520
|
-
lookupViewName: string;
|
|
2521
|
-
};
|
|
2517
|
+
export const LookupDefaultProps: Partial<LookupCommonProps>;
|
|
2522
2518
|
export interface useLookupFormType {
|
|
2523
2519
|
open: ({ entity, viewName, onOK, onCancel, modalProps, search }: ModalLookupOptions) => void;
|
|
2524
2520
|
}
|
|
@@ -2542,6 +2538,51 @@ export interface ModalLookupOptions {
|
|
|
2542
2538
|
}
|
|
2543
2539
|
export const UseLookupFormDefaultProps: Partial<ModalLookupOptions>;
|
|
2544
2540
|
export function useLookupForm(): (props: ModalLookupOptions) => Promise<void>;
|
|
2541
|
+
interface UseCompoundLookupOptions {
|
|
2542
|
+
parentKeys?: ValuesObject;
|
|
2543
|
+
bindingColumns: string[];
|
|
2544
|
+
entityForm: UseEntityFormReturnType;
|
|
2545
|
+
entity: Entity<EntityDefinition>;
|
|
2546
|
+
lookupDefName: string;
|
|
2547
|
+
required?: boolean;
|
|
2548
|
+
inputRef: MutableRefObject<HTMLInputElement | null>;
|
|
2549
|
+
enableAdd?: boolean;
|
|
2550
|
+
enableEdit?: boolean;
|
|
2551
|
+
enableDelete?: boolean;
|
|
2552
|
+
enableView?: boolean;
|
|
2553
|
+
transform?: "uppercase" | "lowercase" | "capitalize" | "titlecase";
|
|
2554
|
+
autoTrim?: boolean;
|
|
2555
|
+
}
|
|
2556
|
+
export function useCompoundLookup({ entityForm, entity, lookupDefName, bindingColumns, parentKeys, required, inputRef, enableAdd, enableEdit, enableDelete, enableView, transform, autoTrim, }: UseCompoundLookupOptions): UseLookupReturnType;
|
|
2557
|
+
export type LookupProps = LookupCommonProps & ({
|
|
2558
|
+
column: EntityColumn<Value>;
|
|
2559
|
+
bindingColumns?: never;
|
|
2560
|
+
} | {
|
|
2561
|
+
column?: never;
|
|
2562
|
+
bindingColumns: EntityColumn<Value>[];
|
|
2563
|
+
});
|
|
2564
|
+
export function Lookup(props: LookupProps): JSX.Element;
|
|
2565
|
+
export interface LookupFormProps {
|
|
2566
|
+
dataGridProps: DataGridProps;
|
|
2567
|
+
onOK: (selectedKeys: DataGridSelectionKeys) => void;
|
|
2568
|
+
onCancel?: () => void;
|
|
2569
|
+
helpMessage?: string;
|
|
2570
|
+
okLabel?: string;
|
|
2571
|
+
cancelLabel?: string;
|
|
2572
|
+
breadCrumbs?: ReactNode;
|
|
2573
|
+
}
|
|
2574
|
+
export const LookupFormDefaultProps: Partial<LookupFormProps>;
|
|
2575
|
+
export function LookupForm(props: LookupFormProps): JSX.Element;
|
|
2576
|
+
export interface UseLookupEntityOptions {
|
|
2577
|
+
parentKeys?: ValuesObject;
|
|
2578
|
+
entity: Entity<EntityDefinition>;
|
|
2579
|
+
lookupDefName: string;
|
|
2580
|
+
}
|
|
2581
|
+
export function useLookupEntity({ entity, lookupDefName, parentKeys }: UseLookupEntityOptions): {
|
|
2582
|
+
lookupEntity: Entity<EntityDefinition> | undefined;
|
|
2583
|
+
lookupDef: EntityLookup | undefined;
|
|
2584
|
+
lookupViewName: string;
|
|
2585
|
+
};
|
|
2545
2586
|
export interface LookupFormActionProps {
|
|
2546
2587
|
lookupEntity: Entity<EntityDefinition>;
|
|
2547
2588
|
viewName: string;
|