@mcurros2/microm 1.1.370-0 → 1.1.372-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 +25 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +344 -65
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,9 @@ import { Cluster, ClusterStats, Marker, MarkerClustererOptions } from "@googlema
|
|
|
16
16
|
export type Value = string | number | Date | boolean | string[] | null;
|
|
17
17
|
export type ValuesObject = Record<string, Value>;
|
|
18
18
|
export type ValuesRecord = Value[];
|
|
19
|
+
export interface MicroMRequestOptions {
|
|
20
|
+
keepalive?: boolean;
|
|
21
|
+
}
|
|
19
22
|
export type SQLType = 'char' | 'nchar' | 'varchar' | 'nvarchar' | 'text' | 'ntext' | 'tinyint' | 'smallint' | 'int' | 'bigint' | 'float' | 'decimal' | 'real' | 'bit' | 'money' | 'datetime2' | 'datetime' | 'smalldatetime' | 'date' | 'binary' | 'varbinary' | 'image' | 'time';
|
|
20
23
|
export interface DataResult {
|
|
21
24
|
Header: string[];
|
|
@@ -334,7 +337,7 @@ export interface UseEntityFormOptions extends FormOptions<Entity<EntityDefinitio
|
|
|
334
337
|
validateInputOnBlur?: boolean;
|
|
335
338
|
validateInputOnChange?: boolean | LooseKeys<ValuesObject>[];
|
|
336
339
|
forceDirty?: boolean;
|
|
337
|
-
saveAndGetOverride?: (get_data_if_saved: boolean, override_values?: ValuesObject) => Promise<OperationStatus<DBStatusResult>>;
|
|
340
|
+
saveAndGetOverride?: (get_data_if_saved: boolean, override_values?: ValuesObject, requestOptions?: MicroMRequestOptions) => Promise<OperationStatus<DBStatusResult>>;
|
|
338
341
|
noSaveOnSubmit?: boolean;
|
|
339
342
|
bindedColumnNames?: string[];
|
|
340
343
|
saveAndGetOnSubmit?: boolean;
|
|
@@ -349,6 +352,14 @@ export type GetColumnInputPropsReturnType = {
|
|
|
349
352
|
onFocus?: any;
|
|
350
353
|
onBlur?: any;
|
|
351
354
|
};
|
|
355
|
+
export type SilentSaveResult = 'saved' | 'unchanged' | 'invalid' | 'failed';
|
|
356
|
+
export interface NavigationConfirmationState {
|
|
357
|
+
opened: boolean;
|
|
358
|
+
saving: boolean;
|
|
359
|
+
save: () => Promise<void>;
|
|
360
|
+
discard: () => void;
|
|
361
|
+
stay: () => void;
|
|
362
|
+
}
|
|
352
363
|
export interface UseEntityFormReturnType {
|
|
353
364
|
form: UseFormReturnType<ValuesObject>;
|
|
354
365
|
status: OperationStatus<DBStatusResult | ValuesObject>;
|
|
@@ -356,7 +367,7 @@ export interface UseEntityFormReturnType {
|
|
|
356
367
|
handleCancel: () => Promise<void> | void;
|
|
357
368
|
handleSubmit: (event?: React.FormEvent<HTMLFormElement>) => Promise<void>;
|
|
358
369
|
performGetData: () => Promise<boolean>;
|
|
359
|
-
saveAndGet: (get_data_if_saved: boolean, override_values?: ValuesObject) => Promise<OperationStatus<DBStatusResult>>;
|
|
370
|
+
saveAndGet: (get_data_if_saved: boolean, override_values?: ValuesObject, requestOptions?: MicroMRequestOptions) => Promise<OperationStatus<DBStatusResult>>;
|
|
360
371
|
configureField: (column: EntityColumn<Value>, validation?: ValidationRule) => void;
|
|
361
372
|
removeValidation: (column: EntityColumn<Value>) => void;
|
|
362
373
|
notifyValidationErrorState: useStateReturnType<boolean>;
|
|
@@ -368,7 +379,8 @@ export interface UseEntityFormReturnType {
|
|
|
368
379
|
clearAllAsyncErrors: () => void;
|
|
369
380
|
isFormValid: () => boolean;
|
|
370
381
|
isFormFieldValid: (column_name: string) => boolean;
|
|
371
|
-
silentSave: () => Promise<
|
|
382
|
+
silentSave: (requestOptions?: MicroMRequestOptions) => Promise<SilentSaveResult>;
|
|
383
|
+
navigationConfirmation: NavigationConfirmationState;
|
|
372
384
|
}
|
|
373
385
|
export const UseEntityFormDefaultProps: Partial<UseEntityFormOptions>;
|
|
374
386
|
export function useEntityForm(props: UseEntityFormOptions): UseEntityFormReturnType;
|
|
@@ -393,6 +405,12 @@ export interface EntityFormProps extends PropsWithChildren {
|
|
|
393
405
|
okButtonVariant?: Variants<'filled' | 'outline' | 'light' | 'white' | 'default' | 'subtle' | 'gradient'>;
|
|
394
406
|
saveBeforeLocalNavigation?: boolean;
|
|
395
407
|
saveBeforeRemoteNavigation?: boolean;
|
|
408
|
+
confirmBeforeNavigation?: boolean;
|
|
409
|
+
navigationConfirmationTitle?: ReactNode;
|
|
410
|
+
navigationConfirmationMessage?: ReactNode;
|
|
411
|
+
navigationSaveLabel?: ReactNode;
|
|
412
|
+
navigationDiscardLabel?: ReactNode;
|
|
413
|
+
navigationStayLabel?: ReactNode;
|
|
396
414
|
disableOKIfNotDirty?: boolean;
|
|
397
415
|
formHeight?: string | number;
|
|
398
416
|
}
|
|
@@ -586,11 +604,11 @@ export class EntityAPI {
|
|
|
586
604
|
/**
|
|
587
605
|
* Add the data for the current row and fill the key columns values with the returned auto-numeric (if any).
|
|
588
606
|
*/
|
|
589
|
-
addData(abort_signal?: AbortSignal | null, recordsSelection?: ValuesObject[], ignoreRecordExists?: boolean): Promise<DBStatusResult>;
|
|
607
|
+
addData(abort_signal?: AbortSignal | null, recordsSelection?: ValuesObject[], ignoreRecordExists?: boolean, requestOptions?: MicroMRequestOptions): Promise<DBStatusResult>;
|
|
590
608
|
/**
|
|
591
609
|
* Edits the data for the current row.
|
|
592
610
|
*/
|
|
593
|
-
editData(abort_signal?: AbortSignal | null, recordsSelection?: ValuesObject[]): Promise<DBStatusResult>;
|
|
611
|
+
editData(abort_signal?: AbortSignal | null, recordsSelection?: ValuesObject[], requestOptions?: MicroMRequestOptions): Promise<DBStatusResult>;
|
|
594
612
|
/**
|
|
595
613
|
* Deletes the data for the current row.
|
|
596
614
|
*/
|
|
@@ -4124,8 +4142,8 @@ export class MicroMClient {
|
|
|
4124
4142
|
upload(file: File, fileprocess_id: string, abort_signal?: AbortSignal | null, max_size?: number, quality?: number, onProgress?: FetchUploadProgress): Promise<FileUploadResponse>;
|
|
4125
4143
|
downloadBlob(fileUrl: string, abort_signal?: AbortSignal | null): Promise<Blob>;
|
|
4126
4144
|
get(entity_name: string, parent_keys: ValuesObject | null, values: ValuesObject, abort_signal?: AbortSignal | null): Promise<ValuesObject>;
|
|
4127
|
-
insert(entity_name: string, parent_keys: ValuesObject | null, values: ValuesObject, recordsSelection: ValuesObject[] | null, abort_signal?: AbortSignal | null): Promise<DBStatusResult>;
|
|
4128
|
-
update(entity_name: string, parent_keys: ValuesObject | null, values: ValuesObject, recordsSelection: ValuesObject[] | null, abort_signal?: AbortSignal | null): Promise<DBStatusResult>;
|
|
4145
|
+
insert(entity_name: string, parent_keys: ValuesObject | null, values: ValuesObject, recordsSelection: ValuesObject[] | null, abort_signal?: AbortSignal | null, requestOptions?: MicroMRequestOptions): Promise<DBStatusResult>;
|
|
4146
|
+
update(entity_name: string, parent_keys: ValuesObject | null, values: ValuesObject, recordsSelection: ValuesObject[] | null, abort_signal?: AbortSignal | null, requestOptions?: MicroMRequestOptions): Promise<DBStatusResult>;
|
|
4129
4147
|
delete(entity_name: string, parent_keys: ValuesObject | null, values: ValuesObject | null, recordsSelection: ValuesObject[] | null, abort_signal?: AbortSignal | null): Promise<DBStatusResult>;
|
|
4130
4148
|
lookup(entity_name: string, parent_keys: ValuesObject | null, values: ValuesObject, lookup_name?: string | null, abort_signal?: AbortSignal | null): Promise<any>;
|
|
4131
4149
|
viewtoexcel(entity_name: string, parent_keys: ValuesObject | null, values: ValuesObject, view_name: string, abort_signal?: AbortSignal | null): Promise<Blob>;
|