@mezzanine-ui/react 0.9.2 → 0.10.2

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 (184) 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 +7 -5
  17. package/Button/ButtonGroup.js +7 -5
  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 +5 -3
  35. package/Checkbox/CheckboxGroup.js +5 -5
  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.d.ts +1 -1
  47. package/Dropdown/Dropdown.js +2 -2
  48. package/Empty/Empty.js +3 -4
  49. package/Form/FormField.js +2 -2
  50. package/Form/FormLabel.js +1 -2
  51. package/Form/FormMessage.d.ts +1 -1
  52. package/Form/FormMessage.js +1 -1
  53. package/Form/useAutoCompleteValueControl.d.ts +30 -11
  54. package/Form/useAutoCompleteValueControl.js +71 -31
  55. package/Form/useInputWithTagsModeValue.js +2 -1
  56. package/Form/useSelectValueControl.d.ts +1 -1
  57. package/Icon/Icon.d.ts +4 -0
  58. package/Icon/Icon.js +4 -4
  59. package/Input/Input.d.ts +1 -1
  60. package/Input/Input.js +5 -4
  61. package/Loading/Loading.js +4 -5
  62. package/Menu/Menu.js +5 -3
  63. package/Menu/MenuDivider.d.ts +1 -1
  64. package/Menu/MenuDivider.js +1 -1
  65. package/Menu/MenuItem.js +2 -3
  66. package/Menu/MenuItemGroup.js +1 -2
  67. package/Message/Message.js +2 -3
  68. package/Modal/Modal.js +5 -5
  69. package/Modal/ModalActions.js +1 -1
  70. package/Modal/ModalBody.d.ts +1 -1
  71. package/Modal/ModalBody.js +1 -1
  72. package/Modal/ModalFooter.d.ts +1 -1
  73. package/Modal/ModalFooter.js +1 -1
  74. package/Modal/ModalHeader.js +2 -3
  75. package/Modal/useModalContainer.js +1 -1
  76. package/Navigation/Navigation.js +2 -2
  77. package/Navigation/NavigationItem.js +1 -1
  78. package/Navigation/NavigationSubMenu.js +3 -5
  79. package/Notification/Notification.js +2 -7
  80. package/Notifier/NotifierManager.js +1 -1
  81. package/Notifier/createNotifier.js +1 -1
  82. package/Overlay/Overlay.js +3 -3
  83. package/PageFooter/PageFooter.js +1 -2
  84. package/Pagination/Pagination.js +2 -3
  85. package/Pagination/PaginationItem.js +4 -4
  86. package/Pagination/PaginationJumper.js +2 -4
  87. package/Picker/PickerTrigger.d.ts +1 -1
  88. package/Picker/PickerTrigger.js +2 -2
  89. package/Picker/RangePickerTrigger.d.ts +1 -1
  90. package/Picker/RangePickerTrigger.js +2 -4
  91. package/Picker/usePickerInputValue.d.ts +2 -2
  92. package/Picker/usePickerValue.d.ts +6 -7
  93. package/Picker/useRangePickerValue.d.ts +9 -10
  94. package/Popconfirm/Popconfirm.js +1 -1
  95. package/Popover/Popover.js +2 -3
  96. package/Popper/Popper.js +2 -2
  97. package/Portal/Portal.js +1 -1
  98. package/Progress/Progress.js +9 -9
  99. package/Provider/ConfigProvider.d.ts +8 -0
  100. package/Provider/ConfigProvider.js +13 -0
  101. package/Provider/context.d.ts +6 -0
  102. package/Provider/context.js +7 -0
  103. package/Provider/index.d.ts +4 -0
  104. package/Provider/index.js +2 -0
  105. package/Radio/Radio.js +5 -3
  106. package/Radio/RadioGroup.js +5 -5
  107. package/Select/AutoComplete.d.ts +40 -14
  108. package/Select/AutoComplete.js +37 -28
  109. package/Select/Option.js +2 -2
  110. package/Select/Select.d.ts +2 -51
  111. package/Select/Select.js +15 -49
  112. package/Select/SelectTrigger.d.ts +8 -1
  113. package/Select/SelectTrigger.js +8 -12
  114. package/Select/SelectTriggerTags.d.ts +19 -0
  115. package/Select/SelectTriggerTags.js +33 -0
  116. package/Select/TreeSelect.js +3 -4
  117. package/Select/index.d.ts +1 -0
  118. package/Select/index.js +1 -0
  119. package/Select/useSelectTriggerTags.d.ts +19 -0
  120. package/Select/useSelectTriggerTags.js +61 -0
  121. package/Skeleton/Skeleton.js +1 -1
  122. package/Slider/Slider.d.ts +1 -1
  123. package/Slider/Slider.js +7 -11
  124. package/Stepper/Step.js +2 -2
  125. package/Stepper/Stepper.js +1 -1
  126. package/Switch/Switch.js +2 -3
  127. package/Table/Table.d.ts +1 -1
  128. package/Table/Table.js +3 -10
  129. package/Table/TableBody.js +2 -4
  130. package/Table/TableBodyRow.js +4 -7
  131. package/Table/TableCell.js +3 -3
  132. package/Table/TableExpandedTable.js +5 -6
  133. package/Table/TableHeader.d.ts +2 -1
  134. package/Table/TableHeader.js +3 -6
  135. package/Table/editable/TableEditRenderWrapper.js +2 -2
  136. package/Table/expandable/TableExpandable.js +2 -2
  137. package/Table/pagination/TablePagination.js +1 -2
  138. package/Table/refresh/TableRefresh.js +1 -1
  139. package/Table/rowSelection/TableRowSelection.js +5 -6
  140. package/Table/sorting/TableSortingIcon.js +2 -2
  141. package/Table/sorting/useTableSorting.d.ts +2 -2
  142. package/Table/useTableScroll.d.ts +178 -178
  143. package/Tabs/Tab.js +2 -2
  144. package/Tabs/TabPane.js +1 -1
  145. package/Tabs/Tabs.js +1 -3
  146. package/Tag/Tag.js +7 -6
  147. package/TextField/TextField.js +7 -5
  148. package/TextField/useTextFieldControl.d.ts +2 -2
  149. package/Textarea/Textarea.d.ts +1 -1
  150. package/Textarea/Textarea.js +5 -4
  151. package/TimePanel/TimePanel.js +1 -4
  152. package/TimePanel/TimePanelAction.js +1 -1
  153. package/TimePanel/TimePanelColumn.js +2 -5
  154. package/TimePicker/TimePicker.js +2 -3
  155. package/TimePicker/TimePickerPanel.js +1 -1
  156. package/Tooltip/Tooltip.js +3 -3
  157. package/Transition/Collapse.js +3 -2
  158. package/Transition/Fade.js +2 -2
  159. package/Transition/Grow.js +3 -2
  160. package/Transition/SlideFade.js +2 -2
  161. package/Transition/Transition.js +2 -2
  162. package/Transition/Zoom.js +2 -2
  163. package/Tree/Tree.js +1 -1
  164. package/Tree/TreeNode.js +9 -9
  165. package/Tree/TreeNodeList.js +5 -4
  166. package/Tree/getTreeNodeEntities.js +6 -3
  167. package/Typography/Typography.d.ts +2 -2
  168. package/Typography/Typography.js +2 -2
  169. package/Upload/UploadButton.js +2 -2
  170. package/Upload/UploadInput.js +1 -1
  171. package/Upload/UploadPicture.js +1 -1
  172. package/Upload/UploadPictureBlock.js +2 -8
  173. package/Upload/UploadPictureWall.d.ts +1 -1
  174. package/Upload/UploadPictureWall.js +1 -2
  175. package/Upload/UploadPictureWallItem.js +1 -1
  176. package/Upload/UploadResult.d.ts +19 -0
  177. package/Upload/UploadResult.js +6 -7
  178. package/_internal/InputCheck/InputCheck.js +2 -3
  179. package/_internal/InputCheck/InputCheckGroup.js +1 -1
  180. package/_internal/InputTriggerPopper/InputTriggerPopper.js +2 -2
  181. package/_internal/SlideFadeOverlay/SlideFadeOverlay.js +1 -1
  182. package/index.d.ts +3 -1
  183. package/index.js +3 -0
  184. package/package.json +12 -12
