@mezzanine-ui/react 0.15.2 → 0.16.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 (145) hide show
  1. package/Accordion/Accordion.js +1 -2
  2. package/Accordion/AccordionDetails.js +1 -2
  3. package/Accordion/AccordionSummary.d.ts +1 -1
  4. package/Accordion/AccordionSummary.js +1 -2
  5. package/Alert/Alert.js +1 -2
  6. package/Anchor/Anchor.js +1 -2
  7. package/AppBar/AppBar.js +1 -2
  8. package/AppBar/AppBarBrand.js +1 -2
  9. package/AppBar/AppBarMain.js +1 -2
  10. package/AppBar/AppBarSupport.js +1 -2
  11. package/Badge/Badge.js +1 -2
  12. package/Badge/BadgeContainer.js +1 -2
  13. package/Button/ButtonGroup.js +1 -2
  14. package/Button/index.d.ts +3 -3
  15. package/Calendar/Calendar.js +1 -2
  16. package/Calendar/CalendarMonths.js +1 -1
  17. package/Calendar/CalendarYears.js +1 -1
  18. package/Card/Card.js +1 -2
  19. package/Card/CardActions.js +1 -2
  20. package/Checkbox/CheckAll.js +1 -2
  21. package/Checkbox/Checkbox.js +1 -2
  22. package/Checkbox/CheckboxGroup.js +1 -2
  23. package/ConfirmActions/ConfirmActions.js +1 -2
  24. package/DatePicker/DatePicker.js +1 -2
  25. package/DatePicker/DatePickerCalendar.d.ts +1 -1
  26. package/DatePicker/DatePickerCalendar.js +1 -2
  27. package/DateRangePicker/DateRangePicker.js +1 -2
  28. package/DateRangePicker/DateRangePickerCalendar.d.ts +2 -2
  29. package/DateRangePicker/DateRangePickerCalendar.js +1 -2
  30. package/DateTimePicker/DateTimePicker.js +1 -2
  31. package/DateTimePicker/DateTimePickerPanel.js +1 -2
  32. package/Drawer/Drawer.js +1 -2
  33. package/Dropdown/Dropdown.js +1 -2
  34. package/Empty/Empty.js +1 -2
  35. package/Form/FormField.js +1 -2
  36. package/Form/FormLabel.js +1 -2
  37. package/Form/FormMessage.js +1 -2
  38. package/Form/useInputWithClearControlValue.d.ts +1 -1
  39. package/Form/useInputWithTagsModeValue.d.ts +1 -1
  40. package/Icon/Icon.js +1 -2
  41. package/Input/Input.js +2 -5
  42. package/Loading/Loading.js +1 -2
  43. package/Menu/Menu.js +1 -2
  44. package/Menu/MenuDivider.js +1 -2
  45. package/Menu/MenuItem.js +1 -2
  46. package/Menu/MenuItemGroup.js +1 -2
  47. package/Message/Message.js +1 -2
  48. package/Modal/Modal.js +1 -2
  49. package/Modal/ModalActions.js +1 -2
  50. package/Modal/ModalBody.js +1 -2
  51. package/Modal/ModalFooter.js +1 -2
  52. package/Modal/ModalHeader.js +2 -3
  53. package/Modal/useModalContainer.d.ts +1 -1
  54. package/Navigation/Navigation.js +1 -2
  55. package/Navigation/NavigationItem.js +1 -2
  56. package/Navigation/NavigationSubMenu.js +1 -2
  57. package/Notification/Notification.js +1 -2
  58. package/Notifier/NotifierManager.d.ts +1 -1
  59. package/Overlay/Overlay.js +1 -2
  60. package/PageFooter/PageFooter.js +1 -2
  61. package/Pagination/Pagination.js +1 -2
  62. package/Pagination/PaginationItem.js +2 -3
  63. package/Pagination/PaginationJumper.js +1 -2
  64. package/Pagination/PaginationPageSize.js +1 -2
  65. package/Picker/PickerTrigger.d.ts +1 -1
  66. package/Picker/PickerTrigger.js +1 -2
  67. package/Picker/RangePickerTrigger.d.ts +2 -2
  68. package/Picker/RangePickerTrigger.js +1 -2
  69. package/Picker/usePickerDocumentEventClose.d.ts +3 -3
  70. package/Picker/usePickerValue.d.ts +1 -1
  71. package/Picker/useRangePickerValue.d.ts +2 -2
  72. package/Picker/useTabKeyClose.d.ts +1 -1
  73. package/Popconfirm/Popconfirm.js +2 -3
  74. package/Popover/Popover.js +1 -2
  75. package/Popper/Popper.js +1 -2
  76. package/Portal/Portal.js +1 -2
  77. package/Progress/Progress.js +1 -2
  78. package/Provider/ConfigProvider.d.ts +1 -1
  79. package/Radio/Radio.js +1 -2
  80. package/Radio/RadioGroup.js +1 -2
  81. package/Select/AutoComplete.d.ts +7 -0
  82. package/Select/AutoComplete.js +7 -11
  83. package/Select/Option.js +1 -2
  84. package/Select/Select.js +1 -2
  85. package/Select/SelectTrigger.js +1 -2
  86. package/Select/SelectTriggerTags.js +3 -4
  87. package/Select/TreeSelect.js +1 -2
  88. package/Select/useSelectTriggerTags.d.ts +2 -2
  89. package/Select/useSelectTriggerTags.js +1 -4
  90. package/Skeleton/Skeleton.js +1 -2
  91. package/Slider/Slider.js +1 -2
  92. package/Slider/useSlider.d.ts +1 -1
  93. package/Slider/useSlider.js +1 -1
  94. package/Stepper/Step.js +1 -2
  95. package/Stepper/Stepper.js +1 -2
  96. package/Switch/Switch.js +1 -2
  97. package/Table/Table.d.ts +1 -1
  98. package/Table/Table.js +1 -2
  99. package/Table/TableCell.js +1 -2
  100. package/Table/draggable/useTableDraggable.d.ts +1 -1
  101. package/Table/pagination/TablePagination.d.ts +1 -1
  102. package/Table/pagination/useTablePagination.d.ts +1 -1
  103. package/Table/refresh/TableRefresh.js +1 -2
  104. package/Table/useTableScroll.d.ts +42 -8
  105. package/Table/useTableScroll.js +1 -1
  106. package/Tabs/Tab.js +1 -2
  107. package/Tabs/TabPane.js +1 -2
  108. package/Tabs/Tabs.js +1 -2
  109. package/Tabs/useTabsOverflow.d.ts +1 -1
  110. package/Tag/Tag.js +1 -2
  111. package/TextField/TextField.d.ts +1 -2
  112. package/TextField/TextField.js +1 -2
  113. package/Textarea/Textarea.js +1 -2
  114. package/TimePanel/TimePanel.js +1 -2
  115. package/TimePanel/TimePanelAction.js +1 -2
  116. package/TimePanel/TimePanelColumn.js +1 -2
  117. package/TimePicker/TimePicker.js +1 -2
  118. package/TimePicker/TimePickerPanel.js +1 -2
  119. package/Tooltip/Tooltip.d.ts +1 -1
  120. package/Tooltip/Tooltip.js +5 -16
  121. package/Transition/Collapse.js +2 -6
  122. package/Transition/Fade.js +1 -2
  123. package/Transition/Grow.js +1 -2
  124. package/Transition/SlideFade.js +1 -2
  125. package/Transition/Transition.d.ts +1 -1
  126. package/Transition/Zoom.js +1 -2
  127. package/Transition/useAutoTransitionDuration.d.ts +1 -1
  128. package/Tree/Tree.js +1 -2
  129. package/Tree/TreeNode.js +1 -2
  130. package/Tree/TreeNodeList.js +1 -2
  131. package/Tree/typings.d.ts +2 -2
  132. package/Typography/index.d.ts +2 -2
  133. package/Upload/UploadButton.js +1 -2
  134. package/Upload/UploadPicture.js +1 -2
  135. package/Upload/UploadPictureBlock.js +1 -2
  136. package/Upload/UploadPictureWall.js +1 -2
  137. package/Upload/UploadResult.js +1 -2
  138. package/_internal/InputCheck/InputCheck.js +1 -2
  139. package/_internal/InputCheck/InputCheckGroup.js +1 -2
  140. package/_internal/InputTriggerPopper/InputTriggerPopper.js +1 -2
  141. package/_internal/SlideFadeOverlay/SlideFadeOverlay.js +1 -2
  142. package/hooks/useClickAway.d.ts +1 -1
  143. package/index.js +23 -23
  144. package/package.json +18 -18
  145. package/utils/jsx-types.d.ts +1 -1
