@mezzanine-ui/react 0.9.2 → 0.10.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/Accordion/Accordion.js +5 -4
- package/Accordion/AccordionDetails.js +2 -2
- package/Accordion/AccordionSummary.js +3 -4
- package/Alert/Alert.js +1 -3
- package/AppBar/AppBar.js +1 -1
- package/AppBar/AppBarBrand.d.ts +1 -1
- package/AppBar/AppBarBrand.js +1 -1
- package/AppBar/AppBarMain.d.ts +1 -1
- package/AppBar/AppBarMain.js +1 -1
- package/AppBar/AppBarSupport.d.ts +1 -1
- package/AppBar/AppBarSupport.js +1 -1
- package/Badge/Badge.js +2 -2
- package/Badge/BadgeContainer.d.ts +1 -1
- package/Badge/BadgeContainer.js +1 -1
- package/Button/Button.d.ts +2 -2
- package/Button/Button.js +3 -3
- package/Button/ButtonGroup.js +3 -3
- package/Button/IconButton.d.ts +3 -3
- package/Button/IconButton.js +1 -1
- package/Calendar/Calendar.js +9 -10
- package/Calendar/CalendarCell.js +2 -2
- package/Calendar/CalendarContext.d.ts +3 -3
- package/Calendar/CalendarContext.js +20 -12
- package/Calendar/CalendarControls.js +3 -3
- package/Calendar/CalendarDayOfWeek.js +1 -1
- package/Calendar/CalendarDays.js +4 -5
- package/Calendar/CalendarMonths.js +4 -4
- package/Calendar/CalendarWeeks.js +4 -5
- package/Calendar/CalendarYears.js +4 -4
- package/Calendar/useCalendarControls.d.ts +2 -3
- package/Card/Card.js +5 -5
- package/Card/CardActions.js +1 -2
- package/Checkbox/CheckAll.js +2 -2
- package/Checkbox/Checkbox.js +2 -2
- package/Checkbox/CheckboxGroup.js +2 -2
- package/ConfirmActions/ConfirmActions.js +1 -2
- package/DatePicker/DatePicker.js +2 -3
- package/DatePicker/DatePickerCalendar.js +1 -1
- package/DateRangePicker/DateRangePicker.js +2 -3
- package/DateRangePicker/DateRangePickerCalendar.js +3 -4
- package/DateRangePicker/useDateRangeCalendarControls.d.ts +1 -2
- package/DateRangePicker/useDateRangePickerValue.d.ts +12 -13
- package/DateTimePicker/DateTimePicker.js +2 -3
- package/DateTimePicker/DateTimePickerPanel.js +1 -3
- package/Drawer/Drawer.js +1 -1
- package/Dropdown/Dropdown.js +2 -2
- package/Empty/Empty.js +3 -4
- package/Form/FormField.js +2 -2
- package/Form/FormLabel.js +1 -2
- package/Form/FormMessage.d.ts +1 -1
- package/Form/FormMessage.js +1 -1
- package/Form/useAutoCompleteValueControl.d.ts +30 -11
- package/Form/useAutoCompleteValueControl.js +71 -31
- package/Form/useInputWithTagsModeValue.js +2 -1
- package/Form/useSelectValueControl.d.ts +1 -1
- package/Icon/Icon.js +2 -2
- package/Input/Input.js +2 -3
- package/Loading/Loading.js +4 -5
- package/Menu/Menu.js +1 -1
- package/Menu/MenuDivider.d.ts +1 -1
- package/Menu/MenuDivider.js +1 -1
- package/Menu/MenuItem.js +2 -3
- package/Menu/MenuItemGroup.js +1 -2
- package/Message/Message.js +2 -3
- package/Modal/Modal.js +2 -2
- package/Modal/ModalActions.js +1 -1
- package/Modal/ModalBody.d.ts +1 -1
- package/Modal/ModalBody.js +1 -1
- package/Modal/ModalFooter.d.ts +1 -1
- package/Modal/ModalFooter.js +1 -1
- package/Modal/ModalHeader.js +2 -3
- package/Modal/useModalContainer.js +1 -1
- package/Navigation/Navigation.js +2 -2
- package/Navigation/NavigationItem.js +1 -1
- package/Navigation/NavigationSubMenu.js +3 -5
- package/Notification/Notification.js +2 -7
- package/Notifier/NotifierManager.js +1 -1
- package/Notifier/createNotifier.js +1 -1
- package/Overlay/Overlay.js +3 -3
- package/PageFooter/PageFooter.js +1 -2
- package/Pagination/Pagination.js +2 -3
- package/Pagination/PaginationItem.js +4 -4
- package/Pagination/PaginationJumper.js +2 -4
- package/Picker/PickerTrigger.js +1 -1
- package/Picker/RangePickerTrigger.js +1 -3
- package/Picker/usePickerInputValue.d.ts +2 -2
- package/Picker/usePickerValue.d.ts +6 -7
- package/Picker/useRangePickerValue.d.ts +9 -10
- package/Popconfirm/Popconfirm.js +1 -1
- package/Popover/Popover.js +2 -3
- package/Popper/Popper.js +2 -2
- package/Portal/Portal.js +1 -1
- package/Progress/Progress.js +5 -7
- package/Radio/Radio.js +2 -2
- package/Radio/RadioGroup.js +2 -2
- package/Select/AutoComplete.d.ts +40 -13
- package/Select/AutoComplete.js +37 -28
- package/Select/Option.js +2 -2
- package/Select/Select.d.ts +2 -50
- package/Select/Select.js +15 -49
- package/Select/SelectTrigger.d.ts +8 -1
- package/Select/SelectTrigger.js +8 -12
- package/Select/SelectTriggerTags.d.ts +19 -0
- package/Select/SelectTriggerTags.js +33 -0
- package/Select/TreeSelect.js +2 -3
- package/Select/index.d.ts +1 -0
- package/Select/index.js +1 -0
- package/Select/useSelectTriggerTags.d.ts +19 -0
- package/Select/useSelectTriggerTags.js +61 -0
- package/Skeleton/Skeleton.js +1 -1
- package/Slider/Slider.d.ts +1 -1
- package/Slider/Slider.js +7 -11
- package/Stepper/Step.js +2 -2
- package/Stepper/Stepper.js +1 -1
- package/Switch/Switch.js +2 -3
- package/Table/Table.d.ts +1 -1
- package/Table/Table.js +3 -10
- package/Table/TableBody.js +2 -4
- package/Table/TableBodyRow.js +4 -7
- package/Table/TableCell.js +3 -3
- package/Table/TableExpandedTable.js +5 -6
- package/Table/TableHeader.d.ts +2 -1
- package/Table/TableHeader.js +3 -6
- package/Table/editable/TableEditRenderWrapper.js +2 -2
- package/Table/expandable/TableExpandable.js +2 -2
- package/Table/pagination/TablePagination.js +1 -2
- package/Table/refresh/TableRefresh.js +1 -1
- package/Table/rowSelection/TableRowSelection.js +5 -6
- package/Table/sorting/TableSortingIcon.js +2 -2
- package/Table/sorting/useTableSorting.d.ts +2 -2
- package/Table/useTableScroll.d.ts +178 -178
- package/Tabs/Tab.js +2 -2
- package/Tabs/TabPane.js +1 -1
- package/Tabs/Tabs.js +1 -3
- package/Tag/Tag.js +3 -4
- package/TextField/TextField.js +3 -3
- package/TextField/useTextFieldControl.d.ts +2 -2
- package/Textarea/Textarea.js +2 -3
- package/TimePanel/TimePanel.js +1 -4
- package/TimePanel/TimePanelAction.js +1 -1
- package/TimePanel/TimePanelColumn.js +2 -5
- package/TimePicker/TimePicker.js +2 -3
- package/TimePicker/TimePickerPanel.js +1 -1
- package/Tooltip/Tooltip.js +3 -3
- package/Transition/Collapse.js +3 -2
- package/Transition/Fade.js +2 -2
- package/Transition/Grow.js +3 -2
- package/Transition/SlideFade.js +2 -2
- package/Transition/Transition.js +2 -2
- package/Transition/Zoom.js +2 -2
- package/Tree/Tree.js +1 -1
- package/Tree/TreeNode.js +5 -7
- package/Tree/TreeNodeList.js +5 -4
- package/Tree/getTreeNodeEntities.js +6 -3
- package/Typography/Typography.d.ts +2 -2
- package/Typography/Typography.js +2 -2
- package/Upload/UploadButton.js +2 -2
- package/Upload/UploadInput.js +1 -1
- package/Upload/UploadPicture.js +1 -1
- package/Upload/UploadPictureBlock.js +2 -8
- package/Upload/UploadPictureWall.d.ts +1 -1
- package/Upload/UploadPictureWall.js +1 -2
- package/Upload/UploadPictureWallItem.js +1 -1
- package/Upload/UploadResult.js +2 -5
- package/_internal/InputCheck/InputCheck.js +2 -3
- package/_internal/InputCheck/InputCheckGroup.js +1 -1
- package/_internal/InputTriggerPopper/InputTriggerPopper.js +2 -2
- package/_internal/SlideFadeOverlay/SlideFadeOverlay.js +1 -1
- package/index.d.ts +1 -1
- package/index.js +1 -0
- package/package.json +3 -3
package/Table/TableBodyRow.js
CHANGED
|
@@ -27,17 +27,14 @@ const TableBodyRow = forwardRef(function TableBodyRow(props, ref) {
|
|
|
27
27
|
var _a, _b;
|
|
28
28
|
return ((_b = (_a = expanding === null || expanding === void 0 ? void 0 : expanding.expandedRowRender) === null || _a === void 0 ? void 0 : _a.call(expanding, rowData)) !== null && _b !== void 0 ? _b : null);
|
|
29
29
|
}, [expanding, rowData]);
|
|
30
|
-
return (jsxs(Fragment, { children: [jsxs("div",
|
|
30
|
+
return (jsxs(Fragment, { children: [jsxs("div", { ...rest, ref: ref, className: cx(tableClasses.bodyRow, {
|
|
31
31
|
[tableClasses.bodyRowHighlight]: selected || expanded,
|
|
32
|
-
}, className), role: "row"
|
|
33
|
-
expanding ? (jsx(TableExpandable, { expandable: isExpandable, expanded: expanded, role: "gridcell", setExpanded: setExpanded, onExpand: (status) => { var _a; return (_a = expanding.onExpand) === null || _a === void 0 ? void 0 : _a.call(expanding, rowData, status); } }, void 0)) : null,
|
|
34
|
-
(columns !== null && columns !== void 0 ? columns : []).map((column) => {
|
|
32
|
+
}, className), role: "row", children: [rowSelection ? (jsx(TableRowSelection, { role: "gridcell", rowKey: (rowData.key || rowData.id), setChecked: (status) => setSelected(status), showDropdownIcon: false })) : null, expanding ? (jsx(TableExpandable, { expandable: isExpandable, expanded: expanded, role: "gridcell", setExpanded: setExpanded, onExpand: (status) => { var _a; return (_a = expanding.onExpand) === null || _a === void 0 ? void 0 : _a.call(expanding, rowData, status); } })) : null, (columns !== null && columns !== void 0 ? columns : []).map((column) => {
|
|
35
33
|
var _a, _b, _c, _d;
|
|
36
34
|
const ellipsis = !!(get(rowData, column.dataIndex)) && ((_a = column.ellipsis) !== null && _a !== void 0 ? _a : true);
|
|
37
35
|
const tooltipTitle = ((_c = (_b = column.renderTooltipTitle) === null || _b === void 0 ? void 0 : _b.call(column, rowData)) !== null && _c !== void 0 ? _c : get(rowData, column.dataIndex));
|
|
38
|
-
return (jsx("div",
|
|
39
|
-
})] }),
|
|
40
|
-
renderedExpandedContent ? (jsx(Fragment$1, { children: typeof renderedExpandedContent === 'string' ? (jsx(AccordionDetails, Object.assign({ className: expanding.className, expanded: expanded }, { children: renderedExpandedContent }), void 0)) : (jsx(Fragment$1, { children: renderedExpandedContent.dataSource.length > 0 ? (jsx(AccordionDetails, Object.assign({ className: cx(expanding.className, tableClasses.bodyRowExpandedTableWrapper), expanded: expanded }, { children: jsx(TableExpandedTable, { renderedExpandedContent: renderedExpandedContent }, void 0) }), void 0)) : null }, void 0)) }, void 0)) : null] }, void 0));
|
|
36
|
+
return (jsx("div", { className: cx(tableClasses.bodyRowCellWrapper, column.bodyClassName), style: getColumnStyle(column), children: jsx(TableEditRenderWrapper, { ...column, rowData: rowData, children: jsx(TableCell, { ellipsis: ellipsis, forceShownTooltipWhenHovered: column.forceShownTooltipWhenHovered, style: getCellStyle(column), tooltipTitle: tooltipTitle, children: ((_d = column.render) === null || _d === void 0 ? void 0 : _d.call(column, column, rowData, rowIndex)) || get(rowData, column.dataIndex) }) }) }, `${column.dataIndex}-${column.title}`));
|
|
37
|
+
})] }), renderedExpandedContent ? (jsx(Fragment$1, { children: typeof renderedExpandedContent === 'string' ? (jsx(AccordionDetails, { className: expanding.className, expanded: expanded, children: renderedExpandedContent })) : (jsx(Fragment$1, { children: renderedExpandedContent.dataSource.length > 0 ? (jsx(AccordionDetails, { className: cx(expanding.className, tableClasses.bodyRowExpandedTableWrapper), expanded: expanded, children: jsx(TableExpandedTable, { renderedExpandedContent: renderedExpandedContent }) })) : null })) })) : null] }));
|
|
41
38
|
});
|
|
42
39
|
var TableBodyRow$1 = TableBodyRow;
|
|
43
40
|
|
package/Table/TableCell.js
CHANGED
|
@@ -7,9 +7,9 @@ import cx from 'clsx';
|
|
|
7
7
|
const TableCell = forwardRef(function TableCell(props, ref) {
|
|
8
8
|
const { children, className, ellipsis = true, forceShownTooltipWhenHovered = false, role = 'gridcell', tooltipTitle, ...rest } = props;
|
|
9
9
|
const ellipsisRef = useRef(null);
|
|
10
|
-
return (jsx("div",
|
|
10
|
+
return (jsx("div", { ref: ref, ...rest, className: cx(tableClasses.cell, className), role: role, children: ellipsis || forceShownTooltipWhenHovered ? (jsx(Tooltip, { title: `${tooltipTitle}`, options: {
|
|
11
11
|
placement: 'top-start',
|
|
12
|
-
}
|
|
12
|
+
}, children: ({ onMouseEnter, onMouseLeave }) => (jsx("div", { ref: ellipsisRef, className: ellipsis ? tableClasses.cellEllipsis : '', onMouseEnter: (e) => {
|
|
13
13
|
if (ellipsisRef.current) {
|
|
14
14
|
const { current: el } = ellipsisRef;
|
|
15
15
|
const isOverflow = forceShownTooltipWhenHovered || (el.scrollWidth > el.offsetWidth);
|
|
@@ -17,7 +17,7 @@ const TableCell = forwardRef(function TableCell(props, ref) {
|
|
|
17
17
|
if (isOverflow)
|
|
18
18
|
onMouseEnter(e);
|
|
19
19
|
}
|
|
20
|
-
}, onMouseLeave: onMouseLeave
|
|
20
|
+
}, onMouseLeave: onMouseLeave, children: children })) })) : children }));
|
|
21
21
|
});
|
|
22
22
|
var TableCell$1 = TableCell;
|
|
23
23
|
|
|
@@ -10,17 +10,16 @@ import cx from 'clsx';
|
|
|
10
10
|
const TableExpandedTable = forwardRef(function TableExpandedTable(props, ref) {
|
|
11
11
|
const { renderedExpandedContent, } = props;
|
|
12
12
|
const { columns, } = useContext(TableDataContext) || {};
|
|
13
|
-
return (jsx("div",
|
|
13
|
+
return (jsx("div", { className: tableClasses.bodyRowExpandedTable, children: renderedExpandedContent.dataSource.map((source, sourceIndex) => {
|
|
14
14
|
var _a;
|
|
15
|
-
return (jsxs("div",
|
|
16
|
-
((_a = (renderedExpandedContent.columns || columns)) !== null && _a !== void 0 ? _a : [])
|
|
15
|
+
return (jsxs("div", { ref: ref, className: cx(tableClasses.bodyRow, tableClasses.bodyRowExpandedTableRow, renderedExpandedContent.className), role: "row", children: [jsx(TableExpandable, { showIcon: false }), ((_a = (renderedExpandedContent.columns || columns)) !== null && _a !== void 0 ? _a : [])
|
|
17
16
|
.map((column, index) => {
|
|
18
17
|
var _a, _b, _c, _d;
|
|
19
18
|
const ellipsis = !!(get(source, column.dataIndex)) && ((_a = column.ellipsis) !== null && _a !== void 0 ? _a : true);
|
|
20
19
|
const tooltipTitle = ((_c = (_b = column.renderTooltipTitle) === null || _b === void 0 ? void 0 : _b.call(column, source)) !== null && _c !== void 0 ? _c : get(source, column.dataIndex));
|
|
21
|
-
return (jsx("div",
|
|
22
|
-
})] }
|
|
23
|
-
}) })
|
|
20
|
+
return (jsx("div", { className: cx(tableClasses.bodyRowCellWrapper, column.bodyClassName), style: getColumnStyle((columns !== null && columns !== void 0 ? columns : [])[index]), children: jsx(TableCell, { ellipsis: ellipsis, forceShownTooltipWhenHovered: column.forceShownTooltipWhenHovered, style: getCellStyle((columns !== null && columns !== void 0 ? columns : [])[index]), tooltipTitle: tooltipTitle || '', children: ((_d = column.render) === null || _d === void 0 ? void 0 : _d.call(column, column, source, sourceIndex)) || get(source, column.dataIndex) }) }, `${column.dataIndex}-${index}`));
|
|
21
|
+
})] }, (source.key || source.id)));
|
|
22
|
+
}) }));
|
|
24
23
|
});
|
|
25
24
|
var TableExpandedTable$1 = TableExpandedTable;
|
|
26
25
|
|
package/Table/TableHeader.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
2
|
+
import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
|
|
3
|
+
declare const TableHeader: import("react").ForwardRefExoticComponent<NativeElementPropsWithoutKeyAndRef<"div"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
3
4
|
export default TableHeader;
|
package/Table/TableHeader.js
CHANGED
|
@@ -13,13 +13,10 @@ const TableHeader = forwardRef(function TableHeader(props, ref) {
|
|
|
13
13
|
const { className, ...rest } = props;
|
|
14
14
|
const { rowSelection, expanding, } = useContext(TableContext) || {};
|
|
15
15
|
const { columns, } = useContext(TableDataContext) || {};
|
|
16
|
-
return (jsxs("div",
|
|
17
|
-
expanding && !rowSelection ? (jsx(TableExpandable, { showIcon: false }, void 0)) : null,
|
|
18
|
-
(columns !== null && columns !== void 0 ? columns : []).map((column) => {
|
|
16
|
+
return (jsxs("div", { ref: ref, ...rest, className: cx(tableClasses.header, className), role: "rowgroup", children: [rowSelection ? (jsx(TableRowSelection, { rowKey: SELECTED_ALL_KEY, showDropdownIcon: true })) : null, expanding && !rowSelection ? (jsx(TableExpandable, { showIcon: false })) : null, (columns !== null && columns !== void 0 ? columns : []).map((column) => {
|
|
19
17
|
var _a;
|
|
20
|
-
return (jsx("div",
|
|
21
|
-
|
|
22
|
-
})] }), void 0));
|
|
18
|
+
return (jsx("div", { className: cx(tableClasses.headerCellWrapper, column.headerClassName), style: getColumnStyle(column), children: jsxs(TableCell, { ellipsis: false, role: "columnheader", style: getCellStyle(column), children: [((_a = column.renderTitle) === null || _a === void 0 ? void 0 : _a.call(column, tableClasses)) || column.title, typeof column.sorter === 'function' || typeof column.onSorted === 'function' ? (jsx(TableSortingIcon, { column: column })) : null] }) }, `${column.dataIndex}-${column.title}`));
|
|
19
|
+
})] }));
|
|
23
20
|
});
|
|
24
21
|
var TableHeader$1 = TableHeader;
|
|
25
22
|
|
|
@@ -7,9 +7,9 @@ function TableEditRenderWrapper({ children, dataIndex, editable, rowData, setCel
|
|
|
7
7
|
const { bodyCell: BodyCell, } = useContext(TableComponentContext) || {};
|
|
8
8
|
const customProps = (_a = setCellProps === null || setCellProps === void 0 ? void 0 : setCellProps(rowData)) !== null && _a !== void 0 ? _a : {};
|
|
9
9
|
if (typeof BodyCell === 'function') {
|
|
10
|
-
return (jsx(BodyCell,
|
|
10
|
+
return (jsx(BodyCell, { ...customProps, ...rest, dataIndex: dataIndex, editable: editable, rowData: rowData, children: children }));
|
|
11
11
|
}
|
|
12
|
-
return (jsx(Fragment, { children: children }
|
|
12
|
+
return (jsx(Fragment, { children: children }));
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export { TableEditRenderWrapper as default };
|
|
@@ -16,9 +16,9 @@ const TableExpandable = forwardRef(function TableExpandable(props, ref) {
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
|
-
return (jsx("div",
|
|
19
|
+
return (jsx("div", { ...rest, ref: ref, className: cx(tableClasses.collapseAction, className), children: jsx("div", { className: tableClasses.icon, children: showIcon ? (jsx(Icon, { className: cx(tableClasses.icon, {
|
|
20
20
|
[tableClasses.iconClickable]: expandable,
|
|
21
|
-
}), color: expandable ? 'primary' : 'disabled', icon: ChevronDownIcon, onClick: onClick, style: { transform: `rotate(${expanded ? '180deg' : '0'})` } }
|
|
21
|
+
}), color: expandable ? 'primary' : 'disabled', icon: ChevronDownIcon, onClick: onClick, style: { transform: `rotate(${expanded ? '180deg' : '0'})` } })) : null }) }));
|
|
22
22
|
});
|
|
23
23
|
var TableExpandable$1 = TableExpandable;
|
|
24
24
|
|
|
@@ -18,8 +18,7 @@ const TablePagination = forwardRef(function TablePagination(props, ref) {
|
|
|
18
18
|
const { boundaryCount, className: paginationClassName, disabled, hideNextButton, hidePreviousButton, pageSize: pageSizeProp, siblingCount, } = paginationOptions;
|
|
19
19
|
const currentStartCount = (pageSizeProp * (currentPage - 1)) + 1;
|
|
20
20
|
const currentEndCount = Math.min(pageSizeProp * currentPage, total);
|
|
21
|
-
return (jsxs("div",
|
|
22
|
-
jsx("div", Object.assign({ className: tableClasses.paginationActions }, { children: jsx(Pagination, { boundaryCount: boundaryCount, className: paginationClassName, current: currentPage, disabled: disabled, hideNextButton: hideNextButton, hidePreviousButton: hidePreviousButton, onChange: setCurrentPage, pageSize: pageSizeProp, siblingCount: siblingCount, total: total }, void 0) }), void 0)] }), void 0));
|
|
21
|
+
return (jsxs("div", { ...rest, ref: ref, className: cx(tableClasses.pagination, className), children: [jsx("span", { className: tableClasses.paginationIndicator, children: `目前顯示 ${currentStartCount} - ${currentEndCount} 筆,共 ${total} 筆資料` }), jsx("div", { className: tableClasses.paginationActions, children: jsx(Pagination, { boundaryCount: boundaryCount, className: paginationClassName, current: currentPage, disabled: disabled, hideNextButton: hideNextButton, hidePreviousButton: hidePreviousButton, onChange: setCurrentPage, pageSize: pageSizeProp, siblingCount: siblingCount, total: total }) })] }));
|
|
23
22
|
});
|
|
24
23
|
var TablePagination$1 = TablePagination;
|
|
25
24
|
|
|
@@ -17,7 +17,7 @@ const TableRefresh = forwardRef(function TableRefresh(props, ref) {
|
|
|
17
17
|
onClick,
|
|
18
18
|
setLoading,
|
|
19
19
|
]);
|
|
20
|
-
return (jsx("div",
|
|
20
|
+
return (jsx("div", { ref: ref, className: tableClasses.refresh, ...rest, children: jsx(Button, { onClick: onRefreshClicked, prefix: jsx(Icon, { icon: ResetIcon }), children: children || '重新整理' }) }));
|
|
21
21
|
});
|
|
22
22
|
var TableRefresh$1 = TableRefresh;
|
|
23
23
|
|
|
@@ -69,18 +69,17 @@ const TableRowSelection = forwardRef(function TableRowSelection(props, ref) {
|
|
|
69
69
|
(_a = action.onClick) === null || _a === void 0 ? void 0 : _a.call(action, rowSelection.selectedRowKeys);
|
|
70
70
|
toggleOpen(false);
|
|
71
71
|
};
|
|
72
|
-
const actionMenu = (jsx(Menu,
|
|
73
|
-
return (jsxs("div",
|
|
72
|
+
const actionMenu = (jsx(Menu, { size: "medium", children: ((_a = rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.actions) !== null && _a !== void 0 ? _a : []).map(((action) => (jsx(MenuItem, { className: action.className, onClick: (evt) => onMenuItemClicked(evt, action), children: action.text }, action.key)))) }));
|
|
73
|
+
return (jsxs("div", { ref: ref, ...rest, className: tableClasses.selections, style: hiddenIconWithExpandableStyle.host, children: [jsx(Checkbox, { checked: checked, disabled: false, indeterminate: indeterminate, inputProps: {
|
|
74
74
|
name,
|
|
75
|
-
}, onChange: onSelected, size: "medium" },
|
|
76
|
-
jsx("div", Object.assign({ className: tableClasses.icon, style: hiddenIconWithExpandableStyle.icon }, { children: showDropdownIcon ? (jsx(Dropdown, Object.assign({ menu: actionMenu, onClose: () => toggleOpen(false), popperProps: {
|
|
75
|
+
}, onChange: onSelected, size: "medium" }), jsx("div", { className: tableClasses.icon, style: hiddenIconWithExpandableStyle.icon, children: showDropdownIcon ? (jsx(Dropdown, { menu: actionMenu, onClose: () => toggleOpen(false), popperProps: {
|
|
77
76
|
open,
|
|
78
77
|
options: {
|
|
79
78
|
placement: 'bottom-start',
|
|
80
79
|
},
|
|
81
|
-
}
|
|
80
|
+
}, children: (dropdownRef) => (jsx(Icon, { ref: dropdownRef, className: cx(tableClasses.icon, {
|
|
82
81
|
[tableClasses.iconClickable]: isMenuAllowOpen,
|
|
83
|
-
}), color: isMenuAllowOpen ? 'primary' : 'disabled', icon: MoreVerticalIcon, onClick: onIconClicked }
|
|
82
|
+
}), color: isMenuAllowOpen ? 'primary' : 'disabled', icon: MoreVerticalIcon, onClick: onIconClicked })) })) : null })] }));
|
|
84
83
|
});
|
|
85
84
|
var TableRowSelection$1 = TableRowSelection;
|
|
86
85
|
|
|
@@ -18,11 +18,11 @@ const TableSortingIcon = forwardRef(function TableSortingIcon(props, ref) {
|
|
|
18
18
|
transform: `rotate(${90 * (currentType === 'asc' ? -1 : 1)}deg)`,
|
|
19
19
|
},
|
|
20
20
|
}), [currentType]);
|
|
21
|
-
return (jsx(Icon,
|
|
21
|
+
return (jsx(Icon, { ...rest, ref: ref, className: cx(tableClasses.icon, tableClasses.iconClickable, className), color: currentIconStyle.color, icon: ArrowRightIcon, onClick: (evt) => {
|
|
22
22
|
var _a;
|
|
23
23
|
evt.stopPropagation();
|
|
24
24
|
(_a = sorting === null || sorting === void 0 ? void 0 : sorting.onSort) === null || _a === void 0 ? void 0 : _a.call(sorting, column);
|
|
25
|
-
}, style: currentIconStyle.style })
|
|
25
|
+
}, style: currentIconStyle.style }));
|
|
26
26
|
});
|
|
27
27
|
var TableSortingIcon$1 = TableSortingIcon;
|
|
28
28
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { TableDataSource, TableColumn } from '@mezzanine-ui/core/table';
|
|
1
|
+
import { TableDataSource, TableColumn, TableRecord } from '@mezzanine-ui/core/table';
|
|
2
2
|
export interface UseTableSorting {
|
|
3
3
|
dataSource: TableDataSource[];
|
|
4
4
|
}
|
|
5
5
|
export declare type SortedType = 'desc' | 'asc' | 'none';
|
|
6
|
-
export declare function useTableSorting(props: UseTableSorting): readonly [TableDataSource[], (v: Pick<TableColumn<
|
|
6
|
+
export declare function useTableSorting(props: UseTableSorting): readonly [TableDataSource[], (v: Pick<TableColumn<TableRecord<unknown>>, "dataIndex" | "sorter" | "onSorted">) => void, {
|
|
7
7
|
readonly sortedOn: string;
|
|
8
8
|
readonly sortedType: SortedType;
|
|
9
9
|
readonly onResetAll: () => void;
|