@@ -8,7 +8,7 @@ import cx from 'clsx';
8
8
  */
9
9
  const Skeleton = forwardRef(function Skeleton(props, ref) {
10
10
  const { className, height: skeletonHeight, style: skeletonStyle, type, width: skeletonWidth, ...rest } = props;
11
- return (jsx("div", Object.assign({}, rest, { ref: ref, className: cx(skeletonClasses.host, type === 'circle' && skeletonClasses.circle, className), style: { width: skeletonWidth, height: skeletonHeight, ...skeletonStyle } }, rest), void 0));
11
+ return (jsx("div", { ...rest, ref: ref, className: cx(skeletonClasses.host, type === 'circle' && skeletonClasses.circle, className), style: { width: skeletonWidth, height: skeletonHeight, ...skeletonStyle }, ...rest }));
12
12
  });
13
13
  var Skeleton$1 = Skeleton;
14
14
 
@@ -47,5 +47,5 @@ export declare type SliderProps = Omit<SliderComponentProps, 'innerRef'>;
47
47
  * The outcome will be base on the type of given value.
48
48
  * Notice that slider is a fully controlled component. Property value is always needed.
49
49
  */
50
- declare const Slider: import("react").ForwardRefExoticComponent<Pick<SliderComponentProps, "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" | "value" | "disabled" | "max" | "min" | "step" | "withInput"> & import("react").RefAttributes<HTMLDivElement>>;
50
+ declare const Slider: import("react").ForwardRefExoticComponent<SliderProps & import("react").RefAttributes<HTMLDivElement>>;
51
51
  export default Slider;
