@dcs-tech/ui 0.7.0 → 0.9.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/CHANGELOG.md +370 -0
- package/README.md +32 -0
- package/dist/{ChartImageMenu-C6MwKKjc.js → ChartImageMenu-DDVNJNc6.js} +63 -58
- 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-OHJHjCqe.js → SummaryImage-Crf1R-3a.js} +2 -2
- package/dist/{SummarySeeAll-BYrvXSJ6.js → SummarySeeAll-BRHOMQRA.js} +5 -5
- package/dist/assets/fileTask.worker--Q3rI3Bn.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-S8JHzYbS.js → exportEngine-BFZD6djX.js} +3 -3
- package/dist/file-worker.js +1 -1
- package/dist/{fileActions-COf5Q4Eg.js → fileActions-CFNO14Aj.js} +1 -1
- package/dist/{geometry-ChwYB45B.js → geometry-yZmKN662.js} +11 -2
- package/dist/index.js +7198 -6858
- package/dist/{runFileTask--4YjQH7Y.js → runFileTask-BIZTFnZP.js} +55 -39
- package/dist/scrollArea-DbYFqbIH.js +269 -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/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 +2 -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/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/UILabelsContext.d.ts +9 -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/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/index.d.ts +6 -3
- package/package.json +7 -3
- package/dist/assets/fileTask.worker-BHT1olUk.js +0 -1
- 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,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,8 @@ 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;
|
|
905
|
+
actionsHeader?: boolean;
|
|
904
906
|
bulkActions?: DataTableBulkAction<TData>[];
|
|
905
907
|
hideBulkActions?: string[];
|
|
906
908
|
pinning?: DataTablePinningConfig;
|
|
@@ -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;
|
|
@@ -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';
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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;
|
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';
|
|
@@ -64,7 +66,8 @@ export { ImagePicker, ImageStrip, ImageViewer, prepareImage, ImagePrepareError }
|
|
|
64
66
|
export type { ImagePickerProps, ImagePickerItem, ImageStripProps, StripImage, ImageViewerProps, ViewerImage, PrepareImageOptions, PreparedImage, } from './components/Image';
|
|
65
67
|
export { Dialog } from './components/Dialog';
|
|
66
68
|
export type { DialogProps, DialogPlacement, DialogSize } from './components/Dialog';
|
|
67
|
-
export { useDialog } from './components/Dialog/DialogHost';
|
|
69
|
+
export { useDialog, DialogHost } 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';
|
|
@@ -82,7 +85,7 @@ export type { TabsProps, TabItem, TabsVariant, TabsSize, TabPanelProps } from '.
|
|
|
82
85
|
export { CommandPalette } from './components/CommandPalette';
|
|
83
86
|
export type { CommandPaletteProps, CommandPaletteItem } from './components/CommandPalette';
|
|
84
87
|
export { Sidebar } from './components/Sidebar';
|
|
85
|
-
export type { SidebarProps } from './components/Sidebar';
|
|
88
|
+
export type { SidebarProps, SidebarSlot } from './components/Sidebar';
|
|
86
89
|
export { AppBar } from './components/AppBar';
|
|
87
90
|
export type { AppBarProps, AppBarSize, AppBarVariant } from './components/AppBar';
|
|
88
91
|
export { Breadcrumbs } from './components/Breadcrumbs';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcs-tech/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "React UI component library — fields, buttons, tooltips, tables and design tokens.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
"*.css"
|
|
9
9
|
],
|
|
10
10
|
"files": [
|
|
11
|
-
"dist"
|
|
11
|
+
"dist",
|
|
12
|
+
"CHANGELOG.md"
|
|
12
13
|
],
|
|
13
14
|
"main": "./dist/index.js",
|
|
14
15
|
"types": "./dist/types/index.d.ts",
|
|
@@ -53,7 +54,10 @@
|
|
|
53
54
|
},
|
|
54
55
|
"devDependencies": {
|
|
55
56
|
"@storybook/react-vite": "^10.5.5",
|
|
56
|
-
"@types/pdfmake": "^0.2.7"
|
|
57
|
+
"@types/pdfmake": "^0.2.7",
|
|
58
|
+
"valibot": "^1.5.0",
|
|
59
|
+
"yup": "^1.7.1",
|
|
60
|
+
"zod": "^4.6.7"
|
|
57
61
|
},
|
|
58
62
|
"keywords": [
|
|
59
63
|
"react",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=()=>new DOMException(`Aborted`,`AbortError`);async function t(t,n){if(n.signal?.aborted)throw e();switch(t.kind){case`xlsx`:return l(t.workbook,n);case`pdf`:return p(t,n);default:throw Error(`Unknown file task: ${t.kind}`)}}const n=globalThis;async function r(){let e=await import(`exceljs`),t=[e.default?.default,e.default,e,n.ExcelJS].find(e=>e&&typeof e.Workbook==`function`);if(!t)throw Error(`ExcelJS did not load`);return t}async function i(){let e=await import(`pdfmake/build/pdfmake.js`),t=[e.default?.default,e.default,e,n.pdfMake].find(e=>e&&typeof e.createPdf==`function`);if(!t)throw Error(`pdfmake did not load`);let r=await import(`pdfmake/build/vfs_fonts.js`);return{pdfMake:t,vfs:[r?.default,r,r?.pdfMake?.vfs,r?.default?.pdfMake?.vfs,t.vfs,n.pdfMake?.vfs].find(e=>e&&e[`Roboto-Regular.ttf`])}}const a=e=>ArrayBuffer.isView(e)?e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength):e,o=e=>`FF`+e.replace(`#`,``).toUpperCase();function s(e,t){if(t&&((t.bold!==void 0||t.italic!==void 0||t.size||t.color)&&(e.font={...e.font??{},...t.bold===void 0?{}:{bold:t.bold},...t.italic===void 0?{}:{italic:t.italic},...t.size?{size:t.size}:{},...t.color?{color:{argb:o(t.color)}}:{}}),t.fill&&(e.fill={type:`pattern`,pattern:`solid`,fgColor:{argb:o(t.fill)}}),t.align&&(e.alignment={horizontal:t.align,vertical:`middle`}),t.numFmt&&(typeof e.value==`number`||e.value instanceof Date)&&(e.numFmt=t.numFmt),t.borderTop||t.borderBottom)){let n=e=>({style:e.style,...e.color?{color:{argb:o(e.color)}}:{}});e.border={...t.borderTop?{top:n(t.borderTop)}:{},...t.borderBottom?{bottom:n(t.borderBottom)}:{}}}}function c(e,t,n){let r=e.addRow(t.values);t.style?.bold&&(r.font={bold:!0}),t.merge&&n>1&&e.mergeCells(r.number,1,r.number,n);let i=t.merge?1:Math.max(t.values.length,0);for(let e=0;e<i;e++){let n=r.getCell(e+1);s(n,t.style),s(n,t.cells?.[e])}}async function l(t,n){let i=new(await(r())).Workbook,l=Math.max(1,t.sheets.reduce((e,t)=>e+t.rows.length,0)),u=Math.max(1,Math.floor(l/50)),d=0;for(let r of t.sheets){let t=i.addWorksheet(r.name),a=r.columns.length;t.columns=r.columns.map((e,t)=>({key:String(t),width:e.width}));for(let e of r.before??[])c(t,e,a);let f=t.addRow(r.columns.map(e=>e.header));f.font={bold:r.headerStyle?.bold??!0},f.eachCell((e,t)=>{let n=r.columns[t-1]?.align;n&&(e.alignment={horizontal:n,vertical:`middle`}),s(e,r.headerStyle)});let p=f.number;r.freeze?t.views=[{state:`frozen`,ySplit:r.freeze.rows??0,xSplit:r.freeze.cols??0}]:r.freezeHeader!==!1&&(t.views=[{state:`frozen`,ySplit:p}]),r.rows.forEach((i,a)=>{let c=t.addRow(i),f=r.cellStyles?.[a],p=r.stripe&&a%2==1;if(r.columns.forEach((e,t)=>{let n=c.getCell(t+1);e.numFmt&&(typeof n.value==`number`||n.value instanceof Date)&&(n.numFmt=e.numFmt),e.align&&(n.alignment={horizontal:e.align,vertical:`middle`}),p&&(n.fill={type:`pattern`,pattern:`solid`,fgColor:{argb:o(r.stripe)}}),s(n,e.style),s(n,f?.[t])}),++d%u===0){if(n.signal?.aborted)throw e();n.progress(d/l*.9)}}),r.autoFilter&&r.rows.length>0&&(t.autoFilter={from:{row:p,column:1},to:{row:p,column:a}});for(let e of r.after??[])c(t,e,a)}let f=await i.xlsx.writeBuffer();return n.progress(1),a(f)}const u={Roboto:{normal:`Roboto-Regular.ttf`,bold:`Roboto-Medium.ttf`,italics:`Roboto-Italic.ttf`,bolditalics:`Roboto-MediumItalic.ttf`}};function d(e){let t=e.hLineWidth??1,n=e.edgeLineWidth??t;return{hLineWidth:(e,r)=>e===0||e===(r.table.headerRows??0)||e===r.table.body.length?n:t,vLineWidth:()=>e.vLineWidth??1,...e.hLineColor?{hLineColor:()=>e.hLineColor}:{},...e.vLineColor?{vLineColor:()=>e.vLineColor}:{},...e.paddingX===void 0?{}:{paddingLeft:()=>e.paddingX,paddingRight:()=>e.paddingX},...e.paddingY===void 0?{}:{paddingTop:()=>e.paddingY,paddingBottom:()=>e.paddingY}}}function f(e){return(t,n)=>({text:e.text.replace(/\{page\}/g,String(t)).replace(/\{pages\}/g,String(n)),...e.font?{font:e.font}:{},alignment:e.alignment??`center`,fontSize:e.fontSize??8,...e.color?{color:e.color}:{},...e.margin?{margin:e.margin}:{}})}async function p(t,n){let r=n.pdfFonts?{fonts:{...n.pdfFonts.fonts,...t.fonts?.fonts},vfs:n.pdfFonts.vfs||t.fonts?.vfs?{...n.pdfFonts.vfs,...t.fonts?.vfs}:void 0}:t.fonts,a=t.footer?{...t.document,footer:f(t.footer)}:t.document,o=t.tableLayouts?Object.fromEntries(Object.entries(t.tableLayouts).map(([e,t])=>[e,d(t)])):void 0,{pdfMake:s,vfs:c}=await i();if(n.progress(.1),n.signal?.aborted)throw e();let l={...u,...r?.fonts??{}},p=r?.vfs?{...c??{},...r.vfs}:c,m=await new Promise((e,t)=>{try{let n=s.createPdf(a,o,l,p).getStream(),r=[];n.on(`data`,e=>r.push(e)),n.on(`error`,t),n.on(`end`,()=>{let t=new Uint8Array(r.reduce((e,t)=>e+t.byteLength,0)),n=0;for(let e of r)t.set(e,n),n+=e.byteLength;e(t.buffer)}),n.end()}catch(e){t(e)}});return n.progress(1),m}let m;const h=self;h.onmessage=async e=>{if(e.data.type===`init`){m=e.data.pdfFonts;return}let{id:n,task:r}=e.data;try{let e=await t(r,{progress:e=>h.postMessage({type:`progress`,id:n,fraction:e}),pdfFonts:m});h.postMessage({type:`done`,id:n,buffer:e},[e])}catch(e){h.postMessage({type:`error`,id:n,message:e instanceof Error?e.message:String(e)})}};
|
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { Nn as e, wn as t } from "./geometry-ChwYB45B.js";
|
|
3
|
-
import { n, t as r } from "./labels-CnqqTrne.js";
|
|
4
|
-
import { createContext as i, useCallback as a, useContext as o, useEffect as s, useId as ee, useRef as c, useState as l } from "react";
|
|
5
|
-
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
6
|
-
import { createPortal as te } from "react-dom";
|
|
7
|
-
var f = {
|
|
8
|
-
root: "_root_1rswg_7",
|
|
9
|
-
nonModal: "_nonModal_1rswg_30",
|
|
10
|
-
panel: "_panel_1rswg_3",
|
|
11
|
-
center: "_center_1rswg_41",
|
|
12
|
-
right: "_right_1rswg_42",
|
|
13
|
-
left: "_left_1rswg_43",
|
|
14
|
-
top: "_top_1rswg_44",
|
|
15
|
-
bottom: "_bottom_1rswg_45",
|
|
16
|
-
sm: "_sm_1rswg_86",
|
|
17
|
-
md: "_md_1rswg_87",
|
|
18
|
-
lg: "_lg_1rswg_88",
|
|
19
|
-
xl: "_xl_1rswg_89",
|
|
20
|
-
full: "_full_1rswg_90",
|
|
21
|
-
header: "_header_1rswg_96",
|
|
22
|
-
headText: "_headText_1rswg_106",
|
|
23
|
-
title: "_title_1rswg_108",
|
|
24
|
-
subtitle: "_subtitle_1rswg_114",
|
|
25
|
-
body: "_body_1rswg_120",
|
|
26
|
-
flush: "_flush_1rswg_128",
|
|
27
|
-
footer: "_footer_1rswg_130",
|
|
28
|
-
close: "_close_1rswg_141",
|
|
29
|
-
dialogPop: "_dialogPop_1rswg_1",
|
|
30
|
-
slideFromRight: "_slideFromRight_1rswg_1",
|
|
31
|
-
slideFromLeft: "_slideFromLeft_1rswg_1",
|
|
32
|
-
slideFromTop: "_slideFromTop_1rswg_1",
|
|
33
|
-
slideFromBottom: "_slideFromBottom_1rswg_1",
|
|
34
|
-
backdropIn: "_backdropIn_1rswg_1",
|
|
35
|
-
closing: "_closing_1rswg_168"
|
|
36
|
-
}, p = 0, m = null, h = (e) => {
|
|
37
|
-
if (typeof document < "u") {
|
|
38
|
-
if (p === 0) {
|
|
39
|
-
let t = document.body;
|
|
40
|
-
m = {
|
|
41
|
-
overflow: t.style.overflow,
|
|
42
|
-
paddingRight: t.style.paddingRight
|
|
43
|
-
};
|
|
44
|
-
let n = window.innerWidth - document.documentElement.clientWidth;
|
|
45
|
-
if (e && n > 0) {
|
|
46
|
-
let e = parseFloat(window.getComputedStyle(t).paddingRight) || 0;
|
|
47
|
-
t.style.paddingRight = `${e + n}px`;
|
|
48
|
-
}
|
|
49
|
-
t.style.overflow = "hidden";
|
|
50
|
-
}
|
|
51
|
-
p += 1;
|
|
52
|
-
}
|
|
53
|
-
}, g = () => {
|
|
54
|
-
typeof document < "u" && (p = Math.max(0, p - 1), p === 0 && m && (document.body.style.overflow = m.overflow, document.body.style.paddingRight = m.paddingRight, m = null));
|
|
55
|
-
}, _ = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches, ne = /* @__PURE__ */ d("svg", {
|
|
56
|
-
width: "16",
|
|
57
|
-
height: "16",
|
|
58
|
-
viewBox: "0 0 24 24",
|
|
59
|
-
fill: "none",
|
|
60
|
-
stroke: "currentColor",
|
|
61
|
-
strokeWidth: "2",
|
|
62
|
-
strokeLinecap: "round",
|
|
63
|
-
"aria-hidden": "true",
|
|
64
|
-
children: [/* @__PURE__ */ u("line", {
|
|
65
|
-
x1: "18",
|
|
66
|
-
y1: "6",
|
|
67
|
-
x2: "6",
|
|
68
|
-
y2: "18"
|
|
69
|
-
}), /* @__PURE__ */ u("line", {
|
|
70
|
-
x1: "6",
|
|
71
|
-
y1: "6",
|
|
72
|
-
x2: "18",
|
|
73
|
-
y2: "18"
|
|
74
|
-
})]
|
|
75
|
-
}), v = ({ open: n, onClose: r, onBeforeClose: i, onEscKeyDown: o, onOverlayClick: p, onAnimationEnd: m, children: v, title: y, subtitle: b, footer: x, modal: S = !0, placement: C = "center", size: w = "md", closeOnBackdrop: re = !0, closeOnEscape: T = !0, showCloseButton: E = !0, closeIcon: D, closeIconId: O, blockScroll: k = !0, reserveScrollBarGap: A = !0, initialFocusRef: j, container: ie, animationDuration: ae = 200, padded: oe = !0, classNames: M = {}, styleSlots: N = {}, className: P = "", style: F, role: I = "dialog", id: L, "aria-label": R, "aria-labelledby": z, "aria-describedby": B }) => {
|
|
76
|
-
let V = e(), H = c(null), [U, W] = l(null), G = ee(), [K, q] = l(n), [se, J] = l(!1), Y = c(null), X = _() ? 0 : ae;
|
|
77
|
-
s(() => {
|
|
78
|
-
n ? (Y.current &&= (clearTimeout(Y.current), null), J(!1), q(!0)) : K && (J(!0), Y.current = setTimeout(() => {
|
|
79
|
-
H.current?.close(), q(!1), J(!1), m?.();
|
|
80
|
-
}, X));
|
|
81
|
-
}, [n]), s(() => () => {
|
|
82
|
-
Y.current && clearTimeout(Y.current);
|
|
83
|
-
}, []);
|
|
84
|
-
let Z = a(() => {
|
|
85
|
-
i && i() === !1 || r?.();
|
|
86
|
-
}, [i, r]);
|
|
87
|
-
s(() => {
|
|
88
|
-
let e = H.current;
|
|
89
|
-
if (e && K && (e.open || (S ? e.showModal() : e.show(), j?.current && j.current.focus({ focusVisible: !0 })), k && S)) return h(A), () => g();
|
|
90
|
-
}, [
|
|
91
|
-
K,
|
|
92
|
-
S,
|
|
93
|
-
k,
|
|
94
|
-
A,
|
|
95
|
-
j
|
|
96
|
-
]), s(() => {
|
|
97
|
-
let e = H.current;
|
|
98
|
-
if (!e || !K) return;
|
|
99
|
-
let t = (e) => {
|
|
100
|
-
e.preventDefault(), o?.(e), T && Z();
|
|
101
|
-
};
|
|
102
|
-
return e.addEventListener("cancel", t), () => e.removeEventListener("cancel", t);
|
|
103
|
-
}, [
|
|
104
|
-
K,
|
|
105
|
-
T,
|
|
106
|
-
Z,
|
|
107
|
-
o
|
|
108
|
-
]);
|
|
109
|
-
let Q = c(!1), ce = (e) => {
|
|
110
|
-
Q.current = e.target === H.current;
|
|
111
|
-
}, le = (e) => {
|
|
112
|
-
let t = Q.current && e.target === H.current;
|
|
113
|
-
Q.current = !1, t && (p?.(e), re && Z());
|
|
114
|
-
};
|
|
115
|
-
if (!K) return null;
|
|
116
|
-
let ue = y !== void 0 || b !== void 0 || E, de = z ?? (y !== void 0 && !R ? G : void 0), fe = /* @__PURE__ */ u("dialog", {
|
|
117
|
-
ref: (e) => {
|
|
118
|
-
H.current = e, W(e);
|
|
119
|
-
},
|
|
120
|
-
id: L,
|
|
121
|
-
className: [
|
|
122
|
-
f.root,
|
|
123
|
-
f[C],
|
|
124
|
-
f[w],
|
|
125
|
-
S ? "" : f.nonModal,
|
|
126
|
-
se ? f.closing : "",
|
|
127
|
-
M.root,
|
|
128
|
-
P
|
|
129
|
-
].filter(Boolean).join(" "),
|
|
130
|
-
style: {
|
|
131
|
-
"--dialog-anim": `${X}ms`,
|
|
132
|
-
...N.root,
|
|
133
|
-
...F
|
|
134
|
-
},
|
|
135
|
-
role: I,
|
|
136
|
-
"aria-label": R,
|
|
137
|
-
"aria-labelledby": de,
|
|
138
|
-
"aria-describedby": B,
|
|
139
|
-
"aria-modal": S || void 0,
|
|
140
|
-
onPointerDown: ce,
|
|
141
|
-
onPointerUp: le,
|
|
142
|
-
children: /* @__PURE__ */ u(t.Provider, {
|
|
143
|
-
value: U,
|
|
144
|
-
children: /* @__PURE__ */ d("div", {
|
|
145
|
-
className: [f.panel, M.panel].filter(Boolean).join(" "),
|
|
146
|
-
style: N.panel,
|
|
147
|
-
children: [
|
|
148
|
-
ue && /* @__PURE__ */ d("div", {
|
|
149
|
-
className: [f.header, M.header].filter(Boolean).join(" "),
|
|
150
|
-
style: N.header,
|
|
151
|
-
children: [/* @__PURE__ */ d("span", {
|
|
152
|
-
className: f.headText,
|
|
153
|
-
children: [y !== void 0 && /* @__PURE__ */ u("span", {
|
|
154
|
-
className: f.title,
|
|
155
|
-
id: G,
|
|
156
|
-
children: y
|
|
157
|
-
}), b !== void 0 && /* @__PURE__ */ u("span", {
|
|
158
|
-
className: f.subtitle,
|
|
159
|
-
children: b
|
|
160
|
-
})]
|
|
161
|
-
}), E && /* @__PURE__ */ u("button", {
|
|
162
|
-
type: "button",
|
|
163
|
-
id: O,
|
|
164
|
-
className: [f.close, M.closeButton].filter(Boolean).join(" "),
|
|
165
|
-
style: N.closeButton,
|
|
166
|
-
onClick: Z,
|
|
167
|
-
"aria-label": V.dialog.close,
|
|
168
|
-
children: D ?? ne
|
|
169
|
-
})]
|
|
170
|
-
}),
|
|
171
|
-
v !== void 0 && /* @__PURE__ */ u("div", {
|
|
172
|
-
className: [
|
|
173
|
-
f.body,
|
|
174
|
-
oe ? "" : f.flush,
|
|
175
|
-
M.body
|
|
176
|
-
].filter(Boolean).join(" "),
|
|
177
|
-
style: N.body,
|
|
178
|
-
children: v
|
|
179
|
-
}),
|
|
180
|
-
x !== void 0 && /* @__PURE__ */ u("div", {
|
|
181
|
-
className: [f.footer, M.footer].filter(Boolean).join(" "),
|
|
182
|
-
style: N.footer,
|
|
183
|
-
children: x
|
|
184
|
-
})
|
|
185
|
-
]
|
|
186
|
-
})
|
|
187
|
-
})
|
|
188
|
-
}), $ = ie ?? (typeof document > "u" ? null : document.body);
|
|
189
|
-
return $ ? te(fe, $) : null;
|
|
190
|
-
};
|
|
191
|
-
v.displayName = "Dialog";
|
|
192
|
-
var y = i({
|
|
193
|
-
authorize: () => !0,
|
|
194
|
-
exportOptions: {},
|
|
195
|
-
serverMode: !1,
|
|
196
|
-
labels: r,
|
|
197
|
-
format: n(),
|
|
198
|
-
text: {
|
|
199
|
-
yes: r.yes,
|
|
200
|
-
no: r.no
|
|
201
|
-
}
|
|
202
|
-
});
|
|
203
|
-
function b() {
|
|
204
|
-
return o(y);
|
|
205
|
-
}
|
|
206
|
-
function x() {
|
|
207
|
-
return o(y).labels;
|
|
208
|
-
}
|
|
209
|
-
function S(e, t, n) {
|
|
210
|
-
return !e || e(t, n) !== !1;
|
|
211
|
-
}
|
|
212
|
-
// src/components/DataTable/layout/scrollArea.ts
|
|
213
|
-
var C = "dt-scroll-area scroll-fade-y scroll-gutter", w = "dt-scroll-area scroll-fade-x scroll-fade-y scroll-gutter";
|
|
214
|
-
export { x as a, S as i, C as n, b as o, y as r, v as s, w as t };
|