@epam/ai-dial-ui-kit 0.3.0-rc.8 → 0.3.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 +5796 -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/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/FileManagerNavigationPanel/FileManagerNavigationPanel.d.ts +58 -0
- package/dist/src/components/FileManagerNavigationPanel/constants.d.ts +3 -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/FoldersTree/FoldersTree.d.ts +92 -0
- package/dist/src/components/FoldersTree/constants.d.ts +5 -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,92 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { DialFile } from '../../models/file';
|
|
3
|
+
import { DropdownItem } from '../../models/dropdown';
|
|
4
|
+
export interface DialFoldersTreeProps {
|
|
5
|
+
items: DialFile[];
|
|
6
|
+
expandedPaths?: Set<string>;
|
|
7
|
+
loadingPaths?: Set<string>;
|
|
8
|
+
selectedPaths?: Set<string>;
|
|
9
|
+
showFiles?: boolean;
|
|
10
|
+
emptyStateTitle?: string;
|
|
11
|
+
emptyStateDescription?: string;
|
|
12
|
+
emptyStateIcon?: ReactNode;
|
|
13
|
+
onItemClick?: (item: DialFile) => void;
|
|
14
|
+
getContextMenuItems?: (item: DialFile) => DropdownItem[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* DialFoldersTree — A hierarchical folder tree component with nested expand/collapse support, selection highlighting,
|
|
18
|
+
* and optional file display.
|
|
19
|
+
*
|
|
20
|
+
* Provides a fully interactive, recursive folder structure with:
|
|
21
|
+
* - Expandable and collapsible items
|
|
22
|
+
* - Optional file visibility
|
|
23
|
+
* - Loading state indicators for specific paths
|
|
24
|
+
* - Multi-item selection highlighting
|
|
25
|
+
* - Context menu integration via `DialDropdown`
|
|
26
|
+
* - Recursive rendering with indentation and icons
|
|
27
|
+
* - Customizable empty state (title, description, and icon)
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* // Basic usage with folders and files
|
|
32
|
+
* const items: DialFile[] = [
|
|
33
|
+
* {
|
|
34
|
+
* path: '/documents',
|
|
35
|
+
* name: 'Documents',
|
|
36
|
+
* nodeType: DialFileNodeType.FOLDER,
|
|
37
|
+
* items: [
|
|
38
|
+
* {
|
|
39
|
+
* path: '/documents/file.txt',
|
|
40
|
+
* name: 'file.txt',
|
|
41
|
+
* nodeType: DialFileNodeType.FILE,
|
|
42
|
+
* },
|
|
43
|
+
* ],
|
|
44
|
+
* },
|
|
45
|
+
* ];
|
|
46
|
+
*
|
|
47
|
+
* <DialFoldersTree items={items} showFiles />
|
|
48
|
+
*
|
|
49
|
+
* // With expanded and selected items
|
|
50
|
+
* const expandedPaths = new Set(['/documents']);
|
|
51
|
+
* const selectedPaths = new Set(['/documents/file.txt']);
|
|
52
|
+
*
|
|
53
|
+
* <DialFoldersTree
|
|
54
|
+
* items={items}
|
|
55
|
+
* expandedPaths={expandedPaths}
|
|
56
|
+
* selectedPaths={selectedPaths}
|
|
57
|
+
* onItemClick={(item) => console.log('Clicked:', item.path)}
|
|
58
|
+
* />
|
|
59
|
+
*
|
|
60
|
+
* // With custom empty state and context menu
|
|
61
|
+
* const getContextMenuItems = (item: DialFile): DropdownItem[] => [
|
|
62
|
+
* { key: 'rename', label: 'Rename' },
|
|
63
|
+
* { key: 'delete', label: 'Delete', danger: true },
|
|
64
|
+
* ];
|
|
65
|
+
*
|
|
66
|
+
* <DialFoldersTree
|
|
67
|
+
* items={[]}
|
|
68
|
+
* emptyStateTitle="No Content"
|
|
69
|
+
* emptyStateDescription="Upload files or create a new folder to get started."
|
|
70
|
+
* emptyStateIcon={<IconFolderPlus />}
|
|
71
|
+
* getContextMenuItems={getContextMenuItems}
|
|
72
|
+
* />
|
|
73
|
+
* ```
|
|
74
|
+
*
|
|
75
|
+
* @param [items] - Array of folder and file nodes to display in the tree.
|
|
76
|
+
* @param [expandedPaths] - Set of folder paths that should be expanded.
|
|
77
|
+
* @param [loadingPaths] - Set of folder paths currently loading (shows spinner or placeholder).
|
|
78
|
+
* @param [selectedPaths] - Set of paths representing currently selected folders or files.
|
|
79
|
+
* @param [showFiles=false] - Whether to show files in addition to folders.
|
|
80
|
+
* @param [emptyStateTitle='No Folders'] - Title text displayed when there are no items.
|
|
81
|
+
* @param [emptyStateDescription] - Optional description text for the empty state.
|
|
82
|
+
* @param [emptyStateIcon] - Optional icon to display in the empty state.
|
|
83
|
+
* @param [onItemClick] - Callback fired when a folder or file is clicked (receives the corresponding `DialFile` node).
|
|
84
|
+
* @param [getContextMenuItems] - Function returning context menu items for a given node.
|
|
85
|
+
*
|
|
86
|
+
* @remarks
|
|
87
|
+
* - Folder and file data must follow the `DialFile` model.
|
|
88
|
+
* - The `expandedPaths`, `loadingPaths`, and `selectedPaths` props are externally controlled; the component itself does not manage them internally.
|
|
89
|
+
* - Context menus can be attached to both folders and files using `getContextMenuItems`.
|
|
90
|
+
* - Use `showFiles={false}` to render only folders for a simplified tree.
|
|
91
|
+
*/
|
|
92
|
+
export declare const DialFoldersTree: FC<DialFoldersTreeProps>;
|
|
@@ -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 {};
|