@@ -25,6 +25,5 @@ const Pagination = forwardRef((props, ref) => {
25
25
  });
26
26
  return (jsx("nav", { ...rest, ref: ref, "aria-label": "pagination navigation", className: cx(paginationClasses.host, className), children: jsxs("ul", { className: paginationClasses.container, children: [showPageSizeOptions && (jsx("li", { className: paginationClasses.pageSize, children: jsx(PaginationPageSize, { disabled: disabled, label: pageSizeLabel, onChange: onChangePageSize, options: pageSizeOptions, renderOptionName: renderPageSizeOptionName, unit: pageSizeUnit, value: pageSize }) })), items.map((item, index) => (jsx("li", { className: paginationClasses.item, children: itemRender(item) }, index))), showJumper && (jsx("li", { className: paginationClasses.jumper, children: jsx(PaginationJumper, { buttonText: buttonText, disabled: disabled, hintText: hintText, inputPlaceholder: inputPlaceholder, onChange: onChange, pageSize: pageSize, total: total }) }))] }) }));
27
27
  });
28
- var Pagination$1 = Pagination;
29
28
 
30
- export { Pagination$1 as default };
29
+ export { Pagination as default };
@@ -1,7 +1,7 @@
1
1
  import { forwardRef, createElement } from 'react';
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
  import { paginationItemClasses } from '@mezzanine-ui/core/pagination';
4
- import { ChevronRightIcon, ChevronLeftIcon } from '@mezzanine-ui/icons';
4
+ import { ChevronLeftIcon, ChevronRightIcon } from '@mezzanine-ui/icons';
5
5
  import Icon from '../Icon/Icon.js';
6
6
  import cx from 'clsx';
7
7
 
@@ -21,6 +21,5 @@ const PaginationItem = forwardRef((props, ref) => {
21
21
  ButtonIcon && jsx(Icon, { icon: ButtonIcon }),
22
22
  type === 'page' && page));
23
23
  });
24
- var PaginationItem$1 = PaginationItem;
25
24
 
26
- export { PaginationItem$1 as default };
25
+ export { PaginationItem as default };
@@ -46,6 +46,5 @@ const PaginationJumper = forwardRef((props, ref) => {
46
46
  onKeyDown: handleKeyDown,
47
47
  }, value: value }), jsx(Button, { disabled: disabled, onClick: handleClick, children: buttonText })] }));
48
48
  });
