@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.
Files changed (171) hide show
  1. package/Accordion/Accordion.js +5 -4
  2. package/Accordion/AccordionDetails.js +2 -2
  3. package/Accordion/AccordionSummary.js +3 -4
  4. package/Alert/Alert.js +1 -3
  5. package/AppBar/AppBar.js +1 -1
  6. package/AppBar/AppBarBrand.d.ts +1 -1
  7. package/AppBar/AppBarBrand.js +1 -1
  8. package/AppBar/AppBarMain.d.ts +1 -1
  9. package/AppBar/AppBarMain.js +1 -1
  10. package/AppBar/AppBarSupport.d.ts +1 -1
  11. package/AppBar/AppBarSupport.js +1 -1
  12. package/Badge/Badge.js +2 -2
  13. package/Badge/BadgeContainer.d.ts +1 -1
  14. package/Badge/BadgeContainer.js +1 -1
  15. package/Button/Button.d.ts +2 -2
  16. package/Button/Button.js +3 -3
  17. package/Button/ButtonGroup.js +3 -3
  18. package/Button/IconButton.d.ts +3 -3
  19. package/Button/IconButton.js +1 -1
  20. package/Calendar/Calendar.js +9 -10
  21. package/Calendar/CalendarCell.js +2 -2
  22. package/Calendar/CalendarContext.d.ts +3 -3
  23. package/Calendar/CalendarContext.js +20 -12
  24. package/Calendar/CalendarControls.js +3 -3
  25. package/Calendar/CalendarDayOfWeek.js +1 -1
  26. package/Calendar/CalendarDays.js +4 -5
  27. package/Calendar/CalendarMonths.js +4 -4
  28. package/Calendar/CalendarWeeks.js +4 -5
  29. package/Calendar/CalendarYears.js +4 -4
  30. package/Calendar/useCalendarControls.d.ts +2 -3
  31. package/Card/Card.js +5 -5
  32. package/Card/CardActions.js +1 -2
  33. package/Checkbox/CheckAll.js +2 -2
  34. package/Checkbox/Checkbox.js +2 -2
  35. package/Checkbox/CheckboxGroup.js +2 -2
  36. package/ConfirmActions/ConfirmActions.js +1 -2
  37. package/DatePicker/DatePicker.js +2 -3
  38. package/DatePicker/DatePickerCalendar.js +1 -1
  39. package/DateRangePicker/DateRangePicker.js +2 -3
  40. package/DateRangePicker/DateRangePickerCalendar.js +3 -4
  41. package/DateRangePicker/useDateRangeCalendarControls.d.ts +1 -2
  42. package/DateRangePicker/useDateRangePickerValue.d.ts +12 -13
  43. package/DateTimePicker/DateTimePicker.js +2 -3
  44. package/DateTimePicker/DateTimePickerPanel.js +1 -3
  45. package/Drawer/Drawer.js +1 -1
  46. package/Dropdown/Dropdown.js +2 -2
  47. package/Empty/Empty.js +3 -4
  48. package/Form/FormField.js +2 -2
  49. package/Form/FormLabel.js +1 -2
  50. package/Form/FormMessage.d.ts +1 -1
  51. package/Form/FormMessage.js +1 -1
  52. package/Form/useAutoCompleteValueControl.d.ts +30 -11
  53. package/Form/useAutoCompleteValueControl.js +71 -31
  54. package/Form/useInputWithTagsModeValue.js +2 -1
  55. package/Form/useSelectValueControl.d.ts +1 -1
  56. package/Icon/Icon.js +2 -2
  57. package/Input/Input.js +2 -3
  58. package/Loading/Loading.js +4 -5
  59. package/Menu/Menu.js +1 -1
  60. package/Menu/MenuDivider.d.ts +1 -1
  61. package/Menu/MenuDivider.js +1 -1
  62. package/Menu/MenuItem.js +2 -3
  63. package/Menu/MenuItemGroup.js +1 -2
  64. package/Message/Message.js +2 -3
  65. package/Modal/Modal.js +2 -2
  66. package/Modal/ModalActions.js +1 -1
  67. package/Modal/ModalBody.d.ts +1 -1
  68. package/Modal/ModalBody.js +1 -1
  69. package/Modal/ModalFooter.d.ts +1 -1
  70. package/Modal/ModalFooter.js +1 -1
  71. package/Modal/ModalHeader.js +2 -3
  72. package/Modal/useModalContainer.js +1 -1
  73. package/Navigation/Navigation.js +2 -2
  74. package/Navigation/NavigationItem.js +1 -1
  75. package/Navigation/NavigationSubMenu.js +3 -5
  76. package/Notification/Notification.js +2 -7
  77. package/Notifier/NotifierManager.js +1 -1
  78. package/Notifier/createNotifier.js +1 -1
  79. package/Overlay/Overlay.js +3 -3
  80. package/PageFooter/PageFooter.js +1 -2
  81. package/Pagination/Pagination.js +2 -3
  82. package/Pagination/PaginationItem.js +4 -4
  83. package/Pagination/PaginationJumper.js +2 -4
  84. package/Picker/PickerTrigger.js +1 -1
  85. package/Picker/RangePickerTrigger.js +1 -3
  86. package/Picker/usePickerInputValue.d.ts +2 -2
  87. package/Picker/usePickerValue.d.ts +6 -7
  88. package/Picker/useRangePickerValue.d.ts +9 -10
  89. package/Popconfirm/Popconfirm.js +1 -1
  90. package/Popover/Popover.js +2 -3
  91. package/Popper/Popper.js +2 -2
  92. package/Portal/Portal.js +1 -1
  93. package/Progress/Progress.js +5 -7
  94. package/Radio/Radio.js +2 -2
  95. package/Radio/RadioGroup.js +2 -2
  96. package/Select/AutoComplete.d.ts +40 -13
  97. package/Select/AutoComplete.js +37 -28
  98. package/Select/Option.js +2 -2
  99. package/Select/Select.d.ts +2 -50
  100. package/Select/Select.js +15 -49
  101. package/Select/SelectTrigger.d.ts +8 -1
  102. package/Select/SelectTrigger.js +8 -12
  103. package/Select/SelectTriggerTags.d.ts +19 -0
  104. package/Select/SelectTriggerTags.js +33 -0
  105. package/Select/TreeSelect.js +2 -3
  106. package/Select/index.d.ts +1 -0
  107. package/Select/index.js +1 -0
  108. package/Select/useSelectTriggerTags.d.ts +19 -0
  109. package/Select/useSelectTriggerTags.js +61 -0
  110. package/Skeleton/Skeleton.js +1 -1
  111. package/Slider/Slider.d.ts +1 -1
  112. package/Slider/Slider.js +7 -11
  113. package/Stepper/Step.js +2 -2
  114. package/Stepper/Stepper.js +1 -1
  115. package/Switch/Switch.js +2 -3
  116. package/Table/Table.d.ts +1 -1
  117. package/Table/Table.js +3 -10
  118. package/Table/TableBody.js +2 -4
  119. package/Table/TableBodyRow.js +4 -7
  120. package/Table/TableCell.js +3 -3
  121. package/Table/TableExpandedTable.js +5 -6
  122. package/Table/TableHeader.d.ts +2 -1
  123. package/Table/TableHeader.js +3 -6
  124. package/Table/editable/TableEditRenderWrapper.js +2 -2
  125. package/Table/expandable/TableExpandable.js +2 -2
  126. package/Table/pagination/TablePagination.js +1 -2
  127. package/Table/refresh/TableRefresh.js +1 -1
  128. package/Table/rowSelection/TableRowSelection.js +5 -6
  129. package/Table/sorting/TableSortingIcon.js +2 -2
  130. package/Table/sorting/useTableSorting.d.ts +2 -2
  131. package/Table/useTableScroll.d.ts +178 -178
  132. package/Tabs/Tab.js +2 -2
  133. package/Tabs/TabPane.js +1 -1
  134. package/Tabs/Tabs.js +1 -3
  135. package/Tag/Tag.js +3 -4
  136. package/TextField/TextField.js +3 -3
  137. package/TextField/useTextFieldControl.d.ts +2 -2
  138. package/Textarea/Textarea.js +2 -3
  139. package/TimePanel/TimePanel.js +1 -4
  140. package/TimePanel/TimePanelAction.js +1 -1
  141. package/TimePanel/TimePanelColumn.js +2 -5
  142. package/TimePicker/TimePicker.js +2 -3
  143. package/TimePicker/TimePickerPanel.js +1 -1
  144. package/Tooltip/Tooltip.js +3 -3
  145. package/Transition/Collapse.js +3 -2
  146. package/Transition/Fade.js +2 -2
  147. package/Transition/Grow.js +3 -2
  148. package/Transition/SlideFade.js +2 -2
  149. package/Transition/Transition.js +2 -2
  150. package/Transition/Zoom.js +2 -2
  151. package/Tree/Tree.js +1 -1
  152. package/Tree/TreeNode.js +5 -7
  153. package/Tree/TreeNodeList.js +5 -4
  154. package/Tree/getTreeNodeEntities.js +6 -3
  155. package/Typography/Typography.d.ts +2 -2
  156. package/Typography/Typography.js +2 -2
  157. package/Upload/UploadButton.js +2 -2
  158. package/Upload/UploadInput.js +1 -1
  159. package/Upload/UploadPicture.js +1 -1
  160. package/Upload/UploadPictureBlock.js +2 -8
  161. package/Upload/UploadPictureWall.d.ts +1 -1
  162. package/Upload/UploadPictureWall.js +1 -2
  163. package/Upload/UploadPictureWallItem.js +1 -1
  164. package/Upload/UploadResult.js +2 -5
  165. package/_internal/InputCheck/InputCheck.js +2 -3
  166. package/_internal/InputCheck/InputCheckGroup.js +1 -1
  167. package/_internal/InputTriggerPopper/InputTriggerPopper.js +2 -2
  168. package/_internal/SlideFadeOverlay/SlideFadeOverlay.js +1 -1
  169. package/index.d.ts +1 -1
  170. package/index.js +1 -0
  171. package/package.json +3 -3