package/Slider/Slider.js CHANGED
@@ -20,9 +20,9 @@ function SliderComponent(props) {
20
20
  ...styleProp,
21
21
  };
22
22
  const shouldHaveInputHandlers = withInput && onChange && !disabled;
23
- const getHandle = (handlerValue, index) => (jsx("div", Object.assign({ className: cx(sliderClasses.handlerPosition, index === 0 && sliderClasses.handlerStartPosition, index === 1 && sliderClasses.handlerEndPosition) }, { children: jsx(Tooltip, Object.assign({ disablePortal: true, options: {
23
+ const getHandle = (handlerValue, index) => (jsx("div", { className: cx(sliderClasses.handlerPosition, index === 0 && sliderClasses.handlerStartPosition, index === 1 && sliderClasses.handlerEndPosition), children: jsx(Tooltip, { disablePortal: true, options: {
24
24
  placement: 'top',
25
- }, title: handlerValue.toString() }, { children: ({ onMouseEnter, onMouseLeave }) => (jsx("div", { className: cx(sliderClasses.handler, index === activeHandleIndex && sliderClasses.handlerActive), "aria-disabled": disabled, "aria-label": `Slider Handler ${index}`, "aria-valuemax": max, "aria-valuemin": min, "aria-valuenow": handlerValue, onFocus: () => { }, onMouseDown: (e) => handlePress(e, index), onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onTouchStart: (e) => handlePress(e, index), role: "slider", tabIndex: index }, void 0)) }), void 0) }), void 0));
25
+ }, title: handlerValue.toString(), children: ({ onMouseEnter, onMouseLeave }) => (jsx("div", { className: cx(sliderClasses.handler, index === activeHandleIndex && sliderClasses.handlerActive), "aria-disabled": disabled, "aria-label": `Slider Handler ${index}`, "aria-valuemax": max, "aria-valuemin": min, "aria-valuenow": handlerValue, onFocus: () => { }, onMouseDown: (e) => handlePress(e, index), onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onTouchStart: (e) => handlePress(e, index), role: "slider", tabIndex: index })) }) }));
26
26
  const inputSize = Math.max(min.toString().length, max.toString().length);