49
- var PaginationJumper$1 = PaginationJumper;
50
49
 
51
- export { PaginationJumper$1 as default };
50
+ export { PaginationJumper as default };
@@ -16,6 +16,5 @@ const PaginationPageSize = forwardRef((props, ref) => {
16
16
  : undefined, [value, renderOptionName]);
17
17
  return (jsxs("div", { ...rest, ref: ref, className: cx(paginationPageSizeClasses.host, className), children: [label ? (jsx(Typography, { color: "text-secondary", component: "div", ellipsis: true, variant: "button3", children: label })) : null, jsx(Select, { disabled: disabled, value: currentValue, onChange: (nextSelection) => onChange === null || onChange === void 0 ? void 0 : onChange(Number(nextSelection.id)), className: paginationPageSizeClasses.select, children: options.map((opt) => (jsx(Option, { value: `${opt}`, children: renderOptionName(opt) }, opt))) }), unit ? (jsx(Typography, { color: "text-secondary", component: "div", ellipsis: true, variant: "button3", children: unit })) : null] }));
18
18
  });
19
- var PaginationPageSize$1 = PaginationPageSize;
20
19
 
21
- export { PaginationPageSize$1 as default };
20
+ export { PaginationPageSize as default };
@@ -5,7 +5,7 @@ export interface PickerTriggerProps extends Omit<TextFieldProps, 'active' | 'chi
5
5
  /**
6
6
  * React ref for the input element.
7
7
  */
8
- inputRef?: RefObject<HTMLInputElement>;
8
+ inputRef?: RefObject<HTMLInputElement | null>;
9
9
  /**
10
10
  * Change handler for the input element.
11
11
  */
@@ -11,6 +11,5 @@ const PickerTrigger = forwardRef(function PickerTrigger(props, ref) {
11
11
  const { className, clearable, disabled, inputProps, inputRef, onChange, placeholder, readOnly, required, value, ...restTextFieldProps } = props;
12
12
  return (jsx(TextField, { ...restTextFieldProps, ref: ref, active: !!value, className: cx(pickerClasses.host, className), clearable: !readOnly && clearable, disabled: disabled, children: jsx("input", { ...inputProps, ref: inputRef, "aria-disabled": disabled, "aria-multiline": false, "aria-readonly": readOnly, "aria-required": required, disabled: disabled, onChange: onChange, placeholder: placeholder, readOnly: readOnly, required: required, value: value }) }));
13
13
  });
14
- var PickerTrigger$1 = PickerTrigger;
15
14
 
16
- export { PickerTrigger$1 as default };
15
+ export { PickerTrigger as default };
@@ -9,7 +9,7 @@ export interface RangePickerTriggerProps extends Omit<TextFieldProps, 'active' |
9
9
  /**
10
10
  * React Ref for the 'from' input element.
11
11
  */
12
- inputFromRef?: RefObject<HTMLInputElement>;
12
+ inputFromRef?: RefObject<HTMLInputElement | null>;
13
13
  /**
14
14
  * Value of the 'from' input element.
15
15
  */
@@ -21,7 +21,7 @@ export interface RangePickerTriggerProps extends Omit<TextFieldProps, 'active' |
21
21
  /**
22
22
  * React Ref for the 'to' input element.
23
23
  */
24
- inputToRef?: RefObject<HTMLInputElement>;
24
+ inputToRef?: RefObject<HTMLInputElement | null>;
25
25
  /**
26
26
  * Value of the 'to' input element.
27
27
  */
@@ -13,6 +13,5 @@ const RangePickerTrigger = forwardRef(function DateRangePickerTrigger(props, ref
13
13
  const { className, clearable, disabled, inputFromPlaceholder, inputFromProps, inputFromRef, inputFromValue, inputToPlaceholder, inputToProps, inputToRef, inputToValue, onIconClick, onInputFromChange, onInputToChange, readOnly, required, ...restTextFieldProps } = props;
14
14
  return (jsxs(TextField, { ...restTextFieldProps, ref: ref, active: !!inputFromValue || !!inputToValue, className: cx(pickerClasses.host, className), clearable: !readOnly && clearable, disabled: disabled, children: [jsx("input", { ...inputFromProps, ref: inputFromRef, "aria-disabled": disabled, "aria-multiline": false, "aria-readonly": readOnly, "aria-required": required, disabled: disabled, onChange: onInputFromChange, placeholder: inputFromPlaceholder, readOnly: readOnly, required: required, value: inputFromValue }), jsx(Icon, { icon: ArrowRightIcon, className: pickerClasses.arrowIcon }), jsx("input", { ...inputToProps, ref: inputToRef, "aria-disabled": disabled, "aria-multiline": false, "aria-readonly": readOnly, "aria-required": required, disabled: disabled, onChange: onInputToChange, placeholder: inputToPlaceholder, readOnly: readOnly, required: required, value: inputToValue })] }));
15
15
  });
16
- var RangePickerTrigger$1 = RangePickerTrigger;
17
16
 
18
- export { RangePickerTrigger$1 as default };
17
+ export { RangePickerTrigger as default };
@@ -1,10 +1,10 @@
1
1
  import { RefObject } from 'react';
2
2
  export interface UsePickerDocumentEventCloseProps {
3
- anchorRef: RefObject<HTMLElement>;
4
- lastElementRefInFlow: RefObject<HTMLElement>;
3
+ anchorRef: RefObject<HTMLElement | null>;
4
+ lastElementRefInFlow: RefObject<HTMLElement | null>;
5
5
  onClose: VoidFunction;
6
6
  onChangeClose: VoidFunction;
7
7
  open?: boolean;
8
- popperRef: RefObject<HTMLElement>;
8
+ popperRef: RefObject<HTMLElement | null>;
9
9
  }
