@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/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)
@@ -1,5 +1,5 @@
1
1
  //$Id$//
2
- import viewPort from "../Popup/viewPort";
2
+ import viewPort from '@zohodesk/dotkit/es/react/components/Popup/utils/viewPort.js';
3
3
  const {
4
4
  frameRelativeRects
5
5
  } = viewPort;
@@ -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 "../../Popup/viewPort";
9
- import { absolutePositionMapping, rtlAbsolutePositionMapping, rtlFixedPositionMapping } from "../../Popup/PositionMapping.js";
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 _DropBoxPositionMapping = require("../DropBoxPositionMapping.js");
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 = _DropBoxPositionMapping.positionMapping[boxPosition].direction;
78
+ var boxDirection = _positioning.positionMapping[boxPosition].direction;
79
79
 
80
80
  if (isAbsolute) {
81
- arrowPosition = arrowPosition ? arrowPosition : _DropBoxPositionMapping.positionMapping[boxPosition].arrowPosition;
82
- boxPosition = _DropBoxPositionMapping.positionMapping[boxPosition].positionStyle;
81
+ arrowPosition = arrowPosition ? arrowPosition : _positioning.positionMapping[boxPosition].arrowPosition;
82
+ boxPosition = _positioning.positionMapping[boxPosition].positionStyle;
83
83
  } else {
84
- arrowPosition = _DropBoxPositionMapping.positionMapping[boxPosition].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
- function isMobilePopover(needResponsive) {
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
- if (windowWidth <= mobileWidth) {
20
- isModel = true;
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
  }