@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.
- package/Accordion/Accordion.js +5 -4
- package/Accordion/AccordionDetails.js +2 -2
- package/Accordion/AccordionSummary.js +3 -4
- package/Alert/Alert.js +1 -3
- package/AppBar/AppBar.js +1 -1
- package/AppBar/AppBarBrand.d.ts +1 -1
- package/AppBar/AppBarBrand.js +1 -1
- package/AppBar/AppBarMain.d.ts +1 -1
- package/AppBar/AppBarMain.js +1 -1
- package/AppBar/AppBarSupport.d.ts +1 -1
- package/AppBar/AppBarSupport.js +1 -1
- package/Badge/Badge.js +2 -2
- package/Badge/BadgeContainer.d.ts +1 -1
- package/Badge/BadgeContainer.js +1 -1
- package/Button/Button.d.ts +2 -2
- package/Button/Button.js +7 -5
- package/Button/ButtonGroup.js +7 -5
- package/Button/IconButton.d.ts +3 -3
- package/Button/IconButton.js +1 -1
- package/Calendar/Calendar.js +9 -10
- package/Calendar/CalendarCell.js +2 -2
- package/Calendar/CalendarContext.d.ts +3 -3
- package/Calendar/CalendarContext.js +20 -12
- package/Calendar/CalendarControls.js +3 -3
- package/Calendar/CalendarDayOfWeek.js +1 -1
- package/Calendar/CalendarDays.js +4 -5
- package/Calendar/CalendarMonths.js +4 -4
- package/Calendar/CalendarWeeks.js +4 -5
- package/Calendar/CalendarYears.js +4 -4
- package/Calendar/useCalendarControls.d.ts +2 -3
- package/Card/Card.js +5 -5
- package/Card/CardActions.js +1 -2
- package/Checkbox/CheckAll.js +2 -2
- package/Checkbox/Checkbox.js +5 -3
- package/Checkbox/CheckboxGroup.js +5 -5
- package/ConfirmActions/ConfirmActions.js +1 -2
- package/DatePicker/DatePicker.js +2 -3
- package/DatePicker/DatePickerCalendar.js +1 -1
- package/DateRangePicker/DateRangePicker.js +2 -3
- package/DateRangePicker/DateRangePickerCalendar.js +3 -4
- package/DateRangePicker/useDateRangeCalendarControls.d.ts +1 -2
- package/DateRangePicker/useDateRangePickerValue.d.ts +12 -13
- package/DateTimePicker/DateTimePicker.js +2 -3
- package/DateTimePicker/DateTimePickerPanel.js +1 -3
- package/Drawer/Drawer.js +1 -1
- package/Dropdown/Dropdown.d.ts +1 -1
- package/Dropdown/Dropdown.js +2 -2
- package/Empty/Empty.js +3 -4
- package/Form/FormField.js +2 -2
- package/Form/FormLabel.js +1 -2
- package/Form/FormMessage.d.ts +1 -1
- package/Form/FormMessage.js +1 -1
- package/Form/useAutoCompleteValueControl.d.ts +30 -11
- package/Form/useAutoCompleteValueControl.js +71 -31
- package/Form/useInputWithTagsModeValue.js +2 -1
- package/Form/useSelectValueControl.d.ts +1 -1
- package/Icon/Icon.d.ts +4 -0
- package/Icon/Icon.js +4 -4
- package/Input/Input.d.ts +1 -1
- package/Input/Input.js +5 -4
- package/Loading/Loading.js +4 -5
- package/Menu/Menu.js +5 -3
- package/Menu/MenuDivider.d.ts +1 -1
- package/Menu/MenuDivider.js +1 -1
- package/Menu/MenuItem.js +2 -3
- package/Menu/MenuItemGroup.js +1 -2
- package/Message/Message.js +2 -3
- package/Modal/Modal.js +5 -5
- package/Modal/ModalActions.js +1 -1
- package/Modal/ModalBody.d.ts +1 -1
- package/Modal/ModalBody.js +1 -1
- package/Modal/ModalFooter.d.ts +1 -1
- package/Modal/ModalFooter.js +1 -1
- package/Modal/ModalHeader.js +2 -3
- package/Modal/useModalContainer.js +1 -1
- package/Navigation/Navigation.js +2 -2
- package/Navigation/NavigationItem.js +1 -1
- package/Navigation/NavigationSubMenu.js +3 -5
- package/Notification/Notification.js +2 -7
- package/Notifier/NotifierManager.js +1 -1
- package/Notifier/createNotifier.js +1 -1
- package/Overlay/Overlay.js +3 -3
- package/PageFooter/PageFooter.js +1 -2
- package/Pagination/Pagination.js +2 -3
- package/Pagination/PaginationItem.js +4 -4
- package/Pagination/PaginationJumper.js +2 -4
- package/Picker/PickerTrigger.d.ts +1 -1
- package/Picker/PickerTrigger.js +2 -2
- package/Picker/RangePickerTrigger.d.ts +1 -1
- package/Picker/RangePickerTrigger.js +2 -4
- package/Picker/usePickerInputValue.d.ts +2 -2
- package/Picker/usePickerValue.d.ts +6 -7
- package/Picker/useRangePickerValue.d.ts +9 -10
- package/Popconfirm/Popconfirm.js +1 -1
- package/Popover/Popover.js +2 -3
- package/Popper/Popper.js +2 -2
- package/Portal/Portal.js +1 -1
- package/Progress/Progress.js +9 -9
- package/Provider/ConfigProvider.d.ts +8 -0
- package/Provider/ConfigProvider.js +13 -0
- package/Provider/context.d.ts +6 -0
- package/Provider/context.js +7 -0
- package/Provider/index.d.ts +4 -0
- package/Provider/index.js +2 -0
- package/Radio/Radio.js +5 -3
- package/Radio/RadioGroup.js +5 -5
- package/Select/AutoComplete.d.ts +40 -14
- package/Select/AutoComplete.js +37 -28
- package/Select/Option.js +2 -2
- package/Select/Select.d.ts +2 -51
- package/Select/Select.js +15 -49
- package/Select/SelectTrigger.d.ts +8 -1
- package/Select/SelectTrigger.js +8 -12
- package/Select/SelectTriggerTags.d.ts +19 -0
- package/Select/SelectTriggerTags.js +33 -0
- package/Select/TreeSelect.js +3 -4
- package/Select/index.d.ts +1 -0
- package/Select/index.js +1 -0
- package/Select/useSelectTriggerTags.d.ts +19 -0
- package/Select/useSelectTriggerTags.js +61 -0
- package/Skeleton/Skeleton.js +1 -1
- package/Slider/Slider.d.ts +1 -1
- package/Slider/Slider.js +7 -11
- package/Stepper/Step.js +2 -2
- package/Stepper/Stepper.js +1 -1
- package/Switch/Switch.js +2 -3
- package/Table/Table.d.ts +1 -1
- package/Table/Table.js +3 -10
- package/Table/TableBody.js +2 -4
- package/Table/TableBodyRow.js +4 -7
- package/Table/TableCell.js +3 -3
- package/Table/TableExpandedTable.js +5 -6
- package/Table/TableHeader.d.ts +2 -1
- package/Table/TableHeader.js +3 -6
- package/Table/editable/TableEditRenderWrapper.js +2 -2
- package/Table/expandable/TableExpandable.js +2 -2
- package/Table/pagination/TablePagination.js +1 -2
- package/Table/refresh/TableRefresh.js +1 -1
- package/Table/rowSelection/TableRowSelection.js +5 -6
- package/Table/sorting/TableSortingIcon.js +2 -2
- package/Table/sorting/useTableSorting.d.ts +2 -2
- package/Table/useTableScroll.d.ts +178 -178
- package/Tabs/Tab.js +2 -2
- package/Tabs/TabPane.js +1 -1
- package/Tabs/Tabs.js +1 -3
- package/Tag/Tag.js +7 -6
- package/TextField/TextField.js +7 -5
- package/TextField/useTextFieldControl.d.ts +2 -2
- package/Textarea/Textarea.d.ts +1 -1
- package/Textarea/Textarea.js +5 -4
- package/TimePanel/TimePanel.js +1 -4
- package/TimePanel/TimePanelAction.js +1 -1
- package/TimePanel/TimePanelColumn.js +2 -5
- package/TimePicker/TimePicker.js +2 -3
- package/TimePicker/TimePickerPanel.js +1 -1
- package/Tooltip/Tooltip.js +3 -3
- package/Transition/Collapse.js +3 -2
- package/Transition/Fade.js +2 -2
- package/Transition/Grow.js +3 -2
- package/Transition/SlideFade.js +2 -2
- package/Transition/Transition.js +2 -2
- package/Transition/Zoom.js +2 -2
- package/Tree/Tree.js +1 -1
- package/Tree/TreeNode.js +9 -9
- package/Tree/TreeNodeList.js +5 -4
- package/Tree/getTreeNodeEntities.js +6 -3
- package/Typography/Typography.d.ts +2 -2
- package/Typography/Typography.js +2 -2
- package/Upload/UploadButton.js +2 -2
- package/Upload/UploadInput.js +1 -1
- package/Upload/UploadPicture.js +1 -1
- package/Upload/UploadPictureBlock.js +2 -8
- package/Upload/UploadPictureWall.d.ts +1 -1
- package/Upload/UploadPictureWall.js +1 -2
- package/Upload/UploadPictureWallItem.js +1 -1
- package/Upload/UploadResult.d.ts +19 -0
- package/Upload/UploadResult.js +6 -7
- package/_internal/InputCheck/InputCheck.js +2 -3
- package/_internal/InputCheck/InputCheckGroup.js +1 -1
- package/_internal/InputTriggerPopper/InputTriggerPopper.js +2 -2
- package/_internal/SlideFadeOverlay/SlideFadeOverlay.js +1 -1
- package/index.d.ts +3 -1
- package/index.js +3 -0
- package/package.json +12 -12
|
@@ -16,7 +16,7 @@ const NavigationItem = forwardRef((props, ref) => {
|
|
|
16
16
|
onClick(eventKey);
|
|
17
17
|
}
|
|
18
18
|
}, [eventKey, onClick, orientation]);
|
|
19
|
-
return (jsxs("li",
|
|
19
|
+
return (jsxs("li", { ...rest, ref: ref, className: cx(navigationItemClasses.host, active && navigationItemClasses.active, className), role: "menuitem", onClick: handleClick, onKeyDown: () => { }, children: [icon && (jsx(Icon, { className: navigationItemClasses.icon, icon: icon })), children] }));
|
|
20
20
|
});
|
|
21
21
|
var NavigationItem$1 = NavigationItem;
|
|
22
22
|
|
|
@@ -54,12 +54,10 @@ const NavigationSubMenu = forwardRef((props, ref) => {
|
|
|
54
54
|
open,
|
|
55
55
|
orientation,
|
|
56
56
|
]);
|
|
57
|
-
const WrapChildren = (jsx("ul",
|
|
58
|
-
return (jsxs(NavigationItem,
|
|
59
|
-
orientation === 'horizontal' && (jsx(Popper, Object.assign({ anchor: nodeRef, disablePortal: true, open: !!open, options: popperOptions }, { children: WrapChildren }), void 0)),
|
|
60
|
-
orientation === 'vertical' && (jsx(Collapse, Object.assign({ style: {
|
|
57
|
+
const WrapChildren = (jsx("ul", { className: navigationSubMenuClasses.group, children: children }));
|
|
58
|
+
return (jsxs(NavigationItem, { ...rest, ref: composedNodeRef, className: cx(navigationSubMenuClasses.host, active && navigationSubMenuClasses.active, open && navigationSubMenuClasses.open, (icon && orientation === 'vertical') && navigationSubMenuClasses.indent, className), onClick: () => setOpen(!open), children: [jsxs("div", { className: navigationSubMenuClasses.title, children: [icon && (jsx(Icon, { className: navigationSubMenuClasses.icon, icon: icon })), title, jsx(Icon, { className: navigationSubMenuClasses.toggleIcon, icon: GroupToggleIcon })] }), orientation === 'horizontal' && (jsx(Popper, { anchor: nodeRef, disablePortal: true, open: !!open, options: popperOptions, children: WrapChildren })), orientation === 'vertical' && (jsx(Collapse, { style: {
|
|
61
59
|
width: '100%',
|
|
62
|
-
}, in: !!open
|
|
60
|
+
}, in: !!open, children: WrapChildren }))] }));
|
|
63
61
|
});
|
|
64
62
|
var NavigationSubMenu$1 = NavigationSubMenu;
|
|
65
63
|
|
|
@@ -50,16 +50,11 @@ const Notification = ((props) => {
|
|
|
50
50
|
}
|
|
51
51
|
Notification.remove(reference);
|
|
52
52
|
};
|
|
53
|
-
return (jsx(SlideFade,
|
|
54
|
-
jsxs("div", Object.assign({ className: notificationClasses.body }, { children: [jsx("h4", Object.assign({ className: notificationClasses.title }, { children: title }), void 0),
|
|
55
|
-
jsx("div", Object.assign({ className: notificationClasses.content }, { children: children }), void 0),
|
|
56
|
-
onConfirm && !severity ? (jsxs(ButtonGroup, Object.assign({ className: notificationClasses.action }, { children: [jsx(Button, Object.assign({ variant: "contained", onClick: onConfirm }, { children: confirmText }), void 0),
|
|
57
|
-
jsx(Button, Object.assign({ variant: "outlined", onClick: onCancel || onClose }, { children: cancelText }), void 0)] }), void 0)) : null] }), void 0),
|
|
58
|
-
jsx(Icon, { icon: TimesIcon, className: notificationClasses.closeIcon, onClick: onClose }, void 0)] }), void 0) }), void 0));
|
|
53
|
+
return (jsx(SlideFade, { in: open, appear: true, onExited: onExited, direction: direction, ...restTransitionProps, children: jsxs("div", { className: cx(notificationClasses.host, severity ? notificationClasses.severity(severity) : undefined), children: [targetIcon ? (jsx("div", { className: notificationClasses.iconContainer, children: jsx(Icon, { icon: targetIcon, className: notificationClasses.severityIcon }) })) : null, jsxs("div", { className: notificationClasses.body, children: [jsx("h4", { className: notificationClasses.title, children: title }), jsx("div", { className: notificationClasses.content, children: children }), onConfirm && !severity ? (jsxs(ButtonGroup, { className: notificationClasses.action, children: [jsx(Button, { variant: "contained", onClick: onConfirm, children: confirmText }), jsx(Button, { variant: "outlined", onClick: onCancel || onClose, children: cancelText })] })) : null] }), jsx(Icon, { icon: TimesIcon, className: notificationClasses.closeIcon, onClick: onClose })] }) }));
|
|
59
54
|
});
|
|
60
55
|
const { add, config, destroy, remove, } = createNotifier({
|
|
61
56
|
duration: false,
|
|
62
|
-
render: (notif) => jsx(Notification,
|
|
57
|
+
render: (notif) => jsx(Notification, { ...notif }),
|
|
63
58
|
setRoot: (root) => {
|
|
64
59
|
root.setAttribute('class', notificationClasses.root);
|
|
65
60
|
},
|
|
@@ -25,7 +25,7 @@ function NotifierManager(props) {
|
|
|
25
25
|
},
|
|
26
26
|
}), []);
|
|
27
27
|
useImperativeHandle(controllerRef, () => controller, [controller]);
|
|
28
|
-
return (jsx(Fragment, { children: notifiersShouldRendered.map((notifier) => (jsx(Fragment$1, { children: render(notifier) }, notifier.key))) }
|
|
28
|
+
return (jsx(Fragment, { children: notifiersShouldRendered.map((notifier) => (jsx(Fragment$1, { children: render(notifier) }, notifier.key))) }));
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
export { NotifierManager as default };
|
|
@@ -37,7 +37,7 @@ function createNotifier(props) {
|
|
|
37
37
|
controllerRef.current.add(resolvedNotifier);
|
|
38
38
|
}
|
|
39
39
|
else {
|
|
40
|
-
render((jsx(NotifierManager, { controllerRef: controllerRef, defaultNotifiers: [resolvedNotifier], maxCount: currentConfig.maxCount, render: renderNotifier }
|
|
40
|
+
render((jsx(NotifierManager, { controllerRef: controllerRef, defaultNotifiers: [resolvedNotifier], maxCount: currentConfig.maxCount, render: renderNotifier })), root);
|
|
41
41
|
}
|
|
42
42
|
return resolvedNotifier.key;
|
|
43
43
|
},
|
package/Overlay/Overlay.js
CHANGED
|
@@ -11,10 +11,10 @@ import cx from 'clsx';
|
|
|
11
11
|
const Overlay = forwardRef(function Overlay(props, ref) {
|
|
12
12
|
const { children, className, container, disableCloseOnBackdropClick = false, disablePortal, hideBackdrop = false, invisibleBackdrop = false, onBackdropClick, onClose, onSurface, open = false, ...rest } = props;
|
|
13
13
|
const fixedAtBody = Boolean(!container);
|
|
14
|
-
return (jsx(Portal,
|
|
14
|
+
return (jsx(Portal, { container: container, disablePortal: disablePortal, children: jsxs("div", { ...rest, ref: ref, className: cx(overlayClasses.host, {
|
|
15
15
|
[overlayClasses.hostFixed]: fixedAtBody,
|
|
16
16
|
[overlayClasses.hostOpen]: open,
|
|
17
|
-
}, className)
|
|
17
|
+
}, className), children: [hideBackdrop ? null : (jsx(Fade, { in: open, children: jsx("div", { "aria-hidden": true, className: cx(overlayClasses.backdrop, {
|
|
18
18
|
[overlayClasses.backdropFixed]: fixedAtBody,
|
|
19
19
|
[overlayClasses.invisible]: invisibleBackdrop,
|
|
20
20
|
[overlayClasses.backdropOnSurface]: onSurface,
|
|
@@ -25,7 +25,7 @@ const Overlay = forwardRef(function Overlay(props, ref) {
|
|
|
25
25
|
if (onBackdropClick) {
|
|
26
26
|
onBackdropClick(event);
|
|
27
27
|
}
|
|
28
|
-
} }
|
|
28
|
+
} }) })), children] }) }));
|
|
29
29
|
});
|
|
30
30
|
var Overlay$1 = Overlay;
|
|
31
31
|
|
package/PageFooter/PageFooter.js
CHANGED
|
@@ -6,8 +6,7 @@ import cx from 'clsx';
|
|
|
6
6
|
|
|
7
7
|
const PageFooter = forwardRef(function PageFooter(props, ref) {
|
|
8
8
|
const { className, actionClassName, cancelButtonProps, cancelText, children, danger, loading, confirmButtonProps, confirmText, hideCancelButton, hideConfirmButton, onCancel, onConfirm, ...rest } = props;
|
|
9
|
-
return (jsxs("footer",
|
|
10
|
-
jsx(ConfirmActions, { cancelText: cancelText, confirmText: confirmText, cancelButtonProps: cancelButtonProps, confirmButtonProps: confirmButtonProps, danger: danger, hideCancelButton: hideCancelButton, hideConfirmButton: hideConfirmButton, loading: loading, onCancel: onCancel, onConfirm: onConfirm }, void 0)] }), void 0));
|
|
9
|
+
return (jsxs("footer", { ref: ref, ...rest, className: cx(pageFooterClasses.host, className), children: [jsx("div", { className: actionClassName, children: children }), jsx(ConfirmActions, { cancelText: cancelText, confirmText: confirmText, cancelButtonProps: cancelButtonProps, confirmButtonProps: confirmButtonProps, danger: danger, hideCancelButton: hideCancelButton, hideConfirmButton: hideConfirmButton, loading: loading, onCancel: onCancel, onConfirm: onConfirm })] }));
|
|
11
10
|
});
|
|
12
11
|
var PageFooter$1 = PageFooter;
|
|
13
12
|
|
package/Pagination/Pagination.js
CHANGED
|
@@ -10,7 +10,7 @@ import cx from 'clsx';
|
|
|
10
10
|
* The react component for `mezzanine` pagination.
|
|
11
11
|
*/
|
|
12
12
|
const Pagination = forwardRef((props, ref) => {
|
|
13
|
-
const { className, boundaryCount = 1, buttonText, current = 1, disabled = false, hideNextButton = false, hidePreviousButton = false, hintText, inputPlaceholder, itemRender = (item) => jsx(PaginationItem,
|
|
13
|
+
const { className, boundaryCount = 1, buttonText, current = 1, disabled = false, hideNextButton = false, hidePreviousButton = false, hintText, inputPlaceholder, itemRender = (item) => jsx(PaginationItem, { ...item }), onChange, pageSize = 5, showJumper = false, siblingCount = 1, total = 0, ...rest } = props;
|
|
14
14
|
const { items } = usePagination({
|
|
15
15
|
boundaryCount,
|
|
16
16
|
current,
|
|
@@ -22,8 +22,7 @@ const Pagination = forwardRef((props, ref) => {
|
|
|
22
22
|
siblingCount,
|
|
23
23
|
total,
|
|
24
24
|
});
|
|
25
|
-
return (jsx("nav",
|
|
26
|
-
showJumper && (jsx("li", Object.assign({ className: paginationClasses.jumper }, { children: jsx(PaginationJumper, { buttonText: buttonText, disabled: disabled, hintText: hintText, inputPlaceholder: inputPlaceholder, onChange: onChange, pageSize: pageSize, total: total }, void 0) }), void 0))] }), void 0) }), void 0));
|
|
25
|
+
return (jsx("nav", { ...rest, ref: ref, "aria-label": "pagination navigation", className: cx(paginationClasses.host, className), children: jsxs("ul", { className: paginationClasses.container, children: [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
26
|
});
|
|
28
27
|
var Pagination$1 = Pagination;
|
|
29
28
|
|
|
@@ -12,13 +12,13 @@ const PaginationItem = forwardRef((props, ref) => {
|
|
|
12
12
|
previous: ChevronLeftIcon,
|
|
13
13
|
};
|
|
14
14
|
const ButtonIcon = icons[type];
|
|
15
|
-
return type === 'ellipsis' ? (jsx("div",
|
|
15
|
+
return type === 'ellipsis' ? (jsx("div", { ...rest, ref: ref, className: cx(paginationItemClasses.host, paginationItemClasses.ellipsis, {
|
|
16
16
|
[paginationItemClasses.disabled]: disabled,
|
|
17
|
-
}, className)
|
|
17
|
+
}, className), children: "..." })) : (createElement("button", { ...rest, ref: ref, key: page, disabled: disabled, className: cx(paginationItemClasses.host, paginationItemClasses.button, {
|
|
18
18
|
[paginationItemClasses.active]: active,
|
|
19
19
|
[paginationItemClasses.disabled]: disabled,
|
|
20
|
-
}, className), type: "button" }
|
|
21
|
-
ButtonIcon && jsx(Icon, { icon: ButtonIcon }
|
|
20
|
+
}, className), type: "button" },
|
|
21
|
+
ButtonIcon && jsx(Icon, { icon: ButtonIcon }),
|
|
22
22
|
type === 'page' && page));
|
|
23
23
|
});
|
|
24
24
|
var PaginationItem$1 = PaginationItem;
|
|
@@ -38,15 +38,13 @@ const PaginationJumper = forwardRef((props, ref) => {
|
|
|
38
38
|
handleClick();
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
|
-
return (jsxs("div",
|
|
42
|
-
jsx(Input, { disabled: disabled, error: error, onChange: (e) => {
|
|
41
|
+
return (jsxs("div", { ...rest, ref: ref, className: cx(paginationJumperClasses.host, className), children: [jsx(Typography, { color: disabled ? 'text-disabled' : 'text-primary', component: "div", ellipsis: true, variant: "input2", children: hintText }), jsx(Input, { disabled: disabled, error: error, onChange: (e) => {
|
|
43
42
|
setValue(e.target.value);
|
|
44
43
|
}, placeholder: inputPlaceholder, inputProps: {
|
|
45
44
|
type: 'number',
|
|
46
45
|
className: paginationJumperClasses.input,
|
|
47
46
|
onKeyDown: handleKeyDown,
|
|
48
|
-
}, value: value },
|
|
49
|
-
jsx(Button, Object.assign({ disabled: disabled, onClick: handleClick }, { children: buttonText }), void 0)] }), void 0));
|
|
47
|
+
}, value: value }), jsx(Button, { disabled: disabled, onClick: handleClick, children: buttonText })] }));
|
|
50
48
|
});
|
|
51
49
|
var PaginationJumper$1 = PaginationJumper;
|
|
52
50
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ChangeEventHandler, RefObject } from 'react';
|
|
2
2
|
import { TextFieldProps } from '../TextField';
|
|
3
3
|
import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
|
|
4
|
-
export interface PickerTriggerProps extends Omit<TextFieldProps, 'active' | 'children' | 'suffix' | '
|
|
4
|
+
export interface PickerTriggerProps extends Omit<TextFieldProps, 'active' | 'children' | 'suffix' | 'defaultChecked'> {
|
|
5
5
|
/**
|
|
6
6
|
* React ref for the input element.
|
|
7
7
|
*/
|
package/Picker/PickerTrigger.js
CHANGED
|
@@ -8,8 +8,8 @@ import cx from 'clsx';
|
|
|
8
8
|
* The react component for `mezzanine` picker trigger.
|
|
9
9
|
*/
|
|
10
10
|
const PickerTrigger = forwardRef(function PickerTrigger(props, ref) {
|
|
11
|
-
const { className, disabled, inputProps, inputRef, onChange, placeholder, readOnly, required, value, ...restTextFieldProps } = props;
|
|
12
|
-
return (jsx(TextField,
|
|
11
|
+
const { className, clearable, disabled, inputProps, inputRef, onChange, placeholder, readOnly, required, value, ...restTextFieldProps } = props;
|
|
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
14
|
var PickerTrigger$1 = PickerTrigger;
|
|
15
15
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ChangeEventHandler, MouseEventHandler, RefObject } from 'react';
|
|
2
2
|
import { TextFieldProps } from '../TextField';
|
|
3
3
|
import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
|
|
4
|
-
export interface RangePickerTriggerProps extends Omit<TextFieldProps, 'active' | 'children' | 'suffix' | '
|
|
4
|
+
export interface RangePickerTriggerProps extends Omit<TextFieldProps, 'active' | 'children' | 'suffix' | 'defaultChecked' | 'placeholder'> {
|
|
5
5
|
/**
|
|
6
6
|
* Placeholder for the 'from' input element.
|
|
7
7
|
*/
|
|
@@ -10,10 +10,8 @@ import cx from 'clsx';
|
|
|
10
10
|
* The react component for `mezzanine` date range picker trigger.
|
|
11
11
|
*/
|
|
12
12
|
const RangePickerTrigger = forwardRef(function DateRangePickerTrigger(props, ref) {
|
|
13
|
-
const { className, disabled, inputFromPlaceholder, inputFromProps, inputFromRef, inputFromValue, inputToPlaceholder, inputToProps, inputToRef, inputToValue, onIconClick, onInputFromChange, onInputToChange, readOnly, required, ...restTextFieldProps } = props;
|
|
14
|
-
return (jsxs(TextField,
|
|
15
|
-
jsx(Icon, { icon: ArrowRightIcon, className: pickerClasses.arrowIcon }, void 0),
|
|
16
|
-
jsx("input", Object.assign({}, 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 }), void 0)] }), void 0));
|
|
13
|
+
const { className, clearable, disabled, inputFromPlaceholder, inputFromProps, inputFromRef, inputFromValue, inputToPlaceholder, inputToProps, inputToRef, inputToValue, onIconClick, onInputFromChange, onInputToChange, readOnly, required, ...restTextFieldProps } = props;
|
|
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 })] }));
|
|
17
15
|
});
|
|
18
16
|
var RangePickerTrigger$1 = RangePickerTrigger;
|
|
19
17
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { ChangeEventHandler } from 'react';
|
|
2
2
|
export interface UsePickerInputValueProps {
|
|
3
3
|
defaultValue?: string;
|
|
4
4
|
initialValue?: string;
|
|
@@ -6,7 +6,7 @@ export interface UsePickerInputValueProps {
|
|
|
6
6
|
}
|
|
7
7
|
export declare function usePickerInputValue(props?: UsePickerInputValueProps): {
|
|
8
8
|
inputValue: string;
|
|
9
|
-
inputChangeHandler:
|
|
9
|
+
inputChangeHandler: ChangeEventHandler<HTMLInputElement>;
|
|
10
10
|
onChange: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
11
11
|
};
|
|
12
12
|
export default usePickerInputValue;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="moment" />
|
|
2
1
|
import { DateType } from '@mezzanine-ui/core/calendar';
|
|
3
|
-
import { RefObject } from 'react';
|
|
2
|
+
import { FocusEventHandler, KeyboardEventHandler, RefObject } from 'react';
|
|
4
3
|
export declare type UsePickerValueProps = {
|
|
5
4
|
defaultValue?: DateType;
|
|
6
5
|
format: string;
|
|
@@ -13,9 +12,9 @@ export declare type UsePickerValueProps = {
|
|
|
13
12
|
*/
|
|
14
13
|
export declare function usePickerValue({ defaultValue, format, formats, inputRef, value: valueProp, }: UsePickerValueProps): {
|
|
15
14
|
inputValue: string;
|
|
16
|
-
onBlur:
|
|
17
|
-
onChange: (val?:
|
|
18
|
-
onInputChange:
|
|
19
|
-
onKeyDown:
|
|
20
|
-
value:
|
|
15
|
+
onBlur: FocusEventHandler<HTMLInputElement>;
|
|
16
|
+
onChange: (val?: string | undefined) => void;
|
|
17
|
+
onInputChange: import("react").ChangeEventHandler<HTMLInputElement>;
|
|
18
|
+
onKeyDown: KeyboardEventHandler<HTMLInputElement>;
|
|
19
|
+
value: string | undefined;
|
|
21
20
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="moment" />
|
|
2
1
|
import { RangePickerPickingValue, RangePickerValue } from '@mezzanine-ui/core/picker';
|
|
3
|
-
import { RefObject } from 'react';
|
|
2
|
+
import { ChangeEventHandler, KeyboardEventHandler, RefObject } from 'react';
|
|
4
3
|
import { UsePickerValueProps } from './usePickerValue';
|
|
5
4
|
export interface UseRangePickerValueProps extends Pick<UsePickerValueProps, 'format' | 'formats'> {
|
|
6
5
|
inputFromRef: RefObject<HTMLInputElement>;
|
|
@@ -10,12 +9,12 @@ export interface UseRangePickerValueProps extends Pick<UsePickerValueProps, 'for
|
|
|
10
9
|
export declare function useRangePickerValue({ format, formats, inputFromRef, inputToRef, value: valueProp, }: UseRangePickerValueProps): {
|
|
11
10
|
inputFromValue: string;
|
|
12
11
|
inputToValue: string;
|
|
13
|
-
onChange: (target?:
|
|
14
|
-
onFromBlur:
|
|
15
|
-
onFromKeyDown:
|
|
16
|
-
onInputFromChange:
|
|
17
|
-
onInputToChange:
|
|
18
|
-
onToBlur:
|
|
19
|
-
onToKeyDown:
|
|
20
|
-
value: RangePickerPickingValue
|
|
12
|
+
onChange: (target?: RangePickerPickingValue<string> | undefined) => RangePickerPickingValue | undefined;
|
|
13
|
+
onFromBlur: import("react").FocusEventHandler<HTMLInputElement>;
|
|
14
|
+
onFromKeyDown: KeyboardEventHandler<HTMLInputElement>;
|
|
15
|
+
onInputFromChange: ChangeEventHandler<HTMLInputElement>;
|
|
16
|
+
onInputToChange: ChangeEventHandler<HTMLInputElement>;
|
|
17
|
+
onToBlur: import("react").FocusEventHandler<HTMLInputElement>;
|
|
18
|
+
onToKeyDown: KeyboardEventHandler<HTMLInputElement>;
|
|
19
|
+
value: RangePickerPickingValue<string>;
|
|
21
20
|
};
|
package/Popconfirm/Popconfirm.js
CHANGED
|
@@ -9,7 +9,7 @@ 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
|
-
return (jsx(Popover,
|
|
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
14
|
var Popconfirm$1 = Popconfirm;
|
|
15
15
|
|
package/Popover/Popover.js
CHANGED
|
@@ -35,11 +35,10 @@ const Popover = forwardRef(function Popover(props, ref) {
|
|
|
35
35
|
onClose,
|
|
36
36
|
popoverRef,
|
|
37
37
|
]);
|
|
38
|
-
return (jsxs(Popper,
|
|
38
|
+
return (jsxs(Popper, { ...rest, ref: composedRef, className: cx(popoverClasses.host, className), open: open, options: {
|
|
39
39
|
...options,
|
|
40
40
|
modifiers: [offsetModifier, ...modifiers],
|
|
41
|
-
}
|
|
42
|
-
children && jsx("div", Object.assign({ className: popoverClasses.content }, { children: children }), void 0)] }), void 0));
|
|
41
|
+
}, children: [title && jsx("div", { className: popoverClasses.title, children: title }), children && jsx("div", { className: popoverClasses.content, children: children })] }));
|
|
43
42
|
});
|
|
44
43
|
var Popover$1 = Popover;
|
|
45
44
|
|
package/Popper/Popper.js
CHANGED
|
@@ -21,10 +21,10 @@ const Popper = forwardRef(function Popper(props, ref) {
|
|
|
21
21
|
if (!open) {
|
|
22
22
|
return null;
|
|
23
23
|
}
|
|
24
|
-
return (jsx(Portal,
|
|
24
|
+
return (jsx(Portal, { container: container, disablePortal: disablePortal, children: jsx("div", { ...rest, ref: composedRef, style: {
|
|
25
25
|
...style,
|
|
26
26
|
...styles.popper,
|
|
27
|
-
}
|
|
27
|
+
}, ...attributes.popper, children: children }) }));
|
|
28
28
|
});
|
|
29
29
|
var Popper$1 = Popper;
|
|
30
30
|
|
package/Portal/Portal.js
CHANGED
|
@@ -14,7 +14,7 @@ const Portal = (props) => {
|
|
|
14
14
|
}
|
|
15
15
|
}, [container, disablePortal]);
|
|
16
16
|
if (disablePortal || !portalElement) {
|
|
17
|
-
return jsx(Fragment, { children: children }
|
|
17
|
+
return jsx(Fragment, { children: children });
|
|
18
18
|
}
|
|
19
19
|
return createPortal(children, portalElement);
|
|
20
20
|
};
|
package/Progress/Progress.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { forwardRef } from 'react';
|
|
2
|
+
import { forwardRef, useContext } from 'react';
|
|
3
3
|
import { ProgressStatuses, ProgressTypes, progressClasses } from '@mezzanine-ui/core/progress';
|
|
4
4
|
import { CheckCircleFilledIcon, CheckIcon, TimesCircleFilledIcon, TimesIcon } from '@mezzanine-ui/icons';
|
|
5
5
|
import Typography from '../Typography/Typography.js';
|
|
6
|
+
import { MezzanineConfig } from '../Provider/context.js';
|
|
6
7
|
import Icon from '../Icon/Icon.js';
|
|
7
8
|
import cx from 'clsx';
|
|
8
9
|
|
|
@@ -10,23 +11,22 @@ import cx from 'clsx';
|
|
|
10
11
|
* The react component for `mezzanine` progress.
|
|
11
12
|
*/
|
|
12
13
|
const Progress = forwardRef(function Progress(props, ref) {
|
|
13
|
-
const {
|
|
14
|
+
const { size: globalSize, } = useContext(MezzanineConfig);
|
|
15
|
+
const { circleProps, className, errorIconProps, percent = 0, percentProps, showInfo = true, size = globalSize, status = percent < 100 ? ProgressStatuses.normal : ProgressStatuses.success, successIconProps, type = ProgressTypes.line, ...rest } = props;
|
|
14
16
|
const percentLimited = Math.max(0, Math.min(100, percent));
|
|
15
17
|
const defaultSuccessIcon = type === ProgressTypes.line ? CheckCircleFilledIcon : CheckIcon;
|
|
16
18
|
const defaultErrorIcon = type === ProgressTypes.line ? TimesCircleFilledIcon : TimesIcon;
|
|
17
|
-
const renderInfo = (variant) => (jsx("div",
|
|
18
|
-
? /** percent text */ (jsx(Typography,
|
|
19
|
-
|
|
20
|
-
const renderLine = () => (jsxs(Fragment, { children: [jsx("div", Object.assign({ className: progressClasses.lineBg }, { children: jsx("div", { style: { width: `${percentLimited}%` } }, void 0) }), void 0), showInfo && renderInfo('input3')] }, void 0));
|
|
19
|
+
const renderInfo = (variant) => (jsx("div", { className: progressClasses.info, children: status === ProgressStatuses.normal
|
|
20
|
+
? /** percent text */ (jsx(Typography, { className: progressClasses.infoPercent, variant: variant, ...percentProps, children: `${percentLimited}%` })) : (jsxs(Fragment, { children: [status === ProgressStatuses.success && (jsx(Icon, { className: progressClasses.infoIcon, icon: defaultSuccessIcon, ...successIconProps })), status === ProgressStatuses.error && (jsx(Icon, { className: progressClasses.infoIcon, icon: defaultErrorIcon, ...errorIconProps }))] })) }));
|
|
21
|
+
const renderLine = () => (jsxs(Fragment, { children: [jsx("div", { className: progressClasses.lineBg, children: jsx("div", { style: { width: `${percentLimited}%` } }) }), showInfo && renderInfo('input3')] }));
|
|
21
22
|
const renderCircle = () => {
|
|
22
23
|
const { size: circleSize = 80, strokeWidth = 8, } = circleProps || {};
|
|
23
24
|
const radius = (circleSize - strokeWidth) / 2;
|
|
24
25
|
const progressLength = percent > 0 ? percent * radius * Math.PI * 0.02 : 0.00001;
|
|
25
26
|
const circleXY = circleSize / 2;
|
|
26
|
-
return (jsxs(Fragment, { children: [jsxs("svg",
|
|
27
|
-
jsx("circle", { className: progressClasses.circleFiller, cx: circleXY, cy: circleXY, r: radius, strokeWidth: strokeWidth, strokeDasharray: `${progressLength.toString()} 999` }, void 0)] }), void 0), showInfo && renderInfo('button3')] }, void 0));
|
|
27
|
+
return (jsxs(Fragment, { children: [jsxs("svg", { style: { boxSizing: 'border-box' }, height: circleSize, width: circleSize, children: [jsx("circle", { className: progressClasses.circleBg, cx: circleXY, cy: circleXY, r: radius, strokeWidth: strokeWidth }), jsx("circle", { className: progressClasses.circleFiller, cx: circleXY, cy: circleXY, r: radius, strokeWidth: strokeWidth, strokeDasharray: `${progressLength.toString()} 999` })] }), showInfo && renderInfo('button3')] }));
|
|
28
28
|
};
|
|
29
|
-
return (jsxs("div",
|
|
29
|
+
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()] }));
|
|
30
30
|
});
|
|
31
31
|
var Progress$1 = Progress;
|
|
32
32
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { MezzanineConfigContext } from './context';
|
|
3
|
+
export interface ConfigProviderProps {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
size?: MezzanineConfigContext['size'];
|
|
6
|
+
}
|
|
7
|
+
declare function ConfigProvider(props: ConfigProviderProps): JSX.Element;
|
|
8
|
+
export default ConfigProvider;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { MezzanineConfig } from './context.js';
|
|
4
|
+
|
|
5
|
+
function ConfigProvider(props) {
|
|
6
|
+
const { children, size, } = props;
|
|
7
|
+
const context = useMemo(() => ({
|
|
8
|
+
size: size || 'medium',
|
|
9
|
+
}), [size]);
|
|
10
|
+
return (jsx(MezzanineConfig.Provider, { value: context, children: children }));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { ConfigProvider as default };
|
package/Radio/Radio.js
CHANGED
|
@@ -3,6 +3,7 @@ import { forwardRef, useContext } from 'react';
|
|
|
3
3
|
import { radioClasses } from '@mezzanine-ui/core/radio';
|
|
4
4
|
import { useRadioControlValue } from '../Form/useRadioControlValue.js';
|
|
5
5
|
import { RadioGroupContext } from './RadioGroupContext.js';
|
|
6
|
+
import { MezzanineConfig } from '../Provider/context.js';
|
|
6
7
|
import InputCheck from '../_internal/InputCheck/InputCheck.js';
|
|
7
8
|
import { FormControlContext } from '../Form/FormControlContext.js';
|
|
8
9
|
import cx from 'clsx';
|
|
@@ -11,10 +12,11 @@ import cx from 'clsx';
|
|
|
11
12
|
* The react component for `mezzanine` radio.
|
|
12
13
|
*/
|
|
13
14
|
const Radio = forwardRef(function Radio(props, ref) {
|
|
15
|
+
const { size: globalSize, } = useContext(MezzanineConfig);
|
|
14
16
|
const { disabled: disabledFromFormControl, severity, } = useContext(FormControlContext) || {};
|
|
15
17
|
const radioGroup = useContext(RadioGroupContext);
|
|
16
18
|
const { disabled: disabledFromGroup, name: nameFromGroup, size: sizeFromGroup, } = radioGroup || {};
|
|
17
|
-
const { checked: checkedProp, children, defaultChecked, disabled = (disabledFromGroup !== null && disabledFromGroup !== void 0 ? disabledFromGroup : disabledFromFormControl) || false, error = severity === 'error' || false, inputProps, onChange: onChangeProp, size = sizeFromGroup ||
|
|
19
|
+
const { checked: checkedProp, children, defaultChecked, disabled = (disabledFromGroup !== null && disabledFromGroup !== void 0 ? disabledFromGroup : disabledFromFormControl) || false, error = severity === 'error' || false, inputProps, onChange: onChangeProp, size = sizeFromGroup || globalSize, value, ...rest } = props;
|
|
18
20
|
const { id: inputId, name = nameFromGroup, ...restInputProps } = inputProps || {};
|
|
19
21
|
const [checked, onChange] = useRadioControlValue({
|
|
20
22
|
checked: checkedProp,
|
|
@@ -23,9 +25,9 @@ const Radio = forwardRef(function Radio(props, ref) {
|
|
|
23
25
|
radioGroup,
|
|
24
26
|
value,
|
|
25
27
|
});
|
|
26
|
-
return (jsx(InputCheck,
|
|
28
|
+
return (jsx(InputCheck, { ...rest, ref: ref, control: (jsx("span", { className: cx(radioClasses.host, {
|
|
27
29
|
[radioClasses.checked]: checked,
|
|
28
|
-
})
|
|
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 }));
|
|
29
31
|
});
|
|
30
32
|
var Radio$1 = Radio;
|
|
31
33
|
|
package/Radio/RadioGroup.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { forwardRef } from 'react';
|
|
2
|
+
import { forwardRef, useMemo } from 'react';
|
|
3
3
|
import { useInputControlValue } from '../Form/useInputControlValue.js';
|
|
4
4
|
import { RadioGroupContext } from './RadioGroupContext.js';
|
|
5
5
|
import Radio from './Radio.js';
|
|
@@ -15,15 +15,15 @@ const RadioGroup = forwardRef(function RadioGroup(props, ref) {
|
|
|
15
15
|
onChange: onChangeProp,
|
|
16
16
|
value: valueProp,
|
|
17
17
|
});
|
|
18
|
-
const context = {
|
|
18
|
+
const context = useMemo(() => ({
|
|
19
19
|
disabled,
|
|
20
20
|
name,
|
|
21
21
|
onChange,
|
|
22
22
|
size,
|
|
23
23
|
value,
|
|
24
|
-
};
|
|
25
|
-
const children = childrenProp || options.map((option) => (jsx(Radio,
|
|
26
|
-
return (jsx(RadioGroupContext.Provider,
|
|
24
|
+
}), [disabled, name, onChange, size, value]);
|
|
25
|
+
const children = childrenProp || options.map((option) => (jsx(Radio, { disabled: option.disabled, value: option.value, children: option.label }, option.value)));
|
|
26
|
+
return (jsx(RadioGroupContext.Provider, { value: context, children: jsx(InputCheckGroup, { ...rest, ref: ref, role: "radiogroup", children: children }) }));
|
|
27
27
|
});
|
|
28
28
|
var RadioGroup$1 = RadioGroup;
|
|
29
29
|
|
package/Select/AutoComplete.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { SelectInputSize } from '@mezzanine-ui/core/select';
|
|
3
|
+
import { SelectValue } from './typings';
|
|
3
4
|
import { MenuProps } from '../Menu';
|
|
4
5
|
import { PopperProps } from '../Popper';
|
|
5
6
|
import { PickRenameMulti } from '../utils/general';
|
|
6
7
|
import { SelectTriggerProps, SelectTriggerInputProps } from './SelectTrigger';
|
|
7
|
-
export interface
|
|
8
|
+
export interface AutoCompleteBaseProps extends Omit<SelectTriggerProps, 'active' | 'clearable' | 'forceHideSuffixActionIcon' | 'mode' | 'onClick' | 'onKeyDown' | 'onChange' | 'renderValue' | 'inputProps' | 'suffixActionIcon' | 'value'>, PickRenameMulti<Pick<MenuProps, 'itemsInView' | 'maxHeight' | 'role' | 'size'>, {
|
|
8
9
|
maxHeight: 'menuMaxHeight';
|
|
9
10
|
role: 'menuRole';
|
|
10
11
|
size: 'menuSize';
|
|
@@ -16,10 +17,6 @@ export interface AutoCompleteProps extends Omit<SelectTriggerProps, 'active' | '
|
|
|
16
17
|
* @default false
|
|
17
18
|
*/
|
|
18
19
|
addable?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* The default selection
|
|
21
|
-
*/
|
|
22
|
-
defaultValue?: string;
|
|
23
20
|
/**
|
|
24
21
|
* Should the filter rules be disabled (If you need to control options filter by yourself)
|
|
25
22
|
* @default false
|
|
@@ -29,15 +26,11 @@ export interface AutoCompleteProps extends Omit<SelectTriggerProps, 'active' | '
|
|
|
29
26
|
* The other native props for input element.
|
|
30
27
|
*/
|
|
31
28
|
inputProps?: Omit<SelectTriggerInputProps, 'onChange' | 'placeholder' | 'role' | 'value' | `aria-${'controls' | 'expanded' | 'owns'}`>;
|
|
32
|
-
/**
|
|
33
|
-
* The change event handler of input element.
|
|
34
|
-
*/
|
|
35
|
-
onChange?(text: string): any;
|
|
36
29
|
/**
|
|
37
30
|
* insert callback whenever insert icon is clicked
|
|
38
31
|
* return `true` when insert is successfully
|
|
39
32
|
*/
|
|
40
|
-
onInsert?(text: string):
|
|
33
|
+
onInsert?(text: string): SelectValue;
|
|
41
34
|
/**
|
|
42
35
|
* The search event handler
|
|
43
36
|
*/
|
|
@@ -45,7 +38,7 @@ export interface AutoCompleteProps extends Omit<SelectTriggerProps, 'active' | '
|
|
|
45
38
|
/**
|
|
46
39
|
* The options that mapped autocomplete options
|
|
47
40
|
*/
|
|
48
|
-
options:
|
|
41
|
+
options: SelectValue[];
|
|
49
42
|
/**
|
|
50
43
|
* select input placeholder
|
|
51
44
|
*/
|
|
@@ -57,15 +50,48 @@ export interface AutoCompleteProps extends Omit<SelectTriggerProps, 'active' | '
|
|
|
57
50
|
required?: boolean;
|
|
58
51
|
/**
|
|
59
52
|
* The size of input.
|
|
60
|
-
* @default 'medium'
|
|
61
53
|
*/
|
|
62
54
|
size?: SelectInputSize;
|
|
55
|
+
}
|
|
56
|
+
export declare type AutoCompleteMultipleProps = AutoCompleteBaseProps & {
|
|
57
|
+
/**
|
|
58
|
+
* The default selection
|
|
59
|
+
*/
|
|
60
|
+
defaultValue?: SelectValue[];
|
|
61
|
+
/**
|
|
62
|
+
* Controls the layout of trigger.
|
|
63
|
+
*/
|
|
64
|
+
mode: 'multiple';
|
|
65
|
+
/**
|
|
66
|
+
* The change event handler of input element.
|
|
67
|
+
*/
|
|
68
|
+
onChange?(newOptions: SelectValue[]): any;
|
|
63
69
|
/**
|
|
64
70
|
* The value of selection.
|
|
65
71
|
* @default undefined
|
|
66
72
|
*/
|
|
67
|
-
value?:
|
|
68
|
-
}
|
|
73
|
+
value?: SelectValue[];
|
|
74
|
+
};
|
|
75
|
+
export declare type AutoCompleteSingleProps = AutoCompleteBaseProps & {
|
|
76
|
+
/**
|
|
77
|
+
* The default selection
|
|
78
|
+
*/
|
|
79
|
+
defaultValue?: SelectValue;
|
|
80
|
+
/**
|
|
81
|
+
* Controls the layout of trigger.
|
|
82
|
+
*/
|
|
83
|
+
mode?: 'single';
|
|
84
|
+
/**
|
|
85
|
+
* The change event handler of input element.
|
|
86
|
+
*/
|
|
87
|
+
onChange?(newOptions: SelectValue): any;
|
|
88
|
+
/**
|
|
89
|
+
* The value of selection.
|
|
90
|
+
* @default undefined
|
|
91
|
+
*/
|
|
92
|
+
value?: SelectValue | null;
|
|
93
|
+
};
|
|
94
|
+
export declare type AutoCompleteProps = AutoCompleteMultipleProps | AutoCompleteSingleProps;
|
|
69
95
|
/**
|
|
70
96
|
* The AutoComplete component for react. <br />
|
|
71
97
|
* Note that if you need search for ONLY given options, not included your typings,
|