10
10
  export declare function usePickerDocumentEventClose({ anchorRef, lastElementRefInFlow, onClose, onChangeClose, open, popperRef, }: UsePickerDocumentEventCloseProps): void;
@@ -4,7 +4,7 @@ export type UsePickerValueProps = {
4
4
  defaultValue?: DateType;
5
5
  format: string;
6
6
  formats: string[];
7
- inputRef: RefObject<HTMLInputElement>;
7
+ inputRef: RefObject<HTMLInputElement | null>;
8
8
  value?: DateType;
9
9
  };
10
10
  /**
@@ -2,8 +2,8 @@ import { RangePickerPickingValue, RangePickerValue } from '@mezzanine-ui/core/pi
2
2
  import { ChangeEventHandler, KeyboardEventHandler, RefObject } from 'react';
3
3
  import { UsePickerValueProps } from './usePickerValue';
4
4
  export interface UseRangePickerValueProps extends Pick<UsePickerValueProps, 'format' | 'formats'> {
5
- inputFromRef: RefObject<HTMLInputElement>;
6
- inputToRef: RefObject<HTMLInputElement>;
5
+ inputFromRef: RefObject<HTMLInputElement | null>;
6
+ inputToRef: RefObject<HTMLInputElement | null>;
7
7
  value?: RangePickerValue;
8
8
  }
9
9
  export declare function useRangePickerValue({ format, formats, inputFromRef, inputToRef, value: valueProp, }: UseRangePickerValueProps): {
@@ -1,2 +1,2 @@
1
1
  import { DependencyList, RefObject } from 'react';
2
- export declare function useTabKeyClose(onClose: VoidFunction, lastElementRefInFlow: RefObject<HTMLElement>, deps?: DependencyList): void;
2
+ export declare function useTabKeyClose(onClose: VoidFunction, lastElementRefInFlow: RefObject<HTMLElement | null>, deps?: DependencyList): void;
@@ -3,14 +3,13 @@ import { forwardRef } from 'react';
3
3
  import { ExclamationCircleFilledIcon } from '@mezzanine-ui/icons';
4
4
  import { popConfirmClasses } from '@mezzanine-ui/core/popconfirm';
5
5
  import Popover from '../Popover/Popover.js';
6
- import Icon from '../Icon/Icon.js';
7
6
  import ConfirmActions from '../ConfirmActions/ConfirmActions.js';
7
+ import Icon from '../Icon/Icon.js';
8
8
  import cx from 'clsx';
9
9
 
10
10
  const Popconfirm = forwardRef(function Popconfirm(props, ref) {
11
11
  const { className, container, cancelButtonProps, cancelText, confirmButtonProps, confirmText, icon = ExclamationCircleFilledIcon, onCancel, onConfirm, title, ...rest } = props;
12
12
  return (jsx(Popover, { ...rest, ref: ref, className: cx(popConfirmClasses.host, className), title: jsxs(Fragment, { children: [jsx(Icon, { className: popConfirmClasses.icon, icon: icon }), title] }), children: jsx(ConfirmActions, { cancelButtonProps: cancelButtonProps, cancelText: cancelText, confirmButtonProps: confirmButtonProps, confirmText: confirmText, onCancel: onCancel, onConfirm: onConfirm, size: "small" }) }));
13
13
  });
14
- var Popconfirm$1 = Popconfirm;
15
14
 
16
- export { Popconfirm$1 as default };
15
+ export { Popconfirm as default };
@@ -35,6 +35,5 @@ const Popover = forwardRef(function Popover(props, ref) {
35
35
  modifiers: [offsetModifier, ...modifiers],
36
36
  }, children: [title && jsx("div", { className: popoverClasses.title, children: title }), children && jsx("div", { className: popoverClasses.content, children: children })] }));
37
37
  });
38
- var Popover$1 = Popover;
39
38
 
40
- export { Popover$1 as default };
39
+ export { Popover as default };
package/Popper/Popper.js CHANGED
@@ -26,6 +26,5 @@ const Popper = forwardRef(function Popper(props, ref) {
26
26
  ...styles.popper,
27
27
  }, ...attributes.popper, children: children }) }));
28
28
  });
29
- var Popper$1 = Popper;
30
29
 
31
- export { Popper$1 as default };
30
+ export { Popper as default };
package/Portal/Portal.js CHANGED
@@ -19,6 +19,5 @@ const Portal = (props) => {
19
19
  }
20
20
  return createPortal(children, portalElement);
21
21
  };
22
- var Portal$1 = Portal;
23
22
 
24
- export { Portal$1 as default };
23
+ export { Portal as default };
@@ -30,6 +30,5 @@ const Progress = forwardRef(function Progress(props, ref) {
30
30
  };
31
31
  return (jsxs("div", { ref: ref, className: cx(progressClasses.host, className, status === ProgressStatuses.success && progressClasses.success, status === ProgressStatuses.error && progressClasses.error, type === ProgressTypes.line && progressClasses.lineVariant, type === ProgressTypes.circle && progressClasses.circleVariant, progressClasses.size(size)), ...rest, children: [type === ProgressTypes.line && renderLine(), type === ProgressTypes.circle && renderCircle()] }));
32
32
  });
33
- var Progress$1 = Progress;
34
33
 
35
- export { Progress$1 as default };
34
+ export { Progress as default };
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import { ReactNode, type JSX } from 'react';
2
2
  import { MezzanineConfigContext } from './context';
3
3
  export interface ConfigProviderProps {
4
4
  children?: ReactNode;
package/Radio/Radio.js CHANGED
@@ -29,6 +29,5 @@ const Radio = forwardRef(function Radio(props, ref) {
29
29
  [radioClasses.checked]: checked,
30
30
  }), children: jsx("input", { ...restInputProps, "aria-checked": checked, "aria-disabled": disabled, checked: checked, disabled: disabled, id: inputId, onChange: onChange, name: name, type: "radio", value: value }) }), disabled: disabled, error: error, htmlFor: inputId, size: size, children: children }));
31
31
  });
32
- var Radio$1 = Radio;
33
32
 
34
- export { Radio$1 as default };
33
+ export { Radio as default };
@@ -26,6 +26,5 @@ const RadioGroup = forwardRef(function RadioGroup(props, ref) {
26
26
  options.map((option) => (jsx(Radio, { disabled: option.disabled, value: option.value, children: option.label }, option.value)));
27
27
  return (jsx(RadioGroupContext.Provider, { value: context, children: jsx(InputCheckGroup, { ...rest, ref: ref, role: "radiogroup", children: children }) }));
28
28
  });
29
- var RadioGroup$1 = RadioGroup;
30
29
 
31
- export { RadioGroup$1 as default };
30
+ export { RadioGroup as default };
@@ -1,3 +1,4 @@
1
+ import { Dispatch, SetStateAction, RefObject } from 'react';
1
2
  import { SelectInputSize } from '@mezzanine-ui/core/select';
2
3
  import { SelectValue } from './typings';
3
4
  import { MenuProps } from '../Menu';
@@ -47,6 +48,12 @@ export interface AutoCompleteBaseProps extends Omit<SelectTriggerProps, 'active'
47
48
  * @default false
48
49
  */
