@zohodesk/components 1.5.3 → 1.5.4-temp-1
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/README.md +11 -0
- package/es/DropBox/DropBoxElement/DropBoxElement.js +1 -1
- package/es/DropBox/utils/isMobilePopover.js +3 -14
- package/es/Popup/Popup.js +32 -1045
- package/es/Tag/Tag.js +5 -2
- package/es/Tag/props/propTypes.js +2 -0
- package/es/utils/Common.js +1 -1
- package/es/v1/Popup/Popup.js +2 -2
- package/lib/DropBox/DropBoxElement/DropBoxElement.js +5 -5
- package/lib/DropBox/utils/isMobilePopover.js +4 -14
- package/lib/Popup/Popup.js +36 -1149
- package/lib/Tag/Tag.js +6 -2
- package/lib/Tag/props/propTypes.js +2 -0
- package/lib/utils/Common.js +1 -1
- package/lib/v1/Popup/Popup.js +4 -4
- package/package.json +1 -1
- package/es/DropBox/DropBoxPositionMapping.js +0 -142
- package/es/Popup/PositionMapping.js +0 -72
- package/es/Popup/Registry.js +0 -36
- package/es/Popup/intersectionObserver.js +0 -49
- package/es/Popup/viewPort.js +0 -373
- package/lib/DropBox/DropBoxPositionMapping.js +0 -149
- package/lib/Popup/PositionMapping.js +0 -81
- package/lib/Popup/Registry.js +0 -46
- package/lib/Popup/intersectionObserver.js +0 -72
- package/lib/Popup/viewPort.js +0 -367
package/es/Tag/Tag.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
2
|
import { defaultProps } from "./props/defaultProps";
|
|
3
3
|
import { propTypes } from "./props/propTypes";
|
|
4
|
+
import { renderNode } from '@zohodesk/utils';
|
|
4
5
|
import { Icon } from '@zohodesk/icons';
|
|
5
6
|
import Avatar from "../Avatar/Avatar";
|
|
6
7
|
import { Container } from "../Layout";
|
|
@@ -84,6 +85,8 @@ export default class Tag extends PureComponent {
|
|
|
84
85
|
a11y,
|
|
85
86
|
needEffect,
|
|
86
87
|
isReadOnly,
|
|
88
|
+
renderLeftChildren,
|
|
89
|
+
renderRightChildren,
|
|
87
90
|
customProps
|
|
88
91
|
} = this.props;
|
|
89
92
|
const {
|
|
@@ -113,7 +116,7 @@ export default class Tag extends PureComponent {
|
|
|
113
116
|
"aria-labelledby": getAriaId,
|
|
114
117
|
"data-selector-id": dataSelectorId,
|
|
115
118
|
...customAttributes
|
|
116
|
-
}, hasAvatar ? /*#__PURE__*/React.createElement("div", {
|
|
119
|
+
}, renderNode(renderLeftChildren), hasAvatar ? /*#__PURE__*/React.createElement("div", {
|
|
117
120
|
className: style.avatar
|
|
118
121
|
}, /*#__PURE__*/React.createElement(Avatar, {
|
|
119
122
|
palette: isDarkPalette ? 'info' : avatarPalette,
|
|
@@ -150,7 +153,7 @@ export default class Tag extends PureComponent {
|
|
|
150
153
|
isBold: true,
|
|
151
154
|
name: "ZD-close2",
|
|
152
155
|
size: "8"
|
|
153
|
-
}))));
|
|
156
|
+
}))), renderNode(renderRightChildren));
|
|
154
157
|
}
|
|
155
158
|
|
|
156
159
|
}
|
|
@@ -35,6 +35,8 @@ export const propTypes = {
|
|
|
35
35
|
needEffect: PropTypes.bool,
|
|
36
36
|
isReadOnly: PropTypes.bool,
|
|
37
37
|
dataSelectorId: PropTypes.string,
|
|
38
|
+
renderLeftChildren: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
39
|
+
renderRightChildren: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
38
40
|
customProps: PropTypes.shape({
|
|
39
41
|
avatarProps: PropTypes.exact(AvatarPropTypes),
|
|
40
42
|
iconProps: PropTypes.exact(IconPropTypes)
|
package/es/utils/Common.js
CHANGED
package/es/v1/Popup/Popup.js
CHANGED
|
@@ -5,8 +5,8 @@ import hoistStatics from 'hoist-non-react-statics';
|
|
|
5
5
|
/**** Methods ****/
|
|
6
6
|
|
|
7
7
|
import { debounce, isDescendant, isTextSelected, cancelBubblingEffect } from "../../utils/Common.js";
|
|
8
|
-
import viewPort from
|
|
9
|
-
import { absolutePositionMapping, rtlAbsolutePositionMapping, rtlFixedPositionMapping } from
|
|
8
|
+
import viewPort from '@zohodesk/dotkit/es/react/components/Popup/utils/viewPort.js';
|
|
9
|
+
import { absolutePositionMapping, rtlAbsolutePositionMapping, rtlFixedPositionMapping } from '@zohodesk/dotkit/es/react/components/Popup/utils/positioning.js';
|
|
10
10
|
import ResizeObserver from '@zohodesk/virtualizer/lib/commons/ResizeObserver.js';
|
|
11
11
|
let lastOpenedGroup = [];
|
|
12
12
|
let popups = {};
|
|
@@ -11,7 +11,7 @@ var _useDropboxPosCalc2 = _interopRequireDefault(require("./useDropboxPosCalc"))
|
|
|
11
11
|
|
|
12
12
|
var _cssJSLogic2 = _interopRequireDefault(require("./css/cssJSLogic"));
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _positioning = require("@zohodesk/dotkit/es/react/components/Popup/utils/positioning");
|
|
15
15
|
|
|
16
16
|
var _defaultProps = require("./props/defaultProps");
|
|
17
17
|
|
|
@@ -75,13 +75,13 @@ function DropBoxElement(props) {
|
|
|
75
75
|
ariaMultiselectable = a11y.ariaMultiselectable,
|
|
76
76
|
ariaLabelledby = a11y.ariaLabelledby;
|
|
77
77
|
boxPosition = boxPosition && boxPosition != 'undefined' ? boxPosition : 'bottomCenter';
|
|
78
|
-
var boxDirection =
|
|
78
|
+
var boxDirection = _positioning.positionMapping[boxPosition].direction;
|
|
79
79
|
|
|
80
80
|
if (isAbsolute) {
|
|
81
|
-
arrowPosition = arrowPosition ? arrowPosition :
|
|
82
|
-
boxPosition =
|
|
81
|
+
arrowPosition = arrowPosition ? arrowPosition : _positioning.positionMapping[boxPosition].arrowPosition;
|
|
82
|
+
boxPosition = _positioning.positionMapping[boxPosition].positionStyle;
|
|
83
83
|
} else {
|
|
84
|
-
arrowPosition =
|
|
84
|
+
arrowPosition = _positioning.positionMapping[boxPosition].arrowPosition;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
var _useDropboxPosCalc = (0, _useDropboxPosCalc2["default"])(props),
|
|
@@ -7,19 +7,9 @@ exports["default"] = isMobilePopover;
|
|
|
7
7
|
|
|
8
8
|
var _Config = require("../../Provider/Config");
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
// let { needResponsive } = props;
|
|
12
|
-
var windowWidth,
|
|
13
|
-
mobileWidth = (0, _Config.getLibraryConfig)('mobileWidth'),
|
|
14
|
-
isModel = false;
|
|
15
|
-
|
|
16
|
-
if (needResponsive) {
|
|
17
|
-
windowWidth = window.innerWidth;
|
|
10
|
+
var _device = require("@zohodesk/dotkit/es/utils/device.js");
|
|
18
11
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return isModel ? true : false;
|
|
12
|
+
function isMobilePopover(needResponsive) {
|
|
13
|
+
var mobileWidth = (0, _Config.getLibraryConfig)('mobileWidth');
|
|
14
|
+
return (0, _device.isMobilePopover)(needResponsive, mobileWidth);
|
|
25
15
|
}
|