@mcurros2/microm 1.1.389-0 → 1.1.391-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 +58 -37
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1089 -801
- package/dist/index.js.map +1 -1
- package/package.json +5 -4
package/dist/index.d.ts
CHANGED
|
@@ -19,14 +19,14 @@ export type ValuesRecord = Value[];
|
|
|
19
19
|
export interface MicroMRequestOptions {
|
|
20
20
|
keepalive?: boolean;
|
|
21
21
|
}
|
|
22
|
-
export interface
|
|
22
|
+
export interface FileImportColumnMapping {
|
|
23
23
|
SourceHeader: string | null;
|
|
24
24
|
SourceIndex: number | null;
|
|
25
25
|
DestinationColumnName: string;
|
|
26
26
|
}
|
|
27
|
-
export interface
|
|
27
|
+
export interface FileImportMapping {
|
|
28
28
|
SheetName: string | null;
|
|
29
|
-
Mapping:
|
|
29
|
+
Mapping: FileImportColumnMapping[];
|
|
30
30
|
}
|
|
31
31
|
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';
|
|
32
32
|
export interface DataResult {
|
|
@@ -49,7 +49,7 @@ export interface DBStatusResult {
|
|
|
49
49
|
AutonumReturned: boolean;
|
|
50
50
|
Results: DBStatus[];
|
|
51
51
|
}
|
|
52
|
-
export function isDBStatusResult(data:
|
|
52
|
+
export function isDBStatusResult(data: unknown): data is DBStatusResult;
|
|
53
53
|
export function isIn<T>(value: T, ...params: T[]): boolean;
|
|
54
54
|
export function isPromise<T>(obj: unknown): obj is Promise<T>;
|
|
55
55
|
export function createKeysSet<T>(): Set<keyof T>;
|
|
@@ -513,6 +513,8 @@ export interface StepperFormProps extends EntityFormProps {
|
|
|
513
513
|
completedContent?: ReactNode;
|
|
514
514
|
hideNextAndBackWhenCompleted?: boolean;
|
|
515
515
|
onCompleted?: () => void;
|
|
516
|
+
onCancelSubmit?: () => void | Promise<void>;
|
|
517
|
+
cancelSubmitLabel?: ReactNode;
|
|
516
518
|
stepperProps?: Omit<Partial<StepperProps>, 'children' | 'active'>;
|
|
517
519
|
}
|
|
518
520
|
export const StepperFormDefaultProps: Partial<StepperFormProps>;
|
|
@@ -1242,7 +1244,7 @@ export class EntityAPI {
|
|
|
1242
1244
|
/**
|
|
1243
1245
|
* Import data
|
|
1244
1246
|
*/
|
|
1245
|
-
importData(abort_signal: (AbortSignal | null) | undefined, import_procname: (string | null) | undefined, parentKeys: (ValuesObject | null) | undefined, fileprocess_id: string,
|
|
1247
|
+
importData(abort_signal: (AbortSignal | null) | undefined, import_procname: (string | null) | undefined, parentKeys: (ValuesObject | null) | undefined, fileprocess_id: string, fileImportMapping?: FileImportMapping, initialRow?: number): Promise<ImpDataResult>;
|
|
1246
1248
|
executeView(view: EntityView, view_parms?: ValuesObject, limit?: string | null, search?: string[] | null, abort_signal?: AbortSignal | null): Promise<DataResult[]>;
|
|
1247
1249
|
downloadBlobFile(blob: Blob, filename: string): void;
|
|
1248
1250
|
exportView(view: EntityView, view_parms?: ValuesObject, limit?: string | null, search?: string[] | null, abort_signal?: AbortSignal | null): Promise<Blob>;
|
|
@@ -1621,10 +1623,32 @@ export function useLocaleFormat(props: UseLocaleFormatProps): {
|
|
|
1621
1623
|
getNativeValue: (value: Value, sqlType: SQLType) => Value;
|
|
1622
1624
|
formatColumnValue: (col: EntityColumn<Value>) => string;
|
|
1623
1625
|
};
|
|
1624
|
-
export interface
|
|
1626
|
+
export interface ImportFileSheet {
|
|
1627
|
+
name: string | null;
|
|
1628
|
+
rows: string[][];
|
|
1629
|
+
}
|
|
1630
|
+
export interface ParsedImportFile {
|
|
1631
|
+
format: 'csv' | 'xls' | 'xlsx';
|
|
1632
|
+
sheets: ImportFileSheet[];
|
|
1633
|
+
}
|
|
1634
|
+
export function getImportFileExtension(file: File): string;
|
|
1635
|
+
export function parseCSVRows(text: string): string[][];
|
|
1636
|
+
export function parseImportFile(file: File): Promise<ParsedImportFile>;
|
|
1637
|
+
export interface ImportDataMappingState {
|
|
1638
|
+
mapping: FileImportMapping;
|
|
1639
|
+
initialRow: number;
|
|
1640
|
+
isValid: boolean;
|
|
1641
|
+
isSuccessful: boolean;
|
|
1642
|
+
sourceColumnCount: number;
|
|
1643
|
+
mappedColumnCount: number;
|
|
1644
|
+
ignoredSourceColumns: string[];
|
|
1645
|
+
omittedRequiredDestinations: string[];
|
|
1646
|
+
}
|
|
1647
|
+
export interface ImportDataMappingEditorProps {
|
|
1625
1648
|
file: File;
|
|
1626
1649
|
destinations: readonly string[];
|
|
1627
|
-
|
|
1650
|
+
requiredDestinations: readonly string[];
|
|
1651
|
+
onChange: (state: ImportDataMappingState | undefined) => void;
|
|
1628
1652
|
initialRow?: number;
|
|
1629
1653
|
sampleRowCount?: number;
|
|
1630
1654
|
worksheetLabel?: string;
|
|
@@ -1632,14 +1656,16 @@ export interface ExcelImportMappingEditorProps {
|
|
|
1632
1656
|
sourceHeaderLabel?: string;
|
|
1633
1657
|
sourceIndexLabel?: string;
|
|
1634
1658
|
destinationLabel?: string;
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1659
|
+
mappingCorrectLabel?: string;
|
|
1660
|
+
mappingReviewLabel?: string;
|
|
1661
|
+
editMappedColumnsLabel?: string;
|
|
1662
|
+
viewSampleDataLabel?: string;
|
|
1663
|
+
noSampleDataLabel?: string;
|
|
1638
1664
|
noDestinationsLabel?: string;
|
|
1639
|
-
|
|
1665
|
+
fileErrorLabel?: string;
|
|
1640
1666
|
}
|
|
1641
|
-
export const
|
|
1642
|
-
export function
|
|
1667
|
+
export const ImportDataMappingEditorDefaultProps: Partial<ImportDataMappingEditorProps>;
|
|
1668
|
+
export function ImportDataMappingEditor(props: ImportDataMappingEditorProps): JSX.Element | null;
|
|
1643
1669
|
export const ACTDownloadImportedFileLabels: {
|
|
1644
1670
|
label: string;
|
|
1645
1671
|
error: string;
|
|
@@ -1996,24 +2022,29 @@ export interface ImportEntityDataFormProps extends FormOptions<ImportEntityData>
|
|
|
1996
2022
|
entityProcName?: string;
|
|
1997
2023
|
excludedImportDestinations?: string[];
|
|
1998
2024
|
onImportSuccess?: () => Promise<void>;
|
|
1999
|
-
|
|
2000
|
-
|
|
2025
|
+
instructionsStepLabel?: string;
|
|
2026
|
+
instructionsStepDescription?: string;
|
|
2027
|
+
uploadStepLabel?: string;
|
|
2028
|
+
uploadStepDescription?: string;
|
|
2029
|
+
summaryStepLabel?: string;
|
|
2030
|
+
summaryStepDescription?: string;
|
|
2031
|
+
instructionsLabel?: string;
|
|
2001
2032
|
columnHeaderLabel?: string;
|
|
2002
2033
|
dataNameLabel?: string;
|
|
2003
2034
|
contentLabel?: string;
|
|
2004
2035
|
dataTypeLabel?: string;
|
|
2005
|
-
errorReadingFileLabel?: string;
|
|
2006
|
-
emptyCSVFileLabel?: string;
|
|
2007
|
-
missingColumnsLabel?: string;
|
|
2008
2036
|
dateFormatLabel?: string;
|
|
2009
2037
|
numberFormatLabel?: string;
|
|
2010
|
-
|
|
2038
|
+
downloadExcelSampleLabel?: string;
|
|
2039
|
+
downloadCSVSampleLabel?: string;
|
|
2040
|
+
errorReadingFileLabel?: string;
|
|
2041
|
+
emptyFileLabel?: string;
|
|
2042
|
+
uploadRequiredLabel?: string;
|
|
2043
|
+
mappingRequiredLabel?: string;
|
|
2011
2044
|
importButtonLabel?: string;
|
|
2012
|
-
importHelpAndInstructionsLabel?: string;
|
|
2013
|
-
recordsImportedSusccessfullyLabel?: string;
|
|
2014
|
-
recordsNotImportedDueToErrorsLabel?: string;
|
|
2015
|
-
importTheCSVFileLabel?: string;
|
|
2016
2045
|
importedFileLabel?: string;
|
|
2046
|
+
recordsImportedSuccessfullyLabel?: string;
|
|
2047
|
+
recordsNotImportedDueToErrorsLabel?: string;
|
|
2017
2048
|
errorColumnTitle?: string;
|
|
2018
2049
|
rowColumnTitle?: string;
|
|
2019
2050
|
}
|
|
@@ -2078,17 +2109,6 @@ export const UseImportDataDefaultProps: {
|
|
|
2078
2109
|
noFileProcessLabel: string;
|
|
2079
2110
|
errorImportingDataLabel: string;
|
|
2080
2111
|
};
|
|
2081
|
-
export interface useEntityCSVImportValidationProps {
|
|
2082
|
-
errorReadingFileLabel?: string;
|
|
2083
|
-
emptyCSVFileLabel?: string;
|
|
2084
|
-
missingColumnsLabel?: string;
|
|
2085
|
-
}
|
|
2086
|
-
export function useEntityCSVImportValidation({ errorReadingFileLabel, emptyCSVFileLabel, missingColumnsLabel }: useEntityCSVImportValidationProps): {
|
|
2087
|
-
validateEntityImportCSVFile: (props: {
|
|
2088
|
-
file: File;
|
|
2089
|
-
requiredColumns: string[];
|
|
2090
|
-
}) => Promise<ValidateFileReturnType>;
|
|
2091
|
-
};
|
|
2092
2112
|
export interface UseExportToExcelProps {
|
|
2093
2113
|
data: DataResult[];
|
|
2094
2114
|
dataResultNames?: string[];
|
|
@@ -2098,9 +2118,10 @@ export function useExportToExcel(props: UseExportToExcelProps): {
|
|
|
2098
2118
|
exportToExcel: () => Promise<void>;
|
|
2099
2119
|
};
|
|
2100
2120
|
export function useImportData(importEntity?: Entity<EntityDefinition>): {
|
|
2101
|
-
execute: (fileprocess_id: string, importProcedureName?: string,
|
|
2121
|
+
execute: (fileprocess_id: string, importProcedureName?: string, fileImportMapping?: FileImportMapping, initialRow?: number) => Promise<OperationStatus<ImpDataResult> | undefined>;
|
|
2102
2122
|
importStatus: OperationStatus<ImpDataResult>;
|
|
2103
|
-
cancellation: AbortController;
|
|
2123
|
+
readonly cancellation: AbortController;
|
|
2124
|
+
cancel: () => void;
|
|
2104
2125
|
};
|
|
2105
2126
|
export interface MicroMClientClaimTypes {
|
|
2106
2127
|
username: string;
|
|
@@ -4627,7 +4648,7 @@ export class MicroMClient {
|
|
|
4627
4648
|
proctoexcel(entity_name: string, parent_keys: ValuesObject | null, values: ValuesObject, recordsSelection: ValuesObject[] | null, proc_name: string, abort_signal?: AbortSignal | null): Promise<Blob>;
|
|
4628
4649
|
process(entity_name: string, parent_keys: ValuesObject | null, values: ValuesObject, recordsSelection: ValuesObject[] | null, proc_name: string, abort_signal?: AbortSignal | null): Promise<DBStatusResult>;
|
|
4629
4650
|
action<TReturn>(entity_name: string, parent_keys: ValuesObject | null, values: ValuesObject, action_name: string, abort_signal?: AbortSignal | null): Promise<TReturn>;
|
|
4630
|
-
import(entity_name: string, parent_keys: ValuesObject | null, values: ValuesObject, import_procname: string | null, abort_signal?: AbortSignal | null,
|
|
4651
|
+
import(entity_name: string, parent_keys: ValuesObject | null, values: ValuesObject, import_procname: string | null, abort_signal?: AbortSignal | null, fileImportMapping?: FileImportMapping, initialRow?: number): Promise<ImpDataResult>;
|
|
4631
4652
|
}
|
|
4632
4653
|
export class RecordReader {
|
|
4633
4654
|
constructor(dataResult: DataResult);
|