27
27
  const [startInputValue, setStartInputValue] = useState(() => {
28
28
  if (!isRangeSlider(value)) {
@@ -159,19 +159,15 @@ function SliderComponent(props) {
159
159
  },
160
160
  type: 'number',
161
161
  };
162
- return (jsxs("div", Object.assign({}, rest, { ref: innerRef, className: cx(sliderClasses.host, disabled && sliderClasses.disabled, className), style: style }, { children: [withInput && isRangeSlider(value) ? (jsx(Input, { className: sliderClasses.input, disabled: disabled, onChange: onStartInputChange, value: startInputValue, inputProps: {
162
+ return (jsxs("div", { ...rest, ref: innerRef, className: cx(sliderClasses.host, disabled && sliderClasses.disabled, className), style: style, children: [withInput && isRangeSlider(value) ? (jsx(Input, { className: sliderClasses.input, disabled: disabled, onChange: onStartInputChange, value: startInputValue, inputProps: {
163
163
  ...inputProps,
164
164
  onKeyDown: onStartInputKeydown,
165
165
  onBlur: onStartInputBlur,
166
- } }, void 0)) : null,
167
- jsxs("div", Object.assign({ className: sliderClasses.controls }, { children: [jsx("div", { ref: railRef, className: sliderClasses.rail, role: "presentation", onMouseDown: handleClickTrackOrRail }, void 0),
168
- jsx("div", { className: sliderClasses.track, role: "presentation", onMouseDown: handleClickTrackOrRail }, void 0),
169
- isRangeSlider(value) ? (jsxs(Fragment, { children: [getHandle(value[0], 0), getHandle(value[1], 1)] }, void 0)) : getHandle(value, -1)] }), void 0),
170
- withInput ? (jsx(Input, { className: sliderClasses.input, disabled: disabled, onChange: onEndInputChange, value: endInputValue, inputProps: {
166
+ } })) : null, jsxs("div", { className: sliderClasses.controls, children: [jsx("div", { ref: railRef, className: sliderClasses.rail, role: "presentation", onMouseDown: handleClickTrackOrRail }), jsx("div", { className: sliderClasses.track, role: "presentation", onMouseDown: handleClickTrackOrRail }), isRangeSlider(value) ? (jsxs(Fragment, { children: [getHandle(value[0], 0), getHandle(value[1], 1)] })) : getHandle(value, -1)] }), withInput ? (jsx(Input, { className: sliderClasses.input, disabled: disabled, onChange: onEndInputChange, value: endInputValue, inputProps: {
171
167
  ...inputProps,
172
168
  onKeyDown: onEndInputKeydown,
173
169
  onBlur: onEndInputBlur,
174
- } }, void 0)) : null] }), void 0));
170
+ } })) : null] }));
175
171
  }
176
172
  /**
177
173
  * The react component for `mezzanine` slider.
@@ -180,9 +176,9 @@ function SliderComponent(props) {
180
176
  */
181
177
  const Slider = forwardRef((props, ref) => {
182
178
  if (isRangeSlider(props.value)) {
183
- return (jsx(SliderComponent, Object.assign({}, props, { innerRef: ref }), void 0));
179
+ return (jsx(SliderComponent, { ...props, innerRef: ref }));
184
180
  }
185
- return (jsx(SliderComponent, Object.assign({}, props, { innerRef: ref }), void 0));
181
+ return (jsx(SliderComponent, { ...props, innerRef: ref }));
186
182
  });
187
183
  var Slider$1 = Slider;
188
184
 
package/Stepper/Step.js CHANGED
@@ -12,8 +12,8 @@ import cx from 'clsx';
12
12
  const Step = forwardRef(function Step(props, ref) {
13
13
  const { active, children, className, completed, completedIconProps, disabled, index = -1, title, titleProps, ...rest } = props;
14
14
  /** icon and step number */
15
- const iconRender = (jsx(Typography, Object.assign({ className: stepClasses.iconBackground, variant: "button3" }, { children: completed ? (jsx(Icon, Object.assign({ className: stepClasses.completedIcon, icon: CheckIcon }, completedIconProps), void 0)) : index + 1 }), void 0));
16
- return (jsxs("div", Object.assign({ className: cx(stepClasses.host, disabled && stepClasses.disabled, className), ref: ref }, rest, { children: [iconRender, /** title (optional) */ title && (jsx(Typography, Object.assign({ className: stepClasses.title, variant: "button2" }, titleProps, { children: title }), void 0)), children] }), void 0));
15
+ const iconRender = (jsx(Typography, { className: stepClasses.iconBackground, variant: "button3", children: completed ? (jsx(Icon, { className: stepClasses.completedIcon, icon: CheckIcon, ...completedIconProps })) : index + 1 }));
16
+ return (jsxs("div", { className: cx(stepClasses.host, disabled && stepClasses.disabled, className), ref: ref, ...rest, children: [iconRender, /** title (optional) */ title && (jsx(Typography, { className: stepClasses.title, variant: "button2", ...titleProps, children: title })), children] }));
17
17
  });
18
18
  var Step$1 = Step;
19
19
 
@@ -27,7 +27,7 @@ const Stepper = forwardRef(function Stepper(props, ref) {
27
27
  ...step.props,
28
28
  });
29
29
  });
30
- return (jsx("div", Object.assign({ className: cx(stepperClasses.host, className), ref: ref }, rest, { children: stepsWithState }), void 0));
30
+ return (jsx("div", { className: cx(stepperClasses.host, className), ref: ref, ...rest, children: stepsWithState }));
31
31
  });
32
32
  var Stepper$1 = Stepper;
33
33
 
package/Switch/Switch.js CHANGED
@@ -18,12 +18,11 @@ const Switch = forwardRef(function Switch(props, ref) {
18
18
  onChange: onChangeProp,
19
19
  });
