@mezzanine-ui/react 0.6.4 → 0.7.3
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 +3 -2
- package/Accordion/AccordionDetails.js +3 -2
- package/Accordion/AccordionSummary.js +3 -2
- package/Alert/Alert.js +3 -2
- package/AppBar/AppBar.js +3 -2
- package/AppBar/AppBarBrand.js +3 -2
- package/AppBar/AppBarMain.js +3 -2
- package/AppBar/AppBarSupport.js +3 -2
- package/Badge/Badge.js +3 -2
- package/Badge/BadgeContainer.js +3 -2
- package/Button/Button.d.ts +1 -1
- package/Button/Button.js +3 -2
- package/Button/ButtonGroup.js +3 -2
- package/Button/IconButton.js +3 -2
- package/Button/index.js +2 -2
- package/Calendar/Calendar.js +3 -2
- package/Calendar/CalendarCell.js +1 -1
- package/Calendar/CalendarContext.js +1 -2
- package/Calendar/CalendarControls.js +1 -1
- package/Calendar/CalendarDayOfWeek.js +1 -1
- package/Calendar/CalendarDays.js +1 -1
- package/Calendar/CalendarMonths.js +1 -1
- package/Calendar/CalendarWeeks.js +1 -1
- package/Calendar/CalendarYears.js +1 -1
- package/Card/Card.js +3 -2
- package/Card/CardActions.js +3 -2
- package/Checkbox/CheckAll.js +3 -2
- package/Checkbox/Checkbox.js +3 -2
- package/Checkbox/CheckboxGroup.js +3 -2
- package/ConfirmActions/ConfirmActions.js +3 -2
- package/DatePicker/DatePicker.js +4 -3
- package/DatePicker/DatePickerCalendar.js +3 -2
- package/DateRangePicker/DateRangePicker.js +4 -3
- package/DateRangePicker/DateRangePickerCalendar.js +3 -2
- package/DateRangePicker/useDateRangePickerValue.d.ts +2 -2
- package/DateTimePicker/DateTimePicker.js +4 -3
- package/DateTimePicker/DateTimePickerPanel.js +3 -2
- package/Drawer/Drawer.d.ts +2 -7
- package/Drawer/Drawer.js +8 -23
- package/Dropdown/Dropdown.js +3 -2
- package/Empty/Empty.js +3 -2
- package/Form/FormField.js +3 -2
- package/Form/FormLabel.js +3 -2
- package/Form/FormMessage.js +3 -2
- package/Icon/Icon.d.ts +4 -0
- package/Icon/Icon.js +6 -4
- package/Input/Input.js +4 -3
- package/Loading/Loading.js +3 -2
- package/Menu/Menu.js +3 -2
- package/Menu/MenuDivider.js +3 -2
- package/Menu/MenuItem.js +3 -2
- package/Menu/MenuItemGroup.js +3 -2
- package/Message/Message.d.ts +8 -5
- package/Message/Message.js +29 -13
- package/Message/index.d.ts +1 -1
- package/Modal/Modal.d.ts +2 -7
- package/Modal/Modal.js +11 -59
- package/Modal/ModalActions.js +3 -2
- package/Modal/ModalBody.js +3 -2
- package/Modal/ModalFooter.js +3 -2
- package/Modal/ModalHeader.js +3 -2
- package/Modal/index.d.ts +1 -0
- package/Modal/index.js +1 -0
- package/Modal/useModalContainer.d.ts +6 -0
- package/Modal/useModalContainer.js +27 -0
- package/Navigation/Navigation.js +3 -2
- package/Navigation/NavigationItem.js +3 -2
- package/Navigation/NavigationSubMenu.js +3 -2
- package/Notification/Notification.js +4 -3
- package/Notifier/NotifierManager.js +1 -1
- package/Overlay/Overlay.js +3 -2
- package/PageFooter/PageFooter.js +3 -2
- package/Pagination/Pagination.js +3 -2
- package/Pagination/PaginationItem.js +3 -2
- package/Pagination/PaginationJumper.js +3 -2
- package/Picker/PickerTrigger.js +3 -2
- package/Picker/RangePickerTrigger.js +3 -2
- package/Picker/usePickerInputValue.js +1 -2
- package/Picker/usePickerValue.d.ts +1 -1
- package/Picker/useRangePickerValue.d.ts +2 -2
- package/Popconfirm/Popconfirm.js +3 -2
- package/Popover/Popover.js +3 -2
- package/Popper/Popper.js +3 -2
- package/Portal/Portal.js +3 -2
- package/Progress/Progress.js +3 -2
- package/Radio/Radio.js +4 -3
- package/Radio/RadioGroup.js +3 -2
- package/Select/AutoComplete.d.ts +1 -1
- package/Select/AutoComplete.js +4 -3
- package/Select/Option.js +3 -2
- package/Select/Select.d.ts +1 -1
- package/Select/Select.js +4 -3
- package/Select/SelectTrigger.js +3 -2
- package/Select/TreeSelect.d.ts +1 -1
- package/Select/TreeSelect.js +4 -3
- package/Skeleton/Skeleton.js +3 -2
- package/Slider/Slider.js +20 -3
- package/Slider/useSlider.js +8 -6
- package/Stepper/Step.js +3 -2
- package/Stepper/Stepper.js +3 -2
- package/Switch/Switch.js +4 -3
- package/Table/Table.d.ts +51 -44
- package/Table/Table.js +42 -23
- package/Table/TableBody.js +10 -4
- package/Table/TableBodyRow.js +3 -2
- package/Table/TableCell.js +3 -2
- package/Table/TableHeader.js +3 -2
- package/Table/editable/TableEditRenderWrapper.js +1 -1
- package/Table/expandable/TableExpandable.js +3 -2
- package/Table/pagination/TablePagination.js +13 -14
- package/Table/pagination/useTablePagination.d.ts +5 -13
- package/Table/pagination/useTablePagination.js +3 -23
- package/Table/refresh/TableRefresh.js +3 -2
- package/Table/rowSelection/TableRowSelection.js +3 -2
- package/Table/sorting/TableSortingIcon.js +3 -2
- package/Table/useTableScroll.d.ts +9 -9
- package/Table/useTableScroll.js +1 -1
- package/Tabs/Tab.js +3 -2
- package/Tabs/TabPane.js +3 -2
- package/Tabs/Tabs.js +3 -2
- package/Tabs/useTabsOverflow.js +1 -1
- package/Tag/Tag.js +3 -2
- package/TextField/TextField.js +3 -2
- package/Textarea/Textarea.js +4 -3
- package/TimePanel/TimePanel.js +3 -2
- package/TimePanel/TimePanelAction.js +3 -2
- package/TimePanel/TimePanelColumn.js +3 -2
- package/TimePicker/TimePicker.js +4 -3
- package/TimePicker/TimePickerPanel.js +3 -2
- package/Tooltip/Tooltip.js +3 -2
- package/Transition/Collapse.js +3 -2
- package/Transition/Fade.js +3 -2
- package/Transition/Grow.js +3 -2
- package/Transition/SlideFade.js +3 -2
- package/Transition/Transition.d.ts +1 -1
- package/Transition/Transition.js +1 -1
- package/Transition/Zoom.js +3 -2
- package/Tree/Tree.js +3 -2
- package/Tree/TreeNode.js +3 -2
- package/Tree/TreeNodeList.js +3 -2
- package/Typography/Typography.d.ts +1 -1
- package/Typography/Typography.js +3 -2
- package/Upload/UploadButton.js +3 -2
- package/Upload/UploadInput.js +5 -2
- package/Upload/UploadPicture.d.ts +48 -0
- package/Upload/UploadPicture.js +52 -0
- package/Upload/UploadPictureBlock.d.ts +13 -0
- package/Upload/UploadPictureBlock.js +86 -0
- package/Upload/UploadPictureWall.d.ts +71 -0
- package/Upload/UploadPictureWall.js +156 -0
- package/Upload/UploadPictureWallItem.d.ts +13 -0
- package/Upload/UploadPictureWallItem.js +19 -0
- package/Upload/UploadResult.js +3 -2
- package/Upload/index.d.ts +3 -0
- package/Upload/index.js +3 -0
- package/_internal/InputCheck/InputCheck.js +3 -2
- package/_internal/InputCheck/InputCheckGroup.js +3 -2
- package/_internal/InputTriggerPopper/InputTriggerPopper.js +3 -2
- package/_internal/SlideFadeOverlay/SlideFadeOverlay.d.ts +21 -0
- package/_internal/SlideFadeOverlay/SlideFadeOverlay.js +66 -0
- package/_internal/SlideFadeOverlay/index.d.ts +1 -0
- package/_internal/SlideFadeOverlay/index.js +1 -0
- package/_internal/SlideFadeOverlay/useTopStack.d.ts +1 -0
- package/{Modal/useIsTopModal.js → _internal/SlideFadeOverlay/useTopStack.js} +3 -3
- package/index.d.ts +4 -4
- package/index.js +52 -49
- package/package.json +6 -6
- package/utils/{rename-types.d.ts → general.d.ts} +3 -0
- package/Modal/useIsTopModal.d.ts +0 -1
|
@@ -20,6 +20,7 @@ const PaginationItem = forwardRef((props, ref) => {
|
|
|
20
20
|
}, className), type: "button" }),
|
|
21
21
|
ButtonIcon && jsx(Icon, { icon: ButtonIcon }, void 0),
|
|
22
22
|
type === 'page' && page));
|
|
23
|
-
});
|
|
23
|
+
});
|
|
24
|
+
var PaginationItem$1 = PaginationItem;
|
|
24
25
|
|
|
25
|
-
export default
|
|
26
|
+
export { PaginationItem$1 as default };
|
|
@@ -47,6 +47,7 @@ const PaginationJumper = forwardRef((props, ref) => {
|
|
|
47
47
|
onKeyDown: handleKeyDown,
|
|
48
48
|
}, value: value }, void 0),
|
|
49
49
|
jsx(Button, Object.assign({ disabled: disabled, onClick: handleClick }, { children: buttonText }), void 0)] }), void 0));
|
|
50
|
-
});
|
|
50
|
+
});
|
|
51
|
+
var PaginationJumper$1 = PaginationJumper;
|
|
51
52
|
|
|
52
|
-
export default
|
|
53
|
+
export { PaginationJumper$1 as default };
|
package/Picker/PickerTrigger.js
CHANGED
|
@@ -10,6 +10,7 @@ import cx from 'clsx';
|
|
|
10
10
|
const PickerTrigger = forwardRef(function PickerTrigger(props, ref) {
|
|
11
11
|
const { className, disabled, inputProps, inputRef, onChange, placeholder, readOnly, required, value, ...restTextFieldProps } = props;
|
|
12
12
|
return (jsx(TextField, Object.assign({}, restTextFieldProps, { ref: ref, active: !!value, className: cx(pickerClasses.host, className), disabled: disabled }, { children: jsx("input", Object.assign({}, 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 }), void 0) }), void 0));
|
|
13
|
-
});
|
|
13
|
+
});
|
|
14
|
+
var PickerTrigger$1 = PickerTrigger;
|
|
14
15
|
|
|
15
|
-
export default
|
|
16
|
+
export { PickerTrigger$1 as default };
|
|
@@ -14,6 +14,7 @@ const RangePickerTrigger = forwardRef(function DateRangePickerTrigger(props, ref
|
|
|
14
14
|
return (jsxs(TextField, Object.assign({}, restTextFieldProps, { ref: ref, active: !!inputFromValue || !!inputToValue, className: cx(pickerClasses.host, className), disabled: disabled }, { children: [jsx("input", Object.assign({}, 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 }), void 0),
|
|
15
15
|
jsx(Icon, { icon: ArrowRightIcon, className: pickerClasses.arrowIcon }, void 0),
|
|
16
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));
|
|
17
|
-
});
|
|
17
|
+
});
|
|
18
|
+
var RangePickerTrigger$1 = RangePickerTrigger;
|
|
18
19
|
|
|
19
|
-
export default
|
|
20
|
+
export { RangePickerTrigger$1 as default };
|
|
@@ -13,7 +13,7 @@ export declare type UsePickerValueProps = {
|
|
|
13
13
|
*/
|
|
14
14
|
export declare function usePickerValue({ defaultValue, format, formats, inputRef, value: valueProp, }: UsePickerValueProps): {
|
|
15
15
|
inputValue: string;
|
|
16
|
-
onBlur: (event: import("react").FocusEvent<HTMLInputElement>) => void;
|
|
16
|
+
onBlur: (event: import("react").FocusEvent<HTMLInputElement, Element>) => void;
|
|
17
17
|
onChange: (val?: import("moment").Moment | undefined) => void;
|
|
18
18
|
onInputChange: (event: import("react").ChangeEvent<HTMLInputElement>) => void;
|
|
19
19
|
onKeyDown: (event: import("react").KeyboardEvent<HTMLInputElement>) => void;
|
|
@@ -11,11 +11,11 @@ export declare function useRangePickerValue({ format, formats, inputFromRef, inp
|
|
|
11
11
|
inputFromValue: string;
|
|
12
12
|
inputToValue: string;
|
|
13
13
|
onChange: (target?: undefined[] | [import("moment").Moment, import("moment").Moment] | [import("moment").Moment] | [undefined, import("moment").Moment] | [import("moment").Moment, undefined] | undefined) => RangePickerPickingValue | undefined;
|
|
14
|
-
onFromBlur: (event: import("react").FocusEvent<HTMLInputElement>) => void;
|
|
14
|
+
onFromBlur: (event: import("react").FocusEvent<HTMLInputElement, Element>) => void;
|
|
15
15
|
onFromKeyDown: (event: import("react").KeyboardEvent<HTMLInputElement>) => void;
|
|
16
16
|
onInputFromChange: (event: import("react").ChangeEvent<HTMLInputElement>) => void;
|
|
17
17
|
onInputToChange: (event: import("react").ChangeEvent<HTMLInputElement>) => void;
|
|
18
|
-
onToBlur: (event: import("react").FocusEvent<HTMLInputElement>) => void;
|
|
18
|
+
onToBlur: (event: import("react").FocusEvent<HTMLInputElement, Element>) => void;
|
|
19
19
|
onToKeyDown: (event: import("react").KeyboardEvent<HTMLInputElement>) => void;
|
|
20
20
|
value: RangePickerPickingValue;
|
|
21
21
|
};
|
package/Popconfirm/Popconfirm.js
CHANGED
|
@@ -10,6 +10,7 @@ import cx from 'clsx';
|
|
|
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, Object.assign({}, rest, { ref: ref, className: cx(popConfirmClasses.host, className), title: (jsxs(Fragment, { children: [jsx(Icon, { className: popConfirmClasses.icon, icon: icon }, void 0), title] }, void 0)) }, { children: jsx(ConfirmActions, { cancelButtonProps: cancelButtonProps, cancelText: cancelText, confirmButtonProps: confirmButtonProps, confirmText: confirmText, onCancel: onCancel, onConfirm: onConfirm, size: "small" }, void 0) }), void 0));
|
|
13
|
-
});
|
|
13
|
+
});
|
|
14
|
+
var Popconfirm$1 = Popconfirm;
|
|
14
15
|
|
|
15
|
-
export default
|
|
16
|
+
export { Popconfirm$1 as default };
|
package/Popover/Popover.js
CHANGED
|
@@ -40,6 +40,7 @@ const Popover = forwardRef(function Popover(props, ref) {
|
|
|
40
40
|
modifiers: [offsetModifier, ...modifiers],
|
|
41
41
|
} }, { children: [title && jsx("div", Object.assign({ className: popoverClasses.title }, { children: title }), void 0),
|
|
42
42
|
children && jsx("div", Object.assign({ className: popoverClasses.content }, { children: children }), void 0)] }), void 0));
|
|
43
|
-
});
|
|
43
|
+
});
|
|
44
|
+
var Popover$1 = Popover;
|
|
44
45
|
|
|
45
|
-
export default
|
|
46
|
+
export { Popover$1 as default };
|
package/Popper/Popper.js
CHANGED
|
@@ -25,6 +25,7 @@ const Popper = forwardRef(function Popper(props, ref) {
|
|
|
25
25
|
...style,
|
|
26
26
|
...styles.popper,
|
|
27
27
|
} }, attributes.popper, { children: children }), void 0) }), void 0));
|
|
28
|
-
});
|
|
28
|
+
});
|
|
29
|
+
var Popper$1 = Popper;
|
|
29
30
|
|
|
30
|
-
export default
|
|
31
|
+
export { Popper$1 as default };
|
package/Portal/Portal.js
CHANGED
package/Progress/Progress.js
CHANGED
|
@@ -27,6 +27,7 @@ const Progress = forwardRef(function Progress(props, ref) {
|
|
|
27
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));
|
|
28
28
|
};
|
|
29
29
|
return (jsxs("div", Object.assign({ 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()] }), void 0));
|
|
30
|
-
});
|
|
30
|
+
});
|
|
31
|
+
var Progress$1 = Progress;
|
|
31
32
|
|
|
32
|
-
export default
|
|
33
|
+
export { Progress$1 as default };
|
package/Radio/Radio.js
CHANGED
|
@@ -3,8 +3,8 @@ 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 { FormControlContext } from '../Form/FormControlContext.js';
|
|
7
6
|
import InputCheck from '../_internal/InputCheck/InputCheck.js';
|
|
7
|
+
import { FormControlContext } from '../Form/FormControlContext.js';
|
|
8
8
|
import cx from 'clsx';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -26,6 +26,7 @@ const Radio = forwardRef(function Radio(props, ref) {
|
|
|
26
26
|
return (jsx(InputCheck, Object.assign({}, rest, { ref: ref, control: (jsx("span", Object.assign({ className: cx(radioClasses.host, {
|
|
27
27
|
[radioClasses.checked]: checked,
|
|
28
28
|
}) }, { children: jsx("input", Object.assign({}, restInputProps, { "aria-checked": checked, "aria-disabled": disabled, checked: checked, disabled: disabled, id: inputId, onChange: onChange, name: name, type: "radio", value: value }), void 0) }), void 0)), disabled: disabled, error: error, htmlFor: inputId, size: size }, { children: children }), void 0));
|
|
29
|
-
});
|
|
29
|
+
});
|
|
30
|
+
var Radio$1 = Radio;
|
|
30
31
|
|
|
31
|
-
export default
|
|
32
|
+
export { Radio$1 as default };
|
package/Radio/RadioGroup.js
CHANGED
|
@@ -24,6 +24,7 @@ const RadioGroup = forwardRef(function RadioGroup(props, ref) {
|
|
|
24
24
|
};
|
|
25
25
|
const children = childrenProp || options.map((option) => (jsx(Radio, Object.assign({ disabled: option.disabled, value: option.value }, { children: option.label }), option.value)));
|
|
26
26
|
return (jsx(RadioGroupContext.Provider, Object.assign({ value: context }, { children: jsx(InputCheckGroup, Object.assign({}, rest, { ref: ref, role: "radiogroup" }, { children: children }), void 0) }), void 0));
|
|
27
|
-
});
|
|
27
|
+
});
|
|
28
|
+
var RadioGroup$1 = RadioGroup;
|
|
28
29
|
|
|
29
|
-
export default
|
|
30
|
+
export { RadioGroup$1 as default };
|
package/Select/AutoComplete.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { SelectInputSize } from '@mezzanine-ui/core/select';
|
|
3
3
|
import { MenuProps } from '../Menu';
|
|
4
4
|
import { PopperProps } from '../Popper';
|
|
5
|
-
import { PickRenameMulti } from '../utils/
|
|
5
|
+
import { PickRenameMulti } from '../utils/general';
|
|
6
6
|
import { SelectTriggerProps, SelectTriggerInputProps } from './SelectTrigger';
|
|
7
7
|
export interface AutoCompleteProps extends Omit<SelectTriggerProps, 'active' | 'clearable' | 'forceHideSuffixActionIcon' | 'mode' | 'onClick' | 'onKeyDown' | 'onChange' | 'renderValue' | 'inputProps' | 'suffixActionIcon' | 'value'>, PickRenameMulti<Pick<MenuProps, 'itemsInView' | 'maxHeight' | 'role' | 'size'>, {
|
|
8
8
|
maxHeight: 'menuMaxHeight';
|
package/Select/AutoComplete.js
CHANGED
|
@@ -8,11 +8,11 @@ import { SelectControlContext } from './SelectControlContext.js';
|
|
|
8
8
|
import { useAutoCompleteValueControl } from '../Form/useAutoCompleteValueControl.js';
|
|
9
9
|
import { useClickAway } from '../hooks/useClickAway.js';
|
|
10
10
|
import SelectTrigger from './SelectTrigger.js';
|
|
11
|
-
import { FormControlContext } from '../Form/FormControlContext.js';
|
|
12
11
|
import InputTriggerPopper from '../_internal/InputTriggerPopper/InputTriggerPopper.js';
|
|
13
12
|
import Menu from '../Menu/Menu.js';
|
|
14
13
|
import Empty from '../Empty/Empty.js';
|
|
15
14
|
import Icon from '../Icon/Icon.js';
|
|
15
|
+
import { FormControlContext } from '../Form/FormControlContext.js';
|
|
16
16
|
import cx from 'clsx';
|
|
17
17
|
|
|
18
18
|
const MENU_ID = 'mzn-select-autocomplete-menu-id';
|
|
@@ -103,6 +103,7 @@ const AutoComplete = forwardRef(function Select(props, ref) {
|
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
} }, void 0)] }), void 0)) : null] }), void 0)] }), void 0) }), void 0));
|
|
106
|
-
});
|
|
106
|
+
});
|
|
107
|
+
var AutoComplete$1 = AutoComplete;
|
|
107
108
|
|
|
108
|
-
export default
|
|
109
|
+
export { AutoComplete$1 as default };
|
package/Select/Option.js
CHANGED
|
@@ -27,6 +27,7 @@ const Option = forwardRef(function Option(props, ref) {
|
|
|
27
27
|
evt.stopPropagation();
|
|
28
28
|
onSelect();
|
|
29
29
|
}, onKeyDown: onKeyDown, role: role, tabIndex: 0 }, { children: children }), void 0));
|
|
30
|
-
});
|
|
30
|
+
});
|
|
31
|
+
var Option$1 = Option;
|
|
31
32
|
|
|
32
|
-
export default
|
|
33
|
+
export { Option$1 as default };
|
package/Select/Select.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { FormElementFocusHandlers } from '../Form';
|
|
|
4
4
|
import { MenuProps } from '../Menu';
|
|
5
5
|
import { PopperProps } from '../Popper';
|
|
6
6
|
import { SelectValue } from './typings';
|
|
7
|
-
import { PickRenameMulti } from '../utils/
|
|
7
|
+
import { PickRenameMulti } from '../utils/general';
|
|
8
8
|
import { SelectTriggerProps, SelectTriggerInputProps } from './SelectTrigger';
|
|
9
9
|
export interface SelectProps extends Omit<SelectTriggerProps, 'active' | 'inputProps' | 'onBlur' | 'onChange' | 'onClick' | 'onFocus' | 'onKeyDown'>, FormElementFocusHandlers, PickRenameMulti<Pick<MenuProps, 'itemsInView' | 'maxHeight' | 'role' | 'size'>, {
|
|
10
10
|
maxHeight: 'menuMaxHeight';
|
package/Select/Select.js
CHANGED
|
@@ -7,10 +7,10 @@ import { SelectControlContext } from './SelectControlContext.js';
|
|
|
7
7
|
import { useSelectValueControl } from '../Form/useSelectValueControl.js';
|
|
8
8
|
import { useClickAway } from '../hooks/useClickAway.js';
|
|
9
9
|
import SelectTrigger from './SelectTrigger.js';
|
|
10
|
-
import { FormControlContext } from '../Form/FormControlContext.js';
|
|
11
10
|
import Icon from '../Icon/Icon.js';
|
|
12
11
|
import InputTriggerPopper from '../_internal/InputTriggerPopper/InputTriggerPopper.js';
|
|
13
12
|
import Menu from '../Menu/Menu.js';
|
|
13
|
+
import { FormControlContext } from '../Form/FormControlContext.js';
|
|
14
14
|
import cx from 'clsx';
|
|
15
15
|
|
|
16
16
|
const MENU_ID = 'mzn-select-menu-id';
|
|
@@ -140,6 +140,7 @@ const Select = forwardRef(function Select(props, ref) {
|
|
|
140
140
|
value,
|
|
141
141
|
} }, { children: jsxs("div", Object.assign({ 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: !searchable, required: required, inputProps: resolvedInputProps, size: size, suffixActionIcon: suffixActionIcon, value: value, renderValue: renderValue }, void 0),
|
|
142
142
|
jsx(InputTriggerPopper, Object.assign({ ref: popperRef, anchor: controlRef, className: selectClasses.popper, open: open, sameWidth: true, options: popperOptions }, { children: jsx(Menu, Object.assign({ id: MENU_ID, "aria-activedescendant": (_b = (_a = value === null || value === void 0 ? void 0 : value[0]) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : '', itemsInView: itemsInView, maxHeight: menuMaxHeight, role: menuRole, size: menuSize, style: { border: 0 } }, { children: children }), void 0) }), void 0)] }), void 0) }), void 0));
|
|
143
|
-
});
|
|
143
|
+
});
|
|
144
|
+
var Select$1 = Select;
|
|
144
145
|
|
|
145
|
-
export default
|
|
146
|
+
export { Select$1 as default };
|
package/Select/SelectTrigger.js
CHANGED
|
@@ -22,6 +22,7 @@ const SelectTrigger = forwardRef(function SelectTrigger(props, ref) {
|
|
|
22
22
|
e.stopPropagation();
|
|
23
23
|
onTagClose === null || onTagClose === void 0 ? void 0 : onTagClose(selection);
|
|
24
24
|
}, size: size }, { children: selection.name }), selection.id))) }), void 0)) : (jsx("input", Object.assign({}, inputProps, { ref: inputRef, "aria-autocomplete": "list", "aria-disabled": disabled, "aria-haspopup": "listbox", "aria-readonly": readOnly, "aria-required": required, autoComplete: "false", disabled: disabled, readOnly: readOnly, required: required, type: "search", value: renderValue() }), void 0)) }), void 0));
|
|
25
|
-
});
|
|
25
|
+
});
|
|
26
|
+
var SelectTrigger$1 = SelectTrigger;
|
|
26
27
|
|
|
27
|
-
export default
|
|
28
|
+
export { SelectTrigger$1 as default };
|
package/Select/TreeSelect.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { SelectInputSize } from '@mezzanine-ui/core/select';
|
|
3
3
|
import { FormElementFocusHandlers } from '../Form';
|
|
4
4
|
import { MenuProps } from '../Menu';
|
|
5
|
-
import { PickRenameMulti } from '../utils/
|
|
5
|
+
import { PickRenameMulti } from '../utils/general';
|
|
6
6
|
import { InputTriggerPopperProps } from '../_internal/InputTriggerPopper';
|
|
7
7
|
import { SelectTriggerProps, SelectTriggerInputProps } from './SelectTrigger';
|
|
8
8
|
import { SelectValue, TreeSelectOption } from './typings';
|
package/Select/TreeSelect.js
CHANGED
|
@@ -4,12 +4,12 @@ import { selectClasses } from '@mezzanine-ui/core/select';
|
|
|
4
4
|
import { useComposeRefs } from '../hooks/useComposeRefs.js';
|
|
5
5
|
import { useClickAway } from '../hooks/useClickAway.js';
|
|
6
6
|
import SelectTrigger from './SelectTrigger.js';
|
|
7
|
-
import { FormControlContext } from '../Form/FormControlContext.js';
|
|
8
7
|
import { traverseTree } from '../Tree/traverseTree.js';
|
|
9
8
|
import InputTriggerPopper from '../_internal/InputTriggerPopper/InputTriggerPopper.js';
|
|
10
9
|
import Menu from '../Menu/Menu.js';
|
|
11
10
|
import Tree from '../Tree/Tree.js';
|
|
12
11
|
import { toggleValue } from '../Tree/toggleValue.js';
|
|
12
|
+
import { FormControlContext } from '../Form/FormControlContext.js';
|
|
13
13
|
import cx from 'clsx';
|
|
14
14
|
|
|
15
15
|
const TreeSelect = forwardRef((props, ref) => {
|
|
@@ -193,6 +193,7 @@ const TreeSelect = forwardRef((props, ref) => {
|
|
|
193
193
|
border: border || 0,
|
|
194
194
|
width: width || `${panelWidth}px`,
|
|
195
195
|
} }, { children: jsx(Tree, Object.assign({}, 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 }), void 0) }), void 0) }), void 0)] }), void 0));
|
|
196
|
-
});
|
|
196
|
+
});
|
|
197
|
+
var TreeSelect$1 = TreeSelect;
|
|
197
198
|
|
|
198
|
-
export default
|
|
199
|
+
export { TreeSelect$1 as default };
|
package/Skeleton/Skeleton.js
CHANGED
|
@@ -9,6 +9,7 @@ import cx from 'clsx';
|
|
|
9
9
|
const Skeleton = forwardRef(function Skeleton(props, ref) {
|
|
10
10
|
const { className, height: skeletonHeight, style: skeletonStyle, type, width: skeletonWidth, ...rest } = props;
|
|
11
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));
|
|
12
|
-
});
|
|
12
|
+
});
|
|
13
|
+
var Skeleton$1 = Skeleton;
|
|
13
14
|
|
|
14
|
-
export default
|
|
15
|
+
export { Skeleton$1 as default };
|
package/Slider/Slider.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { forwardRef, useState, useEffect } from 'react';
|
|
3
|
-
import { isRangeSlider, sortSliderValue, sliderClasses, roundToStep } from '@mezzanine-ui/core/slider';
|
|
3
|
+
import { isRangeSlider, fixRangeSliderValue, fixSingleSliderValue, sortSliderValue, sliderClasses, roundToStep } from '@mezzanine-ui/core/slider';
|
|
4
4
|
import { useSlider } from './useSlider.js';
|
|
5
5
|
import Input from '../Input/Input.js';
|
|
6
6
|
import Tooltip from '../Tooltip/Tooltip.js';
|
|
@@ -36,6 +36,22 @@ function SliderComponent(props) {
|
|
|
36
36
|
}
|
|
37
37
|
return `${value[1]}`;
|
|
38
38
|
});
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (max > min) {
|
|
41
|
+
if (isRangeSlider(value)) {
|
|
42
|
+
if ((value[0] > max && value[1] > max) ||
|
|
43
|
+
(value[0] < min && value[1] < min) ||
|
|
44
|
+
value[0] < min ||
|
|
45
|
+
value[1] > max) {
|
|
46
|
+
onChange(fixRangeSliderValue(value, min, max));
|
|
47
|
+
}
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (value < min || value > max) {
|
|
51
|
+
onChange(fixSingleSliderValue(value, min, max));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}, [min, max, onChange, value]);
|
|
39
55
|
useEffect(() => {
|
|
40
56
|
if (withInput) {
|
|
41
57
|
if (isRangeSlider(value)) {
|
|
@@ -167,6 +183,7 @@ const Slider = forwardRef((props, ref) => {
|
|
|
167
183
|
return (jsx(SliderComponent, Object.assign({}, props, { innerRef: ref }), void 0));
|
|
168
184
|
}
|
|
169
185
|
return (jsx(SliderComponent, Object.assign({}, props, { innerRef: ref }), void 0));
|
|
170
|
-
});
|
|
186
|
+
});
|
|
187
|
+
var Slider$1 = Slider;
|
|
171
188
|
|
|
172
|
-
export default
|
|
189
|
+
export { Slider$1 as default };
|
package/Slider/useSlider.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toSliderCssVars, getPercentage,
|
|
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
|
|
|
@@ -13,12 +13,14 @@ function useSlider(props) {
|
|
|
13
13
|
}
|
|
14
14
|
return isRangeSlider(value) ? Math.abs(1 - value.indexOf(anchorValue)) : undefined;
|
|
15
15
|
}
|
|
16
|
+
const fixedValue = isRangeSlider(value) ? fixRangeSliderValue(value, min, max)
|
|
17
|
+
: fixSingleSliderValue(value, min, max);
|
|
16
18
|
const cssVars = toSliderCssVars({
|
|
17
|
-
trackWidth: getPercentage(isRangeSlider(
|
|
18
|
-
trackPosition: getPercentage(isRangeSlider(
|
|
19
|
-
handlerPosition: getPercentage(isRangeSlider(
|
|
20
|
-
handlerStartPosition: getPercentage(isRangeSlider(
|
|
21
|
-
handlerEndPosition: getPercentage(isRangeSlider(
|
|
19
|
+
trackWidth: getPercentage(isRangeSlider(fixedValue) ? Math.abs(fixedValue[0] - fixedValue[1]) : fixedValue - min, min, max),
|
|
20
|
+
trackPosition: getPercentage(isRangeSlider(fixedValue) ? Math.abs(Math.min(...fixedValue) - min) : 0, min, max),
|
|
21
|
+
handlerPosition: getPercentage(isRangeSlider(fixedValue) ? 0 : fixedValue - min, min, max),
|
|
22
|
+
handlerStartPosition: getPercentage(isRangeSlider(fixedValue) ? Math.abs(Math.min(...fixedValue) - min) : fixedValue, min, max),
|
|
23
|
+
handlerEndPosition: getPercentage(isRangeSlider(fixedValue) ? Math.abs(Math.max(...fixedValue) - min) : fixedValue, min, max),
|
|
22
24
|
});
|
|
23
25
|
const getRoundedNewValue = (e, railElement) => {
|
|
24
26
|
const clientX = e.type === 'touchmove' ? e.changedTouches[0].clientX : e.clientX;
|
package/Stepper/Step.js
CHANGED
|
@@ -14,6 +14,7 @@ const Step = forwardRef(function Step(props, ref) {
|
|
|
14
14
|
/** icon and step number */
|
|
15
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
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));
|
|
17
|
-
});
|
|
17
|
+
});
|
|
18
|
+
var Step$1 = Step;
|
|
18
19
|
|
|
19
|
-
export default
|
|
20
|
+
export { Step$1 as default };
|
package/Stepper/Stepper.js
CHANGED
|
@@ -28,6 +28,7 @@ const Stepper = forwardRef(function Stepper(props, ref) {
|
|
|
28
28
|
});
|
|
29
29
|
});
|
|
30
30
|
return (jsx("div", Object.assign({ className: cx(stepperClasses.host, className), ref: ref }, rest, { children: stepsWithState }), void 0));
|
|
31
|
-
});
|
|
31
|
+
});
|
|
32
|
+
var Stepper$1 = Stepper;
|
|
32
33
|
|
|
33
|
-
export default
|
|
34
|
+
export { Stepper$1 as default };
|
package/Switch/Switch.js
CHANGED
|
@@ -2,8 +2,8 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { forwardRef, useContext } from 'react';
|
|
3
3
|
import { switchClasses, SwitchSpinnerIcon } from '@mezzanine-ui/core/switch';
|
|
4
4
|
import { useSwitchControlValue } from '../Form/useSwitchControlValue.js';
|
|
5
|
-
import { FormControlContext } from '../Form/FormControlContext.js';
|
|
6
5
|
import Icon from '../Icon/Icon.js';
|
|
6
|
+
import { FormControlContext } from '../Form/FormControlContext.js';
|
|
7
7
|
import cx from 'clsx';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -24,6 +24,7 @@ const Switch = forwardRef(function Switch(props, ref) {
|
|
|
24
24
|
[switchClasses.large]: size === 'large',
|
|
25
25
|
}, className) }, { children: [jsx("span", Object.assign({ className: switchClasses.control }, { children: loading && jsx(Icon, { icon: SwitchSpinnerIcon, spin: true }, void 0) }), void 0),
|
|
26
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));
|
|
27
|
-
});
|
|
27
|
+
});
|
|
28
|
+
var Switch$1 = Switch;
|
|
28
29
|
|
|
29
|
-
export default
|
|
30
|
+
export { Switch$1 as default };
|
package/Table/Table.d.ts
CHANGED
|
@@ -2,78 +2,85 @@
|
|
|
2
2
|
import { TableColumn, TableComponents, TableDataSource, TableRowSelection, TableExpandable, TableFetchMore, TablePagination as TablePaginationType, TableRefresh as TableRefreshType } from '@mezzanine-ui/core/table';
|
|
3
3
|
import { EmptyProps } from '../Empty';
|
|
4
4
|
import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
|
|
5
|
-
export interface
|
|
5
|
+
export interface TableBaseProps<T> extends Omit<NativeElementPropsWithoutKeyAndRef<'div'>, 'role'> {
|
|
6
6
|
/**
|
|
7
7
|
* customized body className
|
|
8
8
|
*/
|
|
9
9
|
bodyClassName?: string;
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
* customized body row className
|
|
12
|
+
*/
|
|
13
13
|
bodyRowClassName?: string;
|
|
14
14
|
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
* Columns of table <br />
|
|
16
|
+
* `column.render` allowed customizing the column body cell rendering. <br />
|
|
17
|
+
* `column.renderTitle` allowed customizing the column header cell rendering. <br />
|
|
18
|
+
* `column.sorter` is the sorting method that you want to apply to your column. <br />
|
|
19
|
+
* `column.onSorted` is the callback triggered whenever sort icon clicked.
|
|
20
|
+
*/
|
|
21
21
|
columns: TableColumn<T>[];
|
|
22
22
|
/**
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
* Custom table components <br />
|
|
24
|
+
*/
|
|
25
25
|
components?: TableComponents;
|
|
26
26
|
/**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
* Data record array to be displayed. <br />
|
|
28
|
+
* Notice that each source should contain `key` or `id` prop as data primary key.
|
|
29
|
+
*/
|
|
30
30
|
dataSource: TableDataSource[];
|
|
31
31
|
/**
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
* props exported from `<Empty />` component.
|
|
33
|
+
*/
|
|
34
34
|
emptyProps?: EmptyProps;
|
|
35
35
|
/**
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
* When `expandable.rowExpandable` is given, it will control whether row data is expandable or not
|
|
37
|
+
* `expandable.expandedRowRender` is a callback to helps you decides what data should be rendered.
|
|
38
|
+
*/
|
|
39
39
|
expandable?: TableExpandable<T>;
|
|
40
|
-
/**
|
|
41
|
-
* If `fetchMore.callback` is given, table will automatically trigger it when scrolling position reach end. <br />
|
|
42
|
-
* If `fetchMore.isReachEnd` is true, table will stop triggering callback. <br />
|
|
43
|
-
* If `fetchMore.isFetching` is true, a loading spinner will display at the end of table and stop triggering callback.
|
|
44
|
-
* <br />
|
|
45
|
-
* Notice that when `fetchMore.isFetching` is `undefined`, table will take control of it when source length changed.
|
|
46
|
-
*/
|
|
47
|
-
fetchMore?: TableFetchMore;
|
|
48
40
|
/**
|
|
49
41
|
* customized header className
|
|
50
42
|
*/
|
|
51
43
|
headerClassName?: string;
|
|
52
44
|
/**
|
|
53
|
-
|
|
54
|
-
|
|
45
|
+
* Whether table is loading or not
|
|
46
|
+
*/
|
|
55
47
|
loading?: boolean;
|
|
56
|
-
/**
|
|
57
|
-
* `pagination.show` controls pagination display. <br />
|
|
58
|
-
* `pagination.current` is the current page number. <br />
|
|
59
|
-
* `pagination.onChange` is the callback when page number changed. <br />
|
|
60
|
-
* `pagination.total` is the total amount of your data. <br />
|
|
61
|
-
* `pagination.options` is the <Pagination /> component props. <br />
|
|
62
|
-
* Notice that if `pagination` object is given, table will disable fetchMore and use pagination instead.
|
|
63
|
-
*/
|
|
64
|
-
pagination?: TablePaginationType;
|
|
65
48
|
/**
|
|
66
49
|
* `refresh.show` is true, refresh button will display at the top-start of table. <br />
|
|
67
50
|
* `refresh.onClick` is the callback of the refresh button.
|
|
68
51
|
*/
|
|
69
52
|
refresh?: TableRefreshType;
|
|
70
53
|
/**
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
54
|
+
* Enable row selection feature <br />
|
|
55
|
+
* `rowSelection.selectedRowKey` is the dataSource keys that are currently selected. <br />
|
|
56
|
+
* `rowSelection.onChange` is the callback when selection changed. <br />
|
|
57
|
+
* `rowSelection.actions` are the actions that you want to do for selected data.
|
|
58
|
+
*/
|
|
76
59
|
rowSelection?: TableRowSelection;
|
|
77
60
|
}
|
|
78
|
-
|
|
61
|
+
export interface TableWithFetchMore<T> extends TableBaseProps<T> {
|
|
62
|
+
/**
|
|
63
|
+
* If `fetchMore.callback` is given, table will automatically trigger it when scrolling position reach end. <br />
|
|
64
|
+
* If `fetchMore.isReachEnd` is true, table will stop triggering callback. <br />
|
|
65
|
+
* If `fetchMore.isFetching` is true, a loading spinner will display at the end of table and stop triggering callback.
|
|
66
|
+
* <br />
|
|
67
|
+
* Notice that when `fetchMore.isFetching` is `undefined`, table will take control of it when source length changed.
|
|
68
|
+
*/
|
|
69
|
+
fetchMore?: TableFetchMore;
|
|
70
|
+
pagination?: undefined;
|
|
71
|
+
}
|
|
72
|
+
export interface TableWithPagination<T> extends TableBaseProps<T> {
|
|
73
|
+
/**
|
|
74
|
+
* `pagination.current` is the current page number. (required) <br />
|
|
75
|
+
* `pagination.onChange` is the callback when page number changed. (required) <br />
|
|
76
|
+
* `pagination.disableAutoSlicing` set this to true if you don't want auto data slicing. <br />
|
|
77
|
+
* `pagination.total` is the total amount of your data. (default will be dataSource length) <br />
|
|
78
|
+
* `pagination.options` is the <Pagination /> component props. <br />
|
|
79
|
+
* Notice that if `pagination` object is given, table will disable fetchMore and use pagination instead.
|
|
80
|
+
*/
|
|
81
|
+
pagination?: TablePaginationType;
|
|
82
|
+
fetchMore?: undefined;
|
|
83
|
+
}
|
|
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>)>;
|
|
79
86
|
export default Table;
|