@itwin/itwinui-react 3.0.0-dev.1 → 3.0.0-dev.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/CHANGELOG.md +18 -0
- package/cjs/core/Alert/Alert.d.ts +47 -28
- package/cjs/core/Alert/Alert.js +73 -21
- package/cjs/core/Avatar/Avatar.js +1 -1
- package/cjs/core/AvatarGroup/AvatarGroup.js +1 -1
- package/cjs/core/Breadcrumbs/Breadcrumbs.js +2 -3
- package/cjs/core/ButtonGroup/ButtonGroup.js +1 -4
- package/cjs/core/Buttons/DropdownButton/DropdownButton.js +3 -5
- package/cjs/core/Carousel/Carousel.d.ts +2 -2
- package/cjs/core/Carousel/Carousel.js +3 -5
- package/cjs/core/Carousel/CarouselDotsList.js +8 -10
- package/cjs/core/Carousel/CarouselNavigation.d.ts +2 -2
- package/cjs/core/Carousel/CarouselNavigation.js +3 -5
- package/cjs/core/Carousel/CarouselSlider.js +10 -15
- package/cjs/core/ColorPicker/ColorBuilder.js +7 -10
- package/cjs/core/ColorPicker/ColorInputPanel.js +12 -15
- package/cjs/core/ColorPicker/ColorPalette.js +4 -6
- package/cjs/core/ColorPicker/ColorPicker.js +3 -3
- package/cjs/core/ComboBox/ComboBox.js +25 -32
- package/cjs/core/ComboBox/ComboBoxDropdown.js +1 -2
- package/cjs/core/ComboBox/ComboBoxEndIcon.js +1 -1
- package/cjs/core/ComboBox/ComboBoxInput.js +21 -20
- package/cjs/core/ComboBox/ComboBoxMenu.js +3 -4
- package/cjs/core/ComboBox/ComboBoxMenuItem.js +2 -2
- package/cjs/core/ComboBox/helpers.js +4 -5
- package/cjs/core/DatePicker/DatePicker.js +32 -32
- package/cjs/core/Dialog/Dialog.js +11 -4
- package/cjs/core/Dialog/DialogBackdrop.js +1 -1
- package/cjs/core/Dialog/DialogContext.d.ts +11 -0
- package/cjs/core/Dialog/DialogMain.js +16 -22
- package/cjs/core/DropdownMenu/DropdownMenu.js +6 -8
- package/cjs/core/ExpandableBlock/ExpandableBlock.js +2 -2
- package/cjs/core/FileUpload/FileEmptyCard.js +1 -1
- package/cjs/core/FileUpload/FileUpload.js +3 -6
- package/cjs/core/FileUpload/FileUploadCard.js +9 -10
- package/cjs/core/InformationPanel/InformationPanel.js +1 -4
- package/cjs/core/LabeledInput/LabeledInput.js +1 -1
- package/cjs/core/LabeledTextarea/LabeledTextarea.js +1 -1
- package/cjs/core/Menu/Menu.js +3 -4
- package/cjs/core/Menu/MenuItem.js +8 -11
- package/cjs/core/Modal/Modal.d.ts +8 -9
- package/cjs/core/Modal/Modal.js +7 -17
- package/cjs/core/SearchBox/SearchBox.js +12 -12
- package/cjs/core/Select/Select.js +12 -17
- package/cjs/core/SideNavigation/SideNavigation.js +2 -2
- package/cjs/core/Slider/Slider.js +16 -19
- package/cjs/core/Slider/Thumb.js +1 -1
- package/cjs/core/StatusMessage/StatusMessage.js +1 -1
- package/cjs/core/Stepper/Stepper.js +1 -1
- package/cjs/core/Stepper/StepperStep.js +1 -1
- package/cjs/core/Table/Table.js +15 -15
- package/cjs/core/Table/TablePaginator.js +2 -3
- package/cjs/core/Table/TableRowMemoized.js +38 -45
- package/cjs/core/Table/actionHandlers/expandHandler.js +3 -3
- package/cjs/core/Table/actionHandlers/filterHandler.js +4 -5
- package/cjs/core/Table/actionHandlers/selectHandler.js +6 -6
- package/cjs/core/Table/cells/DefaultCell.js +1 -1
- package/cjs/core/Table/cells/EditableCell.js +6 -12
- package/cjs/core/Table/columns/actionColumn.js +3 -6
- package/cjs/core/Table/columns/expanderColumn.js +3 -3
- package/cjs/core/Table/columns/selectionColumn.js +4 -4
- package/cjs/core/Table/filters/DateRangeFilter/DatePickerInput.js +2 -4
- package/cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.js +2 -3
- package/cjs/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +2 -3
- package/cjs/core/Table/filters/TextFilter/TextFilter.js +1 -2
- package/cjs/core/Table/hooks/useResizeColumns.js +16 -22
- package/cjs/core/Table/hooks/useScrollToRow.js +1 -2
- package/cjs/core/Table/hooks/useStickyColumns.js +3 -5
- package/cjs/core/Table/hooks/useSubRowFiltering.js +2 -4
- package/cjs/core/Tabs/Tabs.js +13 -16
- package/cjs/core/ThemeProvider/ThemeContext.d.ts +1 -1
- package/cjs/core/ThemeProvider/ThemeProvider.d.ts +2 -3
- package/cjs/core/ThemeProvider/ThemeProvider.js +11 -13
- package/cjs/core/Tile/Tile.js +2 -3
- package/cjs/core/TimePicker/TimePicker.js +13 -13
- package/cjs/core/Toast/Toast.js +2 -3
- package/cjs/core/Toast/Toaster.js +6 -11
- package/cjs/core/TransferList/TransferList.js +3 -4
- package/cjs/core/Tree/Tree.js +9 -13
- package/cjs/core/Tree/TreeNode.js +9 -10
- package/cjs/core/utils/color/ColorValue.js +9 -15
- package/cjs/core/utils/components/AutoclearingHiddenLiveRegion.js +2 -3
- package/cjs/core/utils/components/FocusTrap.js +4 -4
- package/cjs/core/utils/components/MiddleTextTruncation.js +1 -2
- package/cjs/core/utils/components/Popover.js +5 -8
- package/cjs/core/utils/components/Resizer.js +7 -6
- package/cjs/core/utils/components/VirtualScroll.js +14 -21
- package/cjs/core/utils/functions/dom.js +5 -5
- package/cjs/core/utils/functions/polymorphic.js +1 -1
- package/cjs/core/utils/functions/supports.js +1 -1
- package/cjs/core/utils/hooks/index.d.ts +0 -1
- package/cjs/core/utils/hooks/index.js +0 -1
- package/cjs/core/utils/hooks/useContainerWidth.js +1 -1
- package/cjs/core/utils/hooks/useDragAndDrop.js +8 -10
- package/cjs/core/utils/hooks/useEventListener.js +1 -1
- package/cjs/core/utils/hooks/useGlobals.d.ts +9 -2
- package/cjs/core/utils/hooks/useGlobals.js +6 -4
- package/cjs/core/utils/hooks/useId.js +1 -2
- package/cjs/core/utils/hooks/useIntersection.js +2 -3
- package/cjs/core/utils/hooks/useMediaQuery.js +6 -8
- package/cjs/core/utils/hooks/useOverflow.js +1 -2
- package/cjs/core/utils/hooks/useResizeObserver.js +3 -4
- package/cjs/styles.js +1 -4
- package/esm/core/Alert/Alert.d.ts +47 -28
- package/esm/core/Alert/Alert.js +74 -22
- package/esm/core/Avatar/Avatar.js +1 -1
- package/esm/core/AvatarGroup/AvatarGroup.js +1 -1
- package/esm/core/Breadcrumbs/Breadcrumbs.js +2 -3
- package/esm/core/ButtonGroup/ButtonGroup.js +1 -4
- package/esm/core/Buttons/DropdownButton/DropdownButton.js +3 -5
- package/esm/core/Carousel/Carousel.d.ts +2 -2
- package/esm/core/Carousel/Carousel.js +3 -5
- package/esm/core/Carousel/CarouselDotsList.js +8 -10
- package/esm/core/Carousel/CarouselNavigation.d.ts +2 -2
- package/esm/core/Carousel/CarouselNavigation.js +3 -5
- package/esm/core/Carousel/CarouselSlider.js +10 -15
- package/esm/core/ColorPicker/ColorBuilder.js +7 -10
- package/esm/core/ColorPicker/ColorInputPanel.js +12 -15
- package/esm/core/ColorPicker/ColorPalette.js +4 -6
- package/esm/core/ColorPicker/ColorPicker.js +3 -3
- package/esm/core/ComboBox/ComboBox.js +25 -32
- package/esm/core/ComboBox/ComboBoxDropdown.js +1 -2
- package/esm/core/ComboBox/ComboBoxEndIcon.js +1 -1
- package/esm/core/ComboBox/ComboBoxInput.js +21 -20
- package/esm/core/ComboBox/ComboBoxMenu.js +3 -4
- package/esm/core/ComboBox/ComboBoxMenuItem.js +2 -2
- package/esm/core/ComboBox/helpers.js +4 -5
- package/esm/core/DatePicker/DatePicker.js +32 -32
- package/esm/core/Dialog/Dialog.js +12 -5
- package/esm/core/Dialog/DialogBackdrop.js +1 -1
- package/esm/core/Dialog/DialogContext.d.ts +11 -0
- package/esm/core/Dialog/DialogMain.js +16 -22
- package/esm/core/DropdownMenu/DropdownMenu.js +6 -8
- package/esm/core/ExpandableBlock/ExpandableBlock.js +2 -2
- package/esm/core/FileUpload/FileEmptyCard.js +1 -1
- package/esm/core/FileUpload/FileUpload.js +3 -6
- package/esm/core/FileUpload/FileUploadCard.js +9 -10
- package/esm/core/InformationPanel/InformationPanel.js +1 -4
- package/esm/core/LabeledInput/LabeledInput.js +1 -1
- package/esm/core/LabeledTextarea/LabeledTextarea.js +1 -1
- package/esm/core/Menu/Menu.js +3 -4
- package/esm/core/Menu/MenuItem.js +8 -11
- package/esm/core/Modal/Modal.d.ts +8 -9
- package/esm/core/Modal/Modal.js +3 -10
- package/esm/core/SearchBox/SearchBox.js +12 -12
- package/esm/core/Select/Select.js +12 -17
- package/esm/core/SideNavigation/SideNavigation.js +2 -2
- package/esm/core/Slider/Slider.js +16 -19
- package/esm/core/Slider/Thumb.js +1 -1
- package/esm/core/StatusMessage/StatusMessage.js +1 -1
- package/esm/core/Stepper/Stepper.js +1 -1
- package/esm/core/Stepper/StepperStep.js +1 -1
- package/esm/core/Table/Table.js +15 -15
- package/esm/core/Table/TablePaginator.js +2 -3
- package/esm/core/Table/TableRowMemoized.js +38 -45
- package/esm/core/Table/actionHandlers/expandHandler.js +3 -3
- package/esm/core/Table/actionHandlers/filterHandler.js +4 -5
- package/esm/core/Table/actionHandlers/selectHandler.js +6 -6
- package/esm/core/Table/cells/DefaultCell.js +1 -1
- package/esm/core/Table/cells/EditableCell.js +6 -12
- package/esm/core/Table/columns/actionColumn.js +3 -6
- package/esm/core/Table/columns/expanderColumn.js +3 -3
- package/esm/core/Table/columns/selectionColumn.js +4 -4
- package/esm/core/Table/filters/DateRangeFilter/DatePickerInput.js +2 -4
- package/esm/core/Table/filters/DateRangeFilter/DateRangeFilter.js +2 -3
- package/esm/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +2 -3
- package/esm/core/Table/filters/TextFilter/TextFilter.js +1 -2
- package/esm/core/Table/hooks/useResizeColumns.js +16 -22
- package/esm/core/Table/hooks/useScrollToRow.js +1 -2
- package/esm/core/Table/hooks/useStickyColumns.js +3 -5
- package/esm/core/Table/hooks/useSubRowFiltering.js +2 -4
- package/esm/core/Tabs/Tabs.js +13 -16
- package/esm/core/ThemeProvider/ThemeContext.d.ts +1 -1
- package/esm/core/ThemeProvider/ThemeProvider.d.ts +2 -3
- package/esm/core/ThemeProvider/ThemeProvider.js +12 -14
- package/esm/core/Tile/Tile.js +2 -3
- package/esm/core/TimePicker/TimePicker.js +13 -13
- package/esm/core/Toast/Toast.js +2 -3
- package/esm/core/Toast/Toaster.js +6 -11
- package/esm/core/TransferList/TransferList.js +3 -4
- package/esm/core/Tree/Tree.js +9 -13
- package/esm/core/Tree/TreeNode.js +9 -10
- package/esm/core/utils/color/ColorValue.js +9 -15
- package/esm/core/utils/components/AutoclearingHiddenLiveRegion.js +2 -3
- package/esm/core/utils/components/FocusTrap.js +4 -4
- package/esm/core/utils/components/MiddleTextTruncation.js +1 -2
- package/esm/core/utils/components/Popover.js +5 -8
- package/esm/core/utils/components/Resizer.js +7 -6
- package/esm/core/utils/components/VirtualScroll.js +14 -21
- package/esm/core/utils/functions/dom.js +5 -5
- package/esm/core/utils/functions/polymorphic.js +1 -1
- package/esm/core/utils/functions/supports.js +1 -1
- package/esm/core/utils/hooks/index.d.ts +0 -1
- package/esm/core/utils/hooks/index.js +0 -1
- package/esm/core/utils/hooks/useContainerWidth.js +1 -1
- package/esm/core/utils/hooks/useDragAndDrop.js +8 -10
- package/esm/core/utils/hooks/useEventListener.js +1 -1
- package/esm/core/utils/hooks/useGlobals.d.ts +9 -2
- package/esm/core/utils/hooks/useGlobals.js +6 -4
- package/esm/core/utils/hooks/useId.js +1 -2
- package/esm/core/utils/hooks/useIntersection.js +2 -3
- package/esm/core/utils/hooks/useMediaQuery.js +6 -8
- package/esm/core/utils/hooks/useOverflow.js +1 -2
- package/esm/core/utils/hooks/useResizeObserver.js +3 -4
- package/esm/styles.js +1 -4
- package/package.json +2 -2
- package/styles.css +18 -20
- package/cjs/core/utils/hooks/useIsThemeAlreadySet.d.ts +0 -7
- package/cjs/core/utils/hooks/useIsThemeAlreadySet.js +0 -54
- package/esm/core/utils/hooks/useIsThemeAlreadySet.d.ts +0 -7
- package/esm/core/utils/hooks/useIsThemeAlreadySet.js +0 -27
|
@@ -79,17 +79,17 @@ const defaultCombinedRenderer = (date, precision) => {
|
|
|
79
79
|
export const TimePicker = React.forwardRef((props, forwardedRef) => {
|
|
80
80
|
const { date, onChange, use12Hours = false, precision = 'minutes', hourStep = 1, minuteStep = 1, secondStep = 1, setFocusHour = false, hourRenderer = (date) => date.getHours().toLocaleString(undefined, { minimumIntegerDigits: 2 }), minuteRenderer = (date) => date.getMinutes().toLocaleString(undefined, { minimumIntegerDigits: 2 }), secondRenderer = (date) => date.getSeconds().toLocaleString(undefined, { minimumIntegerDigits: 2 }), meridiemRenderer = (meridiem) => meridiem, useCombinedRenderer = false, combinedRenderer = defaultCombinedRenderer, className, ...rest } = props;
|
|
81
81
|
const [selectedTime, setSelectedTime] = React.useState(date);
|
|
82
|
-
const [focusedTime, setFocusedTime] = React.useState(selectedTime
|
|
83
|
-
const [meridiem, setMeridiem] = React.useState(use12Hours ? (
|
|
82
|
+
const [focusedTime, setFocusedTime] = React.useState(selectedTime ?? new Date());
|
|
83
|
+
const [meridiem, setMeridiem] = React.useState(use12Hours ? (focusedTime?.getHours() > 11 ? 'PM' : 'AM') : undefined);
|
|
84
84
|
React.useEffect(() => {
|
|
85
|
-
setFocusedTime(date
|
|
85
|
+
setFocusedTime(date ?? new Date());
|
|
86
86
|
setSelectedTime(date);
|
|
87
87
|
}, [date]);
|
|
88
88
|
const onHourClick = (date) => {
|
|
89
89
|
const adjustedHour = use12Hours
|
|
90
90
|
? formatHourFrom12(date.getHours(), meridiem)
|
|
91
91
|
: date.getHours();
|
|
92
|
-
const adjustedSelectedTime = setHours(adjustedHour, selectedTime
|
|
92
|
+
const adjustedSelectedTime = setHours(adjustedHour, selectedTime ?? new Date());
|
|
93
93
|
updateCurrentTime(adjustedSelectedTime);
|
|
94
94
|
};
|
|
95
95
|
const onTimeClick = (date) => {
|
|
@@ -100,7 +100,7 @@ export const TimePicker = React.forwardRef((props, forwardedRef) => {
|
|
|
100
100
|
updateCurrentTime(adjustedSelectedTime);
|
|
101
101
|
};
|
|
102
102
|
const onMeridiemClick = (value) => {
|
|
103
|
-
let adjustedSelectedTime = selectedTime
|
|
103
|
+
let adjustedSelectedTime = selectedTime ?? new Date();
|
|
104
104
|
const currentHours = adjustedSelectedTime.getHours();
|
|
105
105
|
setMeridiem(value);
|
|
106
106
|
if (value === 'AM' && currentHours > 11) {
|
|
@@ -122,7 +122,7 @@ export const TimePicker = React.forwardRef((props, forwardedRef) => {
|
|
|
122
122
|
}
|
|
123
123
|
setFocusedTime(adjustedTime);
|
|
124
124
|
setSelectedTime(adjustedTime);
|
|
125
|
-
onChange
|
|
125
|
+
onChange?.(adjustedTime);
|
|
126
126
|
};
|
|
127
127
|
const onHourFocus = (date) => {
|
|
128
128
|
const adjustedHour = use12Hours
|
|
@@ -137,7 +137,7 @@ export const TimePicker = React.forwardRef((props, forwardedRef) => {
|
|
|
137
137
|
setFocusedTime(setHours(adjustedHour, date));
|
|
138
138
|
};
|
|
139
139
|
const onMeridiemFocus = (value) => {
|
|
140
|
-
let adjustedSelectedTime = selectedTime
|
|
140
|
+
let adjustedSelectedTime = selectedTime ?? new Date();
|
|
141
141
|
const currentHours = adjustedSelectedTime.getHours();
|
|
142
142
|
if (value === 'AM' && currentHours > 11) {
|
|
143
143
|
setMeridiem(value);
|
|
@@ -159,7 +159,7 @@ export const TimePicker = React.forwardRef((props, forwardedRef) => {
|
|
|
159
159
|
return data;
|
|
160
160
|
};
|
|
161
161
|
const time = React.useMemo(() => {
|
|
162
|
-
const time = selectedTime
|
|
162
|
+
const time = selectedTime ?? new Date();
|
|
163
163
|
const data = [];
|
|
164
164
|
const hoursArray = Array.from(Array(use12Hours ? 12 : 24).keys())
|
|
165
165
|
.filter((i) => i % hourStep === 0)
|
|
@@ -186,15 +186,15 @@ export const TimePicker = React.forwardRef((props, forwardedRef) => {
|
|
|
186
186
|
return data;
|
|
187
187
|
}, [hourStep, minuteStep, secondStep, selectedTime, use12Hours, precision]);
|
|
188
188
|
const hours = React.useMemo(() => {
|
|
189
|
-
const time = selectedTime
|
|
189
|
+
const time = selectedTime ?? new Date();
|
|
190
190
|
return generateDataList(use12Hours ? 12 : 24, (i) => new Date(time.getFullYear(), time.getMonth(), time.getDate(), use12Hours && i === 0 ? 12 : i, time.getMinutes(), time.getSeconds()), hourStep);
|
|
191
191
|
}, [hourStep, selectedTime, use12Hours]);
|
|
192
192
|
const minutes = React.useMemo(() => {
|
|
193
|
-
const time = selectedTime
|
|
193
|
+
const time = selectedTime ?? new Date();
|
|
194
194
|
return generateDataList(60, (i) => new Date(time.getFullYear(), time.getMonth(), time.getDate(), time.getHours(), i, time.getSeconds()), minuteStep);
|
|
195
195
|
}, [minuteStep, selectedTime]);
|
|
196
196
|
const seconds = React.useMemo(() => {
|
|
197
|
-
const time = selectedTime
|
|
197
|
+
const time = selectedTime ?? new Date();
|
|
198
198
|
return generateDataList(60, (i) => new Date(time.getFullYear(), time.getMonth(), time.getDate(), time.getHours(), time.getMinutes(), i), secondStep);
|
|
199
199
|
}, [secondStep, selectedTime]);
|
|
200
200
|
return (React.createElement(Box, { className: cx('iui-time-picker', className), ref: forwardedRef, ...rest },
|
|
@@ -215,7 +215,7 @@ const TimePickerColumn = (props) => {
|
|
|
215
215
|
}
|
|
216
216
|
});
|
|
217
217
|
const scrollIntoView = (ref, isSame) => {
|
|
218
|
-
isSame &&
|
|
218
|
+
isSame && ref?.scrollIntoView({ block: 'nearest', inline: 'nearest' });
|
|
219
219
|
};
|
|
220
220
|
const handleTimeKeyDown = (event, maxValue, onFocus, onSelect, currentValue) => {
|
|
221
221
|
if (event.altKey) {
|
|
@@ -255,7 +255,7 @@ const TimePickerColumn = (props) => {
|
|
|
255
255
|
'iui-selected': isSameSelected(value),
|
|
256
256
|
}), key: index, tabIndex: isSameFocus ? 0 : undefined, ref: (ref) => {
|
|
257
257
|
scrollIntoView(ref, isSameFocus);
|
|
258
|
-
needFocus.current && isSameFocus &&
|
|
258
|
+
needFocus.current && isSameFocus && ref?.focus();
|
|
259
259
|
}, onClick: () => {
|
|
260
260
|
onSelectChange(value);
|
|
261
261
|
} }, valueRenderer(value, precision)));
|
package/esm/core/Toast/Toast.js
CHANGED
|
@@ -7,7 +7,7 @@ import { Transition } from 'react-transition-group';
|
|
|
7
7
|
import cx from 'classnames';
|
|
8
8
|
import { getWindow, StatusIconMap, SvgCloseSmall, Box, } from '../utils/index.js';
|
|
9
9
|
import { IconButton } from '../Buttons/index.js';
|
|
10
|
-
const isMotionOk = () =>
|
|
10
|
+
const isMotionOk = () => getWindow()?.matchMedia?.('(prefers-reduced-motion: no-preference)')?.matches;
|
|
11
11
|
/**
|
|
12
12
|
* Generic Toast Component
|
|
13
13
|
* @example
|
|
@@ -64,8 +64,7 @@ export const Toast = (props) => {
|
|
|
64
64
|
}, timeout);
|
|
65
65
|
};
|
|
66
66
|
const clearCloseTimeout = () => {
|
|
67
|
-
|
|
68
|
-
(_a = getWindow()) === null || _a === void 0 ? void 0 : _a.clearTimeout(closeTimeout.current);
|
|
67
|
+
getWindow()?.clearTimeout(closeTimeout.current);
|
|
69
68
|
};
|
|
70
69
|
const onRef = (ref) => {
|
|
71
70
|
if (ref) {
|
|
@@ -20,11 +20,10 @@ export default class Toaster {
|
|
|
20
20
|
// Create container on demand.
|
|
21
21
|
// Cannot do it in constructor, because SSG/SSR apps would fail.
|
|
22
22
|
this.asyncInit = async () => {
|
|
23
|
-
var _a, _b;
|
|
24
23
|
if (this.isInitialized) {
|
|
25
24
|
return;
|
|
26
25
|
}
|
|
27
|
-
const container =
|
|
26
|
+
const container = getContainer(TOASTS_CONTAINER_ID) ?? getDocument()?.body;
|
|
28
27
|
if (!container) {
|
|
29
28
|
return;
|
|
30
29
|
}
|
|
@@ -56,15 +55,13 @@ export default class Toaster {
|
|
|
56
55
|
* Settings will be applied to new toasts on the page.
|
|
57
56
|
*/
|
|
58
57
|
setSettings(newSettings) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
(_b = newSettings.order) !== null && _b !== void 0 ? _b : (newSettings.order = ((_c = newSettings.placement) === null || _c === void 0 ? void 0 : _c.startsWith('bottom'))
|
|
58
|
+
newSettings.placement ?? (newSettings.placement = this.settings.placement);
|
|
59
|
+
newSettings.order ?? (newSettings.order = newSettings.placement?.startsWith('bottom')
|
|
62
60
|
? 'ascending'
|
|
63
61
|
: 'descending');
|
|
64
62
|
this.settings = newSettings;
|
|
65
63
|
this.asyncInit().then(() => {
|
|
66
|
-
|
|
67
|
-
(_a = this.toastsRef.current) === null || _a === void 0 ? void 0 : _a.setPlacement((_b = this.settings.placement) !== null && _b !== void 0 ? _b : 'top');
|
|
64
|
+
this.toastsRef.current?.setPlacement(this.settings.placement ?? 'top');
|
|
68
65
|
});
|
|
69
66
|
}
|
|
70
67
|
positive(content, options) {
|
|
@@ -89,9 +86,8 @@ export default class Toaster {
|
|
|
89
86
|
content,
|
|
90
87
|
category,
|
|
91
88
|
onRemove: () => {
|
|
92
|
-
var _a;
|
|
93
89
|
this.removeToast(currentId);
|
|
94
|
-
|
|
90
|
+
options?.onRemove?.();
|
|
95
91
|
},
|
|
96
92
|
id: currentId,
|
|
97
93
|
isVisible: true,
|
|
@@ -107,8 +103,7 @@ export default class Toaster {
|
|
|
107
103
|
}
|
|
108
104
|
updateView() {
|
|
109
105
|
this.asyncInit().then(() => {
|
|
110
|
-
|
|
111
|
-
(_a = this.toastsRef.current) === null || _a === void 0 ? void 0 : _a.setToasts(this.toasts);
|
|
106
|
+
this.toastsRef.current?.setToasts(this.toasts);
|
|
112
107
|
});
|
|
113
108
|
}
|
|
114
109
|
closeToast(toastId) {
|
|
@@ -30,10 +30,9 @@ const TransferListListbox = React.forwardRef((props, ref) => {
|
|
|
30
30
|
return focusableItems.filter((i) => !focusableItems.some((p) => p.contains(i.parentElement)));
|
|
31
31
|
}, []);
|
|
32
32
|
React.useEffect(() => {
|
|
33
|
-
var _a;
|
|
34
33
|
const items = getFocusableNodes();
|
|
35
34
|
if (focusedIndex != null) {
|
|
36
|
-
|
|
35
|
+
items?.[focusedIndex]?.focus();
|
|
37
36
|
return;
|
|
38
37
|
}
|
|
39
38
|
}, [focusedIndex, getFocusableNodes]);
|
|
@@ -42,10 +41,10 @@ const TransferListListbox = React.forwardRef((props, ref) => {
|
|
|
42
41
|
return;
|
|
43
42
|
}
|
|
44
43
|
const items = getFocusableNodes();
|
|
45
|
-
if (!
|
|
44
|
+
if (!items?.length) {
|
|
46
45
|
return;
|
|
47
46
|
}
|
|
48
|
-
const currentIndex = focusedIndex
|
|
47
|
+
const currentIndex = focusedIndex ?? 0;
|
|
49
48
|
switch (event.key) {
|
|
50
49
|
case 'ArrowDown': {
|
|
51
50
|
setFocusedIndex(Math.min(currentIndex + 1, items.length - 1));
|
package/esm/core/Tree/Tree.js
CHANGED
|
@@ -73,10 +73,10 @@ export const Tree = (props) => {
|
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
75
|
const items = getFocusableNodes();
|
|
76
|
-
if (!
|
|
76
|
+
if (!items?.length) {
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
|
-
const activeIndex = items.findIndex((el) =>
|
|
79
|
+
const activeIndex = items.findIndex((el) => el.contains(treeRef.current?.ownerDocument.activeElement));
|
|
80
80
|
const currentIndex = activeIndex > -1 ? activeIndex : 0;
|
|
81
81
|
switch (event.key) {
|
|
82
82
|
case 'ArrowUp': {
|
|
@@ -126,20 +126,18 @@ export const Tree = (props) => {
|
|
|
126
126
|
return [flatList, firstLevelNodes];
|
|
127
127
|
}, [data, getNode]);
|
|
128
128
|
const itemRenderer = React.useCallback((index) => {
|
|
129
|
-
var _a, _b, _c, _d;
|
|
130
129
|
const node = flatNodesList[index];
|
|
131
130
|
return (React.createElement(TreeContext.Provider, { key: node.nodeProps.nodeId, value: {
|
|
132
131
|
nodeDepth: node.depth,
|
|
133
132
|
subNodeIds: node.subNodeIds,
|
|
134
133
|
groupSize: node.depth === 0
|
|
135
134
|
? firstLevelNodesList.length
|
|
136
|
-
:
|
|
135
|
+
: node.parentNode?.subNodeIds?.length ?? 0,
|
|
137
136
|
indexInGroup: node.indexInGroup,
|
|
138
|
-
parentNodeId:
|
|
137
|
+
parentNodeId: node.parentNode?.nodeProps.nodeId,
|
|
139
138
|
scrollToParent: node.parentNode
|
|
140
139
|
? () => {
|
|
141
|
-
|
|
142
|
-
const parentNodeId = (_a = node.parentNode) === null || _a === void 0 ? void 0 : _a.nodeProps.nodeId;
|
|
140
|
+
const parentNodeId = node.parentNode?.nodeProps.nodeId;
|
|
143
141
|
const parentNodeIndex = flatNodesList.findIndex((n) => n.nodeProps.nodeId === parentNodeId);
|
|
144
142
|
setScrollToIndex(parentNodeIndex);
|
|
145
143
|
}
|
|
@@ -153,11 +151,10 @@ export const Tree = (props) => {
|
|
|
153
151
|
}, [flatNodesList]);
|
|
154
152
|
React.useEffect(() => {
|
|
155
153
|
setTimeout(() => {
|
|
156
|
-
var _a;
|
|
157
154
|
if (scrollToIndex !== undefined) {
|
|
158
155
|
const nodeId = flatNodesListRef.current[scrollToIndex].nodeProps.nodeId;
|
|
159
|
-
const nodeElement =
|
|
160
|
-
nodeElement
|
|
156
|
+
const nodeElement = treeRef.current?.ownerDocument.querySelector(`#${nodeId}`);
|
|
157
|
+
nodeElement?.focus();
|
|
161
158
|
// Need to reset that if navigating with mouse and keyboard,
|
|
162
159
|
// e.g. pressing arrow left to go to parent node and then with mouse
|
|
163
160
|
// clicking some other child node and then pressing arrow left
|
|
@@ -166,13 +163,12 @@ export const Tree = (props) => {
|
|
|
166
163
|
});
|
|
167
164
|
}, [scrollToIndex]);
|
|
168
165
|
const handleFocus = (event) => {
|
|
169
|
-
|
|
170
|
-
if ((_a = treeRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.relatedTarget)) {
|
|
166
|
+
if (treeRef.current?.contains(event.relatedTarget)) {
|
|
171
167
|
return;
|
|
172
168
|
}
|
|
173
169
|
const items = getFocusableNodes();
|
|
174
170
|
if (items.length > 0) {
|
|
175
|
-
|
|
171
|
+
items[focusedIndex.current]?.focus();
|
|
176
172
|
}
|
|
177
173
|
};
|
|
178
174
|
return (React.createElement(React.Fragment, null, enableVirtualization ? (React.createElement(VirtualizedTree, { flatNodesList: flatNodesList, itemRenderer: itemRenderer, scrollToIndex: scrollToIndex, onFocus: handleFocus, onKeyDown: handleKeyDown, ref: treeRef, className: className, style: style, ...rest })) : (React.createElement(TreeElement, { onKeyDown: handleKeyDown, onFocus: handleFocus, className: className, style: style, ref: treeRef, ...rest }, flatNodesList.map((_, i) => itemRenderer(i))))));
|
|
@@ -32,11 +32,10 @@ export const TreeNode = (props) => {
|
|
|
32
32
|
const [isFocused, setIsFocused] = React.useState(false);
|
|
33
33
|
const nodeRef = React.useRef(null);
|
|
34
34
|
const onKeyDown = (event) => {
|
|
35
|
-
var _a, _b, _c, _d, _e, _f;
|
|
36
35
|
if (event.altKey) {
|
|
37
36
|
return;
|
|
38
37
|
}
|
|
39
|
-
const isNodeFocused = nodeRef.current ===
|
|
38
|
+
const isNodeFocused = nodeRef.current === nodeRef.current?.ownerDocument.activeElement;
|
|
40
39
|
switch (event.key) {
|
|
41
40
|
case 'ArrowLeft': {
|
|
42
41
|
event.preventDefault();
|
|
@@ -46,19 +45,19 @@ export const TreeNode = (props) => {
|
|
|
46
45
|
break;
|
|
47
46
|
}
|
|
48
47
|
if (parentNodeId) {
|
|
49
|
-
scrollToParent
|
|
48
|
+
scrollToParent?.();
|
|
50
49
|
break;
|
|
51
50
|
}
|
|
52
51
|
// If it is top level node (doesn't have parent node), then do nothing.
|
|
53
52
|
break;
|
|
54
53
|
}
|
|
55
54
|
const focusableElements = getFocusableElements(nodeRef.current);
|
|
56
|
-
const currentIndex = focusableElements.indexOf(
|
|
55
|
+
const currentIndex = focusableElements.indexOf(nodeRef.current?.ownerDocument.activeElement);
|
|
57
56
|
if (currentIndex === 0) {
|
|
58
|
-
|
|
57
|
+
nodeRef.current?.focus();
|
|
59
58
|
}
|
|
60
59
|
else {
|
|
61
|
-
|
|
60
|
+
focusableElements[currentIndex - 1]?.focus();
|
|
62
61
|
}
|
|
63
62
|
break;
|
|
64
63
|
}
|
|
@@ -70,10 +69,10 @@ export const TreeNode = (props) => {
|
|
|
70
69
|
onExpanded(nodeId, true);
|
|
71
70
|
break;
|
|
72
71
|
}
|
|
73
|
-
|
|
72
|
+
focusableElements[0]?.focus();
|
|
74
73
|
break;
|
|
75
74
|
}
|
|
76
|
-
const currentIndex = focusableElements.indexOf(
|
|
75
|
+
const currentIndex = focusableElements.indexOf(nodeRef.current?.ownerDocument.activeElement);
|
|
77
76
|
if (currentIndex < focusableElements.length - 1) {
|
|
78
77
|
focusableElements[currentIndex + 1].focus();
|
|
79
78
|
break;
|
|
@@ -89,7 +88,7 @@ export const TreeNode = (props) => {
|
|
|
89
88
|
}
|
|
90
89
|
event.preventDefault();
|
|
91
90
|
if (!isDisabled) {
|
|
92
|
-
onSelected
|
|
91
|
+
onSelected?.(nodeId, !isSelected);
|
|
93
92
|
}
|
|
94
93
|
break;
|
|
95
94
|
}
|
|
@@ -111,7 +110,7 @@ export const TreeNode = (props) => {
|
|
|
111
110
|
React.createElement(Box, { className: cx('iui-tree-node', {
|
|
112
111
|
'iui-active': isSelected,
|
|
113
112
|
'iui-disabled': isDisabled,
|
|
114
|
-
}), style: { '--level': nodeDepth }, onClick: () => !isDisabled &&
|
|
113
|
+
}), style: { '--level': nodeDepth }, onClick: () => !isDisabled && onSelected?.(nodeId, !isSelected) },
|
|
115
114
|
checkbox && (React.createElement(Box, { className: 'iui-tree-node-checkbox' }, React.isValidElement(checkbox)
|
|
116
115
|
? React.cloneElement(checkbox, {
|
|
117
116
|
tabIndex: isFocused ? 0 : -1,
|
|
@@ -110,27 +110,24 @@ export class ColorValue {
|
|
|
110
110
|
* This allows component builders to know if they received bad input from user.
|
|
111
111
|
*/
|
|
112
112
|
static fromString(val, defaultColorIfNotParsed) {
|
|
113
|
-
const [tbgr, hue] = this.computeTbgrFromString(val, defaultColorIfNotParsed
|
|
113
|
+
const [tbgr, hue] = this.computeTbgrFromString(val, defaultColorIfNotParsed?.toTbgr());
|
|
114
114
|
return new ColorValue(tbgr, hue);
|
|
115
115
|
}
|
|
116
116
|
/** Create a ColorValue from hue, saturation, lightness values. */
|
|
117
117
|
static fromHSL(hsl) {
|
|
118
|
-
|
|
119
|
-
const alpha = (_a = hsl.a) !== null && _a !== void 0 ? _a : 1;
|
|
118
|
+
const alpha = hsl.a ?? 1;
|
|
120
119
|
return new ColorValue(this.computeTbgrFromHSL(hsl.h / 360, hsl.s / 100, hsl.l / 100, Math.round((1 - alpha) * 255)), hsl.h);
|
|
121
120
|
}
|
|
122
121
|
/** Create a ColorValue from an RgbColor */
|
|
123
122
|
static fromRGB(rgb) {
|
|
124
|
-
|
|
125
|
-
const alpha = (_a = rgb.a) !== null && _a !== void 0 ? _a : 1;
|
|
123
|
+
const alpha = rgb.a ?? 1;
|
|
126
124
|
return ColorValue.fromRgbt(rgb.r, rgb.g, rgb.b, Math.round((1 - alpha) * 255));
|
|
127
125
|
}
|
|
128
126
|
/**
|
|
129
127
|
* Create a ColorValue from an HsvColor
|
|
130
128
|
*/
|
|
131
129
|
static fromHSV(hsv) {
|
|
132
|
-
|
|
133
|
-
const alpha = (_a = hsv.a) !== null && _a !== void 0 ? _a : 1;
|
|
130
|
+
const alpha = hsv.a ?? 1;
|
|
134
131
|
const transparency = Math.round((1 - alpha) * 255);
|
|
135
132
|
// Check for simple case first.
|
|
136
133
|
if (!hsv.s || hsv.h === -1) {
|
|
@@ -481,33 +478,30 @@ export class ColorValue {
|
|
|
481
478
|
}
|
|
482
479
|
/** Convert the 0xTTBBGGRR color to a string of the form "rgba(r,g,b,a)" where the color components are specified in decimal and the alpha component is a fraction. */
|
|
483
480
|
toRgbString(includeAlpha) {
|
|
484
|
-
var _a;
|
|
485
481
|
const rgb = this.toRgbColor();
|
|
486
482
|
const rgbString = `${rgb.r}, ${rgb.g}, ${rgb.b}`;
|
|
487
483
|
if (includeAlpha) {
|
|
488
|
-
const alpha =
|
|
484
|
+
const alpha = rgb.a ?? 1;
|
|
489
485
|
return `rgba(${rgbString}, ${ColorValue.getFormattedColorNumber(alpha, 2)})`;
|
|
490
486
|
}
|
|
491
487
|
return `rgb(${rgbString})`;
|
|
492
488
|
}
|
|
493
489
|
/** Convert this ColorValue to a string in the form "hsl(h,s,l) or hsla(h,s,l,a)" - i.e hsl(120,50%,50%). */
|
|
494
490
|
toHslString(includeAlpha) {
|
|
495
|
-
var _a, _b;
|
|
496
491
|
const hsl = this.toHslColor();
|
|
497
|
-
const hslString = `${ColorValue.getFormattedColorNumber(
|
|
492
|
+
const hslString = `${ColorValue.getFormattedColorNumber(this._hue ?? hsl.h)}, ${ColorValue.getFormattedColorNumber(hsl.s)}%, ${ColorValue.getFormattedColorNumber(hsl.l)}%`;
|
|
498
493
|
if (includeAlpha) {
|
|
499
|
-
const alpha =
|
|
494
|
+
const alpha = hsl.a ?? 1;
|
|
500
495
|
return `hsla(${hslString}, ${ColorValue.getFormattedColorNumber(alpha, 2)})`;
|
|
501
496
|
}
|
|
502
497
|
return `hsl(${hslString})`;
|
|
503
498
|
}
|
|
504
499
|
/** Convert this ColorValue to a string in the form "hsv(h,s,v) or hsva(h,s,v,a)" - i.e hsv(120,50%,50%). */
|
|
505
500
|
toHsvString(includeAlpha) {
|
|
506
|
-
var _a, _b;
|
|
507
501
|
const hsv = this.toHsvColor();
|
|
508
|
-
const hsvString = `${
|
|
502
|
+
const hsvString = `${this._hue ?? hsv.h}, ${hsv.s}%, ${hsv.v}%`;
|
|
509
503
|
if (includeAlpha) {
|
|
510
|
-
const alpha =
|
|
504
|
+
const alpha = hsv.a ?? 1;
|
|
511
505
|
return `hsva(${hsvString}, ${ColorValue.getFormattedColorNumber(alpha, 2)})`;
|
|
512
506
|
}
|
|
513
507
|
return `hsv(${hsvString})`;
|
|
@@ -16,10 +16,9 @@ import { getWindow } from '../functions/index.js';
|
|
|
16
16
|
export const AutoclearingHiddenLiveRegion = ({ text = '' }) => {
|
|
17
17
|
const [maybeText, setMaybeText] = React.useState(text);
|
|
18
18
|
React.useEffect(() => {
|
|
19
|
-
var _a;
|
|
20
19
|
setMaybeText(text);
|
|
21
|
-
const timeout =
|
|
22
|
-
return () =>
|
|
20
|
+
const timeout = getWindow()?.setTimeout(() => setMaybeText(''), 5000);
|
|
21
|
+
return () => void getWindow()?.clearTimeout(timeout);
|
|
23
22
|
}, [text]);
|
|
24
23
|
return (React.createElement(VisuallyHidden, { as: 'div', "aria-live": 'polite', "aria-atomic": 'true' }, maybeText));
|
|
25
24
|
};
|
|
@@ -21,19 +21,19 @@ export const FocusTrap = (props) => {
|
|
|
21
21
|
const onFirstFocus = (event) => {
|
|
22
22
|
const [firstElement, lastElement] = getFirstLastFocusables();
|
|
23
23
|
if (event.relatedTarget === firstElement) {
|
|
24
|
-
lastElement
|
|
24
|
+
lastElement?.focus();
|
|
25
25
|
}
|
|
26
26
|
else {
|
|
27
|
-
firstElement
|
|
27
|
+
firstElement?.focus();
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
30
|
const onLastFocus = (event) => {
|
|
31
31
|
const [firstElement, lastElement] = getFirstLastFocusables();
|
|
32
32
|
if (event.relatedTarget === lastElement) {
|
|
33
|
-
firstElement
|
|
33
|
+
firstElement?.focus();
|
|
34
34
|
}
|
|
35
35
|
else {
|
|
36
|
-
lastElement
|
|
36
|
+
lastElement?.focus();
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
39
|
return (React.createElement(React.Fragment, null,
|
|
@@ -22,7 +22,6 @@ const ELLIPSIS_CHAR = '…';
|
|
|
22
22
|
* />
|
|
23
23
|
*/
|
|
24
24
|
export const MiddleTextTruncation = (props) => {
|
|
25
|
-
var _a;
|
|
26
25
|
const { text, endCharsCount = 6, textRenderer, style, ...rest } = props;
|
|
27
26
|
const [ref, visibleCount] = useOverflow(text);
|
|
28
27
|
const truncatedText = React.useMemo(() => {
|
|
@@ -39,6 +38,6 @@ export const MiddleTextTruncation = (props) => {
|
|
|
39
38
|
flexGrow: 1,
|
|
40
39
|
whiteSpace: 'nowrap',
|
|
41
40
|
...style,
|
|
42
|
-
}, ref: ref, ...rest },
|
|
41
|
+
}, ref: ref, ...rest }, textRenderer?.(truncatedText, text) ?? truncatedText));
|
|
43
42
|
};
|
|
44
43
|
export default MiddleTextTruncation;
|
|
@@ -13,7 +13,6 @@ import { ThemeContext } from '../../ThemeProvider/ThemeContext.js';
|
|
|
13
13
|
* @private
|
|
14
14
|
*/
|
|
15
15
|
export const Popover = React.forwardRef((props, ref) => {
|
|
16
|
-
var _a;
|
|
17
16
|
const [mounted, setMounted] = React.useState(false);
|
|
18
17
|
const themeInfo = React.useContext(ThemeContext);
|
|
19
18
|
const isDomAvailable = useIsClient();
|
|
@@ -30,15 +29,14 @@ export const Popover = React.forwardRef((props, ref) => {
|
|
|
30
29
|
const removeTabIndex = {
|
|
31
30
|
fn: () => ({
|
|
32
31
|
onCreate: (instance) => {
|
|
33
|
-
|
|
34
|
-
(_a = instance.popper.firstElementChild) === null || _a === void 0 ? void 0 : _a.removeAttribute('tabindex');
|
|
32
|
+
instance.popper.firstElementChild?.removeAttribute('tabindex');
|
|
35
33
|
},
|
|
36
34
|
}),
|
|
37
35
|
};
|
|
38
36
|
const computedProps = {
|
|
39
37
|
allowHTML: true,
|
|
40
38
|
animation: false,
|
|
41
|
-
appendTo: (el) =>
|
|
39
|
+
appendTo: (el) => themeInfo?.portalContainerRef?.current || el.ownerDocument.body,
|
|
42
40
|
arrow: false,
|
|
43
41
|
duration: 0,
|
|
44
42
|
interactive: true,
|
|
@@ -63,7 +61,7 @@ export const Popover = React.forwardRef((props, ref) => {
|
|
|
63
61
|
modifiers: [
|
|
64
62
|
{ name: 'flip' },
|
|
65
63
|
{ name: 'preventOverflow', options: { padding: 0 } },
|
|
66
|
-
...(
|
|
64
|
+
...(props.popperOptions?.modifiers || []),
|
|
67
65
|
],
|
|
68
66
|
},
|
|
69
67
|
};
|
|
@@ -78,9 +76,8 @@ export const Popover = React.forwardRef((props, ref) => {
|
|
|
78
76
|
const clonedContent = React.isValidElement(props.content)
|
|
79
77
|
? React.cloneElement(props.content, {
|
|
80
78
|
onClick: (e) => {
|
|
81
|
-
var _a, _b;
|
|
82
79
|
e.stopPropagation();
|
|
83
|
-
|
|
80
|
+
props.content.props.onClick?.(e);
|
|
84
81
|
},
|
|
85
82
|
})
|
|
86
83
|
: props.content;
|
|
@@ -97,7 +94,7 @@ export const hideOnEscOrTab = {
|
|
|
97
94
|
/** @returns true if none of the children are tabbable */
|
|
98
95
|
const shouldHideOnTab = () => {
|
|
99
96
|
const descendents = Array.from(instance.popper.querySelectorAll('*'));
|
|
100
|
-
return !descendents.some((el) =>
|
|
97
|
+
return !descendents.some((el) => el?.tabIndex >= 0);
|
|
101
98
|
};
|
|
102
99
|
const onKeyDown = (event) => {
|
|
103
100
|
if (event.altKey) {
|
|
@@ -38,17 +38,18 @@ export const Resizer = (props) => {
|
|
|
38
38
|
const originalUserSelect = ownerDocument.body.style.userSelect;
|
|
39
39
|
ownerDocument.body.style.userSelect = 'none';
|
|
40
40
|
const onResizePointerMove = (event) => {
|
|
41
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
42
41
|
if (!elementRef.current) {
|
|
43
42
|
return;
|
|
44
43
|
}
|
|
45
44
|
if (!isResizing.current) {
|
|
46
45
|
isResizing.current = true;
|
|
47
|
-
onResizeStart
|
|
46
|
+
onResizeStart?.();
|
|
48
47
|
}
|
|
49
|
-
const containerRect =
|
|
50
|
-
const clientX = getBoundedValue(event.clientX,
|
|
51
|
-
const clientY = getBoundedValue(event.clientY,
|
|
48
|
+
const containerRect = containerRef?.current?.getBoundingClientRect();
|
|
49
|
+
const clientX = getBoundedValue(event.clientX, containerRect?.left ?? 0, containerRect?.right ?? ownerDocument.documentElement.clientWidth ?? 0);
|
|
50
|
+
const clientY = getBoundedValue(event.clientY, containerRect?.top ?? 0, containerRect?.bottom ??
|
|
51
|
+
ownerDocument.documentElement.clientHeight ??
|
|
52
|
+
0);
|
|
52
53
|
const diffX = initialPointerX - clientX;
|
|
53
54
|
const diffY = initialPointerY - clientY;
|
|
54
55
|
switch (resizer) {
|
|
@@ -129,7 +130,7 @@ export const Resizer = (props) => {
|
|
|
129
130
|
if (elementRef.current) {
|
|
130
131
|
ownerDocument.body.style.userSelect = originalUserSelect;
|
|
131
132
|
isResizing.current = false;
|
|
132
|
-
onResizeEnd
|
|
133
|
+
onResizeEnd?.({
|
|
133
134
|
width,
|
|
134
135
|
height,
|
|
135
136
|
transform: `translate(${translateX}px, ${translateY}px)`,
|