@epam/ai-dial-ui-kit 0.3.0-rc.9 → 0.4.0-rc.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/dial-ui-kit.cjs.js +2 -1
- package/dist/dial-ui-kit.es.js +5791 -2050
- package/dist/index.css +2 -2
- package/dist/src/components/Breadcrumb/Breadcrumb.d.ts +41 -0
- package/dist/src/components/Breadcrumb/BreadcrumbItem.d.ts +13 -0
- package/dist/src/components/Breadcrumb/constants.d.ts +9 -0
- package/dist/src/components/ButtonDropdown/ButtonDropdown.d.ts +23 -0
- package/dist/src/components/ButtonDropdown/constants.d.ts +2 -0
- package/dist/src/components/Checkbox/Checkbox.d.ts +3 -1
- package/dist/src/components/CollapsibleSidebar/CollapsibleSidebar.d.ts +3 -1
- package/dist/src/components/ConfirmationPopup/ConfirmationPopup.d.ts +2 -2
- package/dist/src/components/ConfirmationPopup/constants.d.ts +1 -0
- package/dist/src/components/DraggableItem/DraggableItem.d.ts +31 -0
- package/dist/src/components/DraggableItem/constants.d.ts +3 -0
- package/dist/src/components/Dropdown/Dropdown.d.ts +8 -0
- package/dist/src/components/Dropdown/constants.d.ts +1 -1
- package/dist/src/components/EllipsisTooltip/EllipsisTooltip.d.ts +31 -0
- package/dist/src/components/EllipsisTooltip/constants.d.ts +1 -0
- package/dist/src/components/Field/Field.d.ts +4 -2
- package/dist/src/components/FileIcon/FileIcon.d.ts +31 -0
- package/dist/src/components/FileIcon/constants.d.ts +9 -0
- package/dist/src/components/FileManager/components/FileManagerNavigationPanel/FileManagerNavigationPanel.d.ts +58 -0
- package/dist/src/components/FileManager/components/FileManagerNavigationPanel/constants.d.ts +3 -0
- package/dist/src/components/FileManager/components/FoldersTree/FoldersTree.d.ts +92 -0
- package/dist/src/components/FileManager/components/FoldersTree/constants.d.ts +5 -0
- package/dist/src/components/FileName/FileName.d.ts +20 -0
- package/dist/src/components/FolderName/FolderName.d.ts +21 -0
- package/dist/src/components/FormItem/FormItem.d.ts +64 -0
- package/dist/src/components/FormItem/constants.d.ts +3 -0
- package/dist/src/components/FormPopup/FormPopup.d.ts +44 -0
- package/dist/src/components/FormPopup/constants.d.ts +3 -0
- package/dist/src/components/Grid/Grid.d.ts +90 -0
- package/dist/src/components/Grid/comparators/base-column-comparator.d.ts +3 -0
- package/dist/src/components/Grid/constants.d.ts +26 -0
- package/dist/src/components/Grid/hooks/use-grid-selection.d.ts +12 -0
- package/dist/src/components/Icon/Icon.d.ts +1 -0
- package/dist/src/components/Input/Input.d.ts +18 -24
- package/dist/src/components/InputField/InputField.d.ts +23 -47
- package/dist/src/components/JsonEditor/JsonEditor.d.ts +2 -2
- package/dist/src/components/LoadFileArea/EmptyFileArea.d.ts +52 -0
- package/dist/src/components/LoadFileArea/FilledInput.d.ts +30 -0
- package/dist/src/components/LoadFileArea/LoadFileArea.d.ts +46 -0
- package/dist/src/components/LoadFileArea/LoadFileAreaField.d.ts +51 -0
- package/dist/src/components/PasswordInput/PasswordInputField.d.ts +1 -1
- package/dist/src/components/RadioGroup/RadioGroup.d.ts +19 -4
- package/dist/src/components/RemoveButton/RemoveButton.d.ts +24 -0
- package/dist/src/components/Select/MultiSelectTags.d.ts +8 -0
- package/dist/src/components/Select/Select.d.ts +61 -0
- package/dist/src/components/Select/constants.d.ts +8 -0
- package/dist/src/components/SelectField/SelectField.d.ts +35 -0
- package/dist/src/components/SharedEntityIndicator/SharedEntityIndicator.d.ts +25 -0
- package/dist/src/components/Tab/Tab.d.ts +35 -0
- package/dist/src/components/Tabs/Tabs.d.ts +46 -0
- package/dist/src/components/Tabs/constants.d.ts +1 -0
- package/dist/src/components/Tag/Tag.d.ts +4 -1
- package/dist/src/components/TextAreaField/TextAreaField.d.ts +4 -2
- package/dist/src/components/Textarea/Textarea.d.ts +4 -0
- package/dist/src/components/Tooltip/TooltipContext.d.ts +4 -4
- package/dist/src/constants/storybook/form-item.d.ts +3 -0
- package/dist/src/constants/storybook/input.d.ts +5 -0
- package/dist/src/hooks/use-is-tablet-screen.d.ts +15 -0
- package/dist/src/index.d.ts +28 -0
- package/dist/src/models/base-entity.d.ts +4 -0
- package/dist/src/models/breadcrumb.d.ts +9 -0
- package/dist/src/models/field-control-props.d.ts +34 -2
- package/dist/src/models/file.d.ts +35 -0
- package/dist/src/models/select.d.ts +7 -0
- package/dist/src/models/tab.d.ts +5 -0
- package/dist/src/types/form-item.d.ts +33 -0
- package/dist/src/types/tab.d.ts +4 -0
- package/dist/src/utils/merge-classes.d.ts +3 -0
- package/dist/src/utils/mobile.d.ts +14 -0
- package/package.json +14 -10
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export interface DialFileNameProps {
|
|
3
|
+
name: string;
|
|
4
|
+
cssClass?: string;
|
|
5
|
+
shared?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Component to display a file name with a file icon and shared indicator.
|
|
9
|
+
* Handles long names with ellipsis and tooltip.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <DialFileName name="Document.pdf" />
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @param name - Full file name with or without extension
|
|
17
|
+
* @param cssClass - Additional CSS classes for the root container
|
|
18
|
+
* @param shared - Whether the file is shared
|
|
19
|
+
*/
|
|
20
|
+
export declare const DialFileName: FC<DialFileNameProps>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export interface DialFolderNameProps {
|
|
3
|
+
name: string;
|
|
4
|
+
cssClass?: string;
|
|
5
|
+
shared?: boolean;
|
|
6
|
+
loading?: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Component to display a folder name with a folder icon and shared indicator.
|
|
10
|
+
* Handles long names with ellipsis and tooltip.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <DialFolderName name="Organization" />
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @param name - Folder name
|
|
18
|
+
* @param cssClass - Additional CSS classes for the root container
|
|
19
|
+
* @param shared - Whether the folder is shared
|
|
20
|
+
*/
|
|
21
|
+
export declare const DialFolderName: FC<DialFolderNameProps>;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { DialFormItemBaseProps } from '../../types/form-item';
|
|
3
|
+
export interface DialFormItemProps extends DialFormItemBaseProps {
|
|
4
|
+
elementId: string;
|
|
5
|
+
labelVisuallyHidden?: boolean;
|
|
6
|
+
cssClass?: string;
|
|
7
|
+
childrenCssClass?: string;
|
|
8
|
+
labelCssClass?: string;
|
|
9
|
+
errorCssClass?: string;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
value?: ReactNode | string;
|
|
12
|
+
defaultEmptyText?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A layout wrapper for form controls with label, helper text and error message.
|
|
16
|
+
*
|
|
17
|
+
* Uses `DialFieldLabel` for the label and `DialErrorText` for consistent error styling.
|
|
18
|
+
* Wires accessibility with:
|
|
19
|
+
* - `role="group"`
|
|
20
|
+
* - `aria-labelledby` (when label is present)
|
|
21
|
+
* - `aria-describedby` (description and/or error ids)
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* <DialFormItem elementId="transport" label="Transport" cssClass="w-[320px]">
|
|
26
|
+
* <DialSelect
|
|
27
|
+
* elementId="transport"
|
|
28
|
+
* value={transport}
|
|
29
|
+
* options={transportOptions}
|
|
30
|
+
* onChange={(val) => setTransport(val as ToolsetTransport)}
|
|
31
|
+
* />
|
|
32
|
+
* </DialFormItem>
|
|
33
|
+
*
|
|
34
|
+
* // With description and error
|
|
35
|
+
* <DialFormItem
|
|
36
|
+
* elementId="email"
|
|
37
|
+
* label="Email Address"
|
|
38
|
+
* description="We'll never share your email."
|
|
39
|
+
* error="Please enter a valid email address."
|
|
40
|
+
* >
|
|
41
|
+
* <DialInput
|
|
42
|
+
* elementId="email"
|
|
43
|
+
* type="email"
|
|
44
|
+
* value={email}
|
|
45
|
+
* onChange={(val) => setEmail(val as string)}
|
|
46
|
+
* placeholder="name@company.com"
|
|
47
|
+
* />
|
|
48
|
+
* </DialFormItem>
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* @params - Component properties extending:
|
|
52
|
+
* - {@link DialFormItemBaseProps} - Form item properties (label, error, description, orientation, etc.)
|
|
53
|
+
*
|
|
54
|
+
* @param elementId - Unique identifier for the form control element (used for accessibility)
|
|
55
|
+
* @param labelVisuallyHidden - Whether to visually hide the label (still accessible to screen readers, default: false)
|
|
56
|
+
* @param cssClass - Additional CSS classes to apply to the container div
|
|
57
|
+
* @param childrenCssClass - Additional CSS classes to apply to the children container div
|
|
58
|
+
* @param labelCssClass - Additional CSS classes to apply to the label element
|
|
59
|
+
* @param errorCssClass - Additional CSS classes to apply to the error message element
|
|
60
|
+
* @param children - The form control element(s) to render inside the DialFormItem
|
|
61
|
+
* @param value - The current value of the form control (for readonly mode)
|
|
62
|
+
* @param defaultEmptyText - Text to display when readonly and value is empty (default: "None")
|
|
63
|
+
*/
|
|
64
|
+
export declare const DialFormItem: FC<DialFormItemProps>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { DialPopupProps } from '../Popup/Popup';
|
|
3
|
+
export interface DialFormPopupProps extends DialPopupProps {
|
|
4
|
+
submitLabel?: string;
|
|
5
|
+
cancelLabel?: string;
|
|
6
|
+
isLoading?: boolean;
|
|
7
|
+
disableSubmitButton?: boolean;
|
|
8
|
+
submitClassName?: string;
|
|
9
|
+
onSubmit: () => void;
|
|
10
|
+
onCancel?: () => void;
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A form-oriented popup dialog.
|
|
15
|
+
*
|
|
16
|
+
* Provides an accessible popup with a title, custom body,
|
|
17
|
+
* and a footer with "Cancel" and "Submit" actions.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <DialFormPopup
|
|
22
|
+
* open
|
|
23
|
+
* title="Create Model"
|
|
24
|
+
* onClose={() => setOpen(false)}
|
|
25
|
+
* onSubmit={handleSubmit}
|
|
26
|
+
* />
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @param title - Title content for the header
|
|
30
|
+
* @param [open=false] - Controls visibility of the popup
|
|
31
|
+
* @param [submitLabel="Submit"] - Label for the primary action button
|
|
32
|
+
* @param [cancelLabel="Cancel"] - Label for the cancel button
|
|
33
|
+
* @param [isLoading=false] - Shows loader placeholder and hides actions
|
|
34
|
+
* @param [disableSubmitButton=false] - Disables the submit button
|
|
35
|
+
* @param [cssClass] - Extra classes for the popup container
|
|
36
|
+
* @param [submitClassName] - Extra classes merged into the submit button
|
|
37
|
+
* @param onClose - Fired on close
|
|
38
|
+
* @param onSubmit - Fired on submit
|
|
39
|
+
* @param [onCancel] - Fired on cancel (falls back to `onClose`)
|
|
40
|
+
* @param [children] - Custom body content
|
|
41
|
+
* @param [dividers=true] - Whether to render separators between sections
|
|
42
|
+
* @param [size=PopupSize.Md] - Size of the popup
|
|
43
|
+
*/
|
|
44
|
+
export declare const DialFormPopup: FC<DialFormPopupProps>;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { ColDef, GridOptions } from 'ag-grid-community';
|
|
2
|
+
import { DropdownItem } from '../../models/dropdown';
|
|
3
|
+
export interface DialGridProps<T extends object = Record<string, unknown>> {
|
|
4
|
+
columnDefs?: ColDef<T>[];
|
|
5
|
+
rowData?: T[];
|
|
6
|
+
additionalGridOptions?: GridOptions<T>;
|
|
7
|
+
getContextMenuItems?: (row: T) => DropdownItem[];
|
|
8
|
+
cssClass?: string;
|
|
9
|
+
ariaLabel?: string;
|
|
10
|
+
withSelectionColumn?: boolean;
|
|
11
|
+
wrapCustomCellRenderers?: boolean | ((col: ColDef<T>) => boolean);
|
|
12
|
+
selectedRowIds?: Set<string>;
|
|
13
|
+
onSelectionChange?: (selectedRowIds: Set<string>, selectedRows: T[]) => void;
|
|
14
|
+
getRowId?: (row: T) => string;
|
|
15
|
+
alternateOddRowColors?: boolean;
|
|
16
|
+
filterPlaceholder?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* DialGrid — A feature-rich data grid wrapper built on ag-Grid with dark theme support.
|
|
20
|
+
*
|
|
21
|
+
* Provides a pre-configured grid with:
|
|
22
|
+
* - Dark theme styling with CSS variable integration
|
|
23
|
+
* - Optional row selection with checkboxes
|
|
24
|
+
* - Context menu integration via DialDropdown
|
|
25
|
+
* - Text overflow handling with tooltips via DialEllipsisTooltip
|
|
26
|
+
* - Controlled or uncontrolled selection modes
|
|
27
|
+
* - Automatic column sizing and responsive behavior
|
|
28
|
+
* - Full accessibility support with ARIA attributes
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* // Basic usage with data
|
|
33
|
+
* interface Product {
|
|
34
|
+
* id: string;
|
|
35
|
+
* name: string;
|
|
36
|
+
* price: number;
|
|
37
|
+
* }
|
|
38
|
+
*
|
|
39
|
+
* const columns: ColDef<Product>[] = [
|
|
40
|
+
* { field: 'name', headerName: 'Product Name', flex: 1 },
|
|
41
|
+
* { field: 'price', headerName: 'Price', width: 120 },
|
|
42
|
+
* ];
|
|
43
|
+
*
|
|
44
|
+
* <DialGrid<Product>
|
|
45
|
+
* columnDefs={columns}
|
|
46
|
+
* rowData={products}
|
|
47
|
+
* storageKey="products-grid"
|
|
48
|
+
* />
|
|
49
|
+
*
|
|
50
|
+
* // With context menu
|
|
51
|
+
* const getContextMenu = (row: Product): DropdownItem[] => [
|
|
52
|
+
* { key: 'edit', label: 'Edit' },
|
|
53
|
+
* { key: 'delete', label: 'Delete', danger: true },
|
|
54
|
+
* ];
|
|
55
|
+
*
|
|
56
|
+
* <DialGrid<Product>
|
|
57
|
+
* columnDefs={columns}
|
|
58
|
+
* rowData={products}
|
|
59
|
+
* getContextMenuItems={getContextMenu}
|
|
60
|
+
* />
|
|
61
|
+
*
|
|
62
|
+
* // Controlled selection
|
|
63
|
+
* const [selectedIds, setSelectedIds] = useState<Set<string>>(new Set());
|
|
64
|
+
*
|
|
65
|
+
* <DialGrid<Product>
|
|
66
|
+
* columnDefs={columns}
|
|
67
|
+
* rowData={products}
|
|
68
|
+
* selectedRowIds={selectedIds}
|
|
69
|
+
* onSelectionChange={(ids, rows) => {
|
|
70
|
+
* setSelectedIds(ids);
|
|
71
|
+
* console.log('Selected:', rows);
|
|
72
|
+
* }}
|
|
73
|
+
* />
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* @param [columnDefs] - Array of column definitions (ag-Grid ColDef format)
|
|
77
|
+
* @param [rowData] - Array of data objects to display in the grid
|
|
78
|
+
* @param [additionalGridOptions] - Additional ag-Grid GridOptions to merge with defaults
|
|
79
|
+
* @param [getContextMenuItems] - Function returning context menu items for a given row
|
|
80
|
+
* @param [cssClass] - Additional CSS classes to apply to the grid container
|
|
81
|
+
* @param [ariaLabel='Data grid'] - Accessible label for the grid region
|
|
82
|
+
* @param [withSelectionColumn=true] - Whether to show the checkbox selection column
|
|
83
|
+
* @param [wrapCustomCellRenderers=true] - Whether to wrap custom cell renderers with context menu support
|
|
84
|
+
* @param [selectedRowIds] - Controlled selection: set of row IDs that should be selected
|
|
85
|
+
* @param [onSelectionChange] - Callback invoked when selection changes (selectedIds, selectedRows)
|
|
86
|
+
* @param [getRowId] - Function to extract unique ID from a row object (defaults to 'id' field)
|
|
87
|
+
* @param [alternateOddRowColors=false] - Whether to alternate background colors for odd/even rows
|
|
88
|
+
* @param [filterPlaceholder='Enter value'] - Placeholder text for column filter inputs
|
|
89
|
+
*/
|
|
90
|
+
export declare const DialGrid: <T extends object>({ columnDefs, rowData, additionalGridOptions, getContextMenuItems, cssClass, ariaLabel, withSelectionColumn, wrapCustomCellRenderers, selectedRowIds, onSelectionChange, getRowId, alternateOddRowColors, filterPlaceholder, }: DialGridProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ColDef, IRowNode } from 'ag-grid-community';
|
|
2
|
+
export declare const baseColumnComparator: (a: string | number | undefined, b: string | number | undefined, _nodeA?: IRowNode, _nodeB?: IRowNode, isInverted?: boolean) => number;
|
|
3
|
+
export declare const checkColDefsChanges: (cols: ColDef[], initialCols: ColDef[]) => boolean;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const gridBaseClasses = "h-full";
|
|
2
|
+
export declare const GRID_THEME_COLORS: {
|
|
3
|
+
accentColor: string;
|
|
4
|
+
backgroundColor: string;
|
|
5
|
+
oddRowBackgroundColor: string;
|
|
6
|
+
borderColor: string;
|
|
7
|
+
rowBorder: string;
|
|
8
|
+
borderRadius: number;
|
|
9
|
+
browserColorScheme: string;
|
|
10
|
+
chromeBackgroundColor: string;
|
|
11
|
+
foregroundColor: string;
|
|
12
|
+
headerFontSize: number;
|
|
13
|
+
headerFontWeight: number;
|
|
14
|
+
headerTextColor: string;
|
|
15
|
+
spacing: number;
|
|
16
|
+
wrapperBorderRadius: number;
|
|
17
|
+
fontSize: number;
|
|
18
|
+
fontFamily: {
|
|
19
|
+
googleFont: string;
|
|
20
|
+
};
|
|
21
|
+
headerColumnBorderHeight: string;
|
|
22
|
+
cellStyle: {
|
|
23
|
+
textAlign: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export declare const ROW_HEIGHT = 40;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface UseGridSelectionProps<T> {
|
|
2
|
+
selectedRowIds?: Set<string>;
|
|
3
|
+
onSelectionChange?: (selectedRowIds: Set<string>, selectedRows: T[]) => void;
|
|
4
|
+
rowData?: T[];
|
|
5
|
+
getRowId: (row: T) => string;
|
|
6
|
+
}
|
|
7
|
+
export declare const useGridSelection: <T extends object>({ selectedRowIds, onSelectionChange, rowData, getRowId, }: UseGridSelectionProps<T>) => {
|
|
8
|
+
currentSelectedIds: Set<string>;
|
|
9
|
+
handleSelectionToggle: (rowId: string, checked: boolean) => void;
|
|
10
|
+
headerCheckboxState: string;
|
|
11
|
+
handleHeaderCheckboxChange: () => void;
|
|
12
|
+
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { InputBaseProps } from '../../models/field-control-props';
|
|
3
|
-
export interface DialInputProps extends InputBaseProps {
|
|
1
|
+
import { FC, FocusEvent } from 'react';
|
|
2
|
+
import { InputBaseProps, NumberInputBaseProps } from '../../models/field-control-props';
|
|
3
|
+
export interface DialInputProps extends InputBaseProps, Partial<NumberInputBaseProps> {
|
|
4
4
|
type?: string;
|
|
5
5
|
containerCssClass?: string;
|
|
6
6
|
cssClass?: string;
|
|
7
7
|
hideBorder?: boolean;
|
|
8
|
+
tooltipText?: string;
|
|
8
9
|
tooltipTriggerClassName?: string;
|
|
9
|
-
onChange?: (value
|
|
10
|
+
onChange?: (value?: string) => void;
|
|
11
|
+
onBlur?: (event: FocusEvent<HTMLInputElement, Element>) => void;
|
|
10
12
|
}
|
|
11
13
|
/**
|
|
12
14
|
* A flexible input component with icon support and various styling options
|
|
@@ -22,25 +24,17 @@ export interface DialInputProps extends InputBaseProps {
|
|
|
22
24
|
* />
|
|
23
25
|
* ```
|
|
24
26
|
*
|
|
25
|
-
* @
|
|
26
|
-
* @
|
|
27
|
-
* @
|
|
28
|
-
*
|
|
29
|
-
* @param
|
|
30
|
-
* @param
|
|
31
|
-
* @param
|
|
32
|
-
* @param
|
|
33
|
-
* @param
|
|
34
|
-
* @param
|
|
35
|
-
* @param
|
|
36
|
-
* @param
|
|
37
|
-
* @param [hideBorder=false] - Whether to hide the input border styling
|
|
38
|
-
* @param [min] - Minimum value for number inputs
|
|
39
|
-
* @param [max] - Maximum value for number inputs
|
|
40
|
-
* @param [prefix] - Text to display inside the input on the left
|
|
41
|
-
* @param [suffix] - Text to display inside the input on the right
|
|
42
|
-
* @param [textBeforeInput] - Text to display before the input in a separate field
|
|
43
|
-
* @param [tooltipTriggerClassName] - Additional CSS classes to apply to the tooltip
|
|
44
|
-
* @param [textAfterInput] - Text to display after the input in a separate field
|
|
27
|
+
* @params Component properties extending:
|
|
28
|
+
* - {@link InputBaseProps} - Base input properties (elementId, value, placeholder, disabled, readonly, invalid, icons, etc.)
|
|
29
|
+
* - {@link NumberInputBaseProps} - Number input properties (min, max) - partial
|
|
30
|
+
*
|
|
31
|
+
* @param type - The HTML input type (text, password, email, number, etc.)
|
|
32
|
+
* @param containerCssClass - Additional CSS classes to apply to the container div
|
|
33
|
+
* @param cssClass - Additional CSS classes to apply to the input element
|
|
34
|
+
* @param hideBorder - Whether to hide the input border styling
|
|
35
|
+
* @param tooltipText - The text to display inside the tooltip. If empty, the tooltip will display the value prop.
|
|
36
|
+
* @param tooltipTriggerClassName - Additional CSS classes to apply to the tooltip
|
|
37
|
+
* @param onChange - Callback function called when the input value changes
|
|
38
|
+
* @param onBlur - Callback function called when the input blurs
|
|
45
39
|
*/
|
|
46
40
|
export declare const DialInput: FC<DialInputProps>;
|
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { FieldControlProps, InputBaseProps } from '../../models/field-control-props';
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { FieldControlProps, InputBaseProps, NumberInputBaseProps } from '../../models/field-control-props';
|
|
3
|
+
import { DialFormItemBaseProps } from '../../types/form-item';
|
|
4
|
+
export interface DialInputFieldBaseProps extends FieldControlProps, DialFormItemBaseProps, InputBaseProps {
|
|
5
|
+
value?: string | number;
|
|
5
6
|
defaultEmptyText?: string;
|
|
6
7
|
errorText?: string;
|
|
7
8
|
elementCssClass?: string;
|
|
8
9
|
elementContainerCssClass?: string;
|
|
9
10
|
containerCssClass?: string;
|
|
10
11
|
}
|
|
11
|
-
export interface DialInputFieldProps extends DialInputFieldBaseProps {
|
|
12
|
+
export interface DialInputFieldProps extends DialInputFieldBaseProps, Partial<NumberInputBaseProps> {
|
|
12
13
|
type: string;
|
|
13
|
-
onChange?: (value
|
|
14
|
-
min?: number;
|
|
15
|
-
max?: number;
|
|
14
|
+
onChange?: (value?: string | number) => void;
|
|
16
15
|
}
|
|
17
|
-
export interface DialNumberInputFieldProps extends DialInputFieldBaseProps {
|
|
18
|
-
onChange?: (value
|
|
19
|
-
min?: number;
|
|
20
|
-
max?: number;
|
|
16
|
+
export interface DialNumberInputFieldProps extends DialInputFieldBaseProps, Partial<NumberInputBaseProps> {
|
|
17
|
+
onChange?: (value?: number | string) => void;
|
|
21
18
|
}
|
|
22
19
|
/**
|
|
23
20
|
* A number input field component
|
|
@@ -33,29 +30,18 @@ export interface DialNumberInputFieldProps extends DialInputFieldBaseProps {
|
|
|
33
30
|
* />
|
|
34
31
|
* ```
|
|
35
32
|
*
|
|
36
|
-
* @
|
|
37
|
-
* @
|
|
38
|
-
* @
|
|
39
|
-
* @
|
|
40
|
-
* @
|
|
41
|
-
*
|
|
42
|
-
* @param
|
|
43
|
-
*
|
|
44
|
-
* @param [readonly=false] - Whether the input is read-only
|
|
45
|
-
* @param [invalid=false] - Whether the input has validation errors (applies error styling)
|
|
46
|
-
* @param [errorText] - Error message text to display below the input
|
|
47
|
-
* @param [defaultEmptyText="None"] - Text to display when readonly and value is empty
|
|
48
|
-
* @param [iconBefore] - Icon or element to display before the input
|
|
49
|
-
* @param [iconAfter] - Icon or element to display after the input
|
|
50
|
-
* @param [elementCssClass] - Additional CSS classes to apply to the input element
|
|
51
|
-
* @param [elementContainerCssClass] - Additional CSS classes to apply to the input container
|
|
52
|
-
* @param [containerCssClass] - Additional CSS classes to apply to the DialNumberInputField container
|
|
53
|
-
* @param [min] - Minimum allowed value for the number input
|
|
54
|
-
* @param [max] - Maximum allowed value for the number input
|
|
33
|
+
* @params - Component properties extending:
|
|
34
|
+
* - {@link FieldControlProps} - Field control properties (fieldTitle, optional)
|
|
35
|
+
* - {@link DialFormItemBaseProps} - Form item properties (label, error, description, etc.)
|
|
36
|
+
* - {@link InputBaseProps} - Base input properties (elementId, value, placeholder, disabled, readonly, invalid, icons, etc.)
|
|
37
|
+
* - {@link NumberInputBaseProps} - Number input properties (min, max) - partial
|
|
38
|
+
*
|
|
39
|
+
* @param onChange - Callback function called when the input value changes.
|
|
40
|
+
* Returns either a number (for most values) or a string (for decimal values < 1 with leading zeros)
|
|
55
41
|
*/
|
|
56
42
|
export declare const DialNumberInputField: FC<DialNumberInputFieldProps>;
|
|
57
43
|
export interface DialTextInputFieldProps extends DialInputFieldBaseProps {
|
|
58
|
-
onChange?: (value
|
|
44
|
+
onChange?: (value?: string) => void;
|
|
59
45
|
}
|
|
60
46
|
/**
|
|
61
47
|
* A text input field component
|
|
@@ -72,21 +58,11 @@ export interface DialTextInputFieldProps extends DialInputFieldBaseProps {
|
|
|
72
58
|
* />
|
|
73
59
|
* ```
|
|
74
60
|
*
|
|
75
|
-
* @
|
|
76
|
-
* @
|
|
77
|
-
* @
|
|
78
|
-
* @
|
|
79
|
-
*
|
|
80
|
-
* @param
|
|
81
|
-
* @param [disabled=false] - Whether the input is disabled and cannot be interacted with
|
|
82
|
-
* @param [readonly=false] - Whether the input is read-only (displays value as text, no input element)
|
|
83
|
-
* @param [invalid=false] - Whether the input has validation errors (applies error styling)
|
|
84
|
-
* @param [errorText] - Error message text to display below the input
|
|
85
|
-
* @param [defaultEmptyText="None"] - Text to display when readonly and value is empty
|
|
86
|
-
* @param [iconBefore] - Icon or element to display before the input
|
|
87
|
-
* @param [iconAfter] - Icon or element to display after the input
|
|
88
|
-
* @param [elementCssClass] - Additional CSS classes to apply to the input element
|
|
89
|
-
* @param [elementContainerCssClass] - Additional CSS classes to apply to the input container
|
|
90
|
-
* @param [containerCssClass] - Additional CSS classes to apply to the outer container
|
|
61
|
+
* @params - Component properties extending:
|
|
62
|
+
* - {@link FieldControlProps} - Field control properties (fieldTitle, optional)
|
|
63
|
+
* - {@link DialFormItemBaseProps} - Form item properties (label, error, description, etc.)
|
|
64
|
+
* - {@link InputBaseProps} - Base input properties (elementId, value, placeholder, disabled, readonly, invalid, icons, etc.)
|
|
65
|
+
*
|
|
66
|
+
* @param onChange - Callback function called when the input value changes, receives the new string value
|
|
91
67
|
*/
|
|
92
68
|
export declare const DialTextInputField: FC<DialTextInputFieldProps>;
|
|
@@ -2,7 +2,7 @@ import { FC } from 'react';
|
|
|
2
2
|
import { EDITOR_THEMES } from '../../types/editor';
|
|
3
3
|
import { OnValidate } from '@monaco-editor/react';
|
|
4
4
|
import { editor } from 'monaco-editor';
|
|
5
|
-
export interface
|
|
5
|
+
export interface DialJsonEditorProps {
|
|
6
6
|
value?: string | undefined;
|
|
7
7
|
currentTheme: string;
|
|
8
8
|
themesConfig?: Record<EDITOR_THEMES, editor.IStandaloneThemeData>;
|
|
@@ -21,4 +21,4 @@ export interface Props {
|
|
|
21
21
|
* @param [onValidateJSON] - Callback fired when JSON validation occurs
|
|
22
22
|
* @param [options] - Additional Monaco editor options
|
|
23
23
|
*/
|
|
24
|
-
export declare const DialJsonEditor: FC<
|
|
24
|
+
export declare const DialJsonEditor: FC<DialJsonEditorProps>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export interface DialEmptyFileAreaProps {
|
|
3
|
+
emptyTextFirstLine?: string;
|
|
4
|
+
emptyTextSecondLine?: string;
|
|
5
|
+
emptyButtonLabel?: string;
|
|
6
|
+
acceptTypes: string;
|
|
7
|
+
maxFilesCount?: number;
|
|
8
|
+
multiple?: boolean;
|
|
9
|
+
fileFormatError?: string;
|
|
10
|
+
fileCountError?: string;
|
|
11
|
+
getIsFileFormatError?: (fileItems: File[] | DataTransferItem[]) => boolean;
|
|
12
|
+
onChange: (files: File[]) => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A drag-and-drop file upload area component that allows users to upload files
|
|
16
|
+
* either by dragging them into the drop zone or selecting them via the file picker.
|
|
17
|
+
* Displays customizable helper text, an upload button, and validation messages for file format
|
|
18
|
+
* or maximum file count errors. Integrates with `react-dnd` for drag-and-drop behavior.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <DialEmptyFileArea
|
|
23
|
+
* onChange={(files) => console.log('Selected files:', files)}
|
|
24
|
+
* emptyTextFirstLine="Drag & drop files here"
|
|
25
|
+
* emptyTextSecondLine="or click below to select files"
|
|
26
|
+
* emptyButtonLabel="Choose files"
|
|
27
|
+
* acceptTypes="application/pdf, application/txt, image/svg+xml"
|
|
28
|
+
* maxFilesCount={3}
|
|
29
|
+
* multiple
|
|
30
|
+
* fileFormatError="Only PNG and JPG files are allowed"
|
|
31
|
+
* fileCountError="You can upload up to 3 files"
|
|
32
|
+
* getIsFileFormatError={(files) =>
|
|
33
|
+
* files.some(file => !file.name.endsWith('.png') && !file.name.endsWith('.jpg'))
|
|
34
|
+
* }
|
|
35
|
+
* />
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @param {DialEmptyFileAreaProps} props - The properties for the empty file area component.
|
|
39
|
+
* @param {(files: File[]) => void} props.onChange - Callback fired when valid files are selected or dropped.
|
|
40
|
+
* @param {string} [props.emptyTextFirstLine] - Text displayed as the first line inside the drop area.
|
|
41
|
+
* @param {string} [props.emptyTextSecondLine] - Text displayed as the second line inside the drop area.
|
|
42
|
+
* @param {string} [props.emptyButtonLabel] - Label for the upload button shown below the text.
|
|
43
|
+
* @param {string} [props.acceptTypes] - Comma-separated list of accepted file MIME types (e.g., "application/pdf").
|
|
44
|
+
* @param {number} [props.maxFilesCount] - Maximum allowed number of files that can be uploaded at once.
|
|
45
|
+
* @param {boolean} [props.multiple=false] - Whether multiple file uploads are allowed.
|
|
46
|
+
* @param {string} [props.fileFormatError] - Error message shown when an invalid file format is detected.
|
|
47
|
+
* @param {string} [props.fileCountError] - Error message shown when the selected files exceed the limit.
|
|
48
|
+
* @param {(files: File[] | DataTransferItem[]) => boolean} [props.getIsFileFormatError] - Optional validation function that returns `true` if selected files have invalid formats.
|
|
49
|
+
*
|
|
50
|
+
* @returns {JSX.Element} The rendered drag-and-drop upload area with file validation feedback.
|
|
51
|
+
*/
|
|
52
|
+
export declare const DialEmptyFileArea: FC<DialEmptyFileAreaProps>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { DialInputProps } from '../Input/Input';
|
|
3
|
+
interface DialFilledInputProps extends DialInputProps {
|
|
4
|
+
errorText?: string;
|
|
5
|
+
onClick?: () => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* A styled input component that wraps `DialInput` and provides built-in
|
|
9
|
+
* error handling and icon display.
|
|
10
|
+
*
|
|
11
|
+
* - Displays an error icon (`IconExclamationCircle`) when the input is invalid.
|
|
12
|
+
* - Supports an optional `errorText` tooltip shown on hover when invalid.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* <DialFilledInput
|
|
16
|
+
* value={username}
|
|
17
|
+
* onChange={handleChange}
|
|
18
|
+
* invalid={!username}
|
|
19
|
+
* errorText="Username is required"
|
|
20
|
+
* iconBefore={<UserIcon />}
|
|
21
|
+
* />
|
|
22
|
+
*
|
|
23
|
+
* @component
|
|
24
|
+
* @param {DialFilledInputProps} props - The properties for the filled input component.
|
|
25
|
+
* @param {string} [props.errorText] - Optional text to display in a tooltip when the input is invalid.
|
|
26
|
+
* @param {() => void} [props.onClick] - Optional click handler for the input container.
|
|
27
|
+
* @returns {JSX.Element} The rendered filled input component.
|
|
28
|
+
*/
|
|
29
|
+
export declare const DialFilledInput: FC<DialFilledInputProps>;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { DialEmptyFileAreaProps } from './EmptyFileArea';
|
|
3
|
+
export interface DialLoadFileAreaProps extends DialEmptyFileAreaProps {
|
|
4
|
+
files?: File[];
|
|
5
|
+
dynamicIcon?: (name: string) => ReactNode;
|
|
6
|
+
iconBeforeInput?: ReactNode;
|
|
7
|
+
isInvalid?: (file: File) => boolean;
|
|
8
|
+
errorText?: string;
|
|
9
|
+
removeButtonAriaLabel?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A drag-and-drop file upload area component that allows users to upload files
|
|
13
|
+
* either by dragging them into the area or by selecting them through the file picker.
|
|
14
|
+
* Displays helpful text, button prompts, and validation errors for file format or count limits.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <DialEmptyFileArea
|
|
19
|
+
* onChange={(files) => console.log(files)}
|
|
20
|
+
* emptyTextFirstLine="Drag & drop your files here"
|
|
21
|
+
* emptyTextSecondLine="or click the button below to upload"
|
|
22
|
+
* emptyButtonLabel="Upload files"
|
|
23
|
+
* acceptTypes="application/pdf, application/txt, image/svg+xml"
|
|
24
|
+
* maxFilesCount={5}
|
|
25
|
+
* isMultiple
|
|
26
|
+
* fileFormatError="Unsupported file format"
|
|
27
|
+
* fileCountError="You can upload up to 5 files only"
|
|
28
|
+
* getIsFileFormatError={(files) => files.some(file => !file.name.endsWith('.jpg') && !file.name.endsWith('.png'))}
|
|
29
|
+
* />
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @param {DialEmptyFileAreaProps} props - The properties for the empty file area component.
|
|
33
|
+
* @param {(files: File[]) => void} props.onChange - Callback fired when valid files are selected or dropped.
|
|
34
|
+
* @param {string} [props.emptyTextFirstLine] - Optional text displayed as the first line in the empty area.
|
|
35
|
+
* @param {string} [props.emptyTextSecondLine] - Optional text displayed as the second line in the empty area.
|
|
36
|
+
* @param {string} [props.emptyButtonLabel] - Label text for the upload button.
|
|
37
|
+
* @param {string} [props.acceptTypes] - Comma-separated list of accepted file MIME types (e.g., "application/pdf").
|
|
38
|
+
* @param {number} [props.maxFilesCount] - Maximum allowed number of files to upload at once.
|
|
39
|
+
* @param {boolean} [props.multiple=false] - Whether multiple file uploads are allowed.
|
|
40
|
+
* @param {string} [props.fileFormatError] - Error message displayed when an invalid file format is detected.
|
|
41
|
+
* @param {string} [props.fileCountError] - Error message displayed when the file count exceeds the limit.
|
|
42
|
+
* @param {(files: File[]) => boolean} [props.getIsFileFormatError] - Optional validation callback that checks whether selected files have valid formats.
|
|
43
|
+
*
|
|
44
|
+
* @returns {JSX.Element} The rendered drag-and-drop file upload area with optional validation feedback.
|
|
45
|
+
*/
|
|
46
|
+
export declare const DialLoadFileArea: FC<DialLoadFileAreaProps>;
|