49
50
  required?: boolean;
51
+ /**
52
+ *
53
+ */
54
+ searchTextControlRef?: RefObject<{
55
+ setSearchText: Dispatch<SetStateAction<string>>;
56
+ } | undefined>;
50
57
  /**
51
58
  * The size of input.
52
59
  */
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import { forwardRef, useContext, useState, useRef, useMemo } from 'react';
2
+ import { forwardRef, useContext, useState, useImperativeHandle, useRef, useMemo } from 'react';
3
3
  import { selectClasses } from '@mezzanine-ui/core/select';
4
4
  import { PlusIcon } from '@mezzanine-ui/icons';
5
5
  import isArray from 'lodash/isArray';
@@ -24,7 +24,7 @@ const MENU_ID = 'mzn-select-autocomplete-menu-id';
24
24
  const AutoComplete = forwardRef(function Select(props, ref) {
25
25
  var _a, _b;
26
26
  const { disabled: disabledFromFormControl, fullWidth: fullWidthFromFormControl, required: requiredFromFormControl, severity, } = useContext(FormControlContext) || {};
27
- const { addable = false, className, disabled = disabledFromFormControl || false, disabledOptionsFilter = false, defaultValue, error = severity === 'error' || false, fullWidth = fullWidthFromFormControl || false, inputRef, inputProps, itemsInView = 4, menuMaxHeight, menuRole = 'listbox', menuSize, mode = 'single', onChange: onChangeProp, onClear: onClearProp, onInsert, onSearch, options: optionsProp, popperOptions = {}, placeholder = '', prefix, required = requiredFromFormControl || false, size, value: valueProp, } = props;
27
+ const { addable = false, className, disabled = disabledFromFormControl || false, disabledOptionsFilter = false, defaultValue, error = severity === 'error' || false, fullWidth = fullWidthFromFormControl || false, inputRef, inputProps, itemsInView = 4, menuMaxHeight, menuRole = 'listbox', menuSize, mode = 'single', onChange: onChangeProp, onClear: onClearProp, onInsert, onSearch, options: optionsProp, popperOptions = {}, placeholder = '', prefix, required = requiredFromFormControl || false, searchTextControlRef, size, value: valueProp, } = props;
28
28
  const [open, toggleOpen] = useState(false);
29
29
  const { focused, onFocus, onChange, onClear, options, searchText, selectedOptions, setSearchText, unselectedOptions, value, } = useAutoCompleteValueControl({
30
30
  defaultValue,
@@ -37,6 +37,8 @@ const AutoComplete = forwardRef(function Select(props, ref) {
37
37
  options: optionsProp,
38
38
  value: valueProp,
39
39
  });
40
+ /** export set search text action to props (allow user to customize search text) */
41
+ useImperativeHandle(searchTextControlRef, () => ({ setSearchText }));
40
42
  /** insert feature */
41
43
  const [insertText, setInsertText] = useState('');
42
44
  const nodeRef = useRef(null);
@@ -93,13 +95,8 @@ const AutoComplete = forwardRef(function Select(props, ref) {
93
95
  };
94
96
  const searchTextExistWithoutOption = !!searchText &&
95
97
  options.find((option) => option.name === searchText) === undefined;
96
- const context = useMemo(() => ({
97
- onChange,
98
- value,
99
- }), [onChange, value]);
100
- return (jsx(SelectControlContext.Provider, { value: context, children: jsxs("div", { ref: nodeRef, className: cx(selectClasses.host, {
101
- [selectClasses.hostFullWidth]: fullWidth,
102
- }), children: [jsx(SelectTrigger, { ref: composedRef, active: open, className: className, clearable: true, disabled: disabled, ellipsis: true, error: error, fullWidth: fullWidth, inputRef: inputRef, mode: mode, onTagClose: onChange, onClear: onClear, prefix: prefix, readOnly: false, required: required, inputProps: resolvedInputProps, searchText: searchText, size: size, showTextInputAfterTags: true, suffixAction: onClickSuffixActionIcon, value: value, renderValue: renderValue }), jsxs(InputTriggerPopper, { ref: popperRef, anchor: controlRef, className: selectClasses.popper, open: open, sameWidth: true, options: popperOptions, children: [options.length ? (jsx(Menu, { id: MENU_ID, "aria-activedescendant": Array.isArray(value) ? ((_b = (_a = value === null || value === void 0 ? void 0 : value[0]) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : '') : value === null || value === void 0 ? void 0 : value.id, itemsInView: itemsInView, maxHeight: menuMaxHeight, role: menuRole, size: menuSize, style: { border: 0 }, children: mode === 'single' ? (jsx(Fragment, { children: options.map((option) => (jsx(Option, { value: option.id, children: option.name }, option.id))) })) : (jsxs(Fragment, { children: [selectedOptions.map((option) => (jsx(Option, { value: option.id, children: option.name }, option.id))), unselectedOptions.map((option) => (jsx(Option, { value: option.id, children: option.name }, option.id)))] })) })) : null, searchTextExistWithoutOption && addable ? (jsxs("button", { type: "button", className: selectClasses.autoComplete, onClick: (e) => {
98
+ const context = useMemo(() => ({ onChange, value }), [onChange, value]);
99
+ return (jsx(SelectControlContext.Provider, { value: context, children: jsxs("div", { ref: nodeRef, className: cx(selectClasses.host, { [selectClasses.hostFullWidth]: fullWidth }), children: [jsx(SelectTrigger, { ref: composedRef, active: open, className: className, clearable: true, disabled: disabled, ellipsis: true, error: error, fullWidth: fullWidth, inputRef: inputRef, mode: mode, onTagClose: onChange, onClear: onClear, prefix: prefix, readOnly: false, required: required, inputProps: resolvedInputProps, searchText: searchText, size: size, showTextInputAfterTags: true, suffixAction: onClickSuffixActionIcon, value: value, renderValue: renderValue }), jsxs(InputTriggerPopper, { ref: popperRef, anchor: controlRef, className: selectClasses.popper, open: open, sameWidth: true, options: popperOptions, children: [options.length ? (jsx(Menu, { id: MENU_ID, "aria-activedescendant": Array.isArray(value) ? ((_b = (_a = value === null || value === void 0 ? void 0 : value[0]) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : '') : value === null || value === void 0 ? void 0 : value.id, itemsInView: itemsInView, maxHeight: menuMaxHeight, role: menuRole, size: menuSize, style: { border: 0 }, children: mode === 'single' ? (jsx(Fragment, { children: options.map((option) => (jsx(Option, { value: option.id, children: option.name }, option.id))) })) : (jsxs(Fragment, { children: [selectedOptions.map((option) => (jsx(Option, { value: option.id, children: option.name }, option.id))), unselectedOptions.map((option) => (jsx(Option, { value: option.id, children: option.name }, option.id)))] })) })) : null, searchTextExistWithoutOption && addable ? (jsxs("button", { type: "button", className: selectClasses.autoComplete, onClick: (e) => {
103
100
  var _a;
104
101
  e.stopPropagation();
105
102
  if (insertText) {
@@ -112,6 +109,5 @@ const AutoComplete = forwardRef(function Select(props, ref) {
112
109
  }
113
110
  }, children: [jsx("p", { children: insertText }), jsx(Icon, { className: selectClasses.autoCompleteIcon, icon: PlusIcon })] })) : null] })] }) }));
114
111
  });
115
- var AutoComplete$1 = AutoComplete;
116
112
 
117
- export { AutoComplete$1 as default };
113
+ export { AutoComplete as default };
package/Select/Option.js CHANGED
@@ -40,6 +40,5 @@ const Option = forwardRef(function Option(props, ref) {
40
40
  onSelect();
41
41
  }, onKeyDown: onKeyDown, role: role, tabIndex: 0, children: children }));
42
42
  });
43
- var Option$1 = Option;
44
43
 
45
- export { Option$1 as default };
44
+ export { Option as default };
package/Select/Select.js CHANGED
@@ -119,6 +119,5 @@ const Select = forwardRef(function Select(props, ref) {
119
119
  }), [onChange, value]);
120
120
  return (jsx(SelectControlContext.Provider, { value: context, children: jsxs("div", { ref: nodeRef, className: cx(selectClasses.host, fullWidth && selectClasses.hostFullWidth), children: [jsx(SelectTrigger, { ref: composedRef, active: open, className: className, clearable: clearable, disabled: disabled, error: error, fullWidth: fullWidth, inputRef: inputRef, mode: mode, onTagClose: onChange, onClear: onClear, onClick: onClickTextField, onKeyDown: onKeyDownTextField, prefix: prefix, readOnly: true, renderValue: renderValue, required: required, inputProps: resolvedInputProps, size: size, suffixActionIcon: suffixActionIcon, value: value }), jsx(InputTriggerPopper, { anchor: controlRef, className: selectClasses.popper, disablePortal: disablePortal, open: open, options: popperOptions, sameWidth: true, children: jsx(Menu, { id: MENU_ID, "aria-activedescendant": Array.isArray(value) ? ((_b = (_a = value === null || value === void 0 ? void 0 : value[0]) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : '') : value === null || value === void 0 ? void 0 : value.id, itemsInView: itemsInView, maxHeight: menuMaxHeight, onScroll: onMenuScrollCallback, role: menuRole, size: menuSize, style: { border: 0 }, children: children }) })] }) }));
121
121
  });
122
- var Select$1 = Select;
123
122
 
124
- export { Select$1 as default };
123
+ export { Select as default };
@@ -51,6 +51,5 @@ const SelectTrigger = forwardRef((props, ref) => {
51
51
  }
52
52
  return (jsx(SelectTriggerComponent, { ...props, innerRef: ref }));
53
53
  });
54
- var SelectTrigger$1 = SelectTrigger;
55
54
 
56
- export { SelectTrigger$1 as default };
55
+ export { SelectTrigger as default };
@@ -1,4 +1,4 @@
1
- import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
1
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
2
  import { forwardRef, useRef } from 'react';
3
3
  import { selectClasses } from '@mezzanine-ui/core/select';
4
4
  import take from 'lodash/take';
@@ -9,7 +9,7 @@ import cx from 'clsx';
9
9
 
10
10
  const SelectTriggerTags = forwardRef(function SelectTriggerTags(props, ref) {
11
11
  const { disabled, ellipsis, inputProps, inputRef, onTagClose, readOnly, required, searchText, size, showTextInputAfterTags, value, } = props;
12
- const controlRef = useRef();
12
+ const controlRef = useRef(undefined);
13
13
  const composedRef = useComposeRefs([ref, controlRef]);
14
14
  const { renderFakeTags, takeCount } = useSelectTriggerTags({
15
15
  controlRef,
@@ -28,6 +28,5 @@ const SelectTriggerTags = forwardRef(function SelectTriggerTags(props, ref) {
28
28
  onTagClose === null || onTagClose === void 0 ? void 0 : onTagClose(selection);
29
29
  }, size: size, children: selection.name }, selection.id)))), ellipsis ? renderFakeTags() : null] }), showTextInputAfterTags ? (jsx("div", { className: selectClasses.triggerTagsInput, children: jsx("input", { ...inputProps, ref: inputRef, "aria-autocomplete": "list", "aria-disabled": disabled, "aria-haspopup": "listbox", "aria-readonly": readOnly, "aria-required": required, autoComplete: "off", disabled: disabled, readOnly: readOnly, required: required, type: "search", value: searchText }) })) : null] }));
30
30
  });
31
- var SelectTriggerTags$1 = SelectTriggerTags;
32
31
 
33
- export { SelectTriggerTags$1 as default };
32
+ export { SelectTriggerTags as default };
@@ -193,6 +193,5 @@ const TreeSelect = forwardRef((props, ref) => {
193
193
  width: width || `${panelWidth}px`,
194
194
  }, children: jsx(Tree, { ...restTreeProps, ref: ref, className: cx(selectClasses.tree, treeClassName), disabledValues: disabledValues, expandControllerRef: expandControllerRef, expandedValues: expandedValues, multiple: multiple, nodes: nodes, onExpand: onExpand, onSelect: onSelect, selectMethod: "target", selectable: true, values: selectedValues }) }) })] }));
