@salutejs/plasma-new-hope 0.335.0-canary.2194.17367251959.0 → 0.335.0-canary.2196.17400757003.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/components/Autocomplete/Autocomplete.js +4 -1
- package/cjs/components/Autocomplete/Autocomplete.js.map +1 -1
- package/cjs/components/Autocomplete/FloatingPopover.js +5 -4
- package/cjs/components/Autocomplete/FloatingPopover.js.map +1 -1
- package/cjs/components/Calendar/Calendar.tokens.js +1 -0
- package/cjs/components/Calendar/Calendar.tokens.js.map +1 -1
- package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.js +3 -3
- package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/Combobox.js +15 -30
- package/cjs/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/utils/getTextValue.js +24 -0
- package/cjs/components/Combobox/ComboboxNew/utils/getTextValue.js.map +1 -0
- package/cjs/components/DatePicker/DatePicker.tokens.js +1 -0
- package/cjs/components/DatePicker/DatePicker.tokens.js.map +1 -1
- package/cjs/components/DatePicker/DatePickerBase.styles.js +1 -1
- package/cjs/components/DatePicker/DatePickerBase.styles.js.map +1 -1
- package/cjs/components/DatePicker/{DatePickerBase.styles_10sa0ht.css → DatePickerBase.styles_1fnt3hc.css} +1 -1
- package/cjs/components/DatePicker/RangeDate/RangeDate.css +4 -4
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.css +2 -2
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles.js +1 -1
- package/{es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles_1n0dbxm.css → cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles_160e4y4.css} +2 -2
- package/cjs/components/DatePicker/SingleDate/SingleDate.css +2 -2
- package/cjs/components/Popup/Popup.js +8 -67
- package/cjs/components/Popup/Popup.js.map +1 -1
- package/cjs/components/Popup/ui/Draggable/Draggable.js +33 -0
- package/cjs/components/Popup/ui/Draggable/Draggable.js.map +1 -0
- package/cjs/components/Popup/ui/Resizable/Resizable.js +79 -0
- package/cjs/components/Popup/ui/Resizable/Resizable.js.map +1 -0
- package/cjs/components/Slider/ui/Handler/Handler.js +3 -3
- package/cjs/components/Slider/ui/Handler/Handler.js.map +1 -1
- package/cjs/components/Tooltip/Tooltip.js +22 -45
- package/cjs/components/Tooltip/Tooltip.js.map +1 -1
- package/cjs/components/Tooltip/hooks/useDelayedTooltip.js +49 -0
- package/cjs/components/Tooltip/hooks/useDelayedTooltip.js.map +1 -0
- package/cjs/components/Tree/Tree.css +6 -6
- package/cjs/components/Tree/Tree.js +9 -2
- package/cjs/components/Tree/Tree.js.map +1 -1
- package/cjs/components/Tree/Tree.styles.js +1 -1
- package/cjs/components/Tree/Tree.styles.js.map +1 -1
- package/cjs/components/Tree/Tree.styles_6sla5y.css +7 -0
- package/cjs/components/Tree/Tree.tokens.js +2 -1
- package/cjs/components/Tree/Tree.tokens.js.map +1 -1
- package/cjs/index.css +10 -10
- package/emotion/cjs/components/Autocomplete/Autocomplete.js +3 -1
- package/emotion/cjs/components/Autocomplete/FloatingPopover.js +31 -4
- package/emotion/cjs/components/Calendar/Calendar.tokens.js +1 -0
- package/emotion/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.js +3 -3
- package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.js +26 -44
- package/emotion/cjs/components/Combobox/ComboboxNew/utils/getTextValue.js +25 -0
- package/emotion/cjs/components/Combobox/ComboboxNew/utils/index.js +4 -0
- package/emotion/cjs/components/DatePicker/DatePicker.tokens.js +1 -0
- package/emotion/cjs/components/DatePicker/DatePickerBase.styles.js +5 -5
- package/emotion/cjs/components/Popup/Popup.js +7 -69
- package/emotion/cjs/components/Popup/ui/Draggable/Draggable.js +75 -0
- package/emotion/cjs/components/Popup/ui/Resizable/Resizable.js +114 -0
- package/emotion/cjs/components/Popup/ui/index.js +20 -0
- package/emotion/cjs/components/Tooltip/Tooltip.js +19 -41
- package/emotion/cjs/components/Tooltip/hooks/index.js +11 -0
- package/emotion/cjs/components/Tooltip/hooks/useDelayedTooltip.js +93 -0
- package/emotion/cjs/components/Tree/Tree.js +7 -2
- package/emotion/cjs/components/Tree/Tree.styles.js +13 -13
- package/emotion/cjs/components/Tree/Tree.tokens.js +2 -1
- package/emotion/cjs/examples/components/Calendar/CalendarBase.config.js +5 -5
- package/emotion/cjs/examples/components/Calendar/CalendarDouble.config.js +5 -5
- package/emotion/cjs/examples/components/Chip/Chip.config.js +13 -14
- package/emotion/cjs/examples/components/Combobox/Combobox.js +15 -0
- package/emotion/cjs/examples/components/DatePicker/DatePicker.config.js +7 -7
- package/emotion/es/components/Autocomplete/Autocomplete.js +3 -1
- package/emotion/es/components/Autocomplete/FloatingPopover.js +31 -4
- package/emotion/es/components/Calendar/Calendar.tokens.js +1 -0
- package/emotion/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js +4 -4
- package/emotion/es/components/Combobox/ComboboxNew/Combobox.js +12 -30
- package/emotion/es/components/Combobox/ComboboxNew/utils/getTextValue.js +16 -0
- package/emotion/es/components/Combobox/ComboboxNew/utils/index.js +1 -0
- package/emotion/es/components/DatePicker/DatePicker.tokens.js +1 -0
- package/emotion/es/components/DatePicker/DatePickerBase.styles.js +5 -5
- package/emotion/es/components/Popup/Popup.js +6 -63
- package/emotion/es/components/Popup/ui/Draggable/Draggable.js +19 -0
- package/emotion/es/components/Popup/ui/Resizable/Resizable.js +63 -0
- package/emotion/es/components/Popup/ui/index.js +2 -0
- package/emotion/es/components/Tooltip/Tooltip.js +20 -42
- package/emotion/es/components/Tooltip/hooks/index.js +1 -0
- package/emotion/es/components/Tooltip/hooks/useDelayedTooltip.js +83 -0
- package/emotion/es/components/Tree/Tree.js +7 -2
- package/emotion/es/components/Tree/Tree.styles.js +13 -13
- package/emotion/es/components/Tree/Tree.tokens.js +2 -1
- package/emotion/es/examples/components/Calendar/CalendarBase.config.js +5 -5
- package/emotion/es/examples/components/Calendar/CalendarDouble.config.js +5 -5
- package/emotion/es/examples/components/Chip/Chip.config.js +13 -14
- package/emotion/es/examples/components/Combobox/Combobox.js +7 -0
- package/emotion/es/examples/components/DatePicker/DatePicker.config.js +7 -7
- package/es/components/Autocomplete/Autocomplete.js +4 -1
- package/es/components/Autocomplete/Autocomplete.js.map +1 -1
- package/es/components/Autocomplete/FloatingPopover.js +6 -5
- package/es/components/Autocomplete/FloatingPopover.js.map +1 -1
- package/es/components/Calendar/Calendar.tokens.js +1 -0
- package/es/components/Calendar/Calendar.tokens.js.map +1 -1
- package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js +4 -4
- package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/Combobox.js +15 -30
- package/es/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/utils/getTextValue.js +20 -0
- package/es/components/Combobox/ComboboxNew/utils/getTextValue.js.map +1 -0
- package/es/components/DatePicker/DatePicker.tokens.js +1 -0
- package/es/components/DatePicker/DatePicker.tokens.js.map +1 -1
- package/es/components/DatePicker/DatePickerBase.styles.js +1 -1
- package/es/components/DatePicker/DatePickerBase.styles.js.map +1 -1
- package/es/components/DatePicker/{DatePickerBase.styles_10sa0ht.css → DatePickerBase.styles_1fnt3hc.css} +1 -1
- package/es/components/DatePicker/RangeDate/RangeDate.css +4 -4
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.css +2 -2
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles.js +1 -1
- package/{cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles_1n0dbxm.css → es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles_160e4y4.css} +2 -2
- package/es/components/DatePicker/SingleDate/SingleDate.css +2 -2
- package/es/components/Popup/Popup.js +7 -65
- package/es/components/Popup/Popup.js.map +1 -1
- package/es/components/Popup/ui/Draggable/Draggable.js +24 -0
- package/es/components/Popup/ui/Draggable/Draggable.js.map +1 -0
- package/es/components/Popup/ui/Resizable/Resizable.js +71 -0
- package/es/components/Popup/ui/Resizable/Resizable.js.map +1 -0
- package/es/components/Slider/ui/Handler/Handler.js +2 -2
- package/es/components/Slider/ui/Handler/Handler.js.map +1 -1
- package/es/components/Tooltip/Tooltip.js +23 -46
- package/es/components/Tooltip/Tooltip.js.map +1 -1
- package/es/components/Tooltip/hooks/useDelayedTooltip.js +45 -0
- package/es/components/Tooltip/hooks/useDelayedTooltip.js.map +1 -0
- package/es/components/Tree/Tree.css +6 -6
- package/es/components/Tree/Tree.js +9 -2
- package/es/components/Tree/Tree.js.map +1 -1
- package/es/components/Tree/Tree.styles.js +1 -1
- package/es/components/Tree/Tree.styles.js.map +1 -1
- package/es/components/Tree/Tree.styles_6sla5y.css +7 -0
- package/es/components/Tree/Tree.tokens.js +2 -1
- package/es/components/Tree/Tree.tokens.js.map +1 -1
- package/es/index.css +10 -10
- package/package.json +4 -4
- package/styled-components/cjs/components/Autocomplete/Autocomplete.js +3 -1
- package/styled-components/cjs/components/Autocomplete/FloatingPopover.js +31 -4
- package/styled-components/cjs/components/Calendar/Calendar.tokens.js +1 -0
- package/styled-components/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.js +3 -3
- package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.js +26 -44
- package/styled-components/cjs/components/Combobox/ComboboxNew/utils/getTextValue.js +25 -0
- package/styled-components/cjs/components/Combobox/ComboboxNew/utils/index.js +4 -0
- package/styled-components/cjs/components/DatePicker/DatePicker.tokens.js +1 -0
- package/styled-components/cjs/components/DatePicker/DatePickerBase.styles.js +3 -3
- package/styled-components/cjs/components/Popup/Popup.js +7 -69
- package/styled-components/cjs/components/Popup/ui/Draggable/Draggable.js +75 -0
- package/styled-components/cjs/components/Popup/ui/Resizable/Resizable.js +114 -0
- package/styled-components/cjs/components/Popup/ui/index.js +20 -0
- package/styled-components/cjs/components/Tooltip/Tooltip.js +18 -40
- package/styled-components/cjs/components/Tooltip/hooks/index.js +11 -0
- package/styled-components/cjs/components/Tooltip/hooks/useDelayedTooltip.js +93 -0
- package/styled-components/cjs/components/Tree/Tree.js +7 -2
- package/styled-components/cjs/components/Tree/Tree.styles.js +13 -10
- package/styled-components/cjs/components/Tree/Tree.tokens.js +2 -1
- package/styled-components/cjs/examples/components/Calendar/CalendarBase.config.js +8 -4
- package/styled-components/cjs/examples/components/Calendar/CalendarDouble.config.js +8 -4
- package/styled-components/cjs/examples/components/Chip/Chip.config.js +0 -21
- package/styled-components/cjs/examples/components/Combobox/Combobox.js +15 -0
- package/styled-components/cjs/examples/components/DatePicker/DatePicker.config.js +8 -4
- package/styled-components/es/components/Autocomplete/Autocomplete.js +3 -1
- package/styled-components/es/components/Autocomplete/FloatingPopover.js +31 -4
- package/styled-components/es/components/Calendar/Calendar.tokens.js +1 -0
- package/styled-components/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js +4 -4
- package/styled-components/es/components/Combobox/ComboboxNew/Combobox.js +12 -30
- package/styled-components/es/components/Combobox/ComboboxNew/utils/getTextValue.js +16 -0
- package/styled-components/es/components/Combobox/ComboboxNew/utils/index.js +1 -0
- package/styled-components/es/components/DatePicker/DatePicker.tokens.js +1 -0
- package/styled-components/es/components/DatePicker/DatePickerBase.styles.js +3 -3
- package/styled-components/es/components/Popup/Popup.js +6 -63
- package/styled-components/es/components/Popup/ui/Draggable/Draggable.js +19 -0
- package/styled-components/es/components/Popup/ui/Resizable/Resizable.js +63 -0
- package/styled-components/es/components/Popup/ui/index.js +2 -0
- package/styled-components/es/components/Tooltip/Tooltip.js +19 -41
- package/styled-components/es/components/Tooltip/hooks/index.js +1 -0
- package/styled-components/es/components/Tooltip/hooks/useDelayedTooltip.js +83 -0
- package/styled-components/es/components/Tree/Tree.js +7 -2
- package/styled-components/es/components/Tree/Tree.styles.js +13 -10
- package/styled-components/es/components/Tree/Tree.tokens.js +2 -1
- package/styled-components/es/examples/components/Calendar/CalendarBase.config.js +8 -4
- package/styled-components/es/examples/components/Calendar/CalendarDouble.config.js +8 -4
- package/styled-components/es/examples/components/Chip/Chip.config.js +0 -21
- package/styled-components/es/examples/components/Combobox/Combobox.js +0 -7
- package/styled-components/es/examples/components/DatePicker/DatePicker.config.js +8 -4
- package/types/components/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/types/components/Autocomplete/Autocomplete.types.d.ts +6 -0
- package/types/components/Autocomplete/Autocomplete.types.d.ts.map +1 -1
- package/types/components/Calendar/Calendar.tokens.d.ts +1 -0
- package/types/components/Calendar/Calendar.tokens.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/Combobox.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/Combobox.types.d.ts +1 -1
- package/types/components/Combobox/ComboboxNew/Combobox.types.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/utils/getTextValue.d.ts +4 -0
- package/types/components/Combobox/ComboboxNew/utils/getTextValue.d.ts.map +1 -0
- package/types/components/Combobox/ComboboxNew/utils/index.d.ts +1 -0
- package/types/components/Combobox/ComboboxNew/utils/index.d.ts.map +1 -1
- package/types/components/DatePicker/DatePicker.tokens.d.ts +1 -0
- package/types/components/DatePicker/DatePicker.tokens.d.ts.map +1 -1
- package/types/components/DatePicker/DatePickerBase.styles.d.ts.map +1 -1
- package/types/components/Popup/Popup.d.ts.map +1 -1
- package/types/components/Popup/ui/Draggable/Draggable.d.ts +6 -0
- package/types/components/Popup/ui/Draggable/Draggable.d.ts.map +1 -0
- package/types/components/Popup/ui/Resizable/Resizable.d.ts +7 -0
- package/types/components/Popup/ui/Resizable/Resizable.d.ts.map +1 -0
- package/types/components/Popup/ui/index.d.ts +3 -0
- package/types/components/Popup/ui/index.d.ts.map +1 -0
- package/types/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/types/components/Tooltip/Tooltip.types.d.ts +31 -20
- package/types/components/Tooltip/Tooltip.types.d.ts.map +1 -1
- package/types/components/Tooltip/hooks/index.d.ts +2 -0
- package/types/components/Tooltip/hooks/index.d.ts.map +1 -0
- package/types/components/Tooltip/hooks/useDelayedTooltip.d.ts +7 -0
- package/types/components/Tooltip/hooks/useDelayedTooltip.d.ts.map +1 -0
- package/types/components/Tree/Tree.d.ts.map +1 -1
- package/types/components/Tree/Tree.styles.d.ts.map +1 -1
- package/types/components/Tree/Tree.tokens.d.ts +1 -0
- package/types/components/Tree/Tree.tokens.d.ts.map +1 -1
- package/types/components/Tree/Tree.types.d.ts +11 -4
- package/types/components/Tree/Tree.types.d.ts.map +1 -1
- package/types/examples/components/Autocomplete/Autocomplete.d.ts +8 -0
- package/types/examples/components/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/types/examples/components/Calendar/CalendarBase.config.d.ts.map +1 -1
- package/types/examples/components/Calendar/CalendarDouble.config.d.ts.map +1 -1
- package/types/examples/components/Chip/Chip.config.d.ts +0 -1
- package/types/examples/components/Chip/Chip.config.d.ts.map +1 -1
- package/types/examples/components/Chip/Chip.d.ts +0 -1
- package/types/examples/components/Chip/Chip.d.ts.map +1 -1
- package/types/examples/components/Combobox/Combobox.d.ts.map +1 -1
- package/types/examples/components/DatePicker/DatePicker.config.d.ts.map +1 -1
- package/cjs/components/Tree/Tree.styles_1w91oy6.css +0 -7
- package/es/components/Tree/Tree.styles_1w91oy6.css +0 -7
@@ -0,0 +1,63 @@
|
|
1
|
+
import React, { useRef } from "react";
|
2
|
+
import { Resizable as ReResizable } from "re-resizable";
|
3
|
+
import { classes } from "../../Popup.tokens";
|
4
|
+
import { getHandleStyles, getRatioBasedOnPlacement, getResizeDirections } from "../../utils";
|
5
|
+
import { IconResizeDiagonalStyled } from "../../Popup.styles";
|
6
|
+
export var Resizable = function(param) {
|
7
|
+
var children = param.children, outerResizable = param.resizable, placement = param.placement;
|
8
|
+
var _resizable_hiddenIcons, _resizable_icons, _resizable_hiddenIcons1, _resizable_icons1, _resizable_hiddenIcons2, _resizable_icons2, _resizable_hiddenIcons3, _resizable_icons3;
|
9
|
+
var resizableContainer = useRef(null);
|
10
|
+
var resizable = typeof outerResizable === 'boolean' ? {
|
11
|
+
disabled: !outerResizable
|
12
|
+
} : outerResizable;
|
13
|
+
var handleResizeStart = function() {
|
14
|
+
if ((resizableContainer === null || resizableContainer === void 0 ? void 0 : resizableContainer.current) && resizableContainer.current.resizable) {
|
15
|
+
resizableContainer.current.resizable.classList.toggle(classes.resizableContainerNoSelect);
|
16
|
+
}
|
17
|
+
};
|
18
|
+
var handleResizeStop = function() {
|
19
|
+
if ((resizableContainer === null || resizableContainer === void 0 ? void 0 : resizableContainer.current) && resizableContainer.current.resizable) {
|
20
|
+
resizableContainer.current.resizable.classList.toggle(classes.resizableContainerNoSelect);
|
21
|
+
}
|
22
|
+
};
|
23
|
+
if (!resizable || resizable.disabled) {
|
24
|
+
return /*#__PURE__*/ React.createElement(React.Fragment, null, children);
|
25
|
+
}
|
26
|
+
return /*#__PURE__*/ React.createElement(ReResizable, {
|
27
|
+
ref: resizableContainer,
|
28
|
+
enable: resizable && !resizable.disabled ? getResizeDirections(resizable.directions) : false,
|
29
|
+
resizeRatio: getRatioBasedOnPlacement(placement),
|
30
|
+
defaultSize: resizable === null || resizable === void 0 ? void 0 : resizable.defaultSize,
|
31
|
+
minWidth: resizable === null || resizable === void 0 ? void 0 : resizable.minWidth,
|
32
|
+
minHeight: resizable === null || resizable === void 0 ? void 0 : resizable.minHeight,
|
33
|
+
maxWidth: resizable === null || resizable === void 0 ? void 0 : resizable.maxWidth,
|
34
|
+
maxHeight: resizable === null || resizable === void 0 ? void 0 : resizable.maxHeight,
|
35
|
+
onResizeStart: handleResizeStart,
|
36
|
+
onResizeStop: handleResizeStop,
|
37
|
+
handleComponent: {
|
38
|
+
topRight: (resizable === null || resizable === void 0 ? void 0 : (_resizable_hiddenIcons = resizable.hiddenIcons) === null || _resizable_hiddenIcons === void 0 ? void 0 : _resizable_hiddenIcons.includes('top-right')) ? undefined : /*#__PURE__*/ React.createElement(React.Fragment, null, (resizable === null || resizable === void 0 ? void 0 : (_resizable_icons = resizable.icons) === null || _resizable_icons === void 0 ? void 0 : _resizable_icons.topRight) || /*#__PURE__*/ React.createElement(IconResizeDiagonalStyled, {
|
39
|
+
className: classes.resizableTopRightIcon,
|
40
|
+
color: "inherit",
|
41
|
+
size: resizable === null || resizable === void 0 ? void 0 : resizable.iconSize
|
42
|
+
})),
|
43
|
+
bottomRight: (resizable === null || resizable === void 0 ? void 0 : (_resizable_hiddenIcons1 = resizable.hiddenIcons) === null || _resizable_hiddenIcons1 === void 0 ? void 0 : _resizable_hiddenIcons1.includes('bottom-right')) ? undefined : /*#__PURE__*/ React.createElement(React.Fragment, null, (resizable === null || resizable === void 0 ? void 0 : (_resizable_icons1 = resizable.icons) === null || _resizable_icons1 === void 0 ? void 0 : _resizable_icons1.bottomRight) || /*#__PURE__*/ React.createElement(IconResizeDiagonalStyled, {
|
44
|
+
className: classes.resizableBottomRightIcon,
|
45
|
+
color: "inherit",
|
46
|
+
size: resizable === null || resizable === void 0 ? void 0 : resizable.iconSize
|
47
|
+
})),
|
48
|
+
bottomLeft: (resizable === null || resizable === void 0 ? void 0 : (_resizable_hiddenIcons2 = resizable.hiddenIcons) === null || _resizable_hiddenIcons2 === void 0 ? void 0 : _resizable_hiddenIcons2.includes('bottom-left')) ? undefined : /*#__PURE__*/ React.createElement(React.Fragment, null, (resizable === null || resizable === void 0 ? void 0 : (_resizable_icons2 = resizable.icons) === null || _resizable_icons2 === void 0 ? void 0 : _resizable_icons2.bottomLeft) || /*#__PURE__*/ React.createElement(IconResizeDiagonalStyled, {
|
49
|
+
className: classes.resizableBottomLeftIcon,
|
50
|
+
color: "inherit",
|
51
|
+
size: resizable === null || resizable === void 0 ? void 0 : resizable.iconSize
|
52
|
+
})),
|
53
|
+
topLeft: (resizable === null || resizable === void 0 ? void 0 : (_resizable_hiddenIcons3 = resizable.hiddenIcons) === null || _resizable_hiddenIcons3 === void 0 ? void 0 : _resizable_hiddenIcons3.includes('top-left')) ? undefined : /*#__PURE__*/ React.createElement(React.Fragment, null, (resizable === null || resizable === void 0 ? void 0 : (_resizable_icons3 = resizable.icons) === null || _resizable_icons3 === void 0 ? void 0 : _resizable_icons3.topLeft) || /*#__PURE__*/ React.createElement(IconResizeDiagonalStyled, {
|
54
|
+
className: classes.resizableTopLeftIcon,
|
55
|
+
color: "inherit",
|
56
|
+
size: resizable === null || resizable === void 0 ? void 0 : resizable.iconSize
|
57
|
+
}))
|
58
|
+
},
|
59
|
+
className: classes.resizableContainer,
|
60
|
+
handleStyles: getHandleStyles(),
|
61
|
+
handleWrapperClass: classes.resizableHandleWrapper
|
62
|
+
}, children);
|
63
|
+
};
|
@@ -99,11 +99,12 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
99
99
|
if (n === "Map" || n === "Set") return Array.from(n);
|
100
100
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
101
101
|
}
|
102
|
-
import React, { useEffect, forwardRef, useState
|
102
|
+
import React, { useEffect, forwardRef, useState } from "react";
|
103
103
|
import styled from "@emotion/styled";
|
104
104
|
import { component } from "../../engines";
|
105
|
-
import { popoverConfig, popoverTokens } from "../Popover";
|
106
105
|
import { cx } from "../../utils";
|
106
|
+
import { popoverConfig, popoverTokens } from "../Popover";
|
107
|
+
import { useDelayedTooltip } from "./hooks";
|
107
108
|
import { StyledContentLeft, TooltipRoot } from "./Tooltip.styles";
|
108
109
|
import { base as viewCSS } from "./variations/_view/base";
|
109
110
|
import { base as sizeCSS } from "./variations/_size/base";
|
@@ -114,9 +115,9 @@ var getStringValue = function(value) {
|
|
114
115
|
};
|
115
116
|
var Popover = component(popoverConfig);
|
116
117
|
var StyledPopover = /*#__PURE__*/ styled(Popover, {
|
117
|
-
target: "
|
118
|
+
target: "ehyx5h60",
|
118
119
|
label: "StyledPopover"
|
119
|
-
})(popoverTokens.arrowMaskWidth, ":var(", tokens.arrowMaskWidth, ");", popoverTokens.arrowMaskHeight, ":var(", tokens.arrowMaskHeight, ");", popoverTokens.arrowMaskImage, ":var(", tokens.arrowMaskImage, ");", popoverTokens.arrowBackground, ":var(", tokens.arrowBackground, ");", popoverTokens.arrowHeight, ":var(", tokens.arrowHeight, ");", popoverTokens.arrowEdgeMargin, ":var(", tokens.arrowEdgeMargin, ");", "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
120
|
+
})(popoverTokens.arrowMaskWidth, ":var(", tokens.arrowMaskWidth, ");", popoverTokens.arrowMaskHeight, ":var(", tokens.arrowMaskHeight, ");", popoverTokens.arrowMaskImage, ":var(", tokens.arrowMaskImage, ");", popoverTokens.arrowBackground, ":var(", tokens.arrowBackground, ");", popoverTokens.arrowHeight, ":var(", tokens.arrowHeight, ");", popoverTokens.arrowEdgeMargin, ":var(", tokens.arrowEdgeMargin, ");", "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3JjLWVtb3Rpb24vY29tcG9uZW50cy9Ub29sdGlwL1Rvb2x0aXAudHN4Iiwic291cmNlcyI6WyJzcmMtZW1vdGlvbi9jb21wb25lbnRzL1Rvb2x0aXAvVG9vbHRpcC50c3giXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFJlYWN0LCB7IHVzZUVmZmVjdCwgZm9yd2FyZFJlZiwgdXNlU3RhdGUgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5pbXBvcnQgeyBSb290UHJvcHMsIGNvbXBvbmVudCB9IGZyb20gJ3NyYy9lbmdpbmVzJztcbmltcG9ydCB7IGN4IH0gZnJvbSAnc3JjL3V0aWxzJztcblxuaW1wb3J0IHsgcG9wb3ZlckNvbmZpZywgcG9wb3ZlclRva2VucyB9IGZyb20gJy4uL1BvcG92ZXInO1xuXG5pbXBvcnQgeyB1c2VEZWxheWVkVG9vbHRpcCB9IGZyb20gJy4vaG9va3MnO1xuaW1wb3J0IHsgVG9vbHRpcFByb3BzIH0gZnJvbSAnLi9Ub29sdGlwLnR5cGVzJztcbmltcG9ydCB7IFN0eWxlZENvbnRlbnRMZWZ0LCBUb29sdGlwUm9vdCB9IGZyb20gJy4vVG9vbHRpcC5zdHlsZXMnO1xuaW1wb3J0IHsgYmFzZSBhcyB2aWV3Q1NTIH0gZnJvbSAnLi92YXJpYXRpb25zL192aWV3L2Jhc2UnO1xuaW1wb3J0IHsgYmFzZSBhcyBzaXplQ1NTIH0gZnJvbSAnLi92YXJpYXRpb25zL19zaXplL2Jhc2UnO1xuaW1wb3J0IHsgdG9rZW5zIH0gZnJvbSAnLi9Ub29sdGlwLnRva2Vucyc7XG5cbmNvbnN0IEVTQ0FQRV9LRVlDT0RFID0gMjc7XG5cbmNvbnN0IGdldFN0cmluZ1ZhbHVlID0gKHZhbHVlPzogbnVtYmVyIHwgc3RyaW5nKSA9PiB7XG4gICAgcmV0dXJuIHR5cGVvZiB2YWx1ZSA9PT0gJ251bWJlcicgPyBgJHt2YWx1ZX1yZW1gIDogdmFsdWU7XG59O1xuXG5jb25zdCBQb3BvdmVyID0gY29tcG9uZW50KHBvcG92ZXJDb25maWcpO1xuXG5jb25zdCBTdHlsZWRQb3BvdmVyID0gc3R5bGVkKFBvcG92ZXIpYFxuICAgICR7cG9wb3ZlclRva2Vucy5hcnJvd01hc2tXaWR0aH06IHZhcigke3Rva2Vucy5hcnJvd01hc2tXaWR0aH0pO1xuICAgICR7cG9wb3ZlclRva2Vucy5hcnJvd01hc2tIZWlnaHR9OiB2YXIoJHt0b2tlbnMuYXJyb3dNYXNrSGVpZ2h0fSk7XG4gICAgJHtwb3BvdmVyVG9rZW5zLmFycm93TWFza0ltYWdlfTogdmFyKCR7dG9rZW5zLmFycm93TWFza0ltYWdlfSk7XG4gICAgJHtwb3BvdmVyVG9rZW5zLmFycm93QmFja2dyb3VuZH06IHZhcigke3Rva2Vucy5hcnJvd0JhY2tncm91bmR9KTtcbiAgICAke3BvcG92ZXJUb2tlbnMuYXJyb3dIZWlnaHR9OiB2YXIoJHt0b2tlbnMuYXJyb3dIZWlnaHR9KTtcbiAgICAke3BvcG92ZXJUb2tlbnMuYXJyb3dFZGdlTWFyZ2lufTogdmFyKCR7dG9rZW5zLmFycm93RWRnZU1hcmdpbn0pO1xuYDtcblxuLyoqXG4gKiDQmtC+0LzQv9C+0L3QtdC90YIg0LTQu9GPINGC0LXQutGB0YLQvtCy0YvRhSDQv9C+0LTRgdC60LDQt9C+0LouINCe0YHQvdC+0LLQvdC+0LUg0L/RgNC10LTQvdCw0LfQvdCw0YfQtdC90LjQtSDigJQg0L/QvtC00L/QuNGB0Lgg0Log0LHQu9C+0LrQsNC8LlxuICovXG5cbmV4cG9ydCBjb25zdCB0b29sdGlwUm9vdCA9IChSb290OiBSb290UHJvcHM8SFRNTERpdkVsZW1lbnQsIE9taXQ8VG9vbHRpcFByb3BzLCAnb3BlbmVkJyB8ICd0ZXh0Jz4+KSA9PlxuICAgIGZvcndhcmRSZWY8SFRNTERpdkVsZW1lbnQsIFRvb2x0aXBQcm9wcz4oXG4gICAgICAgIChcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBpZCxcbiAgICAgICAgICAgICAgICB0ZXh0LFxuICAgICAgICAgICAgICAgIG9wZW5lZCxcbiAgICAgICAgICAgICAgICBpc1Zpc2libGUsXG4gICAgICAgICAgICAgICAgaXNPcGVuLFxuICAgICAgICAgICAgICAgIGhhc0Fycm93ID0gdHJ1ZSxcbiAgICAgICAgICAgICAgICBhcnJvdyxcbiAgICAgICAgICAgICAgICBhbmltYXRlZCxcbiAgICAgICAgICAgICAgICBvZmZzZXQgPSBbMywgOF0sXG4gICAgICAgICAgICAgICAgbWluV2lkdGgsXG4gICAgICAgICAgICAgICAgbWF4V2lkdGgsXG4gICAgICAgICAgICAgICAgcGxhY2VtZW50ID0gJ2JvdHRvbScsXG4gICAgICAgICAgICAgICAgdXNlUG9ydGFsID0gdHJ1ZSxcbiAgICAgICAgICAgICAgICB0YXJnZXQsXG4gICAgICAgICAgICAgICAgY2hpbGRyZW4sXG4gICAgICAgICAgICAgICAgb25EaXNtaXNzLFxuICAgICAgICAgICAgICAgIHZpZXcsXG4gICAgICAgICAgICAgICAgc2l6ZSxcbiAgICAgICAgICAgICAgICBjb250ZW50TGVmdCxcbiAgICAgICAgICAgICAgICB6SW5kZXggPSAnOTIwMCcsXG4gICAgICAgICAgICAgICAgY2xhc3NOYW1lLFxuICAgICAgICAgICAgICAgIHN0eWxlLFxuICAgICAgICAgICAgICAgIGhvdmVyVGltZW91dCxcbiAgICAgICAgICAgICAgICBtb3VzZUVudGVyRGVsYXkgPSAwLFxuICAgICAgICAgICAgICAgIG1vdXNlTGVhdmVEZWxheSxcbiAgICAgICAgICAgICAgICB0cmlnZ2VyLFxuICAgICAgICAgICAgICAgIC4uLnJlc3RcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBvdXRlclJlZixcbiAgICAgICAgKSA9PiB7XG4gICAgICAgICAgICBjb25zdCBbcmVmLCBzZXRSZWZdID0gdXNlU3RhdGU8SFRNTERpdkVsZW1lbnQgfCBudWxsPihudWxsKTtcblxuICAgICAgICAgICAgbW91c2VMZWF2ZURlbGF5ID0gbW91c2VMZWF2ZURlbGF5ID8/IGhvdmVyVGltZW91dCA/PyAzMDA7XG5cbiAgICAgICAgICAgIGNvbnN0IHsgb3BlbmVkOiBvcGVuZWRTdGF0ZSwgc2hvd1Rvb2x0aXAsIGhpZGVUb29sdGlwLCBzZXRPcGVuZWQgfSA9IHVzZURlbGF5ZWRUb29sdGlwKFxuICAgICAgICAgICAgICAgIG1vdXNlRW50ZXJEZWxheSxcbiAgICAgICAgICAgICAgICBtb3VzZUxlYXZlRGVsYXksXG4gICAgICAgICAgICApO1xuXG4gICAgICAgICAgICBjb25zdCBpc1Rvb2x0aXBPcGVuZWQgPSBCb29sZWFuKHRleHQpICYmIChpc1Zpc2libGUgfHwgaXNPcGVuIHx8IG9wZW5lZCB8fCBvcGVuZWRTdGF0ZSk7XG5cbiAgICAgICAgICAgIHVzZUVmZmVjdCgoKSA9PiB7XG4gICAgICAgICAgICAgICAgY29uc3Qgb25LZXlEb3duID0gKGV2ZW50OiBLZXlib2FyZEV2ZW50KSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChldmVudC5rZXlDb2RlID09PSBFU0NBUEVfS0VZQ09ERSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgb25EaXNtaXNzPy4oKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgICB3aW5kb3cuYWRkRXZlbnRMaXN0ZW5lcigna2V5ZG93bicsIG9uS2V5RG93bik7XG5cbiAgICAgICAgICAgICAgICByZXR1cm4gKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICB3aW5kb3cucmVtb3ZlRXZlbnRMaXN0ZW5lcigna2V5ZG93bicsIG9uS2V5RG93bik7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0sIFtdKTtcblxuICAgICAgICAgICAgY29uc3Qgb25Ub2dnbGUgPSAoaXNPcGVuOiBib29sZWFuKSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKHRyaWdnZXIgPT09ICdob3ZlcicpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzT3Blbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgc2hvd1Rvb2x0aXAoKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGhpZGVUb29sdGlwKCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBzZXRPcGVuZWQoaXNPcGVuKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgIDxTdHlsZWRQb3BvdmVyXG4gICAgICAgICAgICAgICAgICAgIG9wZW5lZD17aXNUb29sdGlwT3BlbmVkfVxuICAgICAgICAgICAgICAgICAgICBwbGFjZW1lbnQ9e3BsYWNlbWVudH1cbiAgICAgICAgICAgICAgICAgICAgb2Zmc2V0PXtvZmZzZXR9XG4gICAgICAgICAgICAgICAgICAgIHpJbmRleD17ekluZGV4fVxuICAgICAgICAgICAgICAgICAgICB0YXJnZXQ9e3RhcmdldCB8fCBjaGlsZHJlbn1cbiAgICAgICAgICAgICAgICAgICAgdXNlUG9ydGFsPXt1c2VQb3J0YWx9XG4gICAgICAgICAgICAgICAgICAgIGhhc0Fycm93PXthcnJvdyB8fCBoYXNBcnJvd31cbiAgICAgICAgICAgICAgICAgICAgYXJpYS1oaWRkZW49eyFpc1Rvb2x0aXBPcGVuZWR9XG4gICAgICAgICAgICAgICAgICAgIGFyaWEtbGl2ZT1cInBvbGl0ZVwiXG4gICAgICAgICAgICAgICAgICAgIHJvbGU9XCJ0b29sdGlwXCJcbiAgICAgICAgICAgICAgICAgICAgYW5pbWF0ZWQ9e2FuaW1hdGVkfVxuICAgICAgICAgICAgICAgICAgICBjbGFzc05hbWU9e2N4KHJlZj8uY2xhc3NMaXN0LnRvU3RyaW5nKCkpfVxuICAgICAgICAgICAgICAgICAgICB7Li4uKCh0cmlnZ2VyID09PSAnaG92ZXInIHx8IHRyaWdnZXIgPT09ICdjbGljaycpICYmIHsgdHJpZ2dlciwgb25Ub2dnbGUgfSl9XG4gICAgICAgICAgICAgICAgICAgIHsuLi5yZXN0fVxuICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAgPFJvb3Qgdmlldz17dmlld30gc2l6ZT17c2l6ZX0gcmVmPXtzZXRSZWZ9IGNsYXNzTmFtZT17Y2xhc3NOYW1lfSBzdHlsZT17c3R5bGV9PlxuICAgICAgICAgICAgICAgICAgICAgICAgPFRvb2x0aXBSb290XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmPXtvdXRlclJlZn1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZD17aWR9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbWF4V2lkdGg9e2dldFN0cmluZ1ZhbHVlKG1heFdpZHRoKX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtaW5XaWR0aD17Z2V0U3RyaW5nVmFsdWUobWluV2lkdGgpfVxuICAgICAgICAgICAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHtjb250ZW50TGVmdCAmJiA8U3R5bGVkQ29udGVudExlZnQ+e2NvbnRlbnRMZWZ0fTwvU3R5bGVkQ29udGVudExlZnQ+fVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHt0ZXh0fVxuICAgICAgICAgICAgICAgICAgICAgICAgPC9Ub29sdGlwUm9vdD5cbiAgICAgICAgICAgICAgICAgICAgPC9Sb290PlxuICAgICAgICAgICAgICAgIDwvU3R5bGVkUG9wb3Zlcj5cbiAgICAgICAgICAgICk7XG4gICAgICAgIH0sXG4gICAgKTtcblxuZXhwb3J0IGNvbnN0IHRvb2x0aXBDb25maWcgPSB7XG4gICAgbmFtZTogJ1Rvb2x0aXAnLFxuICAgIHRhZzogJ2RpdicsXG4gICAgbGF5b3V0OiB0b29sdGlwUm9vdCxcbiAgICBiYXNlOiAnJyxcbiAgICB2YXJpYXRpb25zOiB7XG4gICAgICAgIHZpZXc6IHtcbiAgICAgICAgICAgIGNzczogdmlld0NTUyxcbiAgICAgICAgfSxcbiAgICAgICAgc2l6ZToge1xuICAgICAgICAgICAgY3NzOiBzaXplQ1NTLFxuICAgICAgICB9LFxuICAgIH0sXG4gICAgZGVmYXVsdHM6IHtcbiAgICAgICAgdmlldzogJ2RlZmF1bHQnLFxuICAgICAgICBzaXplOiAnbScsXG4gICAgfSxcbn07XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBc0JzQiJ9 */");
|
120
121
|
/**
|
121
122
|
* Компонент для текстовых подсказок. Основное предназначение — подписи к блокам.
|
122
123
|
*/ export var tooltipRoot = function(Root) {
|
@@ -124,7 +125,7 @@ var StyledPopover = /*#__PURE__*/ styled(Popover, {
|
|
124
125
|
var id = _param.id, text = _param.text, opened = _param.opened, isVisible = _param.isVisible, isOpen = _param.isOpen, _param_hasArrow = _param.hasArrow, hasArrow = _param_hasArrow === void 0 ? true : _param_hasArrow, arrow = _param.arrow, animated = _param.animated, _param_offset = _param.offset, offset = _param_offset === void 0 ? [
|
125
126
|
3,
|
126
127
|
8
|
127
|
-
] : _param_offset, minWidth = _param.minWidth, maxWidth = _param.maxWidth, _param_placement = _param.placement, placement = _param_placement === void 0 ? 'bottom' : _param_placement, _param_usePortal = _param.usePortal, usePortal = _param_usePortal === void 0 ? true : _param_usePortal, target = _param.target, children = _param.children, onDismiss = _param.onDismiss, view = _param.view, size = _param.size, contentLeft = _param.contentLeft, _param_zIndex = _param.zIndex, zIndex = _param_zIndex === void 0 ? '9200' : _param_zIndex, className = _param.className, style = _param.style,
|
128
|
+
] : _param_offset, minWidth = _param.minWidth, maxWidth = _param.maxWidth, _param_placement = _param.placement, placement = _param_placement === void 0 ? 'bottom' : _param_placement, _param_usePortal = _param.usePortal, usePortal = _param_usePortal === void 0 ? true : _param_usePortal, target = _param.target, children = _param.children, onDismiss = _param.onDismiss, view = _param.view, size = _param.size, contentLeft = _param.contentLeft, _param_zIndex = _param.zIndex, zIndex = _param_zIndex === void 0 ? '9200' : _param_zIndex, className = _param.className, style = _param.style, hoverTimeout = _param.hoverTimeout, _param_mouseEnterDelay = _param.mouseEnterDelay, mouseEnterDelay = _param_mouseEnterDelay === void 0 ? 0 : _param_mouseEnterDelay, mouseLeaveDelay = _param.mouseLeaveDelay, trigger = _param.trigger, rest = _object_without_properties(_param, [
|
128
129
|
"id",
|
129
130
|
"text",
|
130
131
|
"opened",
|
@@ -148,16 +149,15 @@ var StyledPopover = /*#__PURE__*/ styled(Popover, {
|
|
148
149
|
"className",
|
149
150
|
"style",
|
150
151
|
"hoverTimeout",
|
152
|
+
"mouseEnterDelay",
|
153
|
+
"mouseLeaveDelay",
|
151
154
|
"trigger"
|
152
155
|
]);
|
153
156
|
var _useState = _sliced_to_array(useState(null), 2), ref = _useState[0], setRef = _useState[1];
|
154
|
-
var
|
155
|
-
|
156
|
-
var
|
157
|
-
|
158
|
-
var innerIsOpen = Boolean(isVisible || isOpen || opened);
|
159
|
-
var innerHasArrow = arrow || hasArrow;
|
160
|
-
var showTooltip = innerIsOpen && Boolean(text);
|
157
|
+
var _ref;
|
158
|
+
mouseLeaveDelay = (_ref = mouseLeaveDelay !== null && mouseLeaveDelay !== void 0 ? mouseLeaveDelay : hoverTimeout) !== null && _ref !== void 0 ? _ref : 300;
|
159
|
+
var _useDelayedTooltip = useDelayedTooltip(mouseEnterDelay, mouseLeaveDelay), openedState = _useDelayedTooltip.opened, showTooltip = _useDelayedTooltip.showTooltip, hideTooltip = _useDelayedTooltip.hideTooltip, setOpened = _useDelayedTooltip.setOpened;
|
160
|
+
var isTooltipOpened = Boolean(text) && (isVisible || isOpen || opened || openedState);
|
161
161
|
useEffect(function() {
|
162
162
|
var onKeyDown = function(event) {
|
163
163
|
if (event.keyCode === ESCAPE_KEYCODE) {
|
@@ -169,45 +169,26 @@ var StyledPopover = /*#__PURE__*/ styled(Popover, {
|
|
169
169
|
window.removeEventListener('keydown', onKeyDown);
|
170
170
|
};
|
171
171
|
}, []);
|
172
|
-
var onMouseEnter = function() {
|
173
|
-
clearTimeout(timeoutRef.current);
|
174
|
-
setIsHovered(true);
|
175
|
-
};
|
176
|
-
var onMouseLeave = function() {
|
177
|
-
timeoutRef.current = setTimeout(function() {
|
178
|
-
setIsHovered(false);
|
179
|
-
}, hoverTimeout);
|
180
|
-
};
|
181
|
-
useEffect(function() {
|
182
|
-
return function() {
|
183
|
-
return clearTimeout(timeoutRef.current);
|
184
|
-
};
|
185
|
-
}, [
|
186
|
-
trigger
|
187
|
-
]);
|
188
172
|
var onToggle = function(isOpen) {
|
189
173
|
if (trigger === 'hover') {
|
190
174
|
if (isOpen) {
|
191
|
-
|
192
|
-
setIsOpened(true);
|
175
|
+
showTooltip();
|
193
176
|
} else {
|
194
|
-
|
195
|
-
setIsOpened(false);
|
196
|
-
}, hoverTimeout);
|
177
|
+
hideTooltip();
|
197
178
|
}
|
198
179
|
} else {
|
199
|
-
|
180
|
+
setOpened(isOpen);
|
200
181
|
}
|
201
182
|
};
|
202
183
|
return /*#__PURE__*/ React.createElement(StyledPopover, _object_spread({
|
203
|
-
opened:
|
184
|
+
opened: isTooltipOpened,
|
204
185
|
placement: placement,
|
205
186
|
offset: offset,
|
206
187
|
zIndex: zIndex,
|
207
188
|
target: target || children,
|
208
189
|
usePortal: usePortal,
|
209
|
-
hasArrow:
|
210
|
-
"aria-hidden": !
|
190
|
+
hasArrow: arrow || hasArrow,
|
191
|
+
"aria-hidden": !isTooltipOpened,
|
211
192
|
"aria-live": "polite",
|
212
193
|
role: "tooltip",
|
213
194
|
animated: animated,
|
@@ -215,16 +196,13 @@ var StyledPopover = /*#__PURE__*/ styled(Popover, {
|
|
215
196
|
}, (trigger === 'hover' || trigger === 'click') && {
|
216
197
|
trigger: trigger,
|
217
198
|
onToggle: onToggle
|
218
|
-
}, rest), /*#__PURE__*/ React.createElement(Root,
|
199
|
+
}, rest), /*#__PURE__*/ React.createElement(Root, {
|
219
200
|
view: view,
|
220
201
|
size: size,
|
221
202
|
ref: setRef,
|
222
203
|
className: className,
|
223
204
|
style: style
|
224
|
-
},
|
225
|
-
onMouseEnter: onMouseEnter,
|
226
|
-
onMouseLeave: onMouseLeave
|
227
|
-
}), /*#__PURE__*/ React.createElement(TooltipRoot, {
|
205
|
+
}, /*#__PURE__*/ React.createElement(TooltipRoot, {
|
228
206
|
ref: outerRef,
|
229
207
|
id: id,
|
230
208
|
maxWidth: getStringValue(maxWidth),
|
@@ -0,0 +1 @@
|
|
1
|
+
export { useDelayedTooltip } from "./useDelayedTooltip";
|
@@ -0,0 +1,83 @@
|
|
1
|
+
function _array_like_to_array(arr, len) {
|
2
|
+
if (len == null || len > arr.length) len = arr.length;
|
3
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
4
|
+
return arr2;
|
5
|
+
}
|
6
|
+
function _array_with_holes(arr) {
|
7
|
+
if (Array.isArray(arr)) return arr;
|
8
|
+
}
|
9
|
+
function _iterable_to_array_limit(arr, i) {
|
10
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
11
|
+
if (_i == null) return;
|
12
|
+
var _arr = [];
|
13
|
+
var _n = true;
|
14
|
+
var _d = false;
|
15
|
+
var _s, _e;
|
16
|
+
try {
|
17
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
18
|
+
_arr.push(_s.value);
|
19
|
+
if (i && _arr.length === i) break;
|
20
|
+
}
|
21
|
+
} catch (err) {
|
22
|
+
_d = true;
|
23
|
+
_e = err;
|
24
|
+
} finally{
|
25
|
+
try {
|
26
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
27
|
+
} finally{
|
28
|
+
if (_d) throw _e;
|
29
|
+
}
|
30
|
+
}
|
31
|
+
return _arr;
|
32
|
+
}
|
33
|
+
function _non_iterable_rest() {
|
34
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
35
|
+
}
|
36
|
+
function _sliced_to_array(arr, i) {
|
37
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
38
|
+
}
|
39
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
40
|
+
if (!o) return;
|
41
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
42
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
43
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
44
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
45
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
46
|
+
}
|
47
|
+
import { useState, useRef, useEffect } from "react";
|
48
|
+
export var useDelayedTooltip = function(openDelay, closeDelay) {
|
49
|
+
var _useState = _sliced_to_array(useState(false), 2), opened = _useState[0], setOpened = _useState[1];
|
50
|
+
var openTimeoutRef = useRef(null);
|
51
|
+
var closeTimeoutRef = useRef(null);
|
52
|
+
var clearTimeouts = function() {
|
53
|
+
if (openTimeoutRef.current) {
|
54
|
+
clearTimeout(openTimeoutRef.current);
|
55
|
+
openTimeoutRef.current = null;
|
56
|
+
}
|
57
|
+
if (closeTimeoutRef.current) {
|
58
|
+
clearTimeout(closeTimeoutRef.current);
|
59
|
+
closeTimeoutRef.current = null;
|
60
|
+
}
|
61
|
+
};
|
62
|
+
var showTooltip = function() {
|
63
|
+
clearTimeouts();
|
64
|
+
openTimeoutRef.current = setTimeout(function() {
|
65
|
+
setOpened(true);
|
66
|
+
}, openDelay);
|
67
|
+
};
|
68
|
+
var hideTooltip = function() {
|
69
|
+
clearTimeouts();
|
70
|
+
closeTimeoutRef.current = setTimeout(function() {
|
71
|
+
setOpened(false);
|
72
|
+
}, closeDelay);
|
73
|
+
};
|
74
|
+
useEffect(function() {
|
75
|
+
return clearTimeouts;
|
76
|
+
}, []);
|
77
|
+
return {
|
78
|
+
opened: opened,
|
79
|
+
setOpened: setOpened,
|
80
|
+
showTooltip: showTooltip,
|
81
|
+
hideTooltip: hideTooltip
|
82
|
+
};
|
83
|
+
};
|
@@ -106,10 +106,14 @@ import { classes } from "./Tree.tokens";
|
|
106
106
|
* Многоуровневый раскрывающийся список в виде дерева.
|
107
107
|
*/ export var treeRoot = function(Root) {
|
108
108
|
return /*#__PURE__*/ forwardRef(function(param, ref) {
|
109
|
-
var items = param.items, _param_arrowPlacement = param.arrowPlacement, arrowPlacement = _param_arrowPlacement === void 0 ? 'left' : _param_arrowPlacement, _param_virtual = param.virtual, virtual = _param_virtual === void 0 ? true : _param_virtual, height = param.height, itemHeight = param.itemHeight, size = param.size, view = param.view, _param_fullWidthItemSelection = param.fullWidthItemSelection, fullWidthItemSelection = _param_fullWidthItemSelection === void 0 ? false : _param_fullWidthItemSelection, _param_multiple = param.multiple, multiple = _param_multiple === void 0 ? false : _param_multiple, _param_defaultExpandAll = param.defaultExpandAll, defaultExpandAll = _param_defaultExpandAll === void 0 ? false : _param_defaultExpandAll, _param_autoExpandParent = param.autoExpandParent, autoExpandParent = _param_autoExpandParent === void 0 ? false : _param_autoExpandParent, _param_checkable = param.checkable, checkable = _param_checkable === void 0 ? false : _param_checkable, outerSelectedKeys = param.selectedKeys, checkedKeys = param.checkedKeys, expandedKeys = param.expandedKeys, defaultCheckedKeys = param.defaultCheckedKeys, defaultExpandedKeys = param.defaultExpandedKeys, defaultSelectedKeys = param.defaultSelectedKeys, className = param.className, onTreeSelect = param.onTreeSelect, onTreeCheck = param.onTreeCheck, onTreeExpand = param.onTreeExpand, _param_hasIcon = param.hasIcon, hasIcon = _param_hasIcon === void 0 ? false : _param_hasIcon, icon = param.icon, renderTitle = param.renderTitle;
|
109
|
+
var items = param.items, _param_arrowPlacement = param.arrowPlacement, arrowPlacement = _param_arrowPlacement === void 0 ? 'left' : _param_arrowPlacement, _param_virtual = param.virtual, virtual = _param_virtual === void 0 ? true : _param_virtual, height = param.height, itemHeight = param.itemHeight, size = param.size, view = param.view, _param_fullWidthItemSelection = param.fullWidthItemSelection, fullWidthItemSelection = _param_fullWidthItemSelection === void 0 ? false : _param_fullWidthItemSelection, _param_multiple = param.multiple, multiple = _param_multiple === void 0 ? false : _param_multiple, _param_defaultExpandAll = param.defaultExpandAll, defaultExpandAll = _param_defaultExpandAll === void 0 ? false : _param_defaultExpandAll, _param_autoExpandParent = param.autoExpandParent, autoExpandParent = _param_autoExpandParent === void 0 ? false : _param_autoExpandParent, _param_checkable = param.checkable, checkable = _param_checkable === void 0 ? false : _param_checkable, outerSelectedKeys = param.selectedKeys, checkedKeys = param.checkedKeys, expandedKeys = param.expandedKeys, defaultCheckedKeys = param.defaultCheckedKeys, defaultExpandedKeys = param.defaultExpandedKeys, defaultSelectedKeys = param.defaultSelectedKeys, className = param.className, onTreeSelect = param.onTreeSelect, onTreeCheck = param.onTreeCheck, onTreeExpand = param.onTreeExpand, _param_hasIcon = param.hasIcon, hasIcon = _param_hasIcon === void 0 ? false : _param_hasIcon, icon = param.icon, renderTitle = param.renderTitle, _param_mode = param.mode, mode = _param_mode === void 0 ? 'default' : _param_mode;
|
110
110
|
var _useState = _sliced_to_array(useState(defaultSelectedKeys || []), 2), selected = _useState[0], setSelected = _useState[1];
|
111
111
|
var selectedKeys = outerSelectedKeys !== null && outerSelectedKeys !== void 0 ? outerSelectedKeys : selected;
|
112
|
+
var isRadioMode = mode === 'radio' && !multiple;
|
112
113
|
var handleSelect = function(updatedSelectedKeys, info) {
|
114
|
+
if (!multiple && isRadioMode && updatedSelectedKeys.length === 0) {
|
115
|
+
return;
|
116
|
+
}
|
113
117
|
setSelected(updatedSelectedKeys);
|
114
118
|
if (onTreeSelect) {
|
115
119
|
onTreeSelect(updatedSelectedKeys, info);
|
@@ -117,6 +121,7 @@ import { classes } from "./Tree.tokens";
|
|
117
121
|
};
|
118
122
|
var invertedClass = arrowPlacement === 'right' ? classes.treeInverted : undefined;
|
119
123
|
var itemFilledClass = fullWidthItemSelection ? classes.treeItemFilled : undefined;
|
124
|
+
var radioModeClass = isRadioMode ? classes.treeRadioMode : undefined;
|
120
125
|
// Проходимся по дереву и устанавливаем соответствующие классы для узлов дерева,
|
121
126
|
// чтобы соблюсти иерархию вложенности в UI.
|
122
127
|
var treeData = useMemo(function() {
|
@@ -136,7 +141,7 @@ import { classes } from "./Tree.tokens";
|
|
136
141
|
virtual: virtual,
|
137
142
|
multiple: multiple,
|
138
143
|
checkable: checkable,
|
139
|
-
className: cx(className, invertedClass, itemFilledClass),
|
144
|
+
className: cx(className, invertedClass, itemFilledClass, radioModeClass),
|
140
145
|
defaultExpandAll: defaultExpandAll,
|
141
146
|
autoExpandParent: autoExpandParent,
|
142
147
|
style: {
|