@mezzanine-ui/react 1.0.0-beta.1 → 1.0.0-beta.3
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/Anchor/Anchor.d.ts +51 -18
- package/Anchor/Anchor.js +15 -15
- package/Anchor/AnchorGroup.d.ts +34 -0
- package/Anchor/AnchorGroup.js +37 -0
- package/Anchor/AnchorItem.d.ts +30 -0
- package/Anchor/AnchorItem.js +65 -0
- package/Anchor/index.d.ts +2 -0
- package/Anchor/index.js +1 -0
- package/Anchor/utils.d.ts +13 -0
- package/Anchor/utils.js +95 -0
- package/AutoComplete/AutoComplete.d.ts +194 -0
- package/AutoComplete/AutoComplete.js +419 -0
- package/AutoComplete/index.d.ts +2 -0
- package/AutoComplete/index.js +1 -0
- package/AutoComplete/useAutoCompleteCreation.d.ts +33 -0
- package/AutoComplete/useAutoCompleteCreation.js +201 -0
- package/AutoComplete/useAutoCompleteKeyboard.d.ts +31 -0
- package/AutoComplete/useAutoCompleteKeyboard.js +149 -0
- package/AutoComplete/useAutoCompleteSearch.d.ts +16 -0
- package/AutoComplete/useAutoCompleteSearch.js +69 -0
- package/AutoComplete/useCreationTracker.d.ts +17 -0
- package/AutoComplete/useCreationTracker.js +47 -0
- package/Badge/Badge.js +2 -2
- package/Breadcrumb/BreadcrumbItem.d.ts +1 -1
- package/Button/Button.js +13 -11
- package/Button/index.d.ts +1 -1
- package/Button/typings.d.ts +27 -4
- package/Description/Description.d.ts +30 -0
- package/Description/Description.js +13 -0
- package/Description/DescriptionContent.d.ts +41 -0
- package/Description/DescriptionContent.js +14 -0
- package/Description/DescriptionGroup.d.ts +13 -0
- package/Description/DescriptionGroup.js +12 -0
- package/Description/DescriptionTitle.d.ts +45 -0
- package/Description/DescriptionTitle.js +17 -0
- package/Description/index.d.ts +8 -0
- package/Description/index.js +4 -0
- package/Dropdown/Dropdown.d.ts +43 -3
- package/Dropdown/Dropdown.js +154 -35
- package/Dropdown/DropdownAction.d.ts +1 -1
- package/Dropdown/DropdownAction.js +1 -4
- package/Dropdown/DropdownItem.d.ts +21 -4
- package/Dropdown/DropdownItem.js +23 -10
- package/Dropdown/DropdownItemCard.d.ts +5 -5
- package/Dropdown/DropdownItemCard.js +11 -10
- package/Dropdown/DropdownStatus.d.ts +2 -2
- package/Dropdown/DropdownStatus.js +29 -0
- package/Dropdown/dropdownKeydownHandler.d.ts +2 -1
- package/Dropdown/dropdownKeydownHandler.js +73 -0
- package/Dropdown/highlightText.js +5 -1
- package/Dropdown/shortcutTextHandler.d.ts +24 -0
- package/Dropdown/shortcutTextHandler.js +171 -0
- package/Form/FormControlContext.d.ts +2 -2
- package/Form/FormField.d.ts +56 -4
- package/Form/FormField.js +10 -6
- package/Form/FormHintText.d.ts +24 -1
- package/Form/FormHintText.js +4 -4
- package/Form/FormLabel.d.ts +6 -3
- package/Form/FormLabel.js +5 -3
- package/Input/Input.d.ts +29 -3
- package/Input/Input.js +22 -6
- package/Input/PasswordStrengthIndicator/PasswordStrengthIndicator.js +1 -1
- package/Modal/Modal.d.ts +103 -11
- package/Modal/Modal.js +14 -9
- package/Modal/ModalBodyForVerification.d.ts +59 -0
- package/Modal/ModalBodyForVerification.js +99 -0
- package/Modal/ModalControl.d.ts +2 -2
- package/Modal/ModalControl.js +1 -1
- package/Modal/ModalFooter.d.ts +119 -1
- package/Modal/ModalFooter.js +15 -3
- package/Modal/ModalHeader.d.ts +26 -7
- package/Modal/ModalHeader.js +33 -7
- package/Modal/index.d.ts +4 -5
- package/Modal/index.js +1 -2
- package/Modal/useModalContainer.d.ts +12 -3
- package/Modal/useModalContainer.js +28 -6
- package/Navigation/CollapsedMenu.d.ts +6 -0
- package/Navigation/CollapsedMenu.js +16 -0
- package/Navigation/Navigation.d.ts +17 -3
- package/Navigation/Navigation.js +48 -33
- package/Navigation/NavigationFooter.js +4 -2
- package/Navigation/NavigationHeader.d.ts +11 -1
- package/Navigation/NavigationHeader.js +6 -3
- package/Navigation/NavigationOption.d.ts +3 -2
- package/Navigation/NavigationOption.js +45 -26
- package/Navigation/NavigationOptionCategory.js +20 -2
- package/Navigation/context.d.ts +2 -0
- package/Navigation/useVisibleItems.d.ts +5 -0
- package/Navigation/useVisibleItems.js +54 -0
- package/NotificationCenter/NotificationCenter.d.ts +124 -0
- package/NotificationCenter/NotificationCenter.js +259 -0
- package/NotificationCenter/NotificationCenterDrawer.d.ts +89 -0
- package/NotificationCenter/index.d.ts +3 -0
- package/NotificationCenter/index.js +1 -0
- package/PageFooter/PageFooter.d.ts +19 -9
- package/PageFooter/PageFooter.js +10 -10
- package/PageHeader/PageHeader.js +4 -12
- package/PageToolbar/PageToolbar.d.ts +2 -6
- package/PageToolbar/utils.js +4 -12
- package/Select/index.d.ts +0 -2
- package/Select/index.js +0 -1
- package/Slider/useSlider.js +1 -1
- package/Table/Table.d.ts +53 -15
- package/Table/Table.js +178 -82
- package/Table/TableContext.d.ts +18 -42
- package/Table/components/TableActionsCell.d.ts +26 -0
- package/Table/components/TableActionsCell.js +78 -0
- package/Table/components/TableBody.d.ts +2 -5
- package/Table/components/TableBody.js +16 -19
- package/Table/components/TableBulkActions.d.ts +15 -0
- package/Table/components/TableBulkActions.js +26 -0
- package/Table/components/TableCell.d.ts +2 -0
- package/Table/components/TableCell.js +42 -10
- package/Table/components/TableColGroup.js +10 -112
- package/Table/components/TableColumnTitleMenu.d.ts +6 -0
- package/Table/components/TableColumnTitleMenu.js +20 -0
- package/Table/components/TableDragHandleCell.d.ts +2 -0
- package/Table/components/TableDragHandleCell.js +8 -1
- package/Table/components/TableExpandCell.d.ts +2 -0
- package/Table/components/TableExpandCell.js +8 -1
- package/Table/components/TableExpandedRow.js +3 -2
- package/Table/components/TableHeader.d.ts +2 -4
- package/Table/components/TableHeader.js +11 -14
- package/Table/components/TableResizeHandle.js +3 -7
- package/Table/components/TableRow.js +54 -20
- package/Table/components/TableSelectionCell.d.ts +5 -0
- package/Table/components/TableSelectionCell.js +12 -1
- package/Table/components/index.d.ts +1 -0
- package/Table/components/index.js +1 -0
- package/Table/hooks/index.d.ts +1 -1
- package/Table/hooks/index.js +1 -1
- package/Table/hooks/useTableDataSource.d.ts +2 -2
- package/Table/hooks/useTableExpansion.js +0 -6
- package/Table/hooks/useTableFixedOffsets.d.ts +1 -1
- package/Table/hooks/useTableFixedOffsets.js +24 -26
- package/Table/hooks/useTableResizedColumns.d.ts +2 -0
- package/Table/hooks/useTableResizedColumns.js +22 -0
- package/Table/hooks/useTableScroll.d.ts +3 -1
- package/Table/hooks/useTableScroll.js +25 -19
- package/Table/hooks/useTableSelection.js +32 -8
- package/Table/hooks/useTableVirtualization.d.ts +1 -1
- package/Table/index.d.ts +4 -4
- package/Table/index.js +5 -3
- package/Table/utils/calculateColumnWidths.d.ts +28 -0
- package/Table/utils/calculateColumnWidths.js +80 -0
- package/Table/utils/index.d.ts +2 -0
- package/Table/utils/index.js +1 -0
- package/Table/utils/useTableRowSelection.d.ts +5 -5
- package/Table/utils/useTableRowSelection.js +14 -6
- package/Tag/TagGroup.d.ts +3 -0
- package/Tag/index.d.ts +2 -0
- package/Tag/index.js +1 -0
- package/Upload/UploadPictureCard.js +1 -1
- package/index.d.ts +36 -20
- package/index.js +26 -7
- package/package.json +4 -4
- package/utils/format-number-with-commas.d.ts +4 -0
- package/utils/format-number-with-commas.js +27 -0
- package/utils/parse-number-with-commas.d.ts +4 -0
- package/utils/parse-number-with-commas.js +22 -0
- package/Modal/ModalActions.d.ts +0 -9
- package/Modal/ModalActions.js +0 -20
- package/Modal/ModalBody.d.ts +0 -7
- package/Modal/ModalBody.js +0 -14
- package/Notification/Notification.d.ts +0 -54
- package/Notification/Notification.js +0 -76
- package/Notification/index.d.ts +0 -3
- package/Notification/index.js +0 -1
- package/Select/AutoComplete.d.ts +0 -107
- package/Select/AutoComplete.js +0 -114
- package/Table/hooks/useTableColumns.d.ts +0 -8
- package/Table/hooks/useTableColumns.js +0 -91
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useState, useCallback } from 'react';
|
|
3
|
+
|
|
4
|
+
function useTableResizedColumns() {
|
|
5
|
+
const [resizedColumnWidths, setResizedColumnWidths] = useState(new Map());
|
|
6
|
+
const getResizedColumnWidth = useCallback((key) => {
|
|
7
|
+
return resizedColumnWidths.get(key);
|
|
8
|
+
}, [resizedColumnWidths]);
|
|
9
|
+
const setResizedColumnWidth = useCallback((key, width) => {
|
|
10
|
+
setResizedColumnWidths((prev) => {
|
|
11
|
+
const next = new Map(prev);
|
|
12
|
+
next.set(key, width);
|
|
13
|
+
return next;
|
|
14
|
+
});
|
|
15
|
+
}, []);
|
|
16
|
+
return {
|
|
17
|
+
getResizedColumnWidth,
|
|
18
|
+
setResizedColumnWidth,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { useTableResizedColumns };
|
|
@@ -4,7 +4,9 @@ export interface UseTableScrollReturn {
|
|
|
4
4
|
handleScroll: (event: React.UIEvent<HTMLDivElement>) => void;
|
|
5
5
|
isScrollingHorizontally: boolean;
|
|
6
6
|
scrollLeft: number;
|
|
7
|
-
/**
|
|
7
|
+
/** Ref object for internal use */
|
|
8
|
+
containerRef: React.RefObject<HTMLDivElement | null>;
|
|
9
|
+
/** Callback ref setter that should be used for the scroll container */
|
|
8
10
|
setContainerRef: (element: HTMLDivElement | null) => void;
|
|
9
11
|
}
|
|
10
12
|
export declare function useTableScroll({ enabled, }: {
|
|
@@ -6,45 +6,51 @@ function useTableScroll({ enabled, }) {
|
|
|
6
6
|
const [scrollLeft, setScrollLeft] = useState(0);
|
|
7
7
|
const [containerWidth, setContainerWidth] = useState(0);
|
|
8
8
|
const containerRef = useRef(null);
|
|
9
|
-
const
|
|
10
|
-
containerRef.current = element;
|
|
11
|
-
}, []);
|
|
9
|
+
const resizeObserverRef = useRef(null);
|
|
12
10
|
const measureDimensions = useCallback(() => {
|
|
13
11
|
if (containerRef.current) {
|
|
14
12
|
const newContainerWidth = containerRef.current.clientWidth;
|
|
15
13
|
setContainerWidth((prev) => prev !== newContainerWidth ? newContainerWidth : prev);
|
|
16
14
|
}
|
|
17
15
|
}, []);
|
|
16
|
+
// Callback ref that sets up ResizeObserver when element is attached
|
|
17
|
+
const setContainerRef = useCallback((element) => {
|
|
18
|
+
// Clean up previous observer
|
|
19
|
+
if (resizeObserverRef.current) {
|
|
20
|
+
resizeObserverRef.current.disconnect();
|
|
21
|
+
resizeObserverRef.current = null;
|
|
22
|
+
}
|
|
23
|
+
containerRef.current = element;
|
|
24
|
+
if (element && enabled) {
|
|
25
|
+
// Measure immediately
|
|
26
|
+
measureDimensions();
|
|
27
|
+
// Set up ResizeObserver
|
|
28
|
+
resizeObserverRef.current = new ResizeObserver(() => {
|
|
29
|
+
measureDimensions();
|
|
30
|
+
});
|
|
31
|
+
resizeObserverRef.current.observe(element);
|
|
32
|
+
}
|
|
33
|
+
}, [enabled, measureDimensions]);
|
|
18
34
|
const handleScroll = useCallback((event) => {
|
|
19
35
|
const target = event.currentTarget;
|
|
20
36
|
const newScrollLeft = target.scrollLeft;
|
|
21
37
|
setScrollLeft(newScrollLeft);
|
|
22
38
|
setIsScrollingHorizontally(newScrollLeft > 0);
|
|
23
39
|
}, []);
|
|
24
|
-
//
|
|
40
|
+
// Cleanup on unmount
|
|
25
41
|
useEffect(() => {
|
|
26
|
-
const { current: container } = containerRef;
|
|
27
|
-
if (!container || !enabled)
|
|
28
|
-
return;
|
|
29
|
-
const resizeObserver = new ResizeObserver(() => {
|
|
30
|
-
measureDimensions();
|
|
31
|
-
});
|
|
32
|
-
resizeObserver.observe(container);
|
|
33
42
|
return () => {
|
|
34
|
-
|
|
43
|
+
if (resizeObserverRef.current) {
|
|
44
|
+
resizeObserverRef.current.disconnect();
|
|
45
|
+
}
|
|
35
46
|
};
|
|
36
|
-
}, [
|
|
37
|
-
// Initial measurement after mount
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
if (enabled) {
|
|
40
|
-
measureDimensions();
|
|
41
|
-
}
|
|
42
|
-
}, [measureDimensions, enabled]);
|
|
47
|
+
}, []);
|
|
43
48
|
return useMemo(() => ({
|
|
44
49
|
containerWidth,
|
|
45
50
|
handleScroll,
|
|
46
51
|
isScrollingHorizontally,
|
|
47
52
|
scrollLeft,
|
|
53
|
+
containerRef,
|
|
48
54
|
setContainerRef,
|
|
49
55
|
}), [
|
|
50
56
|
containerWidth,
|
|
@@ -3,28 +3,44 @@ import { useMemo, useCallback } from 'react';
|
|
|
3
3
|
import { getRowKey } from '@mezzanine-ui/core/table';
|
|
4
4
|
|
|
5
5
|
function useTableSelection({ dataSource, rowSelection, }) {
|
|
6
|
-
|
|
6
|
+
var _a;
|
|
7
|
+
// Extract common props
|
|
8
|
+
const { onChange, mode = 'checkbox' } = rowSelection || {};
|
|
9
|
+
const selections = mode === 'radio'
|
|
10
|
+
? rowSelection.selectedRowKey
|
|
11
|
+
: rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRowKeys;
|
|
12
|
+
const isSelectionDisabled = rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.isSelectionDisabled;
|
|
13
|
+
const onSelectAll = mode === 'radio' ? undefined : rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.onSelectAll;
|
|
14
|
+
const preserveSelectedRowKeys = mode === 'radio' ? false : ((_a = rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.preserveSelectedRowKeys) !== null && _a !== void 0 ? _a : false);
|
|
15
|
+
const selectedRowKeys = useMemo(() => {
|
|
16
|
+
var _a;
|
|
17
|
+
if (mode === 'radio') {
|
|
18
|
+
const key = selections;
|
|
19
|
+
return key !== undefined ? [key] : [];
|
|
20
|
+
}
|
|
21
|
+
return (_a = selections) !== null && _a !== void 0 ? _a : [];
|
|
22
|
+
}, [mode, selections]);
|
|
7
23
|
const selectableKeys = useMemo(() => {
|
|
8
24
|
if (!rowSelection)
|
|
9
25
|
return [];
|
|
10
26
|
return dataSource
|
|
11
27
|
.filter((record) => {
|
|
12
|
-
if (!
|
|
28
|
+
if (!isSelectionDisabled)
|
|
13
29
|
return true;
|
|
14
|
-
const disabled =
|
|
30
|
+
const disabled = isSelectionDisabled(record);
|
|
15
31
|
return !disabled;
|
|
16
32
|
})
|
|
17
33
|
.map((record) => getRowKey(record));
|
|
18
|
-
}, [dataSource,
|
|
34
|
+
}, [dataSource, isSelectionDisabled, rowSelection]);
|
|
19
35
|
const isRowSelected = useCallback((key) => {
|
|
20
36
|
return selectedRowKeys.includes(key);
|
|
21
37
|
}, [selectedRowKeys]);
|
|
22
38
|
const isRowDisabled = useCallback((record) => {
|
|
23
|
-
if (!
|
|
39
|
+
if (!isSelectionDisabled)
|
|
24
40
|
return false;
|
|
25
|
-
const disabled =
|
|
41
|
+
const disabled = isSelectionDisabled(record);
|
|
26
42
|
return disabled;
|
|
27
|
-
}, [
|
|
43
|
+
}, [isSelectionDisabled]);
|
|
28
44
|
const isAllSelected = useMemo(() => {
|
|
29
45
|
if (!selectableKeys.length)
|
|
30
46
|
return false;
|
|
@@ -37,13 +53,20 @@ function useTableSelection({ dataSource, rowSelection, }) {
|
|
|
37
53
|
return selectedCount > 0 && selectedCount < selectableKeys.length;
|
|
38
54
|
}, [selectableKeys, selectedRowKeys]);
|
|
39
55
|
const toggleRow = useCallback((key) => {
|
|
56
|
+
// Radio mode: only one selection allowed
|
|
57
|
+
if (mode === 'radio') {
|
|
58
|
+
const selectedRow = dataSource.find((r) => getRowKey(r) === key) || null;
|
|
59
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(key, selectedRow);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
// Checkbox mode: toggle selection
|
|
40
63
|
const newKeys = selectedRowKeys.includes(key)
|
|
41
64
|
? selectedRowKeys.filter((k) => k !== key)
|
|
42
65
|
: [...selectedRowKeys, key];
|
|
43
66
|
const selectedRow = dataSource.find((r) => getRowKey(r) === key) || null;
|
|
44
67
|
const selectedRows = dataSource.filter((r) => newKeys.includes(getRowKey(r)));
|
|
45
68
|
onChange === null || onChange === void 0 ? void 0 : onChange(newKeys, selectedRow, selectedRows);
|
|
46
|
-
}, [selectedRowKeys, dataSource, onChange]);
|
|
69
|
+
}, [mode, selectedRowKeys, dataSource, onChange]);
|
|
47
70
|
const toggleAll = useCallback(() => {
|
|
48
71
|
let newKeys;
|
|
49
72
|
let type;
|
|
@@ -85,6 +108,7 @@ function useTableSelection({ dataSource, rowSelection, }) {
|
|
|
85
108
|
isIndeterminate,
|
|
86
109
|
isRowDisabled,
|
|
87
110
|
isRowSelected,
|
|
111
|
+
mode,
|
|
88
112
|
selectedRowKeys,
|
|
89
113
|
toggleAll,
|
|
90
114
|
toggleRow,
|
|
@@ -3,7 +3,7 @@ import { type TableDataSource } from '@mezzanine-ui/core/table';
|
|
|
3
3
|
export interface UseTableVirtualizationOptions<T extends TableDataSource> {
|
|
4
4
|
dataSource: T[];
|
|
5
5
|
enabled?: boolean;
|
|
6
|
-
isRowExpanded?: (key: string
|
|
6
|
+
isRowExpanded?: (key: string) => boolean;
|
|
7
7
|
overscan?: number;
|
|
8
8
|
scrollContainerRef: React.RefObject<HTMLDivElement | null>;
|
|
9
9
|
}
|
package/Table/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { tableClasses as classes, getCellAlignClass,
|
|
2
|
-
export { default, type TableBaseProps, type
|
|
3
|
-
export { TableContext, TableDataContext, useTableContext, useTableDataContext, type
|
|
4
|
-
export { type UpdateDataSourceOptions } from './hooks';
|
|
1
|
+
export { TABLE_ACTIONS_KEY, tableClasses as classes, getCellAlignClass, getRowKey, type ColumnAlign, type FixedType, type HighlightMode, type SortOrder, type TableActionItem, type TableActions, type TableActionsBase, type TableActionsWithMinWidth, type TableBulkActions, type TableBulkGeneralAction, type TableBulkOverflowAction, type TableColumnBase, type TableColumnBaseWithMinWidthRequired, type TableColumn, type TableColumnTitleMenu, type TableColumnWithDataIndex, type TableColumnWithDataIndexAndMinWidth, type TableColumnWithMinWidth, type TableColumnWithRender, type TableColumnWithRenderAndMinWidth, type TableDataSource, type TableDataSourceWithId, type TableDataSourceWithKey, type TableDraggable, type TableExpandable, type TableRecord, type TableRowSelection, type TableRowSelectionBase, type TableRowSelectionCheckbox, type TableRowSelectionRadio, type TableScroll, type TableSelectionMode, type TableSize, } from '@mezzanine-ui/core/table';
|
|
2
|
+
export { default, type TableBaseProps, type TableResizableProps, type TableNonResizableProps, type TableVirtualizedProps, type TableNonVirtualizedProps, type TableProps, } from './Table';
|
|
3
|
+
export { TableContext, TableDataContext, TableSuperContext, useTableContext, useTableDataContext, useTableSuperContext, type TableResizedColumnState, type TableContextValue, type TableDataContextValue, type TableDraggableState, type TableHighlightState, type TableExpansionState, type TableSelectionState, type TableSortingState, } from './TableContext';
|
|
4
|
+
export { type UpdateDataSourceOptions, type UseTableDataSourceOptions, type TableTransitionState, } from './hooks';
|
|
5
5
|
export * from './hooks';
|
|
6
6
|
export * from './components';
|
|
7
7
|
export * from './utils';
|
package/Table/index.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
export { tableClasses as classes, getCellAlignClass,
|
|
1
|
+
export { TABLE_ACTIONS_KEY, tableClasses as classes, getCellAlignClass, getRowKey } from '@mezzanine-ui/core/table';
|
|
2
2
|
export { Table as default } from './Table.js';
|
|
3
|
-
export { TableContext, TableDataContext, useTableContext, useTableDataContext } from './TableContext.js';
|
|
3
|
+
export { TableContext, TableDataContext, TableSuperContext, useTableContext, useTableDataContext, useTableSuperContext } from './TableContext.js';
|
|
4
4
|
export { useTableSorting } from './hooks/useTableSorting.js';
|
|
5
5
|
export { useTableSelection } from './hooks/useTableSelection.js';
|
|
6
|
-
export {
|
|
6
|
+
export { useTableResizedColumns } from './hooks/useTableResizedColumns.js';
|
|
7
7
|
export { useTableExpansion } from './hooks/useTableExpansion.js';
|
|
8
8
|
export { useTableFixedOffsets } from './hooks/useTableFixedOffsets.js';
|
|
9
9
|
export { useTableScroll } from './hooks/useTableScroll.js';
|
|
10
10
|
export { useTableVirtualization } from './hooks/useTableVirtualization.js';
|
|
11
11
|
export { useTableDataSource } from './hooks/useTableDataSource.js';
|
|
12
|
+
export { TableActionsCell } from './components/TableActionsCell.js';
|
|
12
13
|
export { TableBody } from './components/TableBody.js';
|
|
13
14
|
export { TableCell } from './components/TableCell.js';
|
|
14
15
|
export { TableColGroup } from './components/TableColGroup.js';
|
|
@@ -19,4 +20,5 @@ export { TablePagination } from './components/TablePagination.js';
|
|
|
19
20
|
export { TableResizeHandle } from './components/TableResizeHandle.js';
|
|
20
21
|
export { TableRow } from './components/TableRow.js';
|
|
21
22
|
export { TableSelectionCell } from './components/TableSelectionCell.js';
|
|
23
|
+
export { calculateColumnWidths, clampWidth } from './utils/calculateColumnWidths.js';
|
|
22
24
|
export { useTableRowSelection } from './utils/useTableRowSelection.js';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { TableColumn } from '@mezzanine-ui/core/table';
|
|
2
|
+
/**
|
|
3
|
+
* Check if width calculation should be applied.
|
|
4
|
+
* Only calculate explicit widths for root tables (not nested).
|
|
5
|
+
* Nested tables should let columns use natural CSS behavior.
|
|
6
|
+
*/
|
|
7
|
+
export declare function shouldCalculateWidths(isNestedTable: boolean, containerWidth: number | undefined): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Clamp a width value between min and max bounds
|
|
10
|
+
*/
|
|
11
|
+
export declare function clampWidth(width: number, minWidth?: number, maxWidth?: number): number;
|
|
12
|
+
export interface CalculateColumnWidthsOptions {
|
|
13
|
+
/** Action columns (drag handle, selection, expansion) total width */
|
|
14
|
+
actionColumnsWidth: number;
|
|
15
|
+
/** All data columns */
|
|
16
|
+
columns: TableColumn[];
|
|
17
|
+
/** Container width */
|
|
18
|
+
containerWidth: number;
|
|
19
|
+
/** Get resized column width by key */
|
|
20
|
+
getResizedColumnWidth?: (key: string) => number | undefined;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Calculate the resolved width for each column.
|
|
24
|
+
* - Columns with explicit width use that value
|
|
25
|
+
* - Columns without width share the remaining space equally (simulating flex: 1)
|
|
26
|
+
* - All widths are clamped to minWidth/maxWidth if specified
|
|
27
|
+
*/
|
|
28
|
+
export declare function calculateColumnWidths({ actionColumnsWidth, columns, containerWidth, getResizedColumnWidth, }: CalculateColumnWidthsOptions): Map<string, number>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check if width calculation should be applied.
|
|
3
|
+
* Only calculate explicit widths for root tables (not nested).
|
|
4
|
+
* Nested tables should let columns use natural CSS behavior.
|
|
5
|
+
*/
|
|
6
|
+
function shouldCalculateWidths(isNestedTable, containerWidth) {
|
|
7
|
+
// Don't calculate widths for nested tables - they inherit parent's context
|
|
8
|
+
// and should use natural CSS column sizing
|
|
9
|
+
if (isNestedTable) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
// Don't calculate if container width is not available
|
|
13
|
+
if (!containerWidth || containerWidth <= 0) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Clamp a width value between min and max bounds
|
|
20
|
+
*/
|
|
21
|
+
function clampWidth(width, minWidth, maxWidth) {
|
|
22
|
+
let result = width;
|
|
23
|
+
if (minWidth !== undefined && result < minWidth) {
|
|
24
|
+
result = minWidth;
|
|
25
|
+
}
|
|
26
|
+
if (maxWidth !== undefined && result > maxWidth) {
|
|
27
|
+
result = maxWidth;
|
|
28
|
+
}
|
|
29
|
+
return result;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Calculate the resolved width for each column.
|
|
33
|
+
* - Columns with explicit width use that value
|
|
34
|
+
* - Columns without width share the remaining space equally (simulating flex: 1)
|
|
35
|
+
* - All widths are clamped to minWidth/maxWidth if specified
|
|
36
|
+
*/
|
|
37
|
+
function calculateColumnWidths({ actionColumnsWidth, columns, containerWidth, getResizedColumnWidth, }) {
|
|
38
|
+
const widthMap = new Map();
|
|
39
|
+
// If container width is not available yet, return empty map
|
|
40
|
+
if (containerWidth <= 0) {
|
|
41
|
+
return widthMap;
|
|
42
|
+
}
|
|
43
|
+
// Available width for data columns
|
|
44
|
+
const availableWidth = containerWidth - actionColumnsWidth;
|
|
45
|
+
if (availableWidth <= 0) {
|
|
46
|
+
return widthMap;
|
|
47
|
+
}
|
|
48
|
+
// First pass: identify columns with explicit width and calculate total fixed width
|
|
49
|
+
let totalFixedWidth = 0;
|
|
50
|
+
const flexColumns = [];
|
|
51
|
+
columns.forEach((column) => {
|
|
52
|
+
const resizedWidth = getResizedColumnWidth === null || getResizedColumnWidth === void 0 ? void 0 : getResizedColumnWidth(column.key);
|
|
53
|
+
if (resizedWidth !== undefined) {
|
|
54
|
+
// Column has been resized, use that width
|
|
55
|
+
widthMap.set(column.key, resizedWidth);
|
|
56
|
+
totalFixedWidth += resizedWidth;
|
|
57
|
+
}
|
|
58
|
+
else if (column.width !== undefined) {
|
|
59
|
+
// Column has explicit width
|
|
60
|
+
const width = clampWidth(column.width, column.minWidth, column.maxWidth);
|
|
61
|
+
widthMap.set(column.key, width);
|
|
62
|
+
totalFixedWidth += width;
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
// Column needs flex width calculation
|
|
66
|
+
flexColumns.push(column);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
// Second pass: distribute remaining width to flex columns
|
|
70
|
+
if (flexColumns.length > 0) {
|
|
71
|
+
const averageWidth = (availableWidth - totalFixedWidth) / flexColumns.length;
|
|
72
|
+
flexColumns.forEach((column) => {
|
|
73
|
+
const clampedWidth = clampWidth(averageWidth, column.minWidth, column.maxWidth);
|
|
74
|
+
widthMap.set(column.key, clampedWidth);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
return widthMap;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export { calculateColumnWidths, clampWidth, shouldCalculateWidths };
|
package/Table/utils/index.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
export type { CalculateColumnWidthsOptions } from './calculateColumnWidths';
|
|
2
|
+
export { calculateColumnWidths, clampWidth } from './calculateColumnWidths';
|
|
1
3
|
export type { UseTableRowSelectionProps } from './useTableRowSelection';
|
|
2
4
|
export { useTableRowSelection } from './useTableRowSelection';
|
package/Table/utils/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TableDataSource,
|
|
1
|
+
import { TableDataSource, TableRowSelectionCheckbox } from '@mezzanine-ui/core/table';
|
|
2
2
|
export interface UseTableRowSelectionProps<T extends TableDataSource> {
|
|
3
3
|
getSubData: (record: T) => T[] | undefined;
|
|
4
4
|
}
|
|
@@ -6,13 +6,13 @@ export interface UseTableRowSelectionProps<T extends TableDataSource> {
|
|
|
6
6
|
* Custom hook for users to manage row selection state in a table with expandable rows.
|
|
7
7
|
*/
|
|
8
8
|
export declare function useTableRowSelection<T extends TableDataSource = TableDataSource>(props: UseTableRowSelectionProps<T>): {
|
|
9
|
-
parentSelectedKeys:
|
|
10
|
-
parentOnChange: (selectedRowKeys:
|
|
9
|
+
parentSelectedKeys: string[];
|
|
10
|
+
parentOnChange: (selectedRowKeys: string[], selectedRow: T | null, selectedRows: T[]) => void;
|
|
11
11
|
parentGetCheckboxProps: (record: T) => {
|
|
12
12
|
indeterminate?: boolean;
|
|
13
13
|
selected?: boolean;
|
|
14
14
|
};
|
|
15
|
-
getChildOnChange: (record: T) =>
|
|
16
|
-
getChildSelectedRowKeys: (record: T) =>
|
|
15
|
+
getChildOnChange: (record: T) => TableRowSelectionCheckbox<T>["onChange"];
|
|
16
|
+
getChildSelectedRowKeys: (record: T) => string[];
|
|
17
17
|
totalSelectionCount: number;
|
|
18
18
|
};
|
|
@@ -8,15 +8,23 @@ function useTableRowSelection(props) {
|
|
|
8
8
|
const { getSubData } = props;
|
|
9
9
|
const [selectedKeys, setSelectedKeys] = useState([]);
|
|
10
10
|
const parentSelectedKeys = useMemo(() => selectedKeys.map((item) => item.key), [selectedKeys]);
|
|
11
|
-
const parentOnChange = useCallback((_,
|
|
12
|
-
setSelectedKeys(selectedRows.map((row) => {
|
|
11
|
+
const parentOnChange = useCallback((_, selectedRow, selectedRows) => {
|
|
12
|
+
setSelectedKeys((prev) => selectedRows.map((row) => {
|
|
13
|
+
const isCurrentSelectedRow = row.key === (selectedRow === null || selectedRow === void 0 ? void 0 : selectedRow.key);
|
|
13
14
|
const subData = getSubData(row);
|
|
14
15
|
const pk = getRowKey(row);
|
|
16
|
+
const subKeys = (() => {
|
|
17
|
+
var _a;
|
|
18
|
+
if (isCurrentSelectedRow) {
|
|
19
|
+
return (subData === null || subData === void 0 ? void 0 : subData.length)
|
|
20
|
+
? subData.map((subRow) => getRowKey(subRow))
|
|
21
|
+
: undefined;
|
|
22
|
+
}
|
|
23
|
+
return (_a = prev.find((item) => item.key === pk)) === null || _a === void 0 ? void 0 : _a.subKeys;
|
|
24
|
+
})();
|
|
15
25
|
return {
|
|
16
26
|
key: pk,
|
|
17
|
-
subKeys
|
|
18
|
-
? subData.map((subRow) => getRowKey(subRow))
|
|
19
|
-
: undefined,
|
|
27
|
+
subKeys,
|
|
20
28
|
};
|
|
21
29
|
}));
|
|
22
30
|
}, [getSubData]);
|
|
@@ -49,7 +57,7 @@ function useTableRowSelection(props) {
|
|
|
49
57
|
const selectedItem = selectedKeys.find((item) => item.key === getRowKey(record));
|
|
50
58
|
return (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.subKeys) || [];
|
|
51
59
|
}, [selectedKeys]);
|
|
52
|
-
const totalSelectionCount = useMemo(() => selectedKeys.reduce((acc, item) => { var _a; return acc + (((_a = item.subKeys) === null || _a === void 0 ? void 0 : _a.length)
|
|
60
|
+
const totalSelectionCount = useMemo(() => selectedKeys.reduce((acc, item) => { var _a, _b; return acc + ((_b = (_a = item.subKeys) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) + 1; }, 0), [selectedKeys]);
|
|
53
61
|
return {
|
|
54
62
|
parentSelectedKeys,
|
|
55
63
|
parentOnChange,
|
package/Tag/TagGroup.d.ts
CHANGED
|
@@ -6,6 +6,9 @@ import { TransitionImplementationChildProps } from '../Transition';
|
|
|
6
6
|
type TagElement = ReactElement<TagProps & TransitionImplementationChildProps, typeof Tag>;
|
|
7
7
|
type OverflowCounterTagElement = ReactElement<OverflowCounterTagProps & TransitionImplementationChildProps, typeof OverflowCounterTag>;
|
|
8
8
|
type TagGroupChild = TagElement | OverflowCounterTagElement;
|
|
9
|
+
export type TagGroupProps = Omit<NativeElementPropsWithoutKeyAndRef<'div'>, 'children'> & {
|
|
10
|
+
children: TagGroupChild | TagGroupChild[];
|
|
11
|
+
};
|
|
9
12
|
declare const TagGroup: import("react").ForwardRefExoticComponent<Omit<NativeElementPropsWithoutKeyAndRef<"div">, "children"> & {
|
|
10
13
|
children: TagGroupChild | TagGroupChild[];
|
|
11
14
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
package/Tag/index.d.ts
CHANGED
package/Tag/index.js
CHANGED
|
@@ -95,7 +95,7 @@ const UploadPictureCard = forwardRef(function UploadPictureCard(props, ref) {
|
|
|
95
95
|
return (jsx("div", { className: cx(uploadPictureCardClasses.host, uploadPictureCardClasses.size(size), disabled && uploadPictureCardClasses.disabled, className), "aria-disabled": disabled, ref: ref, role: "group", tabIndex: disabled ? -1 : 0, ...rest, children: jsxs("div", { className: uploadPictureCardClasses.container, children: [isImage && imageUrl && status !== 'error' && (jsx("img", { alt: fileName, src: imageUrl, style: {
|
|
96
96
|
objectFit: imageFit,
|
|
97
97
|
objectPosition: 'center',
|
|
98
|
-
} })), status === 'done' && size !== 'minor' && !isImage && (jsxs("div", { className: uploadPictureCardClasses.content, children: [jsx(Icon, { icon: FileIcon, color: "brand", size: 16 }), jsx(Typography, { className: uploadPictureCardClasses.name, ellipsis: true, children: fileName })] })), status === 'error' && size !== 'minor' && (jsxs("div", { className: uploadPictureCardClasses.errorMessage, role: "alert", "aria-live": "polite", children: [jsx(Icon, { icon: errorIconContent, color: "error", size: 16 }), jsx(Typography, { className: uploadPictureCardClasses.errorMessageText, children: errorMessageContent })] })), jsxs("div", { className: cx(uploadPictureCardClasses.actions, uploadPictureCardClasses.actionsStatus(status)), children: [status === 'loading' && size !== 'minor' && (jsxs(Fragment, { children: [jsx(ClearActions, { type: "embedded", variant: "contrast", onClick: onDelete, className: uploadPictureCardClasses.clearActionsIcon, "aria-label": labels.cancelUpload }), jsx("div", { className: uploadPictureCardClasses.loadingIcon, "aria-label": labels.uploading, children: jsx(Icon, { icon: SpinnerIcon, color: "fixed-light", spin: true, size: 32 }) })] })), status === 'done' && size !== 'minor' && (jsx(Fragment, { children: jsx("div", { className: uploadPictureCardClasses.tools, children: jsxs("div", { className: uploadPictureCardClasses.toolsContent, children: [jsx(Button, { variant: "base-secondary", size: "minor", icon:
|
|
98
|
+
} })), status === 'done' && size !== 'minor' && !isImage && (jsxs("div", { className: uploadPictureCardClasses.content, children: [jsx(Icon, { icon: FileIcon, color: "brand", size: 16 }), jsx(Typography, { className: uploadPictureCardClasses.name, ellipsis: true, children: fileName })] })), status === 'error' && size !== 'minor' && (jsxs("div", { className: uploadPictureCardClasses.errorMessage, role: "alert", "aria-live": "polite", children: [jsx(Icon, { icon: errorIconContent, color: "error", size: 16 }), jsx(Typography, { className: uploadPictureCardClasses.errorMessageText, children: errorMessageContent })] })), jsxs("div", { className: cx(uploadPictureCardClasses.actions, uploadPictureCardClasses.actionsStatus(status)), children: [status === 'loading' && size !== 'minor' && (jsxs(Fragment, { children: [jsx(ClearActions, { type: "embedded", variant: "contrast", onClick: onDelete, className: uploadPictureCardClasses.clearActionsIcon, "aria-label": labels.cancelUpload }), jsx("div", { className: uploadPictureCardClasses.loadingIcon, "aria-label": labels.uploading, children: jsx(Icon, { icon: SpinnerIcon, color: "fixed-light", spin: true, size: 32 }) })] })), status === 'done' && size !== 'minor' && (jsx(Fragment, { children: jsx("div", { className: uploadPictureCardClasses.tools, children: jsxs("div", { className: uploadPictureCardClasses.toolsContent, children: [jsx(Button, { variant: "base-secondary", size: "minor", icon: ZoomInIcon, iconType: "icon-only", onClick: onZoomIn, "aria-label": labels.zoomIn }), jsx(Button, { variant: "base-secondary", size: "minor", iconType: "icon-only", icon: DownloadIcon, onClick: onDownload, "aria-label": labels.download }), jsx(Button, { variant: "base-secondary", size: "minor", iconType: "icon-only", icon: TrashIcon, onClick: onDelete, "aria-label": labels.delete })] }) }) })), status === 'error' && size !== 'minor' && (jsx(Fragment, { children: jsx("div", { className: uploadPictureCardClasses.tools, children: jsxs("div", { className: uploadPictureCardClasses.toolsContent, children: [jsx(Button, { variant: "base-secondary", size: "minor", iconType: "icon-only", icon: ResetIcon, onClick: onReload, "aria-label": labels.reload }), jsx(Button, { variant: "base-secondary", size: "minor", iconType: "icon-only", icon: TrashIcon, onClick: onDelete, "aria-label": labels.delete })] }) }) })), size === 'minor' && (jsx(Icon, { icon: ZoomInIcon, color: "fixed-light", size: 24 }))] })] }) }));
|
|
99
99
|
});
|
|
100
100
|
|
|
101
101
|
export { UploadPictureCard as default };
|
package/index.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
export * from './utils/array-move';
|
|
2
2
|
export * from './utils/composeRefs';
|
|
3
3
|
export * from './utils/cx';
|
|
4
|
+
export * from './utils/format-number-with-commas';
|
|
4
5
|
export * from './utils/general';
|
|
5
6
|
export * from './utils/get-css-variable-value';
|
|
6
7
|
export * from './utils/get-scrollbar-width';
|
|
7
8
|
export * from './utils/getElement';
|
|
8
9
|
export * from './utils/jsx-types';
|
|
10
|
+
export * from './utils/parse-number-with-commas';
|
|
9
11
|
export * from './hooks/useClickAway';
|
|
10
12
|
export * from './hooks/useComposeRefs';
|
|
11
13
|
export * from './hooks/useDocumentEscapeKeyDown';
|
|
@@ -48,20 +50,18 @@ export { default as Breadcrumb } from './Breadcrumb';
|
|
|
48
50
|
export type { BreadcrumbItemProps, BreadcrumbProps } from './Breadcrumb';
|
|
49
51
|
export { default as Drawer } from './Drawer';
|
|
50
52
|
export type { DrawerPlacement, DrawerProps } from './Drawer';
|
|
51
|
-
export { default as Dropdown } from './Dropdown';
|
|
52
|
-
export type { DropdownProps } from './Dropdown';
|
|
53
53
|
export { default as Menu, MenuDivider, MenuItem, MenuItemGroup } from './Menu';
|
|
54
54
|
export type { MenuDividerProps, MenuItemGroupProps, MenuItemProps, MenuProps, MenuSize, } from './Menu';
|
|
55
|
-
export { default as Navigation } from './Navigation';
|
|
56
|
-
export type { NavigationChild, NavigationChildren,
|
|
55
|
+
export { default as Navigation, NavigationFooter, NavigationHeader, NavigationIconButton, NavigationOption, NavigationOptionCategory, NavigationUserMenu, } from './Navigation';
|
|
56
|
+
export type { NavigationChild, NavigationChildren, NavigationFooterProps, NavigationHeaderProps, NavigationIconButtonProps, NavigationOptionCategoryProps, NavigationOptionProps, NavigationProps, NavigationUserMenuProps, } from './Navigation';
|
|
57
57
|
export { default as PageFooter } from './PageFooter';
|
|
58
58
|
export type { PageFooterProps } from './PageFooter';
|
|
59
59
|
export { default as PageHeader } from './PageHeader';
|
|
60
60
|
export type { PageHeaderProps } from './PageHeader';
|
|
61
61
|
export { Step, default as Stepper, useStepper } from './Stepper';
|
|
62
62
|
export type { StepperProps, StepProps } from './Stepper';
|
|
63
|
-
export {
|
|
64
|
-
export type { TabItemProps,
|
|
63
|
+
export { default as Tab, TabItem } from './Tab';
|
|
64
|
+
export type { TabItemProps, TabProps, TabsChild } from './Tab';
|
|
65
65
|
/**
|
|
66
66
|
* Data Display
|
|
67
67
|
*/
|
|
@@ -71,18 +71,17 @@ export { default as Badge, BadgeContainer } from './Badge';
|
|
|
71
71
|
export type { BadgeProps } from './Badge';
|
|
72
72
|
export { default as Card, CardActions } from './Card';
|
|
73
73
|
export type { CardActionsProps, CardProps } from './Card';
|
|
74
|
+
export { Description, DescriptionContent, DescriptionGroup, DescriptionTitle, } from './Description';
|
|
75
|
+
export type { DescriptionContentProps, DescriptionGroupProps, DescriptionProps, DescriptionTitleProps, } from './Description';
|
|
74
76
|
export { default as Empty } from './Empty';
|
|
75
77
|
export type { EmptyProps } from './Empty';
|
|
76
78
|
export { OverflowCounterTag } from './OverflowTooltip';
|
|
77
79
|
export type { OverflowCounterTagProps } from './OverflowTooltip';
|
|
78
80
|
export { default as Pagination, PaginationItem, PaginationJumper, PaginationPageSize, usePagination, } from './Pagination';
|
|
79
81
|
export type { PaginationItemProps, PaginationItemType, PaginationJumperProps, PaginationPageSizeProps, PaginationProps, } from './Pagination';
|
|
80
|
-
export { default as Table, TableContext, TableDataContext, useTableContext, useTableDataContext,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
export type { TableProps, TableContextValue, TableDataContextValue, TableSortingState, TableSelectionState, TableExpansionState, TableColumnState, TableDraggableState, TableSize, UseTableRowSelectionProps, } from './Table';
|
|
84
|
-
export { default as Tag } from './Tag';
|
|
85
|
-
export type { TagProps, TagSize } from './Tag';
|
|
82
|
+
export { getCellAlignClass, getRowKey, default as Table, TableContext, TableDataContext, TableSuperContext, useTableContext, useTableDataContext, useTableDataSource, useTableRowSelection, useTableSuperContext, type ColumnAlign, type FixedType, type HighlightMode, type SortOrder, type TableActionItem, type TableActions, type TableActionsBase, type TableActionsWithMinWidth, type TableBaseProps, type TableBulkActions, type TableBulkGeneralAction, type TableBulkOverflowAction, type TableColumn, type TableColumnBase, type TableColumnBaseWithMinWidthRequired, type TableColumnTitleMenu, type TableColumnWithDataIndex, type TableColumnWithDataIndexAndMinWidth, type TableColumnWithMinWidth, type TableColumnWithRender, type TableColumnWithRenderAndMinWidth, type TableContextValue, type TableDataContextValue, type TableDataSource, type TableDataSourceWithId, type TableDataSourceWithKey, type TableDraggable, type TableDraggableState, type TableExpandable, type TableExpansionState, type TableNonVirtualizedProps, type TableProps, type TableRecord, type TableResizedColumnState, type TableRowSelection, type TableRowSelectionBase, type TableRowSelectionCheckbox, type TableRowSelectionRadio, type TableScroll, type TableSelectionMode, type TableSelectionState, type TableSize, type TableSortingState, type TableTransitionState, type TableVirtualizedProps, type UpdateDataSourceOptions, type UseTableDataSourceOptions, } from './Table';
|
|
83
|
+
export { default as Tag, TagGroup } from './Tag';
|
|
84
|
+
export type { TagGroupProps, TagProps, TagSize } from './Tag';
|
|
86
85
|
export { default as Tooltip } from './Tooltip';
|
|
87
86
|
export type { TooltipProps } from './Tooltip';
|
|
88
87
|
export { getTreeNodeEntities, toggleValue, toggleValueWithStatusControl, traverseTree, default as Tree, TreeNode, TreeNodeList, uniqueArray, useTreeExpandedValue, } from './Tree';
|
|
@@ -90,6 +89,8 @@ export type { GetTreeNodeEntitiesProps, TreeExpandControl, TreeNodeData, TreeNod
|
|
|
90
89
|
/**
|
|
91
90
|
* Data Entry
|
|
92
91
|
*/
|
|
92
|
+
export { default as AutoComplete } from './AutoComplete';
|
|
93
|
+
export type { AutoCompleteBaseProps, AutoCompleteMultipleProps, AutoCompleteProps, AutoCompleteSingleProps, } from './AutoComplete';
|
|
93
94
|
export { CheckAll, default as Checkbox, CheckboxGroup } from './Checkbox';
|
|
94
95
|
export type { CheckAllProps, CheckboxGroupChangeEvent, CheckboxGroupChangeEventTarget, CheckboxGroupLayout, CheckboxGroupOption, CheckboxGroupProps, CheckboxProps, } from './Checkbox';
|
|
95
96
|
export { default as DatePicker, DatePickerCalendar } from './DatePicker';
|
|
@@ -106,8 +107,8 @@ export { PickerTrigger, RangePickerTrigger, usePickerDocumentEventClose, usePick
|
|
|
106
107
|
export type { PickerTriggerProps, RangePickerTriggerProps, UsePickerDocumentEventCloseProps, UsePickerValueProps, } from './Picker';
|
|
107
108
|
export { default as Radio, RadioGroup } from './Radio';
|
|
108
109
|
export type { RadioGroupOrientation, RadioGroupProps, RadioProps, RadioSize, } from './Radio';
|
|
109
|
-
export {
|
|
110
|
-
export type {
|
|
110
|
+
export { Option, OptionGroup, default as Select, SelectControlContext, SelectTrigger, SelectTriggerTags, TreeSelect, } from './Select';
|
|
111
|
+
export type { OptionGroupProps, OptionProps, SelectControl, SelectProps, SelectTriggerInputProps, SelectTriggerProps, SelectTriggerTagsProps, SelectValue, TreeSelectOption, TreeSelectProps, } from './Select';
|
|
111
112
|
export { default as Selection } from './Selection';
|
|
112
113
|
export type { SelectionProps, SelectionPropsBase } from './Selection';
|
|
113
114
|
export { default as Slider, useSlider } from './Slider';
|
|
@@ -131,10 +132,10 @@ export { default as ConfirmActions } from './ConfirmActions';
|
|
|
131
132
|
export type { ConfirmActionsProps } from './ConfirmActions';
|
|
132
133
|
export { default as Message } from './Message';
|
|
133
134
|
export type { MessageData, MessageSeverity, MessageType } from './Message';
|
|
134
|
-
export { default as Modal,
|
|
135
|
-
export type {
|
|
136
|
-
export { default as
|
|
137
|
-
export type { NotificationData, NotificationSeverity } from './
|
|
135
|
+
export { default as Modal, ModalBodyForVerification, ModalFooter, ModalHeader, useModalContainer, } from './Modal';
|
|
136
|
+
export type { ModalBodyForVerificationProps, ModalFooterProps, ModalHeaderProps, ModalProps, ModalSize, ModalStatusType, } from './Modal';
|
|
137
|
+
export { default as NotificationCenter } from './NotificationCenter';
|
|
138
|
+
export type { NotificationData, NotificationSeverity, } from './NotificationCenter';
|
|
138
139
|
export { default as Popconfirm } from './Popconfirm';
|
|
139
140
|
export type { PopconfirmProps } from './Popconfirm';
|
|
140
141
|
export { default as Progress } from './Progress';
|
|
@@ -150,8 +151,8 @@ export type { ResultStateActions, ResultStateProps } from './ResultState';
|
|
|
150
151
|
/**
|
|
151
152
|
* Others
|
|
152
153
|
*/
|
|
153
|
-
export { default as Anchor } from './Anchor';
|
|
154
|
-
export type { AnchorProps } from './Anchor';
|
|
154
|
+
export { default as Anchor, AnchorGroup } from './Anchor';
|
|
155
|
+
export type { AnchorGroupProps, AnchorProps } from './Anchor';
|
|
155
156
|
export { default as Backdrop } from './Backdrop';
|
|
156
157
|
export type { BackdropProps } from './Backdrop';
|
|
157
158
|
export { default as AlertBanner } from './AlertBanner';
|
|
@@ -175,3 +176,18 @@ export type { CollapseProps, FadeProps, RotateProps, ScaleProps, SlideFadeDirect
|
|
|
175
176
|
/** Context */
|
|
176
177
|
export { default as ConfigProvider, MezzanineConfig } from './Provider';
|
|
177
178
|
export type { ConfigProviderProps, MezzanineConfigContext } from './Provider';
|
|
179
|
+
/**
|
|
180
|
+
* internal
|
|
181
|
+
* only export dropdown related components
|
|
182
|
+
*/
|
|
183
|
+
export { default as Dropdown } from './Dropdown';
|
|
184
|
+
export type { DropdownProps } from './Dropdown';
|
|
185
|
+
export { default as DropdownAction } from './Dropdown/DropdownAction';
|
|
186
|
+
export type { DropdownActionProps } from './Dropdown/DropdownAction';
|
|
187
|
+
export { default as DropdownItem } from './Dropdown/DropdownItem';
|
|
188
|
+
export type { DropdownItemProps } from './Dropdown/DropdownItem';
|
|
189
|
+
export { default as DropdownItemCard } from './Dropdown/DropdownItemCard';
|
|
190
|
+
export type { DropdownItemCardProps } from './Dropdown/DropdownItemCard';
|
|
191
|
+
export { default as DropdownStatus } from './Dropdown/DropdownStatus';
|
|
192
|
+
export type { DropdownStatusProps } from './Dropdown/DropdownStatus';
|
|
193
|
+
export type { DropdownCheckPosition, DropdownInputPosition, DropdownItemLevel, DropdownItemSharedProps, DropdownItemValidate, DropdownMode, DropdownOption, DropdownOptionFlat, DropdownOptionGrouped, DropdownOptionsByType, DropdownOptionTree, DropdownStatus as DropdownStatusType, DropdownType, } from '@mezzanine-ui/core/dropdown';
|