195
195
  });
196
- var TreeSelect$1 = TreeSelect;
197
196
 
198
- export { TreeSelect$1 as default };
197
+ export { TreeSelect as default };
@@ -1,8 +1,8 @@
1
- import { MutableRefObject } from 'react';
1
+ import { RefObject, type JSX } from 'react';
2
2
  import { TagSize } from '@mezzanine-ui/core/tag';
3
3
  import { SelectValue } from './typings';
4
4
  export interface UseSelectTriggerTagsProps {
5
- controlRef: MutableRefObject<HTMLDivElement | undefined>;
5
+ controlRef: RefObject<HTMLDivElement | undefined>;
6
6
  size?: TagSize;
7
7
  value?: SelectValue[];
8
8
  }
@@ -52,10 +52,7 @@ function useSelectTriggerTags(props) {
52
52
  opacity: 0,
53
53
  }, children: [value === null || value === void 0 ? void 0 : value.map((selection) => (jsx(Tag, { className: mznFakeTagClassName, closable: true, disabled: true, size: size, children: selection.name }, selection.id))), jsx(Tag, { disabled: true, className: mznFakeEllipsisTagClassName, size: size, children: "+99..." })] }));
54
54
  };
55
- return {
56
- renderFakeTags,
57
- takeCount,
58
- };
55
+ return { renderFakeTags, takeCount };
59
56
  }
