@zohodesk/components 1.3.1 → 1.3.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/.cli/propValidation_report.html +1 -1
- package/README.md +10 -31
- package/es/Popup/Popup.js +16 -10
- package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +40 -3
- package/es/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +4 -1
- package/lib/Popup/Popup.js +16 -11
- package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +80 -26
- package/lib/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +4 -1
- package/package.json +3 -3
- package/result.json +1 -1
package/README.md
CHANGED
|
@@ -1,37 +1,16 @@
|
|
|
1
1
|
# DOT Style Guide
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
- AvatarTeam
|
|
7
|
-
- Accordion
|
|
8
|
-
- Animation
|
|
9
|
-
- Button
|
|
10
|
-
- Buttongroup
|
|
11
|
-
- Card
|
|
12
|
-
- CheckBox
|
|
13
|
-
- DateTime
|
|
14
|
-
- DropBox
|
|
15
|
-
- Icon
|
|
16
|
-
- Label
|
|
17
|
-
- Layout
|
|
18
|
-
- ListItem
|
|
19
|
-
- MultiSelect
|
|
20
|
-
- Popup
|
|
21
|
-
- Radio
|
|
22
|
-
- Responsive
|
|
23
|
-
- Ribbon
|
|
24
|
-
- Select
|
|
25
|
-
- GroupSelect
|
|
26
|
-
- Stencils
|
|
27
|
-
- Switch
|
|
28
|
-
- Tab
|
|
29
|
-
- Tag
|
|
30
|
-
- Textarea
|
|
31
|
-
- TextBox
|
|
32
|
-
- TextBoxIcon
|
|
33
|
-
- Tooltip
|
|
3
|
+
Dot UI is a customizable React component library built to deliver a clean, accessible, and developer-friendly UI experience. It offers a growing set of reusable components designed to align with modern design systems and streamline application development across projects.
|
|
4
|
+
|
|
5
|
+
# 1.3.2
|
|
34
6
|
|
|
7
|
+
- **Popup**
|
|
8
|
+
- Added `scrollDebounceTime` prop to support debounce control for fixed popup scroll behavior.
|
|
9
|
+
- **VelocityAnimationGroup** - Added support for the following props:
|
|
10
|
+
- `onEnterComplete` - Callback triggered after enter animation completes.
|
|
11
|
+
- `onExitComplete` - Callback triggered after exit animation completes.
|
|
12
|
+
- `postEnterStyles` - Inline styles applied to the element once the enter animation has finished.
|
|
13
|
+
|
|
35
14
|
# 1.3.1
|
|
36
15
|
|
|
37
16
|
- **dropDownUtils** - The isObjectContainsSearchString function logic has been updated to use some instead of filter, and additional conditions have been added to prevent potential runtime issues.
|
package/es/Popup/Popup.js
CHANGED
|
@@ -89,8 +89,8 @@ const Popup = function (Component) {
|
|
|
89
89
|
this.getIsOutsideScrollBlocked = this.getIsOutsideScrollBlocked.bind(this);
|
|
90
90
|
this.getNeedArrow = this.getNeedArrow.bind(this);
|
|
91
91
|
this.getCustomPositionOrder = this.getCustomPositionOrder.bind(this);
|
|
92
|
-
this.handleOpenPopupPositionChange = this.handleOpenPopupPositionChange.bind(this);
|
|
93
|
-
|
|
92
|
+
this.handleOpenPopupPositionChange = this.handleOpenPopupPositionChange.bind(this);
|
|
93
|
+
this.getScrollDebounceTime = this.getScrollDebounceTime.bind(this);
|
|
94
94
|
this.getCloseOnScrollPopup = this.getCloseOnScrollPopup.bind(this);
|
|
95
95
|
this.handleCloseLastOpenedGroup = this.handleCloseLastOpenedGroup.bind(this);
|
|
96
96
|
this.handleDocumentMouseDown = this.handleDocumentMouseDown.bind(this);
|
|
@@ -107,7 +107,6 @@ const Popup = function (Component) {
|
|
|
107
107
|
this.updateVisibilityOnIntersection = this.updateVisibilityOnIntersection.bind(this);
|
|
108
108
|
this.handleAddingScrollToUpdatePosition = this.handleAddingScrollToUpdatePosition.bind(this);
|
|
109
109
|
this.handleRemovingScrollToUpdatePosition = this.handleRemovingScrollToUpdatePosition.bind(this);
|
|
110
|
-
this.updatePositionOnScroll = this.updatePositionOnScroll.bind(this);
|
|
111
110
|
this.setContainerDynamicPositioning = this.setContainerDynamicPositioning.bind(this);
|
|
112
111
|
this.updatePopupState = this.updatePopupState.bind(this);
|
|
113
112
|
this.handleScrollAndBlockEvents = this.handleScrollAndBlockEvents.bind(this);
|
|
@@ -122,8 +121,9 @@ const Popup = function (Component) {
|
|
|
122
121
|
this.customPositionOrder = customPositionOrder;
|
|
123
122
|
this.scrollDebounceTime = popupScrollDebounceTime;
|
|
124
123
|
this.closeOnScroll = closeOnScrollPopup;
|
|
125
|
-
this.isOutsideScrollBlock = isOutsideScrollBlock;
|
|
126
|
-
|
|
124
|
+
this.isOutsideScrollBlock = isOutsideScrollBlock;
|
|
125
|
+
const scrollDebounceTime = this.getScrollDebounceTime(this);
|
|
126
|
+
this.updatePositionOnScroll = scrollDebounceTime > 0 ? debounce(this.updatePositionOnScroll.bind(this), scrollDebounceTime) : this.updatePositionOnScroll.bind(this); // this.handleScroll = debounce(this.handleScroll.bind(this), scrollDebounceTime);
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
componentDidMount() {
|
|
@@ -426,6 +426,7 @@ const Popup = function (Component) {
|
|
|
426
426
|
const {
|
|
427
427
|
dropElement
|
|
428
428
|
} = this;
|
|
429
|
+
if (!dropElement) return;
|
|
429
430
|
|
|
430
431
|
if (entry.isIntersecting === true) {
|
|
431
432
|
this.isTargetElementVisible = true;
|
|
@@ -451,12 +452,17 @@ const Popup = function (Component) {
|
|
|
451
452
|
needPopupArrow
|
|
452
453
|
} = popup;
|
|
453
454
|
return isArrow !== undefined ? isArrow : needPopupArrow;
|
|
454
|
-
}
|
|
455
|
-
// const { scrollDebounceTime } = popup.props;
|
|
456
|
-
// const { scrollDebounceTime: popupScrollDebounceTime } = popup;
|
|
457
|
-
// return scrollDebounceTime !== undefined ? scrollDebounceTime : popupScrollDebounceTime;
|
|
458
|
-
// }
|
|
455
|
+
}
|
|
459
456
|
|
|
457
|
+
getScrollDebounceTime(popup) {
|
|
458
|
+
const {
|
|
459
|
+
scrollDebounceTime
|
|
460
|
+
} = popup.props;
|
|
461
|
+
const {
|
|
462
|
+
scrollDebounceTime: popupScrollDebounceTime
|
|
463
|
+
} = popup;
|
|
464
|
+
return scrollDebounceTime !== undefined ? scrollDebounceTime : popupScrollDebounceTime;
|
|
465
|
+
}
|
|
460
466
|
|
|
461
467
|
getCloseOnScrollPopup(popup) {
|
|
462
468
|
const {
|
|
@@ -16,6 +16,38 @@ function clearProps(props) {
|
|
|
16
16
|
export default class VelocityAnimationGroup extends React.Component {
|
|
17
17
|
constructor(props) {
|
|
18
18
|
super(props);
|
|
19
|
+
this.handleEnterComplete = this.handleEnterComplete.bind(this);
|
|
20
|
+
this.handleExitComplete = this.handleExitComplete.bind(this);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
handleEnterComplete(elements) {
|
|
24
|
+
const {
|
|
25
|
+
onEnterComplete,
|
|
26
|
+
postEnterStyles
|
|
27
|
+
} = this.props;
|
|
28
|
+
|
|
29
|
+
if (typeof onEnterComplete === 'function') {
|
|
30
|
+
onEnterComplete(elements);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (postEnterStyles && typeof postEnterStyles === 'object') {
|
|
34
|
+
elements.forEach(rootElement => {
|
|
35
|
+
Object.entries(postEnterStyles).forEach(_ref => {
|
|
36
|
+
let [cssProperty, cssValue] = _ref;
|
|
37
|
+
rootElement.style[cssProperty] = cssValue;
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
handleExitComplete(elements) {
|
|
44
|
+
const {
|
|
45
|
+
onExitComplete
|
|
46
|
+
} = this.props;
|
|
47
|
+
|
|
48
|
+
if (typeof onExitComplete === 'function') {
|
|
49
|
+
onExitComplete(elements);
|
|
50
|
+
}
|
|
19
51
|
}
|
|
20
52
|
|
|
21
53
|
render() {
|
|
@@ -35,7 +67,10 @@ export default class VelocityAnimationGroup extends React.Component {
|
|
|
35
67
|
enterDelay,
|
|
36
68
|
isCustomized,
|
|
37
69
|
name,
|
|
38
|
-
needUIPack
|
|
70
|
+
needUIPack,
|
|
71
|
+
onEnterComplete,
|
|
72
|
+
onExitComplete,
|
|
73
|
+
postEnterStyles
|
|
39
74
|
} = this.props;
|
|
40
75
|
let {
|
|
41
76
|
direction,
|
|
@@ -76,13 +111,15 @@ export default class VelocityAnimationGroup extends React.Component {
|
|
|
76
111
|
animation: isCustomized ? enterAnimationObj[name] : needUIPack ? `transition.${enterName}In` : enterName,
|
|
77
112
|
duration: !isReducedMotion ? enterDuration : 0,
|
|
78
113
|
delay: enterDelay ? enterDelay : 0,
|
|
79
|
-
display: isFlex ? 'flex' : ''
|
|
114
|
+
display: isFlex ? 'flex' : '',
|
|
115
|
+
complete: onEnterComplete || postEnterStyles ? this.handleEnterComplete : undefined
|
|
80
116
|
};
|
|
81
117
|
let exitAnimation = {
|
|
82
118
|
animation: isCustomized ? exitAnimationObj[name] : needUIPack ? `transition.${exitName ? exitName : enterName}Out` : exitName ? exitName : enterName,
|
|
83
119
|
duration: !isReducedMotion ? exitDuration : 0,
|
|
84
120
|
delay: exitDelay ? exitDelay : 0,
|
|
85
|
-
display: 'none'
|
|
121
|
+
display: 'none',
|
|
122
|
+
complete: onExitComplete ? this.handleExitComplete : undefined
|
|
86
123
|
};
|
|
87
124
|
return /*#__PURE__*/React.createElement(VelocityTransitionGroup, {
|
|
88
125
|
enter: enterAnimation,
|
|
@@ -15,5 +15,8 @@ export const propTypes = {
|
|
|
15
15
|
isFlex: PropTypes.bool,
|
|
16
16
|
name: PropTypes.oneOf(['fade', 'slideDown', 'flyDown', 'slideRight', 'shrink', 'expand', 'slideLeft']),
|
|
17
17
|
needUIPack: PropTypes.bool,
|
|
18
|
-
runOnMount: PropTypes.bool
|
|
18
|
+
runOnMount: PropTypes.bool,
|
|
19
|
+
onEnterComplete: PropTypes.func,
|
|
20
|
+
onExitComplete: PropTypes.func,
|
|
21
|
+
postEnterStyles: PropTypes.object
|
|
19
22
|
};
|
package/lib/Popup/Popup.js
CHANGED
|
@@ -162,8 +162,8 @@ var Popup = function Popup(Component) {
|
|
|
162
162
|
_this.getIsOutsideScrollBlocked = _this.getIsOutsideScrollBlocked.bind(_assertThisInitialized(_this));
|
|
163
163
|
_this.getNeedArrow = _this.getNeedArrow.bind(_assertThisInitialized(_this));
|
|
164
164
|
_this.getCustomPositionOrder = _this.getCustomPositionOrder.bind(_assertThisInitialized(_this));
|
|
165
|
-
_this.handleOpenPopupPositionChange = _this.handleOpenPopupPositionChange.bind(_assertThisInitialized(_this));
|
|
166
|
-
|
|
165
|
+
_this.handleOpenPopupPositionChange = _this.handleOpenPopupPositionChange.bind(_assertThisInitialized(_this));
|
|
166
|
+
_this.getScrollDebounceTime = _this.getScrollDebounceTime.bind(_assertThisInitialized(_this));
|
|
167
167
|
_this.getCloseOnScrollPopup = _this.getCloseOnScrollPopup.bind(_assertThisInitialized(_this));
|
|
168
168
|
_this.handleCloseLastOpenedGroup = _this.handleCloseLastOpenedGroup.bind(_assertThisInitialized(_this));
|
|
169
169
|
_this.handleDocumentMouseDown = _this.handleDocumentMouseDown.bind(_assertThisInitialized(_this));
|
|
@@ -180,7 +180,6 @@ var Popup = function Popup(Component) {
|
|
|
180
180
|
_this.updateVisibilityOnIntersection = _this.updateVisibilityOnIntersection.bind(_assertThisInitialized(_this));
|
|
181
181
|
_this.handleAddingScrollToUpdatePosition = _this.handleAddingScrollToUpdatePosition.bind(_assertThisInitialized(_this));
|
|
182
182
|
_this.handleRemovingScrollToUpdatePosition = _this.handleRemovingScrollToUpdatePosition.bind(_assertThisInitialized(_this));
|
|
183
|
-
_this.updatePositionOnScroll = _this.updatePositionOnScroll.bind(_assertThisInitialized(_this));
|
|
184
183
|
_this.setContainerDynamicPositioning = _this.setContainerDynamicPositioning.bind(_assertThisInitialized(_this));
|
|
185
184
|
_this.updatePopupState = _this.updatePopupState.bind(_assertThisInitialized(_this));
|
|
186
185
|
_this.handleScrollAndBlockEvents = _this.handleScrollAndBlockEvents.bind(_assertThisInitialized(_this));
|
|
@@ -195,8 +194,11 @@ var Popup = function Popup(Component) {
|
|
|
195
194
|
_this.customPositionOrder = customPositionOrder;
|
|
196
195
|
_this.scrollDebounceTime = popupScrollDebounceTime;
|
|
197
196
|
_this.closeOnScroll = closeOnScrollPopup;
|
|
198
|
-
_this.isOutsideScrollBlock = isOutsideScrollBlock;
|
|
199
|
-
|
|
197
|
+
_this.isOutsideScrollBlock = isOutsideScrollBlock;
|
|
198
|
+
|
|
199
|
+
var scrollDebounceTime = _this.getScrollDebounceTime(_assertThisInitialized(_this));
|
|
200
|
+
|
|
201
|
+
_this.updatePositionOnScroll = scrollDebounceTime > 0 ? (0, _Common.debounce)(_this.updatePositionOnScroll.bind(_assertThisInitialized(_this)), scrollDebounceTime) : _this.updatePositionOnScroll.bind(_assertThisInitialized(_this)); // this.handleScroll = debounce(this.handleScroll.bind(this), scrollDebounceTime);
|
|
200
202
|
|
|
201
203
|
return _this;
|
|
202
204
|
}
|
|
@@ -513,6 +515,7 @@ var Popup = function Popup(Component) {
|
|
|
513
515
|
key: "updateVisibilityOnIntersection",
|
|
514
516
|
value: function updateVisibilityOnIntersection(entry) {
|
|
515
517
|
var dropElement = this.dropElement;
|
|
518
|
+
if (!dropElement) return;
|
|
516
519
|
|
|
517
520
|
if (entry.isIntersecting === true) {
|
|
518
521
|
this.isTargetElementVisible = true;
|
|
@@ -534,12 +537,14 @@ var Popup = function Popup(Component) {
|
|
|
534
537
|
var isArrow = popup.props.isArrow;
|
|
535
538
|
var needPopupArrow = popup.needPopupArrow;
|
|
536
539
|
return isArrow !== undefined ? isArrow : needPopupArrow;
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
540
|
+
}
|
|
541
|
+
}, {
|
|
542
|
+
key: "getScrollDebounceTime",
|
|
543
|
+
value: function getScrollDebounceTime(popup) {
|
|
544
|
+
var scrollDebounceTime = popup.props.scrollDebounceTime;
|
|
545
|
+
var popupScrollDebounceTime = popup.scrollDebounceTime;
|
|
546
|
+
return scrollDebounceTime !== undefined ? scrollDebounceTime : popupScrollDebounceTime;
|
|
547
|
+
}
|
|
543
548
|
}, {
|
|
544
549
|
key: "getCloseOnScrollPopup",
|
|
545
550
|
value: function getCloseOnScrollPopup(popup) {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
@@ -29,6 +27,20 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
29
27
|
|
|
30
28
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
31
29
|
|
|
30
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
31
|
+
|
|
32
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
33
|
+
|
|
34
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
35
|
+
|
|
36
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
37
|
+
|
|
38
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
39
|
+
|
|
40
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
41
|
+
|
|
42
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
43
|
+
|
|
32
44
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
33
45
|
|
|
34
46
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
@@ -63,35 +75,75 @@ var VelocityAnimationGroup = /*#__PURE__*/function (_React$Component) {
|
|
|
63
75
|
var _super = _createSuper(VelocityAnimationGroup);
|
|
64
76
|
|
|
65
77
|
function VelocityAnimationGroup(props) {
|
|
78
|
+
var _this;
|
|
79
|
+
|
|
66
80
|
_classCallCheck(this, VelocityAnimationGroup);
|
|
67
81
|
|
|
68
|
-
|
|
82
|
+
_this = _super.call(this, props);
|
|
83
|
+
_this.handleEnterComplete = _this.handleEnterComplete.bind(_assertThisInitialized(_this));
|
|
84
|
+
_this.handleExitComplete = _this.handleExitComplete.bind(_assertThisInitialized(_this));
|
|
85
|
+
return _this;
|
|
69
86
|
}
|
|
70
87
|
|
|
71
88
|
_createClass(VelocityAnimationGroup, [{
|
|
89
|
+
key: "handleEnterComplete",
|
|
90
|
+
value: function handleEnterComplete(elements) {
|
|
91
|
+
var _this$props = this.props,
|
|
92
|
+
onEnterComplete = _this$props.onEnterComplete,
|
|
93
|
+
postEnterStyles = _this$props.postEnterStyles;
|
|
94
|
+
|
|
95
|
+
if (typeof onEnterComplete === 'function') {
|
|
96
|
+
onEnterComplete(elements);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (postEnterStyles && _typeof(postEnterStyles) === 'object') {
|
|
100
|
+
elements.forEach(function (rootElement) {
|
|
101
|
+
Object.entries(postEnterStyles).forEach(function (_ref) {
|
|
102
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
103
|
+
cssProperty = _ref2[0],
|
|
104
|
+
cssValue = _ref2[1];
|
|
105
|
+
|
|
106
|
+
rootElement.style[cssProperty] = cssValue;
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}, {
|
|
112
|
+
key: "handleExitComplete",
|
|
113
|
+
value: function handleExitComplete(elements) {
|
|
114
|
+
var onExitComplete = this.props.onExitComplete;
|
|
115
|
+
|
|
116
|
+
if (typeof onExitComplete === 'function') {
|
|
117
|
+
onExitComplete(elements);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}, {
|
|
72
121
|
key: "render",
|
|
73
122
|
value: function render() {
|
|
74
|
-
var _this$
|
|
75
|
-
children = _this$
|
|
76
|
-
enterName = _this$
|
|
77
|
-
exitName = _this$
|
|
78
|
-
enterDuration = _this$
|
|
79
|
-
exitDuration = _this$
|
|
80
|
-
isActive = _this$
|
|
81
|
-
component = _this$
|
|
82
|
-
runOnMount = _this$
|
|
83
|
-
enterShowStyle = _this$
|
|
84
|
-
enterHideStyle = _this$
|
|
85
|
-
exitDelay = _this$
|
|
86
|
-
isFlex = _this$
|
|
87
|
-
enterDelay = _this$
|
|
88
|
-
isCustomized = _this$
|
|
89
|
-
name = _this$
|
|
90
|
-
needUIPack = _this$
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
123
|
+
var _this$props2 = this.props,
|
|
124
|
+
children = _this$props2.children,
|
|
125
|
+
enterName = _this$props2.enterName,
|
|
126
|
+
exitName = _this$props2.exitName,
|
|
127
|
+
enterDuration = _this$props2.enterDuration,
|
|
128
|
+
exitDuration = _this$props2.exitDuration,
|
|
129
|
+
isActive = _this$props2.isActive,
|
|
130
|
+
component = _this$props2.component,
|
|
131
|
+
runOnMount = _this$props2.runOnMount,
|
|
132
|
+
enterShowStyle = _this$props2.enterShowStyle,
|
|
133
|
+
enterHideStyle = _this$props2.enterHideStyle,
|
|
134
|
+
exitDelay = _this$props2.exitDelay,
|
|
135
|
+
isFlex = _this$props2.isFlex,
|
|
136
|
+
enterDelay = _this$props2.enterDelay,
|
|
137
|
+
isCustomized = _this$props2.isCustomized,
|
|
138
|
+
name = _this$props2.name,
|
|
139
|
+
needUIPack = _this$props2.needUIPack,
|
|
140
|
+
onEnterComplete = _this$props2.onEnterComplete,
|
|
141
|
+
onExitComplete = _this$props2.onExitComplete,
|
|
142
|
+
postEnterStyles = _this$props2.postEnterStyles;
|
|
143
|
+
|
|
144
|
+
var _ref3 = this.context || {},
|
|
145
|
+
direction = _ref3.direction,
|
|
146
|
+
isReducedMotion = _ref3.isReducedMotion;
|
|
95
147
|
|
|
96
148
|
var childProps = clearProps(this.props);
|
|
97
149
|
var enterAnimationObj = {
|
|
@@ -128,13 +180,15 @@ var VelocityAnimationGroup = /*#__PURE__*/function (_React$Component) {
|
|
|
128
180
|
animation: isCustomized ? enterAnimationObj[name] : needUIPack ? "transition.".concat(enterName, "In") : enterName,
|
|
129
181
|
duration: !isReducedMotion ? enterDuration : 0,
|
|
130
182
|
delay: enterDelay ? enterDelay : 0,
|
|
131
|
-
display: isFlex ? 'flex' : ''
|
|
183
|
+
display: isFlex ? 'flex' : '',
|
|
184
|
+
complete: onEnterComplete || postEnterStyles ? this.handleEnterComplete : undefined
|
|
132
185
|
};
|
|
133
186
|
var exitAnimation = {
|
|
134
187
|
animation: isCustomized ? exitAnimationObj[name] : needUIPack ? "transition.".concat(exitName ? exitName : enterName, "Out") : exitName ? exitName : enterName,
|
|
135
188
|
duration: !isReducedMotion ? exitDuration : 0,
|
|
136
189
|
delay: exitDelay ? exitDelay : 0,
|
|
137
|
-
display: 'none'
|
|
190
|
+
display: 'none',
|
|
191
|
+
complete: onExitComplete ? this.handleExitComplete : undefined
|
|
138
192
|
};
|
|
139
193
|
return /*#__PURE__*/_react["default"].createElement(_velocityReact.VelocityTransitionGroup, _extends({
|
|
140
194
|
enter: enterAnimation,
|
|
@@ -25,6 +25,9 @@ var propTypes = {
|
|
|
25
25
|
isFlex: _propTypes["default"].bool,
|
|
26
26
|
name: _propTypes["default"].oneOf(['fade', 'slideDown', 'flyDown', 'slideRight', 'shrink', 'expand', 'slideLeft']),
|
|
27
27
|
needUIPack: _propTypes["default"].bool,
|
|
28
|
-
runOnMount: _propTypes["default"].bool
|
|
28
|
+
runOnMount: _propTypes["default"].bool,
|
|
29
|
+
onEnterComplete: _propTypes["default"].func,
|
|
30
|
+
onExitComplete: _propTypes["default"].func,
|
|
31
|
+
postEnterStyles: _propTypes["default"].object
|
|
29
32
|
};
|
|
30
33
|
exports.propTypes = propTypes;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/components",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"main": "es/index.js",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"private": false,
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"@zohodesk/a11y": "2.3.4",
|
|
72
72
|
"@zohodesk/docstool": "1.0.0-alpha-2",
|
|
73
73
|
"@zohodesk/hooks": "2.0.5",
|
|
74
|
-
"@zohodesk/icons": "1.0.
|
|
74
|
+
"@zohodesk/icons": "1.0.78",
|
|
75
75
|
"@zohodesk/svg": "1.1.22",
|
|
76
76
|
"@zohodesk/utils": "1.3.14",
|
|
77
77
|
"@zohodesk/variables": "1.0.0",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"selectn": "1.1.2"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": {
|
|
89
|
-
"@zohodesk/icons": "1.0.
|
|
89
|
+
"@zohodesk/icons": "1.0.78",
|
|
90
90
|
"@zohodesk/variables": "1.0.0",
|
|
91
91
|
"@zohodesk/svg": "1.1.22",
|
|
92
92
|
"@zohodesk/virtualizer": "1.0.3",
|