20
20
  const disabled = loading || disabledProp;
21
- return (jsxs("span", Object.assign({ ref: ref }, rest, { className: cx(switchClasses.host, {
21
+ return (jsxs("span", { ref: ref, ...rest, className: cx(switchClasses.host, {
22
22
  [switchClasses.checked]: checked,
23
23
  [switchClasses.disabled]: disabled,
24
24
  [switchClasses.large]: size === 'large',
25
- }, className) }, { children: [jsx("span", Object.assign({ className: switchClasses.control }, { children: loading && jsx(Icon, { icon: SwitchSpinnerIcon, spin: true }, void 0) }), void 0),
26
- jsx("input", Object.assign({}, inputProps, { "aria-checked": checked, "aria-disabled": disabled, checked: checked, className: switchClasses.input, disabled: disabled, onChange: onChange, type: "checkbox" }), void 0)] }), void 0));
25
+ }, className), children: [jsx("span", { className: switchClasses.control, children: loading && jsx(Icon, { icon: SwitchSpinnerIcon, spin: true }) }), jsx("input", { ...inputProps, "aria-checked": checked, "aria-disabled": disabled, checked: checked, className: switchClasses.input, disabled: disabled, onChange: onChange, type: "checkbox" })] }));
27
26
  });
28
27
  var Switch$1 = Switch;
29
28
 
package/Table/Table.d.ts CHANGED
@@ -82,5 +82,5 @@ export interface TableWithPagination<T> extends TableBaseProps<T> {
82
82
  fetchMore?: undefined;
83
83
  }
84
84
  export declare type TableProps<T> = TableWithFetchMore<T> | TableWithPagination<T>;
85
- declare const Table: import("react").ForwardRefExoticComponent<(TableWithFetchMore<Record<string, unknown>> & import("react").RefAttributes<HTMLDivElement>) | (TableWithPagination<Record<string, unknown>> & import("react").RefAttributes<HTMLDivElement>)>;
85
+ declare const Table: import("react").ForwardRefExoticComponent<TableProps<Record<string, unknown>> & import("react").RefAttributes<HTMLDivElement>>;
86
86
  export default Table;