60
57
 
61
58
  export { calcTakeCount, useSelectTriggerTags };
@@ -14,6 +14,5 @@ const Skeleton = forwardRef(function Skeleton(props, ref) {
14
14
  ...skeletonStyle,
15
15
  }, ...rest }));
16
16
  });
17
- var Skeleton$1 = Skeleton;
18
17
 
19
- export { Skeleton$1 as default };
18
+ export { Skeleton as default };
package/Slider/Slider.js CHANGED
@@ -184,6 +184,5 @@ const Slider = forwardRef((props, ref) => {
184
184
  }
185
185
  return jsx(SliderComponent, { ...props, innerRef: ref });
186
186
  });
187
- var Slider$1 = Slider;
188
187
 
189
- export { Slider$1 as default };
188
+ export { Slider as default };
@@ -25,7 +25,7 @@ export interface UseSliderResult {
25
25
  cssVars: Record<string, CssVarInterpolation>;
26
26
  handleClickTrackOrRail?: (e: any) => void;
27
27
  handlePress: (e: any, index?: number | undefined) => void;
28
- railRef: RefObject<HTMLDivElement>;
28
+ railRef: RefObject<HTMLDivElement | null>;
29
29
  }
30
30
  export declare function useSlider(props: UseRangeSliderProps): UseSliderResult;
