@dcs-tech/ui 0.4.0 → 0.6.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/ChartImageMenu-CuuFnW9q.js +1481 -0
- package/dist/{ChartView-Cehrcr05.js → ChartView-nS4f4EU_.js} +514 -514
- package/dist/{SummaryChart-y27q_BBN.js → SummaryChart-CVg6i2mx.js} +2 -2
- package/dist/{SummaryImage-DDNEEu_K.js → SummaryImage-CoEFzMl6.js} +2 -2
- package/dist/{SummarySeeAll-0dX-_LFe.js → SummarySeeAll-C_OUs3kn.js} +5 -5
- package/dist/assets/fileTask.worker-FQSUtwcz.js +1 -0
- package/dist/columnValue-K98ElfJc.js +610 -0
- package/dist/exportContext-CJaIv8R-.js +166 -0
- package/dist/{exportEngine-DL-jEXFU.js → exportEngine-CDLYHH0d.js} +137 -133
- package/dist/fileActions-KSaVGnaE.js +144 -0
- package/dist/{geometry-CG2nOEnw.js → geometry-ChwYB45B.js} +433 -497
- package/dist/index.js +8572 -8435
- package/dist/{defaults-DL745PK1.js → labels-CnqqTrne.js} +3 -79
- package/dist/runFileTask-BClLQjmv.js +109 -0
- package/dist/scrollArea-DAlVT5U7.js +214 -0
- package/dist/style.css +1 -1
- package/dist/{summaryChartData-Djo73zb8.js → summaryChartData-pNvzaEHp.js} +1 -1
- package/dist/types/components/Charts/parts.d.ts +1 -1
- package/dist/types/components/Collapsible/index.d.ts +1 -1
- package/dist/types/components/DataTable/DataTable.d.ts +1 -1
- package/dist/types/components/DataTable/cards/cardFields.d.ts +2 -4
- package/dist/types/components/DataTable/columnValue.d.ts +19 -0
- package/dist/types/components/DataTable/export/exportCells.d.ts +13 -0
- package/dist/types/components/DataTable/export/exportEngine.d.ts +2 -0
- package/dist/types/components/DataTable/export/useTableExport.d.ts +2 -0
- package/dist/types/components/DataTable/host.d.ts +2 -0
- package/dist/types/components/DataTable/index.d.ts +1 -1
- package/dist/types/components/DataTable/labels.d.ts +2 -0
- package/dist/types/components/DataTable/types.d.ts +11 -0
- package/dist/types/components/DataTable/useTable.d.ts +4 -1
- package/dist/types/components/DataTable/vendor/index.d.ts +1 -1
- package/dist/types/components/EditableTable/EditableTableCell.d.ts +1 -1
- package/dist/types/components/FileEngine/FileEngineContext.d.ts +17 -0
- package/dist/types/components/FileEngine/FileEngineProvider.d.ts +12 -0
- package/dist/types/components/FileEngine/FileJobsTray.d.ts +10 -0
- package/dist/types/components/FileEngine/index.d.ts +8 -0
- package/dist/types/components/FileEngine/labels.d.ts +29 -0
- package/dist/types/components/Toast/ToastHost.d.ts +1 -0
- package/dist/types/components/UIProvider/UIFormatContext.d.ts +7 -0
- package/dist/types/components/UIProvider/UILabelsContext.d.ts +116 -0
- package/dist/types/components/UIProvider/UIProvider.d.ts +6 -1
- package/dist/types/components/UIProvider/index.d.ts +4 -0
- package/dist/types/core/logic/collapsible.logic.d.ts +6 -1
- package/dist/types/core/logic/datePicker.logic.d.ts +5 -0
- package/dist/types/core/logic/exportSafety.logic.d.ts +1 -0
- package/dist/types/core/logic/fileQueue.logic.d.ts +28 -0
- package/dist/types/core/logic/format.logic.d.ts +4 -0
- package/dist/types/core/logic/index.d.ts +4 -0
- package/dist/types/core/logic/tableDate.logic.d.ts +7 -0
- package/dist/types/core/logic/tableSummary.logic.d.ts +2 -2
- package/dist/types/core/types/collapsible.types.d.ts +4 -16
- package/dist/types/core/types/fileEngine.types.d.ts +65 -0
- package/dist/types/core/types/format.types.d.ts +15 -0
- package/dist/types/core/types/index.d.ts +2 -0
- package/dist/types/core/types/table.types.d.ts +1 -0
- package/dist/types/{components/DataTable/vendor → file}/fileActions.d.ts +17 -7
- package/dist/types/file/fileEngine.d.ts +48 -0
- package/dist/types/file/tasks/fileTask.worker.d.ts +1 -0
- package/dist/types/file/tasks/runFileTask.d.ts +6 -0
- package/dist/types/file/workerPool.d.ts +17 -0
- package/dist/types/index.d.ts +9 -2
- package/package.json +1 -1
- package/dist/ChartImageMenu-HILSfn5A.js +0 -1115
- package/dist/exportContext-CdpsOzE8.js +0 -235
- package/dist/scrollArea-CkPGDYH2.js +0 -210
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export type FileFormat = 'pdf' | 'xlsx' | 'csv' | 'html' | 'json' | 'xml' | 'png';
|
|
2
|
+
export type FileDeliveryAction = 'download' | 'share' | 'preview' | 'print' | 'open';
|
|
3
|
+
export type FileJobAction = FileDeliveryAction | 'none';
|
|
4
|
+
export type FileJobPriority = 'high' | 'normal' | 'low';
|
|
5
|
+
export type FileJobStatus = 'queued' | 'running' | 'ready' | 'delivered' | 'failed' | 'cancelled';
|
|
6
|
+
export interface FileJob {
|
|
7
|
+
id: string;
|
|
8
|
+
format: FileFormat;
|
|
9
|
+
filename: string;
|
|
10
|
+
title?: string;
|
|
11
|
+
action: FileJobAction;
|
|
12
|
+
priority: FileJobPriority;
|
|
13
|
+
dedupeKey?: string;
|
|
14
|
+
status: FileJobStatus;
|
|
15
|
+
progress: number;
|
|
16
|
+
attempts: number;
|
|
17
|
+
retry: number;
|
|
18
|
+
seq: number;
|
|
19
|
+
createdAt: number;
|
|
20
|
+
startedAt?: number;
|
|
21
|
+
finishedAt?: number;
|
|
22
|
+
error?: string;
|
|
23
|
+
awaitingClick?: boolean;
|
|
24
|
+
notify: 'all' | 'awaiting-click';
|
|
25
|
+
}
|
|
26
|
+
export interface FileEngineOptions {
|
|
27
|
+
concurrency?: number;
|
|
28
|
+
maxQueued?: number;
|
|
29
|
+
timeoutMs?: number;
|
|
30
|
+
keepFinished?: number;
|
|
31
|
+
workers?: 'auto' | 'off';
|
|
32
|
+
}
|
|
33
|
+
export type XlsxCellValue = string | number | boolean | Date | null;
|
|
34
|
+
export interface XlsxColumnSpec {
|
|
35
|
+
header: string;
|
|
36
|
+
width?: number;
|
|
37
|
+
numFmt?: string;
|
|
38
|
+
align?: 'left' | 'center' | 'right';
|
|
39
|
+
}
|
|
40
|
+
export interface XlsxSheetSpec {
|
|
41
|
+
name: string;
|
|
42
|
+
columns: XlsxColumnSpec[];
|
|
43
|
+
rows: XlsxCellValue[][];
|
|
44
|
+
freezeHeader?: boolean;
|
|
45
|
+
}
|
|
46
|
+
export interface XlsxWorkbookSpec {
|
|
47
|
+
sheets: XlsxSheetSpec[];
|
|
48
|
+
}
|
|
49
|
+
export interface PdfTaskFonts {
|
|
50
|
+
fonts?: Record<string, {
|
|
51
|
+
normal: string;
|
|
52
|
+
bold: string;
|
|
53
|
+
italics: string;
|
|
54
|
+
bolditalics: string;
|
|
55
|
+
}>;
|
|
56
|
+
vfs?: Record<string, string>;
|
|
57
|
+
}
|
|
58
|
+
export type FileTask = {
|
|
59
|
+
kind: 'pdf';
|
|
60
|
+
document: Record<string, unknown>;
|
|
61
|
+
fonts?: PdfTaskFonts;
|
|
62
|
+
} | {
|
|
63
|
+
kind: 'xlsx';
|
|
64
|
+
workbook: XlsxWorkbookSpec;
|
|
65
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { DateDisplayFormat } from './datePicker.types';
|
|
2
|
+
export interface UIFormatSettings {
|
|
3
|
+
locale?: string;
|
|
4
|
+
currency?: string;
|
|
5
|
+
dateFormat?: DateDisplayFormat;
|
|
6
|
+
}
|
|
7
|
+
export interface UIFormat {
|
|
8
|
+
locale: string | undefined;
|
|
9
|
+
currency: string | undefined;
|
|
10
|
+
dateFormat: DateDisplayFormat;
|
|
11
|
+
number: (value: number, decimals?: number) => string;
|
|
12
|
+
money: (value: number, decimals?: number) => string;
|
|
13
|
+
percent: (value: number, decimals?: number) => string;
|
|
14
|
+
day: (value: unknown) => string;
|
|
15
|
+
}
|
|
@@ -1,19 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export interface PdfFontConfig {
|
|
2
|
+
fonts?: Record<string, {
|
|
3
|
+
normal: string;
|
|
4
|
+
bold: string;
|
|
5
|
+
italics: string;
|
|
6
|
+
bolditalics: string;
|
|
7
|
+
}>;
|
|
8
|
+
vfs?: Record<string, string>;
|
|
9
|
+
fontFor?: (text: string) => string | undefined;
|
|
10
|
+
}
|
|
11
|
+
import type { FileFormat, FileDeliveryAction } from '../core/types';
|
|
12
|
+
export type { FileFormat };
|
|
13
|
+
export type FileAction = FileDeliveryAction;
|
|
4
14
|
export declare const EXTENSION_MAP: Record<FileFormat, string>;
|
|
5
15
|
export declare const MIME_MAP: Record<FileFormat, string>;
|
|
6
|
-
export declare function createPdfBlob(docDef: unknown, fontConfig?:
|
|
7
|
-
export declare function rawDataToBlob(format: FileFormat, data: any, fontConfig?:
|
|
16
|
+
export declare function createPdfBlob(docDef: unknown, fontConfig?: PdfFontConfig): Promise<Blob>;
|
|
17
|
+
export declare function rawDataToBlob(format: FileFormat, data: any, fontConfig?: PdfFontConfig): Promise<Blob>;
|
|
8
18
|
export declare function safeFileBaseName(name: string): string;
|
|
9
19
|
export declare function safeFileName(filename: string): string;
|
|
10
20
|
export declare function downloadBlob(blob: Blob, filename: string): void;
|
|
11
|
-
export declare function shareFile(blob: Blob, filename: string): Promise<boolean>;
|
|
21
|
+
export declare function shareFile(blob: Blob, filename: string, title?: string): Promise<boolean>;
|
|
12
22
|
export declare function openPreview(blob: Blob, format: FileFormat, title?: string): {
|
|
13
23
|
type: "new_tab";
|
|
14
24
|
} | {
|
|
15
25
|
type: "modal";
|
|
16
26
|
};
|
|
17
|
-
export declare function executeFileAction(data: any, filename: string, format: FileFormat, action: string, title?: string, fontConfig?:
|
|
27
|
+
export declare function executeFileAction(data: any, filename: string, format: FileFormat, action: string, title?: string, fontConfig?: PdfFontConfig): Promise<void>;
|
|
18
28
|
export declare function getExtension(format: FileFormat): string;
|
|
19
29
|
export declare function getFormatLabel(format: FileFormat): string;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { FileDeliveryAction, FileEngineOptions, FileFormat, FileJob, FileJobAction, FileJobPriority, FileTask } from '../core/types';
|
|
2
|
+
export interface FileBuildContext {
|
|
3
|
+
signal: AbortSignal;
|
|
4
|
+
progress: (fraction: number) => void;
|
|
5
|
+
}
|
|
6
|
+
interface FileJobRequestBase {
|
|
7
|
+
filename: string;
|
|
8
|
+
title?: string;
|
|
9
|
+
action?: FileJobAction;
|
|
10
|
+
priority?: FileJobPriority;
|
|
11
|
+
dedupeKey?: string;
|
|
12
|
+
replace?: boolean;
|
|
13
|
+
retry?: number;
|
|
14
|
+
onReady?: (blob: Blob, job: FileJob) => void;
|
|
15
|
+
notify?: FileJob['notify'];
|
|
16
|
+
}
|
|
17
|
+
export type FileJobRequest = FileJobRequestBase & ({
|
|
18
|
+
format: FileFormat;
|
|
19
|
+
build: (context: FileBuildContext) => unknown | Promise<unknown>;
|
|
20
|
+
task?: never;
|
|
21
|
+
} | {
|
|
22
|
+
task: FileTask;
|
|
23
|
+
format?: FileFormat;
|
|
24
|
+
build?: never;
|
|
25
|
+
});
|
|
26
|
+
export type FileDeliverer = (blob: Blob, job: FileJob, action: FileDeliveryAction) => void | Promise<void>;
|
|
27
|
+
export interface CreateFileEngineOptions extends FileEngineOptions {
|
|
28
|
+
deliver?: FileDeliverer;
|
|
29
|
+
createWorker?: () => Worker;
|
|
30
|
+
}
|
|
31
|
+
export type FileEngineErrorCode = 'queue-full' | 'timeout' | 'disposed';
|
|
32
|
+
export declare class FileEngineError extends Error {
|
|
33
|
+
readonly code: FileEngineErrorCode;
|
|
34
|
+
constructor(code: FileEngineErrorCode, message: string);
|
|
35
|
+
}
|
|
36
|
+
export interface FileEngine {
|
|
37
|
+
submit(request: FileJobRequest): string;
|
|
38
|
+
cancel(id: string): void;
|
|
39
|
+
retry(id: string): void;
|
|
40
|
+
deliver(id: string, action?: FileDeliveryAction): Promise<void>;
|
|
41
|
+
wait(id: string): Promise<FileJob | undefined>;
|
|
42
|
+
clear(filter?: (job: FileJob) => boolean): void;
|
|
43
|
+
getJobs(): readonly FileJob[];
|
|
44
|
+
subscribe(listener: () => void): () => void;
|
|
45
|
+
dispose(): void;
|
|
46
|
+
}
|
|
47
|
+
export declare function createFileEngine(options?: CreateFileEngineOptions): FileEngine;
|
|
48
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FileTask } from '../core/types';
|
|
2
|
+
export declare class WorkerFallback extends Error {
|
|
3
|
+
readonly reason: 'unavailable' | 'uncloneable';
|
|
4
|
+
constructor(reason: 'unavailable' | 'uncloneable', detail: string);
|
|
5
|
+
}
|
|
6
|
+
export interface WorkerPool {
|
|
7
|
+
run(task: FileTask, ctx: {
|
|
8
|
+
signal: AbortSignal;
|
|
9
|
+
progress: (fraction: number) => void;
|
|
10
|
+
}): Promise<ArrayBuffer>;
|
|
11
|
+
readonly broken: boolean;
|
|
12
|
+
dispose(): void;
|
|
13
|
+
}
|
|
14
|
+
export declare function createWorkerPool(options: {
|
|
15
|
+
size: number;
|
|
16
|
+
create: () => Worker;
|
|
17
|
+
}): WorkerPool;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export { Suggest, SuggestionList, useSuggest } from './components/Suggest';
|
|
|
28
28
|
export { FORMATTER_UTILITY_CLASSES, SUGGEST_SEARCH_ENGINE_OPTIONS, SUGGEST_SEARCH_MODE_OPTIONS, } from './components/Suggest';
|
|
29
29
|
export type { SuggestProps, SuggestSize, SuggestLayout, SuggestSearchEngine, SuggestSearchMode, RenderKey, SuggestionConfig, SuggestionItemProps, SuggestionListProps, SuggestionGroup, UseSuggestOptions, UseSuggestReturn, SuggestSearchOptions, } from './components/Suggest';
|
|
30
30
|
export { Collapsible, CollapsibleItem, CollapsibleContext, useCollapsibleContext } from './components/Collapsible';
|
|
31
|
-
export type { CollapsibleProps, CollapsibleItemProps, CollapsibleContextValue, CollapsibleVariant, CollapsibleSize, CollapsibleColor, CollapsibleIconPosition, CollapsibleExpansionMode, CollapsibleAuthorize, } from './components/Collapsible';
|
|
31
|
+
export type { CollapsibleProps, CollapsibleItemProps, CollapsibleContextValue, CollapsibleVariant, CollapsibleSize, CollapsibleColor, CollapsibleIconPosition, CollapsibleExpansionMode, CollapsibleAuthorize, CollapsibleDisclosure, CollapsibleTone, CollapsibleHeadingLevel, } from './components/Collapsible';
|
|
32
32
|
export { Fields, Field } from './components/Fields';
|
|
33
33
|
export { useFieldCondition, useFieldRender, useFieldDisabled, useFieldValue, useFieldChange, useFieldBlur, useFieldValidation, useFieldSelect, } from './components/Fields';
|
|
34
34
|
export type { FieldsProps, FieldProps, FieldsBaseProps, FieldsWithSetState, FieldsWithOnChange, FieldDefinition, FieldsDefinition, FieldAuthorize, FieldTooltipProps, FieldComponentRegistry, FieldEditableTableProps, BaseFieldDefinition, InputFieldDefinition, SwitchFieldDefinition, SelectFieldDefinition, SuggestFieldDefinition, RadioFieldDefinition, CheckboxFieldDefinition, ButtonFieldDefinition, ChildFieldDefinition, EditableTableFieldDefinition, ChipInputFieldDefinition, ConditionOperator, ConditionCompareType, ConditionObject, ConditionRegexObject, ConditionFunction, ConditionSimpleKey, Condition, ConditionContext, NestedKeys, NestedValue, ResetKeyConfig, SelectCopyKeyConfig, ChangeContext, ChangeAdditionalDataContext, SelectAdditionalDataContext, EditableTableCustomPropContext, ErrorObject, TouchedObject, } from './components/Fields';
|
|
@@ -44,7 +44,9 @@ export * from './components/Charts';
|
|
|
44
44
|
export * from './components/Scroll';
|
|
45
45
|
export { ColorSchemeSelect } from './components/ColorSchemeSelect';
|
|
46
46
|
export type { ColorSchemeSelectProps } from './components/ColorSchemeSelect';
|
|
47
|
-
export { UIProvider, useUIPortalContainer, useUITheme } from './components/UIProvider';
|
|
47
|
+
export { UIProvider, useUIPortalContainer, useUITheme, FormatProvider, useFormat, LabelsProvider, useUILabels, DEFAULT_UI_LABELS } from './components/UIProvider';
|
|
48
|
+
export type { FormatProviderProps, UILabels, UILabelsInput } from './components/UIProvider';
|
|
49
|
+
export type { UIFormat, UIFormatSettings } from './core/types';
|
|
48
50
|
export type { UIProviderProps, UITheme, ResolvedUITheme, UIThemeValue } from './components/UIProvider';
|
|
49
51
|
export { Skeleton } from './components/Skeleton';
|
|
50
52
|
export type { SkeletonProps, SkeletonVariant, SkeletonAnimation } from './components/Skeleton';
|
|
@@ -66,6 +68,11 @@ export { useDialog } from './components/Dialog/DialogHost';
|
|
|
66
68
|
export type { DialogApi, DialogChoice, DialogActionProps, ConfirmOptions, ChooseOptions, AlertOptions, } from './components/Dialog/DialogHost';
|
|
67
69
|
export { ToastHost, useToast } from './components/Toast';
|
|
68
70
|
export type { ToastApi, ToastDefaults, ToastOptions, ToastPosition, ToastRecord, ToastType, ToastHostProps, } from './components/Toast';
|
|
71
|
+
export { createFileEngine, FileEngineError } from './file/fileEngine';
|
|
72
|
+
export type { FileEngine, CreateFileEngineOptions, FileJobRequest, FileBuildContext, FileDeliverer, FileEngineErrorCode, } from './file/fileEngine';
|
|
73
|
+
export type { FileFormat, FileDeliveryAction, FileJobAction, FileJobPriority, FileJobStatus, FileJob, FileEngineOptions, FileTask, XlsxWorkbookSpec, XlsxSheetSpec, XlsxColumnSpec, XlsxCellValue, PdfTaskFonts, } from './core/types';
|
|
74
|
+
export { FileEngineProvider, FileJobsTray, useFileEngine, useFileJob, DEFAULT_FILE_ENGINE_LABELS, } from './components/FileEngine';
|
|
75
|
+
export type { FileEngineProviderProps, FileJobsTrayProps, UseFileEngineResult, FileEngineLabels, FileEngineLabelsInput, } from './components/FileEngine';
|
|
69
76
|
export { Stepper } from './components/Stepper';
|
|
70
77
|
export type { StepperProps, StepperStep } from './components/Stepper';
|
|
71
78
|
export { Tabs, TabPanel } from './components/Tabs';
|