package/Table/Table.js CHANGED
@@ -52,13 +52,9 @@ const Table = forwardRef(function Table(props, ref) {
52
52
  /** Feature refresh */
53
53
  const isRefreshShow = useMemo(() => {
54
54
  var _a;
55
- return ((_a =
55
+ return (
56
56
  /** @default false */
57
- refreshProp === null ||
58
- /** @default false */
59
- refreshProp === void 0 ? void 0 :
60
- /** @default false */
61
- refreshProp.show) !== null && _a !== void 0 ? _a : false);
57
+ (_a = refreshProp === null || refreshProp === void 0 ? void 0 : refreshProp.show) !== null && _a !== void 0 ? _a : false);
62
58
  }, [refreshProp === null || refreshProp === void 0 ? void 0 : refreshProp.show]);
63
59
  /** context */
64
60
  const tableContextValue = useMemo(() => {
@@ -120,10 +116,7 @@ const Table = forwardRef(function Table(props, ref) {
120
116
  const tableComponentContextValue = {
121
117
  bodyCell: (_a = components === null || components === void 0 ? void 0 : components.body) === null || _a === void 0 ? void 0 : _a.cell,
122
118
  };
123
- return (jsx(Loading, Object.assign({ loading: loading, stretch: true, tip: "\u8CC7\u6599\u8F09\u5165\u4E2D..." }, { children: jsx("div", Object.assign({ ref: ref }, rest, { className: cx(tableClasses.host, className), role: "grid" }, { children: jsx(TableContext.Provider, Object.assign({ value: tableContextValue }, { children: jsx(TableDataContext.Provider, Object.assign({ value: tableDataContextValue }, { children: jsxs(TableComponentContext.Provider, Object.assign({ value: tableComponentContextValue }, { children: [isRefreshShow ? (jsx(TableRefresh, { onClick: refreshProp.onClick }, void 0)) : null,
124
- jsx(TableHeader, { className: headerClassName }, void 0),
125
- jsx(TableBody, { ref: bodyRef, className: bodyClassName, rowClassName: bodyRowClassName }, void 0),
126
- paginationProp ? (jsx(TablePagination, { bodyRef: bodyRef }, void 0)) : null] }), void 0) }), void 0) }), void 0) }), void 0) }), void 0));
119
+ return (jsx(Loading, { loading: loading, stretch: true, tip: "\u8CC7\u6599\u8F09\u5165\u4E2D...", children: jsx("div", { ref: ref, ...rest, className: cx(tableClasses.host, className), role: "grid", children: jsx(TableContext.Provider, { value: tableContextValue, children: jsx(TableDataContext.Provider, { value: tableDataContextValue, children: jsxs(TableComponentContext.Provider, { value: tableComponentContextValue, children: [isRefreshShow ? (jsx(TableRefresh, { onClick: refreshProp.onClick })) : null, jsx(TableHeader, { className: headerClassName }), jsx(TableBody, { ref: bodyRef, className: bodyClassName, rowClassName: bodyRowClassName }), paginationProp ? (jsx(TablePagination, { bodyRef: bodyRef })) : null] }) }) }) }) }));
127
120
  });
128
121
  var Table$1 = Table;
129
122
 
@@ -22,15 +22,13 @@ const TableBody = forwardRef(function TableBody(props, ref) {
22
22
  const currentStartCount = (paginationOptions === null || paginationOptions === void 0 ? void 0 : paginationOptions.pageSize) && currentPage ? ((paginationOptions.pageSize) * (currentPage - 1)) : 0;
23
23
  const currentEndCount = (paginationOptions === null || paginationOptions === void 0 ? void 0 : paginationOptions.pageSize) && currentPage && total ? (Math.min(((paginationOptions.pageSize) * currentPage), total)) : 0;
24
24
  const currentDataSource = pagination && !disableAutoSlicing ? (dataSource.slice(currentStartCount, currentEndCount)) : dataSource;
25
- return (jsxs("div", Object.assign({}, rest, { ref: composedRefs, className: cx(tableClasses.body, className), onScroll: tableBody.onScroll, role: "rowgroup" }, { children: [currentDataSource.length ? currentDataSource.map((rowData, index) => (jsx(TableBodyRow, { className: rowClassName, rowData: rowData, rowIndex: index }, (rowData.key || rowData.id)))) : (jsx(Empty, Object.assign({}, restEmptyProps, { className: cx(tableClasses.bodyEmpty, emptyComponentClassName), fullHeight: emptyComponentFullHeight }, { children: emptyComponentChildren }), void 0)),
26
- (fetchMore === null || fetchMore === void 0 ? void 0 : fetchMore.isFetching) ? (jsx("div", Object.assign({ className: tableClasses.bodyFetchMore }, { children: jsx(Loading, { loading: true }, void 0) }), void 0)) : null,
27
- jsx("div", Object.assign({ ref: scrollElement.ref, onMouseDown: scrollElement.onMouseDown, onMouseUp: scrollElement.onMouseUp, onMouseEnter: scrollElement.onMouseEnter, onMouseLeave: scrollElement.onMouseLeave, role: "button", style: scrollElement.style, tabIndex: -1 }, { children: jsx("div", { style: {
25
+ return (jsxs("div", { ...rest, ref: composedRefs, className: cx(tableClasses.body, className), onScroll: tableBody.onScroll, role: "rowgroup", children: [currentDataSource.length ? currentDataSource.map((rowData, index) => (jsx(TableBodyRow, { className: rowClassName, rowData: rowData, rowIndex: index }, (rowData.key || rowData.id)))) : (jsx(Empty, { ...restEmptyProps, className: cx(tableClasses.bodyEmpty, emptyComponentClassName), fullHeight: emptyComponentFullHeight, children: emptyComponentChildren })), (fetchMore === null || fetchMore === void 0 ? void 0 : fetchMore.isFetching) ? (jsx("div", { className: tableClasses.bodyFetchMore, children: jsx(Loading, { loading: true }) })) : null, jsx("div", { ref: scrollElement.ref, onMouseDown: scrollElement.onMouseDown, onMouseUp: scrollElement.onMouseUp, onMouseEnter: scrollElement.onMouseEnter, onMouseLeave: scrollElement.onMouseLeave, role: "button", style: scrollElement.style, tabIndex: -1, children: jsx("div", { style: {
28
26
  width: `${scrollBarSize}px`,
29
27
  height: '100%',
30
28
  borderRadius: '10px',
31
29
  backgroundColor: '#7d7d7d',
32
30
  transition: '0.1s',
33
- } }, void 0) }), void 0)] }), void 0));
31
+ } }) })] }));
34
32
  });
35
33
  var TableBody$1 = TableBody;
36
34
 
@@ -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;