@mcurros2/microm 1.1.378-0 → 1.1.379-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 CHANGED
@@ -19,6 +19,15 @@ export type ValuesRecord = Value[];
19
19
  export interface MicroMRequestOptions {
20
20
  keepalive?: boolean;
21
21
  }
22
+ export interface ImportDataMapping {
23
+ SourceHeader: string | null;
24
+ SourceIndex: number | null;
25
+ DestinationColumnName: string;
26
+ }
27
+ export interface ExcelImportMapping {
28
+ SheetName: string | null;
29
+ Mapping: ImportDataMapping[];
30
+ }
22
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';
23
32
  export interface DataResult {
24
33
  Header: string[];
@@ -831,6 +840,8 @@ export interface DataGridProps extends UseEntityUIProps {
831
840
  showToolbar?: boolean;
832
841
  showActionsToolbar?: boolean;
833
842
  enableImport?: boolean;
843
+ entityProcName?: string;
844
+ excludedImportDestinations?: string[];
834
845
  gridHeight?: string | number | 'auto' | 'flex-grow';
835
846
  minGridHeight?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'none';
836
847
  autoSelectFirstRow?: boolean;
@@ -1231,7 +1242,7 @@ export class EntityAPI {
1231
1242
  /**
1232
1243
  * Import data
1233
1244
  */
1234
- importData(abort_signal: (AbortSignal | null) | undefined, import_procname: (string | null) | undefined, parentKeys: (ValuesObject | null) | undefined, fileprocess_id: string): Promise<ImpDataResult>;
1245
+ importData(abort_signal: (AbortSignal | null) | undefined, import_procname: (string | null) | undefined, parentKeys: (ValuesObject | null) | undefined, fileprocess_id: string, excelImportMapping?: ExcelImportMapping, initialRow?: number): Promise<ImpDataResult>;
1235
1246
  executeView(view: EntityView, view_parms?: ValuesObject, limit?: string | null, search?: string[] | null, abort_signal?: AbortSignal | null): Promise<DataResult[]>;
1236
1247
  downloadBlobFile(blob: Blob, filename: string): void;
1237
1248
  exportView(view: EntityView, view_parms?: ValuesObject, limit?: string | null, search?: string[] | null, abort_signal?: AbortSignal | null): Promise<Blob>;
@@ -1605,6 +1616,25 @@ export function useLocaleFormat(props: UseLocaleFormatProps): {
1605
1616
  getNativeValue: (value: Value, sqlType: SQLType) => Value;
1606
1617
  formatColumnValue: (col: EntityColumn<Value>) => string;
1607
1618
  };
1619
+ export interface ExcelImportMappingEditorProps {
1620
+ file: File;
1621
+ destinations: readonly string[];
1622
+ onChange: (mapping: ExcelImportMapping | undefined, initialRow: number) => void;
1623
+ initialRow?: number;
1624
+ sampleRowCount?: number;
1625
+ worksheetLabel?: string;
1626
+ initialRowLabel?: string;
1627
+ sourceHeaderLabel?: string;
1628
+ sourceIndexLabel?: string;
1629
+ destinationLabel?: string;
1630
+ previewLabel?: string;
1631
+ addMappingLabel?: string;
1632
+ legacyHelpLabel?: string;
1633
+ noDestinationsLabel?: string;
1634
+ workbookErrorLabel?: string;
1635
+ }
1636
+ export const ExcelImportMappingEditorDefaultProps: Partial<ExcelImportMappingEditorProps>;
1637
+ export function ExcelImportMappingEditor(props: ExcelImportMappingEditorProps): JSX.Element;
1608
1638
  export const UseImportDataDefaultProps: {
1609
1639
  noFileProcessLabel: string;
1610
1640
  errorImportingDataLabel: string;
@@ -1911,8 +1941,16 @@ export function useEntityCSVImportValidation({ errorReadingFileLabel, emptyCSVFi
1911
1941
  requiredColumns: string[];
1912
1942
  }) => Promise<ValidateFileReturnType>;
1913
1943
  };
1944
+ export interface UseExportToExcelProps {
1945
+ data: DataResult[];
1946
+ dataResultNames?: string[];
1947
+ notExportableColumns?: number[];
1948
+ }
1949
+ export function useExportToExcel(props: UseExportToExcelProps): {
1950
+ exportToExcel: () => Promise<void>;
1951
+ };
1914
1952
  export function useImportData(importEntity?: Entity<EntityDefinition>): {
1915
- execute: (fileprocess_id: string) => Promise<OperationStatus<ImpDataResult> | undefined>;
1953
+ execute: (fileprocess_id: string, importProcedureName?: string, excelImportMapping?: ExcelImportMapping, initialRow?: number) => Promise<OperationStatus<ImpDataResult> | undefined>;
1916
1954
  importStatus: OperationStatus<ImpDataResult>;
1917
1955
  cancellation: AbortController;
1918
1956
  };
@@ -1993,6 +2031,9 @@ export const CircleFilledIconDefaultProps: Partial<CircleFilledIconProps>;
1993
2031
  export const CircleFilledIcon: ForwardRefExoticComponent<CircleFilledIconProps & RefAttributes<HTMLInputElement>>;
1994
2032
  export interface ImportEntityDataFormProps extends FormOptions<ImportEntityData> {
1995
2033
  importEntity?: Entity<EntityDefinition>;
2034
+ entityProcName?: string;
2035
+ excludedImportDestinations?: string[];
2036
+ onImportSuccess?: () => Promise<void>;
1996
2037
  importInfoLabel?: string;
1997
2038
  csvInstructionsLabel?: string;
1998
2039
  columnHeaderLabel?: string;
@@ -2034,17 +2075,10 @@ export interface UseImportDataProps {
2034
2075
  handleModalSaved: (newStatus: OperationStatus<DBStatusResult | null>) => Promise<void>;
2035
2076
  handleModalCancel: () => Promise<void>;
2036
2077
  handleModalClosed?: () => void;
2078
+ handleImportSuccess?: () => Promise<void>;
2037
2079
  }
2038
- export function useImportDataForm({ initialFormMode, title, element, getDataOnInit, modalFormSize, handleModalCancel, handleModalClosed, handleModalSaved }: UseImportDataProps): {
2039
- openImportDataForm: (importEntity: Entity<EntityDefinition>) => Promise<void>;
2040
- };
2041
- export interface UseExportToExcelProps {
2042
- data: DataResult[];
2043
- dataResultNames?: string[];
2044
- notExportableColumns?: number[];
2045
- }
2046
- export function useExportToExcel(props: UseExportToExcelProps): {
2047
- exportToExcel: () => Promise<void>;
2080
+ export function useImportDataForm({ initialFormMode, title, element, getDataOnInit, modalFormSize, handleModalCancel, handleModalClosed, handleModalSaved, handleImportSuccess }: UseImportDataProps): {
2081
+ openImportDataForm: (importEntity: Entity<EntityDefinition>, entityProcName?: string, excludedImportDestinations?: string[]) => Promise<void>;
2048
2082
  };
2049
2083
  export const ApplyFiltersDefaultLabel = "Apply Filters";
2050
2084
  export function AutoFiltersForm(props: FormOptions<Entity<EntityDefinition>>): JSX.Element;
@@ -2096,6 +2130,9 @@ export interface UseEntityUIProps {
2096
2130
  onDeleteClick?: (keys: ValuesObject[], element?: HTMLElement) => void;
2097
2131
  onActionExecuted?: (actionName: string, result?: boolean) => void;
2098
2132
  onModalClosed?: (cancelled?: boolean) => void;
2133
+ entityProcName?: string;
2134
+ excludedImportDestinations?: string[];
2135
+ onImportSuccess?: () => void;
2099
2136
  }
2100
2137
  export function useEntityUI(props: UseEntityUIProps): {
2101
2138
  handleAddClick: (element?: HTMLElement, onClosed?: (cancelled?: boolean) => void) => Promise<void>;
@@ -3438,13 +3475,16 @@ export function useMultiDataMapGrid({ dataMapView, viewState, selectionMode, map
3438
3475
  withModalFullscreenButton: boolean;
3439
3476
  initialHiddenColumns: number[];
3440
3477
  initialSelectRowsToggle: boolean;
3478
+ entityProcName: string;
3479
+ excludedImportDestinations: string[];
3480
+ onRecordsDeleted: () => void;
3481
+ onActionRefreshOnClose: () => void;
3441
3482
  renderOnlyWhenVisible: boolean;
3442
3483
  showToolbar: boolean;
3443
3484
  showActionsToolbar: boolean;
3444
3485
  minGridHeight: "xs" | "sm" | "md" | "lg" | "xl" | "none";
3445
3486
  showColumnsConfigMenu: boolean;
3446
- onRecordsDeleted: () => void;
3447
- onActionRefreshOnClose: () => void;
3487
+ onImportSuccess: () => void;
3448
3488
  };
3449
3489
  viewState: {
3450
3490
  searchText: string[] | undefined;
@@ -4340,9 +4380,9 @@ export interface MenuCardNavBarPanelProps extends Omit<NavbarProps, 'children' |
4340
4380
  searchLabel?: string;
4341
4381
  brandColor?: DefaultMantineColor;
4342
4382
  /** Navbar width in icons mode */
4343
- widthIcons?: number;
4383
+ widthIcons?: string | number;
4344
4384
  /** Navbar width in text mode */
4345
- widthText?: number;
4385
+ widthText?: string | number;
4346
4386
  /** Icon for the home item */
4347
4387
  homeIcon?: ReactNode;
4348
4388
  /** Icon for the search item */
@@ -4531,7 +4571,7 @@ export class MicroMClient {
4531
4571
  proctoexcel(entity_name: string, parent_keys: ValuesObject | null, values: ValuesObject, recordsSelection: ValuesObject[] | null, proc_name: string, abort_signal?: AbortSignal | null): Promise<Blob>;
4532
4572
  process(entity_name: string, parent_keys: ValuesObject | null, values: ValuesObject, recordsSelection: ValuesObject[] | null, proc_name: string, abort_signal?: AbortSignal | null): Promise<DBStatusResult>;
4533
4573
  action<TReturn>(entity_name: string, parent_keys: ValuesObject | null, values: ValuesObject, action_name: string, abort_signal?: AbortSignal | null): Promise<TReturn>;
4534
- import(entity_name: string, parent_keys: ValuesObject | null, values: ValuesObject, import_procname: string | null, abort_signal?: AbortSignal | null): Promise<ImpDataResult>;
4574
+ import(entity_name: string, parent_keys: ValuesObject | null, values: ValuesObject, import_procname: string | null, abort_signal?: AbortSignal | null, excelImportMapping?: ExcelImportMapping, initialRow?: number): Promise<ImpDataResult>;
4535
4575
  }
4536
4576
  export class RecordReader {
4537
4577
  constructor(dataResult: DataResult);