@@ -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", Object.assign({}, rest, { ref: ref, className: cx(tableClasses.bodyRow, {
30
+ return (jsxs(Fragment, { children: [jsxs("div", { ...rest, ref: ref, className: cx(tableClasses.bodyRow, {
31
31
  [tableClasses.bodyRowHighlight]: selected || expanded,
32
- }, className), role: "row" }, { children: [rowSelection ? (jsx(TableRowSelection, { role: "gridcell", rowKey: (rowData.key || rowData.id), setChecked: (status) => setSelected(status), showDropdownIcon: false }, void 0)) : null,
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", Object.assign({ className: cx(tableClasses.bodyRowCellWrapper, column.bodyClassName), style: getColumnStyle(column) }, { children: jsx(TableEditRenderWrapper, Object.assign({}, column, { rowData: rowData }, { children: jsx(TableCell, Object.assign({ 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) }), void 0) }), void 0) }), `${column.dataIndex}-${column.title}`));
39
- })] }), void 0),
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
 
@@ -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", Object.assign({ ref: ref }, rest, { className: cx(tableClasses.cell, className), role: role }, { children: ellipsis || forceShownTooltipWhenHovered ? (jsx(Tooltip, Object.assign({ title: `${tooltipTitle}`, options: {
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
- } }, { children: ({ onMouseEnter, onMouseLeave }) => (jsx("div", Object.assign({ ref: ellipsisRef, className: ellipsis ? tableClasses.cellEllipsis : '', onMouseEnter: (e) => {
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 }, { children: children }), void 0)) }), void 0)) : children }), void 0));
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", Object.assign({ className: tableClasses.bodyRowExpandedTable }, { children: renderedExpandedContent.dataSource.map((source, sourceIndex) => {
13
+ return (jsx("div", { className: tableClasses.bodyRowExpandedTable, children: renderedExpandedContent.dataSource.map((source, sourceIndex) => {
14
14
  var _a;
15
- return (jsxs("div", Object.assign({ ref: ref, className: cx(tableClasses.bodyRow, tableClasses.bodyRowExpandedTableRow, renderedExpandedContent.className), role: "row" }, { children: [jsx(TableExpandable, { showIcon: false }, void 0),
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", Object.assign({ className: cx(tableClasses.bodyRowCellWrapper, column.bodyClassName), style: getColumnStyle((columns !== null && columns !== void 0 ? columns : [])[index]) }, { children: jsx(TableCell, Object.assign({ 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) }), void 0) }), `${column.dataIndex}-${index}`));
22
- })] }), (source.key || source.id)));
23
- }) }), void 0));
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
 
