@dcs-tech/ui 0.6.0 → 0.8.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/README.md +43 -0
- package/dist/{ChartImageMenu-CuuFnW9q.js → ChartImageMenu-AsfvmdTH.js} +99 -81
- package/dist/{ChartView-nS4f4EU_.js → ChartView-CW3m4Z_1.js} +1 -1
- package/dist/{SummaryChart-CVg6i2mx.js → SummaryChart-CxRjK_HU.js} +2 -2
- package/dist/{SummaryImage-CoEFzMl6.js → SummaryImage-DeYs2Jgj.js} +2 -2
- package/dist/{SummarySeeAll-C_OUs3kn.js → SummarySeeAll-CrmROhBv.js} +5 -5
- package/dist/assets/fileTask.worker-BHT1olUk.js +1 -0
- package/dist/{columnValue-K98ElfJc.js → columnValue-DwUqueZ6.js} +1 -1
- package/dist/{exportContext-CJaIv8R-.js → exportContext-BKFnNQ0q.js} +1 -1
- package/dist/{exportEngine-CDLYHH0d.js → exportEngine-CZ22cX7a.js} +377 -382
- package/dist/file-worker.js +1 -0
- package/dist/{fileActions-KSaVGnaE.js → fileActions-COf5Q4Eg.js} +2 -2
- package/dist/{geometry-ChwYB45B.js → geometry-yZmKN662.js} +11 -2
- package/dist/index.js +6534 -6118
- package/dist/runFileTask--4YjQH7Y.js +210 -0
- package/dist/scrollArea-Dd2dNMV4.js +236 -0
- package/dist/style.css +1 -1
- package/dist/{summaryChartData-pNvzaEHp.js → summaryChartData-CARqGRUl.js} +1 -1
- package/dist/types/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/dist/types/components/DataTable/export/exportEngine.d.ts +11 -4
- package/dist/types/components/DataTable/layout/useFillHeight.d.ts +1 -0
- package/dist/types/components/DataTable/rows/RowActions.d.ts +5 -2
- package/dist/types/components/DataTable/types.d.ts +1 -0
- package/dist/types/components/Dialog/DialogHost.d.ts +1 -0
- package/dist/types/components/Dialog/dialogOpen.d.ts +7 -0
- package/dist/types/components/Dialog/index.d.ts +1 -0
- package/dist/types/components/Fields/Field.d.ts +1 -1
- package/dist/types/components/Fields/hooks/useFieldBlur.d.ts +1 -1
- package/dist/types/components/FileEngine/FileEngineProvider.d.ts +20 -1
- package/dist/types/components/FileEngine/index.d.ts +1 -1
- package/dist/types/components/Popover/floatingPosition.d.ts +11 -1
- package/dist/types/components/Scroll/ScrollStrip.d.ts +4 -2
- package/dist/types/components/Sidebar/Sidebar.d.ts +12 -3
- package/dist/types/components/Sidebar/index.d.ts +1 -1
- package/dist/types/components/UIProvider/UIHostContext.d.ts +20 -0
- package/dist/types/components/UIProvider/UILabelsContext.d.ts +9 -0
- package/dist/types/components/UIProvider/UIProvider.d.ts +2 -0
- package/dist/types/components/UIProvider/index.d.ts +2 -0
- package/dist/types/core/logic/index.d.ts +1 -0
- package/dist/types/core/logic/popover.logic.d.ts +2 -0
- package/dist/types/core/logic/standardSchema.logic.d.ts +9 -0
- package/dist/types/core/types/fields.types.d.ts +2 -0
- package/dist/types/core/types/fileEngine.types.d.ts +51 -0
- package/dist/types/core/types/form.types.d.ts +4 -0
- package/dist/types/core/types/index.d.ts +1 -0
- package/dist/types/core/types/standardSchema.types.d.ts +30 -0
- package/dist/types/core/types/suggest.types.d.ts +1 -0
- package/dist/types/core/types/tooltip.types.d.ts +2 -0
- package/dist/types/file/fileEngine.d.ts +2 -1
- package/dist/types/file/tasks/runFileTask.d.ts +4 -1
- package/dist/types/file/workerPool.d.ts +1 -0
- package/dist/types/index.d.ts +11 -6
- package/package.json +7 -3
- package/dist/assets/fileTask.worker-FQSUtwcz.js +0 -1
- package/dist/runFileTask-BClLQjmv.js +0 -109
- package/dist/scrollArea-DAlVT5U7.js +0 -214
|
@@ -3,7 +3,7 @@ import type { NavItem } from '../../core/types';
|
|
|
3
3
|
export interface BreadcrumbsProps {
|
|
4
4
|
items: NavItem[];
|
|
5
5
|
as?: React.ElementType;
|
|
6
|
-
onSelect?: (item: NavItem) => void;
|
|
6
|
+
onSelect?: (item: NavItem, event?: React.MouseEvent) => void;
|
|
7
7
|
home?: NavItem | false;
|
|
8
8
|
showIcons?: boolean;
|
|
9
9
|
separator?: React.ReactNode;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { FileTask, PdfTaskFonts, XlsxWorkbookSpec } from '../../../core/types';
|
|
1
2
|
import { type DataTableExportFormat, type DataTableExportMetadata, type DataTableXlsxStyle, type DataTablePdfConfig, type DataTableColumn, type DataTableCellStyle, type DataTableExportSummary } from '../types';
|
|
2
3
|
export { autoFormatValue, prepareExportRows, buildBusinessMeta } from './exportRows';
|
|
3
4
|
export { formatContextLine, formatMetadataLines } from './exportContext';
|
|
@@ -13,7 +14,7 @@ export interface ColumnMeta {
|
|
|
13
14
|
}
|
|
14
15
|
export declare function buildColumnMeta(columns: DataTableColumn[], headers: string[]): ColumnMeta[];
|
|
15
16
|
export declare function generateCSV(headers: string[], rows: Record<string, any>[], totals?: Record<string, any> | null, summary?: DataTableExportSummary | null, metadata?: DataTableExportMetadata, subtitle?: string): Blob;
|
|
16
|
-
|
|
17
|
+
type XlsxConfig = {
|
|
17
18
|
totals?: Record<string, any> | null;
|
|
18
19
|
summary?: DataTableExportSummary | null;
|
|
19
20
|
style?: DataTableXlsxStyle;
|
|
@@ -22,7 +23,9 @@ export declare function generateXLSX(headers: string[], rows: Record<string, any
|
|
|
22
23
|
cellStyles?: Record<string, DataTableCellStyle>[];
|
|
23
24
|
metadata?: DataTableExportMetadata;
|
|
24
25
|
subtitle?: string;
|
|
25
|
-
}
|
|
26
|
+
};
|
|
27
|
+
export declare function buildTableXlsxSpec(headers: string[], rows: Record<string, any>[], config?: XlsxConfig): XlsxWorkbookSpec;
|
|
28
|
+
export declare function generateXLSX(headers: string[], rows: Record<string, any>[], config?: XlsxConfig): Promise<Blob>;
|
|
26
29
|
export declare function generateJSON(rows: Record<string, any>[], summary?: DataTableExportSummary | null, metadata?: DataTableExportMetadata, subtitle?: string): Blob;
|
|
27
30
|
export declare function generateHTML(headers: string[], rows: Record<string, any>[], config?: {
|
|
28
31
|
title?: string;
|
|
@@ -38,7 +41,10 @@ export declare function generateHTML(headers: string[], rows: Record<string, any
|
|
|
38
41
|
url?: string;
|
|
39
42
|
};
|
|
40
43
|
}): Blob;
|
|
41
|
-
export
|
|
44
|
+
export type TablePdfTask = Extract<FileTask, {
|
|
45
|
+
kind: 'pdf';
|
|
46
|
+
}>;
|
|
47
|
+
export declare function generateTablePDFTask(headers: string[], rows: Record<string, any>[], config?: {
|
|
42
48
|
pdfConfig?: DataTablePdfConfig;
|
|
43
49
|
totals?: Record<string, any> | null;
|
|
44
50
|
summary?: DataTableExportSummary | null;
|
|
@@ -47,7 +53,8 @@ export declare function generateTablePDFDocDef(headers: string[], rows: Record<s
|
|
|
47
53
|
cellStyles?: Record<string, DataTableCellStyle>[];
|
|
48
54
|
metadata?: DataTableExportMetadata;
|
|
49
55
|
fontFor?: PdfFontFor;
|
|
50
|
-
|
|
56
|
+
fonts?: PdfTaskFonts;
|
|
57
|
+
}): TablePdfTask;
|
|
51
58
|
export { rawDataToBlob, downloadBlob, shareFile, openPreview, executeFileAction, getExtension, getFormatLabel, } from '../vendor';
|
|
52
59
|
export declare function generateXML(headers: string[], rows: Record<string, any>[], config?: {
|
|
53
60
|
title?: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type DependencyList, type RefObject } from 'react';
|
|
2
2
|
export declare const MIN_ROWS_HEIGHT = 320;
|
|
3
3
|
export declare function fillHeight(viewport: number, chrome: number, below: number, min?: number): number;
|
|
4
|
+
export declare function fitHeight(viewport: number, covered: number, above: number, chrome: number, below: number, min?: number): number;
|
|
4
5
|
export declare function nextHeight(prev: number | null, next: number): number | null;
|
|
5
6
|
export declare function scrollParent(el: HTMLElement, current?: HTMLElement | null): HTMLElement | null;
|
|
6
7
|
export declare function viewportOf(scroller: HTMLElement | null): {
|
|
@@ -2,14 +2,17 @@ import React from 'react';
|
|
|
2
2
|
import type { DataTableActionDisplay, DataTableRowAction } from '../types';
|
|
3
3
|
import type { RowMenuRequest } from './rowPress';
|
|
4
4
|
export declare function primaryActionOf<T>(actions: DataTableRowAction<T>[], row: T): DataTableRowAction<T> | undefined;
|
|
5
|
+
export declare function inlineActionsOf<T>(actions: DataTableRowAction<T>[], row: T, max: number, primaryOnly?: boolean): DataTableRowAction<T>[];
|
|
5
6
|
interface RowActionsProps<T> {
|
|
6
7
|
row: T;
|
|
7
8
|
rowIndex: number;
|
|
8
9
|
title: string;
|
|
9
10
|
actions: DataTableRowAction<T>[];
|
|
10
11
|
displayMode: DataTableActionDisplay;
|
|
12
|
+
inline: number;
|
|
13
|
+
primaryOnly?: boolean;
|
|
11
14
|
onMenu?: (at: RowMenuRequest) => void;
|
|
12
|
-
|
|
15
|
+
reserveSlots?: number;
|
|
13
16
|
}
|
|
14
|
-
export declare function RowActions<T>({ row, rowIndex, title, actions, displayMode, onMenu,
|
|
17
|
+
export declare function RowActions<T>({ row, rowIndex, title, actions, displayMode, inline, primaryOnly, onMenu, reserveSlots }: RowActionsProps<T>): React.JSX.Element;
|
|
15
18
|
export {};
|
|
@@ -901,6 +901,7 @@ export interface DataTableView<TData = any> {
|
|
|
901
901
|
virtualize?: DataTableVirtualizeConfig;
|
|
902
902
|
expandRow?: (row: TData) => ReactNode;
|
|
903
903
|
actions?: DataTableRowAction<TData>[] | ((row: TData) => DataTableRowAction<TData>[]);
|
|
904
|
+
inlineActions?: number;
|
|
904
905
|
bulkActions?: DataTableBulkAction<TData>[];
|
|
905
906
|
hideBulkActions?: string[];
|
|
906
907
|
pinning?: DataTablePinningConfig;
|
|
@@ -37,6 +37,7 @@ export interface DialogApi {
|
|
|
37
37
|
choose: (opts: ChooseOptions) => Promise<string | null>;
|
|
38
38
|
alert: (opts: AlertOptions) => Promise<void>;
|
|
39
39
|
}
|
|
40
|
+
export declare const useOptionalDialog: () => DialogApi | null;
|
|
40
41
|
export declare const useDialog: () => DialogApi;
|
|
41
42
|
export declare const DialogHost: React.FC<{
|
|
42
43
|
children?: React.ReactNode;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const DialogOpenProvider: React.FC<{
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
}>;
|
|
5
|
+
export declare function useCountOpenDialog(active: boolean): void;
|
|
6
|
+
export declare const useOpenDialogCount: () => number;
|
|
7
|
+
export declare const useDialogOpen: () => boolean;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { FieldProps } from '../../core/types';
|
|
3
|
-
export declare function Field<T>({ field, data, defaultData, errors, touched, setTouched, context, cellindex, renderAuthorize, renderTooltip, componentRegistry, }: FieldProps<T>): React.JSX.Element | null;
|
|
3
|
+
export declare function Field<T>({ field, data, defaultData, errors, touched, setTouched, onFieldBlur, context, cellindex, renderAuthorize, renderTooltip, componentRegistry, }: FieldProps<T>): React.JSX.Element | null;
|
|
@@ -1,12 +1,31 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { FileJob } from '../../core/types';
|
|
2
3
|
import { type CreateFileEngineOptions, type FileEngine } from '../../file/fileEngine';
|
|
3
4
|
import { type FileEngineLabels, type FileEngineLabelsInput } from './labels';
|
|
4
5
|
export interface FileEngineProviderProps {
|
|
5
6
|
children?: React.ReactNode;
|
|
6
7
|
engine?: FileEngine;
|
|
7
8
|
options?: CreateFileEngineOptions;
|
|
8
|
-
notify?: boolean;
|
|
9
|
+
notify?: boolean | ((notice: FileJobNotice) => void);
|
|
9
10
|
labels?: FileEngineLabelsInput;
|
|
10
11
|
}
|
|
12
|
+
export type FileJobNotice = {
|
|
13
|
+
type: 'awaiting-click';
|
|
14
|
+
job: FileJob;
|
|
15
|
+
message: string;
|
|
16
|
+
actionLabel: string;
|
|
17
|
+
deliver: () => Promise<void>;
|
|
18
|
+
dismiss: () => void;
|
|
19
|
+
} | {
|
|
20
|
+
type: 'failed';
|
|
21
|
+
job: FileJob;
|
|
22
|
+
message: string;
|
|
23
|
+
actionLabel: string;
|
|
24
|
+
retry: () => void;
|
|
25
|
+
dismiss: () => void;
|
|
26
|
+
} | {
|
|
27
|
+
type: 'resolved';
|
|
28
|
+
job: FileJob;
|
|
29
|
+
};
|
|
11
30
|
export declare function useFileEngineLabels(labels?: FileEngineLabelsInput): FileEngineLabels;
|
|
12
31
|
export declare const FileEngineProvider: React.FC<FileEngineProviderProps>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { FileEngineProvider, useFileEngineLabels } from './FileEngineProvider';
|
|
2
|
-
export type { FileEngineProviderProps } from './FileEngineProvider';
|
|
2
|
+
export type { FileEngineProviderProps, FileJobNotice } from './FileEngineProvider';
|
|
3
3
|
export { FileJobsTray } from './FileJobsTray';
|
|
4
4
|
export type { FileJobsTrayProps } from './FileJobsTray';
|
|
5
5
|
export { FileEngineContext, useFileEngine, useFileJob, getDefaultFileEngine } from './FileEngineContext';
|
|
@@ -13,5 +13,15 @@ export interface PlaceFloatingInput extends Omit<ComputePopoverPositionInput, 'a
|
|
|
13
13
|
anchor: FloatingAnchor;
|
|
14
14
|
container: Element | null;
|
|
15
15
|
contentEl?: HTMLElement | null;
|
|
16
|
+
contentHeight?: number;
|
|
16
17
|
}
|
|
17
|
-
export declare const placeFloating: ({ anchor, container, contentEl, ...rest }: PlaceFloatingInput) => PopoverPosition;
|
|
18
|
+
export declare const placeFloating: ({ anchor, container, contentEl, contentHeight, ...rest }: PlaceFloatingInput) => PopoverPosition;
|
|
19
|
+
export declare const anchorScrolledAway: (anchor: FloatingAnchor | null | undefined) => boolean;
|
|
20
|
+
export declare const measureListLayer: (layer: HTMLElement | null) => {
|
|
21
|
+
natural: number;
|
|
22
|
+
chrome: number;
|
|
23
|
+
} | null;
|
|
24
|
+
export declare const visibleBounds: (el: Element) => {
|
|
25
|
+
top: number;
|
|
26
|
+
bottom: number;
|
|
27
|
+
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
1
|
+
import { type ElementType, type HTMLAttributes, type ReactNode, type Ref } from 'react';
|
|
2
2
|
import { type ScrollLabels } from './labels';
|
|
3
3
|
export interface ScrollStripProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
4
4
|
children?: ReactNode;
|
|
5
5
|
frameClassName?: string;
|
|
6
6
|
step?: number;
|
|
7
7
|
labels?: Partial<ScrollLabels>;
|
|
8
|
+
as?: ElementType;
|
|
9
|
+
stripRef?: Ref<HTMLElement>;
|
|
8
10
|
}
|
|
9
|
-
export declare function ScrollStrip({ children, className, frameClassName, step, labels, ...rest }: ScrollStripProps): import("react").JSX.Element;
|
|
11
|
+
export declare function ScrollStrip({ children, className, frameClassName, step, labels, as: Strip, stripRef, ...rest }: ScrollStripProps): import("react").JSX.Element;
|
|
@@ -1,21 +1,30 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { NavItem } from '../../core/types';
|
|
3
3
|
export type SidebarDensity = 'compact' | 'comfortable';
|
|
4
|
+
export type SidebarSlot = React.ReactNode | {
|
|
5
|
+
expanded?: React.ReactNode;
|
|
6
|
+
collapsed?: React.ReactNode;
|
|
7
|
+
} | ((state: {
|
|
8
|
+
collapsed: boolean;
|
|
9
|
+
}) => React.ReactNode);
|
|
10
|
+
export declare function resolveSidebarSlot(slot: SidebarSlot, collapsed: boolean): React.ReactNode;
|
|
4
11
|
export interface SidebarProps {
|
|
5
12
|
items: NavItem[];
|
|
6
13
|
activeId?: string | null;
|
|
7
|
-
onSelect?: (item: NavItem) => void;
|
|
14
|
+
onSelect?: (item: NavItem, event?: React.MouseEvent) => void;
|
|
8
15
|
as?: React.ElementType;
|
|
9
16
|
density?: SidebarDensity;
|
|
10
17
|
collapsed?: boolean;
|
|
18
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
11
19
|
open?: boolean;
|
|
12
20
|
onClose?: () => void;
|
|
13
21
|
defaultExpandedIds?: string[];
|
|
14
22
|
expandedIds?: string[];
|
|
15
23
|
onExpandedChange?: (ids: string[]) => void;
|
|
16
24
|
renderItemActions?: (item: NavItem) => React.ReactNode;
|
|
17
|
-
header?:
|
|
18
|
-
|
|
25
|
+
header?: SidebarSlot;
|
|
26
|
+
beforeNav?: SidebarSlot;
|
|
27
|
+
footer?: SidebarSlot;
|
|
19
28
|
className?: string;
|
|
20
29
|
style?: React.CSSProperties;
|
|
21
30
|
'aria-label'?: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as Sidebar } from './Sidebar';
|
|
2
|
-
export type { SidebarProps } from './Sidebar';
|
|
2
|
+
export type { SidebarProps, SidebarSlot } from './Sidebar';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import type { FileJobNotice } from '../FileEngine/FileEngineProvider';
|
|
4
|
+
export interface UIConfirmRequest {
|
|
5
|
+
title: string;
|
|
6
|
+
message: string;
|
|
7
|
+
}
|
|
8
|
+
export interface UIHostDefaults {
|
|
9
|
+
renderAuthorize?: (authorize: any, children: ReactNode) => ReactNode;
|
|
10
|
+
onToast?: (type: 'success' | 'error' | 'info' | 'warning', message: string) => void;
|
|
11
|
+
onNavigate?: (path: string) => void;
|
|
12
|
+
renderLoading?: (isOpen: boolean, message?: string) => ReactNode;
|
|
13
|
+
onConfirm?: (request: UIConfirmRequest) => boolean | Promise<boolean>;
|
|
14
|
+
onFileNotice?: (notice: FileJobNotice) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare const HostProvider: React.FC<{
|
|
17
|
+
host?: UIHostDefaults;
|
|
18
|
+
children?: ReactNode;
|
|
19
|
+
}>;
|
|
20
|
+
export declare const useUIHost: () => UIHostDefaults;
|
|
@@ -14,6 +14,12 @@ export declare const DEFAULT_UI_LABELS: {
|
|
|
14
14
|
toast: {
|
|
15
15
|
dismiss: string;
|
|
16
16
|
};
|
|
17
|
+
form: {
|
|
18
|
+
submit: string;
|
|
19
|
+
reset: string;
|
|
20
|
+
fixErrors: string;
|
|
21
|
+
submitFailed: string;
|
|
22
|
+
};
|
|
17
23
|
input: {
|
|
18
24
|
clear: string;
|
|
19
25
|
showPassword: string;
|
|
@@ -84,6 +90,9 @@ export declare const DEFAULT_UI_LABELS: {
|
|
|
84
90
|
sidebar: {
|
|
85
91
|
name: string;
|
|
86
92
|
closeNavigation: string;
|
|
93
|
+
collapse: string;
|
|
94
|
+
expand: string;
|
|
95
|
+
showChildren: (label: string) => string;
|
|
87
96
|
};
|
|
88
97
|
breadcrumbs: {
|
|
89
98
|
name: string;
|
|
@@ -4,6 +4,7 @@ import type { ToastDefaults } from '../Toast/toast.types';
|
|
|
4
4
|
import type { CreateFileEngineOptions, FileEngine } from '../../file/fileEngine';
|
|
5
5
|
import type { UIFormatSettings } from '../../core/types';
|
|
6
6
|
import { type UILabelsInput } from './UILabelsContext';
|
|
7
|
+
import { type UIHostDefaults } from './UIHostContext';
|
|
7
8
|
import { type ResolvedUITheme, type UITheme } from './UIThemeContext';
|
|
8
9
|
export interface UIProviderProps extends Pick<FieldProviderProps, 'size' | 'variant' | 'layout'>, UIFormatSettings {
|
|
9
10
|
children?: React.ReactNode;
|
|
@@ -13,6 +14,7 @@ export interface UIProviderProps extends Pick<FieldProviderProps, 'size' | 'vari
|
|
|
13
14
|
toast?: ToastDefaults;
|
|
14
15
|
fileEngine?: CreateFileEngineOptions | FileEngine;
|
|
15
16
|
labels?: UILabelsInput;
|
|
17
|
+
host?: UIHostDefaults;
|
|
16
18
|
}
|
|
17
19
|
declare const UIProvider: React.FC<UIProviderProps>;
|
|
18
20
|
export default UIProvider;
|
|
@@ -7,3 +7,5 @@ export { FormatProvider, useFormat } from './UIFormatContext';
|
|
|
7
7
|
export type { FormatProviderProps } from './UIFormatContext';
|
|
8
8
|
export { LabelsProvider, useUILabels, DEFAULT_UI_LABELS } from './UILabelsContext';
|
|
9
9
|
export type { UILabels, UILabelsInput } from './UILabelsContext';
|
|
10
|
+
export { HostProvider, useUIHost } from './UIHostContext';
|
|
11
|
+
export type { UIHostDefaults, UIConfirmRequest } from './UIHostContext';
|
|
@@ -12,6 +12,7 @@ export * from './fieldControl.logic';
|
|
|
12
12
|
export * from './fieldWrapper.logic';
|
|
13
13
|
export * from './fields.logic';
|
|
14
14
|
export * from './form.logic';
|
|
15
|
+
export * from './standardSchema.logic';
|
|
15
16
|
export * from './input.logic';
|
|
16
17
|
export * from './keyboard.logic';
|
|
17
18
|
export * from './motion.logic';
|
|
@@ -31,6 +31,7 @@ export interface ComputePopoverPositionInput {
|
|
|
31
31
|
flip?: boolean;
|
|
32
32
|
shift?: boolean;
|
|
33
33
|
padding?: number;
|
|
34
|
+
placedHeight?: number;
|
|
34
35
|
}
|
|
35
36
|
export interface PopoverPosition {
|
|
36
37
|
top: number;
|
|
@@ -38,6 +39,7 @@ export interface PopoverPosition {
|
|
|
38
39
|
width?: number;
|
|
39
40
|
placement: PopoverPlacement;
|
|
40
41
|
flipped: boolean;
|
|
42
|
+
available?: number;
|
|
41
43
|
}
|
|
42
44
|
export declare function computePopoverPosition(input: ComputePopoverPositionInput): PopoverPosition;
|
|
43
45
|
export interface FloatingFrameMeasure {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ErrorObject, StandardSchemaV1 } from '../types';
|
|
2
|
+
export declare function isStandardSchema(schema: unknown): schema is StandardSchemaV1;
|
|
3
|
+
export declare function issuePathKey(path: StandardSchemaV1.Issue['path']): string;
|
|
4
|
+
export declare function issuesToErrors(issues: ReadonlyArray<StandardSchemaV1.Issue>): ErrorObject;
|
|
5
|
+
export declare function validateStandardSchema(schema: StandardSchemaV1, data: unknown): Promise<{
|
|
6
|
+
valid: boolean;
|
|
7
|
+
errors: ErrorObject;
|
|
8
|
+
}>;
|
|
9
|
+
export declare function mergeFieldErrors(previous: ErrorObject, next: ErrorObject, field: string): ErrorObject;
|
|
@@ -214,6 +214,7 @@ export interface FieldsBaseProps<T> {
|
|
|
214
214
|
errors?: ErrorObject;
|
|
215
215
|
touched?: TouchedObject;
|
|
216
216
|
setTouched?: Dispatch<SetStateAction<TouchedObject>>;
|
|
217
|
+
onFieldBlur?: (path: string) => void;
|
|
217
218
|
basePath?: string;
|
|
218
219
|
onSelect?: (selected: any, fieldName: string) => void;
|
|
219
220
|
renderAuthorize?: (authorize: FieldAuthorize, children: ReactNode) => ReactNode;
|
|
@@ -243,6 +244,7 @@ export interface FieldProps<T> {
|
|
|
243
244
|
errors?: ErrorObject;
|
|
244
245
|
touched?: TouchedObject;
|
|
245
246
|
setTouched?: Dispatch<SetStateAction<TouchedObject>>;
|
|
247
|
+
onFieldBlur?: (path: string) => void;
|
|
246
248
|
context: ChangeContext<T>;
|
|
247
249
|
cellindex?: number;
|
|
248
250
|
renderAuthorize?: (authorize: FieldAuthorize, children: ReactNode) => ReactNode;
|
|
@@ -31,17 +31,49 @@ export interface FileEngineOptions {
|
|
|
31
31
|
workers?: 'auto' | 'off';
|
|
32
32
|
}
|
|
33
33
|
export type XlsxCellValue = string | number | boolean | Date | null;
|
|
34
|
+
export interface XlsxCellStyle {
|
|
35
|
+
bold?: boolean;
|
|
36
|
+
italic?: boolean;
|
|
37
|
+
size?: number;
|
|
38
|
+
color?: string;
|
|
39
|
+
fill?: string;
|
|
40
|
+
align?: 'left' | 'center' | 'right';
|
|
41
|
+
numFmt?: string;
|
|
42
|
+
borderTop?: XlsxBorder;
|
|
43
|
+
borderBottom?: XlsxBorder;
|
|
44
|
+
}
|
|
45
|
+
export interface XlsxBorder {
|
|
46
|
+
style: 'thin' | 'medium' | 'thick' | 'dotted' | 'dashed' | 'double';
|
|
47
|
+
color?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface XlsxRowSpec {
|
|
50
|
+
values: XlsxCellValue[];
|
|
51
|
+
style?: XlsxCellStyle;
|
|
52
|
+
cells?: Record<number, XlsxCellStyle>;
|
|
53
|
+
merge?: boolean;
|
|
54
|
+
}
|
|
34
55
|
export interface XlsxColumnSpec {
|
|
35
56
|
header: string;
|
|
36
57
|
width?: number;
|
|
37
58
|
numFmt?: string;
|
|
38
59
|
align?: 'left' | 'center' | 'right';
|
|
60
|
+
style?: XlsxCellStyle;
|
|
39
61
|
}
|
|
40
62
|
export interface XlsxSheetSpec {
|
|
41
63
|
name: string;
|
|
42
64
|
columns: XlsxColumnSpec[];
|
|
43
65
|
rows: XlsxCellValue[][];
|
|
44
66
|
freezeHeader?: boolean;
|
|
67
|
+
before?: XlsxRowSpec[];
|
|
68
|
+
after?: XlsxRowSpec[];
|
|
69
|
+
headerStyle?: XlsxCellStyle;
|
|
70
|
+
stripe?: string;
|
|
71
|
+
cellStyles?: Array<Record<number, XlsxCellStyle> | null | undefined>;
|
|
72
|
+
autoFilter?: boolean;
|
|
73
|
+
freeze?: {
|
|
74
|
+
rows?: number;
|
|
75
|
+
cols?: number;
|
|
76
|
+
};
|
|
45
77
|
}
|
|
46
78
|
export interface XlsxWorkbookSpec {
|
|
47
79
|
sheets: XlsxSheetSpec[];
|
|
@@ -55,10 +87,29 @@ export interface PdfTaskFonts {
|
|
|
55
87
|
}>;
|
|
56
88
|
vfs?: Record<string, string>;
|
|
57
89
|
}
|
|
90
|
+
export interface PdfTableLayoutSpec {
|
|
91
|
+
hLineWidth?: number;
|
|
92
|
+
edgeLineWidth?: number;
|
|
93
|
+
vLineWidth?: number;
|
|
94
|
+
hLineColor?: string;
|
|
95
|
+
vLineColor?: string;
|
|
96
|
+
paddingX?: number;
|
|
97
|
+
paddingY?: number;
|
|
98
|
+
}
|
|
99
|
+
export interface PdfPageFooterSpec {
|
|
100
|
+
text: string;
|
|
101
|
+
alignment?: 'left' | 'center' | 'right';
|
|
102
|
+
fontSize?: number;
|
|
103
|
+
color?: string;
|
|
104
|
+
font?: string;
|
|
105
|
+
margin?: [number, number, number, number];
|
|
106
|
+
}
|
|
58
107
|
export type FileTask = {
|
|
59
108
|
kind: 'pdf';
|
|
60
109
|
document: Record<string, unknown>;
|
|
61
110
|
fonts?: PdfTaskFonts;
|
|
111
|
+
tableLayouts?: Record<string, PdfTableLayoutSpec>;
|
|
112
|
+
footer?: PdfPageFooterSpec;
|
|
62
113
|
} | {
|
|
63
114
|
kind: 'xlsx';
|
|
64
115
|
workbook: XlsxWorkbookSpec;
|
|
@@ -100,6 +100,10 @@ export interface FormCallbacks<T = any> {
|
|
|
100
100
|
onUnhandledError?: (error: Error, methods: FormMethods<T>) => void;
|
|
101
101
|
onToast?: (type: 'success' | 'error' | 'info' | 'warning', message: string) => void;
|
|
102
102
|
onNavigate?: (path: string) => void;
|
|
103
|
+
onConfirm?: (request: {
|
|
104
|
+
title: string;
|
|
105
|
+
message: string;
|
|
106
|
+
}) => boolean | Promise<boolean>;
|
|
103
107
|
}
|
|
104
108
|
export interface FormProps<T = any> extends FormCallbacks<T> {
|
|
105
109
|
id?: string;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
2
|
+
readonly '~standard': StandardSchemaV1.Props<Input, Output>;
|
|
3
|
+
}
|
|
4
|
+
export declare namespace StandardSchemaV1 {
|
|
5
|
+
interface Props<Input = unknown, Output = Input> {
|
|
6
|
+
readonly version: 1;
|
|
7
|
+
readonly vendor: string;
|
|
8
|
+
readonly validate: (value: unknown) => Result<Output> | Promise<Result<Output>>;
|
|
9
|
+
readonly types?: Types<Input, Output> | undefined;
|
|
10
|
+
}
|
|
11
|
+
type Result<Output> = SuccessResult<Output> | FailureResult;
|
|
12
|
+
interface SuccessResult<Output> {
|
|
13
|
+
readonly value: Output;
|
|
14
|
+
readonly issues?: undefined;
|
|
15
|
+
}
|
|
16
|
+
interface FailureResult {
|
|
17
|
+
readonly issues: ReadonlyArray<Issue>;
|
|
18
|
+
}
|
|
19
|
+
interface Issue {
|
|
20
|
+
readonly message: string;
|
|
21
|
+
readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
|
|
22
|
+
}
|
|
23
|
+
interface PathSegment {
|
|
24
|
+
readonly key: PropertyKey;
|
|
25
|
+
}
|
|
26
|
+
interface Types<Input = unknown, Output = Input> {
|
|
27
|
+
readonly input: Input;
|
|
28
|
+
readonly output: Output;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -2,9 +2,11 @@ import type { ReactElement, ReactNode } from 'react';
|
|
|
2
2
|
export type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';
|
|
3
3
|
export type TooltipTrigger = 'icon' | 'control';
|
|
4
4
|
export type TooltipAnchorTo = 'auto' | 'element' | 'pointer';
|
|
5
|
+
export type TooltipTone = 'default' | 'info' | 'success' | 'warning' | 'danger';
|
|
5
6
|
export interface TooltipConfig {
|
|
6
7
|
content: ReactNode;
|
|
7
8
|
placement?: TooltipPlacement;
|
|
9
|
+
tone?: TooltipTone;
|
|
8
10
|
anchorTo?: TooltipAnchorTo;
|
|
9
11
|
delay?: number;
|
|
10
12
|
closeDelay?: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FileDeliveryAction, FileEngineOptions, FileFormat, FileJob, FileJobAction, FileJobPriority, FileTask } from '../core/types';
|
|
1
|
+
import type { FileDeliveryAction, FileEngineOptions, FileFormat, FileJob, FileJobAction, FileJobPriority, FileTask, PdfTaskFonts } from '../core/types';
|
|
2
2
|
export interface FileBuildContext {
|
|
3
3
|
signal: AbortSignal;
|
|
4
4
|
progress: (fraction: number) => void;
|
|
@@ -27,6 +27,7 @@ export type FileDeliverer = (blob: Blob, job: FileJob, action: FileDeliveryActio
|
|
|
27
27
|
export interface CreateFileEngineOptions extends FileEngineOptions {
|
|
28
28
|
deliver?: FileDeliverer;
|
|
29
29
|
createWorker?: () => Worker;
|
|
30
|
+
pdfFonts?: PdfTaskFonts;
|
|
30
31
|
}
|
|
31
32
|
export type FileEngineErrorCode = 'queue-full' | 'timeout' | 'disposed';
|
|
32
33
|
export declare class FileEngineError extends Error {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import type { FileTask } from '../../core/types';
|
|
1
|
+
import type { FileTask, PdfTaskFonts, PdfPageFooterSpec, PdfTableLayoutSpec } from '../../core/types';
|
|
2
2
|
export interface TaskContext {
|
|
3
3
|
progress: (fraction: number) => void;
|
|
4
4
|
signal?: AbortSignal;
|
|
5
|
+
pdfFonts?: PdfTaskFonts;
|
|
5
6
|
}
|
|
6
7
|
export declare function runFileTask(task: FileTask, ctx: TaskContext): Promise<ArrayBuffer>;
|
|
8
|
+
export declare function pdfTableLayout(spec: PdfTableLayoutSpec): Record<string, unknown>;
|
|
9
|
+
export declare function pdfFooter(spec: PdfPageFooterSpec): (page: number, pages: number) => Record<string, unknown>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { Tooltip, TooltipHelpIcon, useTooltip } from './components/Tooltip';
|
|
2
2
|
export type { TooltipHelpIconProps, UseTooltipResult } from './components/Tooltip';
|
|
3
|
-
export type { TooltipProps, TooltipProp, TooltipConfig, TooltipPlacement, TooltipTrigger, } from './core/types';
|
|
3
|
+
export type { TooltipProps, TooltipProp, TooltipConfig, TooltipPlacement, TooltipTone, TooltipTrigger, } from './core/types';
|
|
4
4
|
export { Typography } from './components/Typography';
|
|
5
5
|
export type { TypographyProps, TypographyVariant, TypographyColor, TypographyAlign, TypographyWeight, TypographyTransform, TypographyDecoration, TypographyComponent, TruncateConfig, GradientConfig, } from './components/Typography';
|
|
6
6
|
export { Button, ButtonGroup } from './components/Button';
|
|
@@ -34,6 +34,8 @@ export { useFieldCondition, useFieldRender, useFieldDisabled, useFieldValue, use
|
|
|
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';
|
|
35
35
|
export { Form } from './components/Form';
|
|
36
36
|
export type { FormProps, FormMethods, FormSection, FormAction, FormValidation, FormHeader, FormFooter, FormCallbacks, FormState, FormLayout, FormSize, FormVariant, } from './components/Form';
|
|
37
|
+
export { validateStandardSchema, isStandardSchema } from './core/logic/standardSchema.logic';
|
|
38
|
+
export type { StandardSchemaV1 } from './core/types/standardSchema.types';
|
|
37
39
|
export { ChipInput, useChipSuggestions } from './components/ChipInput';
|
|
38
40
|
export { parseFormat, resolveFormat, extractPlaceholders, validateFormat, } from './components/ChipInput';
|
|
39
41
|
export type { ChipInputProps, ChipInputSize, ChipInputLayout, ChipKey, ChipSource, ChipSources, ChipSuggestionItem, GroupedSuggestions, ParsedSegment, ResolveOptions, ExtractedPlaceholder, FormatValidationResult, UseChipSuggestionsOptions, UseChipSuggestionsReturn, } from './components/ChipInput';
|
|
@@ -44,8 +46,8 @@ export * from './components/Charts';
|
|
|
44
46
|
export * from './components/Scroll';
|
|
45
47
|
export { ColorSchemeSelect } from './components/ColorSchemeSelect';
|
|
46
48
|
export type { ColorSchemeSelectProps } from './components/ColorSchemeSelect';
|
|
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 { UIProvider, useUIPortalContainer, useUITheme, FormatProvider, useFormat, LabelsProvider, useUILabels, DEFAULT_UI_LABELS, HostProvider, useUIHost } from './components/UIProvider';
|
|
50
|
+
export type { FormatProviderProps, UILabels, UILabelsInput, UIHostDefaults, UIConfirmRequest } from './components/UIProvider';
|
|
49
51
|
export type { UIFormat, UIFormatSettings } from './core/types';
|
|
50
52
|
export type { UIProviderProps, UITheme, ResolvedUITheme, UIThemeValue } from './components/UIProvider';
|
|
51
53
|
export { Skeleton } from './components/Skeleton';
|
|
@@ -65,14 +67,17 @@ export type { ImagePickerProps, ImagePickerItem, ImageStripProps, StripImage, Im
|
|
|
65
67
|
export { Dialog } from './components/Dialog';
|
|
66
68
|
export type { DialogProps, DialogPlacement, DialogSize } from './components/Dialog';
|
|
67
69
|
export { useDialog } from './components/Dialog/DialogHost';
|
|
70
|
+
export { useDialogOpen } from './components/Dialog/dialogOpen';
|
|
68
71
|
export type { DialogApi, DialogChoice, DialogActionProps, ConfirmOptions, ChooseOptions, AlertOptions, } from './components/Dialog/DialogHost';
|
|
69
72
|
export { ToastHost, useToast } from './components/Toast';
|
|
70
73
|
export type { ToastApi, ToastDefaults, ToastOptions, ToastPosition, ToastRecord, ToastType, ToastHostProps, } from './components/Toast';
|
|
71
74
|
export { createFileEngine, FileEngineError } from './file/fileEngine';
|
|
75
|
+
export { createPdfBlob, rawDataToBlob, downloadBlob, shareFile, openPreview, executeFileAction, getExtension, getFormatLabel, safeFileName, safeFileBaseName, EXTENSION_MAP, MIME_MAP, } from './file/fileActions';
|
|
76
|
+
export type { PdfFontConfig, FileAction } from './file/fileActions';
|
|
72
77
|
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';
|
|
78
|
+
export type { FileFormat, FileDeliveryAction, FileJobAction, FileJobPriority, FileJobStatus, FileJob, FileEngineOptions, FileTask, XlsxWorkbookSpec, XlsxSheetSpec, XlsxColumnSpec, XlsxCellValue, PdfTaskFonts, XlsxCellStyle, XlsxBorder, XlsxRowSpec, PdfTableLayoutSpec, PdfPageFooterSpec, } from './core/types';
|
|
74
79
|
export { FileEngineProvider, FileJobsTray, useFileEngine, useFileJob, DEFAULT_FILE_ENGINE_LABELS, } from './components/FileEngine';
|
|
75
|
-
export type { FileEngineProviderProps, FileJobsTrayProps, UseFileEngineResult, FileEngineLabels, FileEngineLabelsInput, } from './components/FileEngine';
|
|
80
|
+
export type { FileEngineProviderProps, FileJobNotice, FileJobsTrayProps, UseFileEngineResult, FileEngineLabels, FileEngineLabelsInput, } from './components/FileEngine';
|
|
76
81
|
export { Stepper } from './components/Stepper';
|
|
77
82
|
export type { StepperProps, StepperStep } from './components/Stepper';
|
|
78
83
|
export { Tabs, TabPanel } from './components/Tabs';
|
|
@@ -80,7 +85,7 @@ export type { TabsProps, TabItem, TabsVariant, TabsSize, TabPanelProps } from '.
|
|
|
80
85
|
export { CommandPalette } from './components/CommandPalette';
|
|
81
86
|
export type { CommandPaletteProps, CommandPaletteItem } from './components/CommandPalette';
|
|
82
87
|
export { Sidebar } from './components/Sidebar';
|
|
83
|
-
export type { SidebarProps } from './components/Sidebar';
|
|
88
|
+
export type { SidebarProps, SidebarSlot } from './components/Sidebar';
|
|
84
89
|
export { AppBar } from './components/AppBar';
|
|
85
90
|
export type { AppBarProps, AppBarSize, AppBarVariant } from './components/AppBar';
|
|
86
91
|
export { Breadcrumbs } from './components/Breadcrumbs';
|