@mcurros2/microm 1.1.166-0 → 1.1.168-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 +24 -26
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -442,6 +442,9 @@ export interface EntityProc {
|
|
|
442
442
|
name: string;
|
|
443
443
|
parms?: Record<string, Value>;
|
|
444
444
|
}
|
|
445
|
+
export interface EntityServerAction {
|
|
446
|
+
name: string;
|
|
447
|
+
}
|
|
445
448
|
export interface EntityClientActionOnClickProps {
|
|
446
449
|
entity: Entity<any>;
|
|
447
450
|
modal?: ModalContextType;
|
|
@@ -462,6 +465,25 @@ export interface EntityClientAction {
|
|
|
462
465
|
showActionInViewMode?: boolean;
|
|
463
466
|
onClick: (props: EntityClientActionOnClickProps) => Promise<boolean>;
|
|
464
467
|
}
|
|
468
|
+
export class EntityDefinition {
|
|
469
|
+
name: string;
|
|
470
|
+
columns: ColumnsObject;
|
|
471
|
+
procs: Record<string, EntityProc>;
|
|
472
|
+
views: Record<string, EntityView>;
|
|
473
|
+
lookups: Record<string, EntityLookup>;
|
|
474
|
+
serverActions: Record<string, EntityServerAction>;
|
|
475
|
+
clientActions: Record<string, EntityClientAction>;
|
|
476
|
+
importColumns: string[] | null;
|
|
477
|
+
standardView(): string | null;
|
|
478
|
+
constructor(name: string);
|
|
479
|
+
addCol<T extends Value>({ name, type, length, scale, value, defaultValue, flags, prompt }: EntityColumnOptions<T>): EntityColumn<T>;
|
|
480
|
+
addView(view: EntityView): EntityView;
|
|
481
|
+
addProc(proc: EntityProc): EntityProc;
|
|
482
|
+
addLookup(lookup: EntityLookup): EntityLookup;
|
|
483
|
+
addServerAction(action: EntityServerAction): EntityServerAction;
|
|
484
|
+
addClientAction(action: EntityClientAction): EntityClientAction;
|
|
485
|
+
static clone(entity_def: EntityDefinition): EntityDefinition;
|
|
486
|
+
}
|
|
465
487
|
export interface ViewMapping {
|
|
466
488
|
keyIndex: number;
|
|
467
489
|
descriptionIndex: number;
|
|
@@ -488,30 +510,6 @@ export interface EntityView {
|
|
|
488
510
|
mapInfoWindowRenderer?: DataMapProps['InfoWindowRenderer'];
|
|
489
511
|
mapSelectRecordsRenderer?: DataMapProps['selectRecordsRenderer'];
|
|
490
512
|
}
|
|
491
|
-
export class EntityDefinition {
|
|
492
|
-
name: string;
|
|
493
|
-
columns: ColumnsObject;
|
|
494
|
-
procs: Record<string, EntityProc>;
|
|
495
|
-
views: Record<string, EntityView>;
|
|
496
|
-
lookups: Record<string, EntityLookup>;
|
|
497
|
-
serverActions: Record<string, EntityServerAction>;
|
|
498
|
-
clientActions: Record<string, EntityClientAction>;
|
|
499
|
-
importColumns: string[] | null;
|
|
500
|
-
standardView(): string | null;
|
|
501
|
-
constructor(name: string);
|
|
502
|
-
addCol<T extends Value>({ name, type, length, scale, value, defaultValue, flags, prompt }: EntityColumnOptions<T>): EntityColumn<T>;
|
|
503
|
-
addView(view: EntityView): EntityView;
|
|
504
|
-
addProc(proc: EntityProc): EntityProc;
|
|
505
|
-
addLookup(lookup: EntityLookup): EntityLookup;
|
|
506
|
-
addServerAction(action: EntityServerAction): EntityServerAction;
|
|
507
|
-
addClientAction(action: EntityClientAction): EntityClientAction;
|
|
508
|
-
static clone(entity_def: EntityDefinition): EntityDefinition;
|
|
509
|
-
}
|
|
510
|
-
export interface EntityServerAction {
|
|
511
|
-
name: string;
|
|
512
|
-
valuesMapper?: (values: ValuesObject) => EntityDefinition;
|
|
513
|
-
columnsMapper?: (columns: ColumnsObject) => ValuesObject;
|
|
514
|
-
}
|
|
515
513
|
export class EntityAPI {
|
|
516
514
|
#private;
|
|
517
515
|
client: MicroMClient;
|
|
@@ -746,11 +744,11 @@ export interface PasswordFieldProps extends PasswordInputProps {
|
|
|
746
744
|
}>;
|
|
747
745
|
}
|
|
748
746
|
export function PasswordField(props: PasswordFieldProps): JSX.Element;
|
|
749
|
-
export type
|
|
747
|
+
export type useExecuteServerActionReturnType<TReturn extends ValuesObject> = {
|
|
750
748
|
status: OperationStatus<TReturn>;
|
|
751
749
|
execute: (values?: ValuesObject) => Promise<OperationStatus<TReturn> | undefined>;
|
|
752
750
|
};
|
|
753
|
-
export function useExecuteServerAction<T extends EntityDefinition, TReturn extends
|
|
751
|
+
export function useExecuteServerAction<T extends EntityDefinition, TReturn extends ValuesObject>(entity: Entity<T>, actionName: string): useExecuteServerActionReturnType<TReturn>;
|
|
754
752
|
export const NotifySuccessDefaultProps: Partial<NotificationProps>;
|
|
755
753
|
export function NotifySuccess(props: NotificationProps): JSX.Element;
|
|
756
754
|
export function NotifyError(props: NotificationProps): JSX.Element;
|