@@ -1,3 +1,4 @@
1
1
  /// <reference types="react" />
2
- declare const TableHeader: import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & import("react").RefAttributes<HTMLDivElement>>;
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;
@@ -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", Object.assign({ ref: ref }, rest, { className: cx(tableClasses.header, className), role: "rowgroup" }, { children: [rowSelection ? (jsx(TableRowSelection, { rowKey: SELECTED_ALL_KEY, showDropdownIcon: true }, void 0)) : null,
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", Object.assign({ className: cx(tableClasses.headerCellWrapper, column.headerClassName), style: getColumnStyle(column) }, { children: jsxs(TableCell, Object.assign({ ellipsis: false, role: "columnheader", style: getCellStyle(column) }, { children: [((_a = column.renderTitle) === null || _a === void 0 ? void 0 : _a.call(column, tableClasses)) || column.title,
21
- typeof column.sorter === 'function' || typeof column.onSorted === 'function' ? (jsx(TableSortingIcon, { column: column }, void 0)) : null] }), void 0) }), `${column.dataIndex}-${column.title}`));
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, Object.assign({}, customProps, rest, { dataIndex: dataIndex, editable: editable, rowData: rowData }, { children: children }), void 0));
10
+ return (jsx(BodyCell, { ...customProps, ...rest, dataIndex: dataIndex, editable: editable, rowData: rowData, children: children }));
11
11
  }