31
31
  export declare function useSlider(props: UseSingleSliderProps): UseSliderResult;
@@ -1,4 +1,4 @@
1
- import { isRangeSlider, fixRangeSliderValue, fixSingleSliderValue, toSliderCssVars, getPercentage, sortSliderValue, findClosetValueIndex, getSliderRect, getValueFromClientX, roundToStep } from '@mezzanine-ui/core/slider';
1
+ import { isRangeSlider, fixRangeSliderValue, fixSingleSliderValue, toSliderCssVars, getPercentage, findClosetValueIndex, sortSliderValue, getSliderRect, getValueFromClientX, roundToStep } from '@mezzanine-ui/core/slider';
2
2
  import { useRef, useState } from 'react';
3
3
  import { useDocumentEvents } from '../hooks/useDocumentEvents.js';
4
4
 
package/Stepper/Step.js CHANGED
@@ -17,6 +17,5 @@ const Step = forwardRef(function Step(props, ref) {
17
17
  /** title (optional) */
18
18
  title && (jsx(Typography, { className: stepClasses.title, variant: "button2", ...titleProps, children: title })), children] }));
19
19
  });
20
- var Step$1 = Step;
21
20
 
22
- export { Step$1 as default };
21
+ export { Step as default };
@@ -29,6 +29,5 @@ const Stepper = forwardRef(function Stepper(props, ref) {
29
29
  });
30
30
  return (jsx("div", { className: cx(stepperClasses.host, className), ref: ref, ...rest, children: stepsWithState }));
31
31
  });
32
- var Stepper$1 = Stepper;
33
32
 
34
- export { Stepper$1 as default };
33
+ export { Stepper as default };
package/Switch/Switch.js CHANGED
@@ -24,6 +24,5 @@ const Switch = forwardRef(function Switch(props, ref) {
24
24
  [switchClasses.large]: size === 'large',
25
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" })] }));
26
26
  });
27
- var Switch$1 = Switch;
28
27
 
29
- export { Switch$1 as default };
28
+ export { Switch as default };
package/Table/Table.d.ts CHANGED
@@ -99,7 +99,7 @@ export interface TableWithPagination<T> extends TableBaseProps<T> {
99
99
  * `pagination.onChange` is the callback when page number changed. (required) <br />
100
100
  * `pagination.disableAutoSlicing` set this to true if you don't want auto data slicing. <br />
101
101
  * `pagination.total` is the total amount of your data. (default will be dataSource length) <br />
102
- * `pagination.options` is the <Pagination /> component props. <br />
102
+ * `pagination.options` is the 'Pagination' component props. <br />
103
103
  * Notice that if `pagination` object is given, table will disable fetchMore and use pagination instead.
104
104
  */
105
105
  pagination?: TablePaginationType;
package/Table/Table.js CHANGED
@@ -178,6 +178,5 @@ const Table = forwardRef(function Table(props, ref) {
178
178
  transition: '0.1s',
179
179
  } }) }) }) })] })) }) }) }) }) }) }));
180
180
  });
181
- var Table$1 = Table;
182
181
 
183
- export { Table$1 as default };
182
+ export { Table as default };
@@ -20,6 +20,5 @@ const TableCell = forwardRef(function TableCell(props, ref) {
20
20
  }
21
21
  }, onMouseLeave: onMouseLeave, children: children })) })) : (children) }));
22
22
  });
23
- var TableCell$1 = TableCell;
24
23
 
25
- export { TableCell$1 as default };
24
+ export { TableCell as default };
@@ -10,5 +10,5 @@ export declare function useTableDraggable(props: UseTableDraggable): {
10
10
  onBeforeDragStart: (e: {
11
11
  draggableId: SetStateAction<string>;
12
12
  }) => void;
13
- onDragEnd: import("@hello-pangea/dnd").OnDragEndResponder;
13
+ onDragEnd: import("@hello-pangea/dnd").OnDragEndResponder<string>;
14
14
  };
@@ -4,7 +4,7 @@ export interface TablePaginationProps extends NativeElementPropsWithoutKeyAndRef
4
4
  /**
5
5
  * body scroll ref
6
6
  */
7
- bodyRef: RefObject<HTMLDivElement>;
7
+ bodyRef: RefObject<HTMLDivElement | null>;
8
8
  }
9
9
  declare const TablePagination: import("react").ForwardRefExoticComponent<TablePaginationProps & import("react").RefAttributes<HTMLDivElement>>;
10
10
  export default TablePagination;
@@ -1,7 +1,7 @@
1
1
  import { RefObject } from 'react';
2
2
  import { TablePagination } from '@mezzanine-ui/core/table';
3
3
  export interface UseTablePagination {
4
- bodyRef: RefObject<HTMLDivElement>;
4
+ bodyRef: RefObject<HTMLDivElement | null>;
5
5
  current?: TablePagination['current'];
6
6
  onChange?: TablePagination['onChange'];
7
7
  }
@@ -16,6 +16,5 @@ const TableRefresh = forwardRef(function TableRefresh(props, ref) {
16
16
  }, [onClick, setLoading]);
17
17
  return (jsx("div", { ref: ref, className: tableClasses.refresh, ...rest, children: jsx(Button, { onClick: onRefreshClicked, prefix: jsx(Icon, { icon: ResetIcon }), children: children || '重新整理' }) }));
18
18
  });
19
- var TableRefresh$1 = TableRefresh;
20
19
 
21
- export { TableRefresh$1 as default };
20
+ export { TableRefresh as default };