12
- return (jsx(Fragment, { children: children }, void 0));
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", Object.assign({}, rest, { ref: ref, className: cx(tableClasses.collapseAction, className) }, { children: jsx("div", Object.assign({ className: tableClasses.icon }, { children: showIcon ? (jsx(Icon, { className: cx(tableClasses.icon, {
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'})` } }, void 0)) : null }), void 0) }), void 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", Object.assign({}, rest, { ref: ref, className: cx(tableClasses.pagination, className) }, { children: [jsx("span", Object.assign({ className: tableClasses.paginationIndicator }, { children: `目前顯示 ${currentStartCount} - ${currentEndCount} 筆,共 ${total} 筆資料` }), void 0),
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", Object.assign({ ref: ref, className: tableClasses.refresh }, rest, { children: jsx(Button, Object.assign({ onClick: onRefreshClicked, prefix: jsx(Icon, { icon: ResetIcon }, void 0) }, { children: children || '重新整理' }), void 0) }), void 0));
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, Object.assign({ size: "medium" }, { children: ((_a = rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.actions) !== null && _a !== void 0 ? _a : []).map(((action) => (jsx(MenuItem, Object.assign({ className: action.className, onClick: (evt) => onMenuItemClicked(evt, action) }, { children: action.text }), action.key)))) }), void 0));
73
- return (jsxs("div", Object.assign({ ref: ref }, rest, { className: tableClasses.selections, style: hiddenIconWithExpandableStyle.host }, { children: [jsx(Checkbox, { checked: checked, disabled: false, indeterminate: indeterminate, inputProps: {
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" }, void 0),
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
- } }, { children: (dropdownRef) => (jsx(Icon, { ref: dropdownRef, className: cx(tableClasses.icon, {
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 }, void 0)) }), void 0)) : null }), void 0)] }), void 0));
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, Object.assign({}, rest, { ref: ref, className: cx(tableClasses.icon, tableClasses.iconClickable, className), color: currentIconStyle.color, icon: ArrowRightIcon, onClick: (evt) => {
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 }), void 0));
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<Record<string, unknown>>, "dataIndex" | "sorter" | "onSorted">) => void, {
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;