@zohodesk/dot 1.0.0-beta.247 → 1.0.0-beta.249

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 CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  In this Library, we Provide Some Basic Components to Build Your Application
4
4
 
5
+ # 1.0.0-beta.249
6
+
7
+ - **FreezeLayer** - Issue fix: While click on the freezelayer, drawer/any dialog box won't close if any text highlighted in the product.
8
+
9
+ # 1.0.0-beta.248
10
+
11
+ - **AvatarFlip** - `customProps` has been added.
12
+
13
+ - **AvatarStatus** - `needDefaultBorder` prop added for all components.
14
+
15
+ - **AvatarWithTeam** - `teamBorderActive` prop has been added.
16
+
5
17
  # 1.0.0-beta.247
6
18
 
7
19
  - **ActionButton** - arrowBoxDataId prop removed .
@@ -3,9 +3,10 @@ import { defaultProps } from './props/defaultProps';
3
3
  import { propTypes } from './props/propTypes';
4
4
  import { Container } from '@zohodesk/components/lib/Layout';
5
5
  import VelocityAnimationGroup from '@zohodesk/components/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup';
6
- import style from './FreezeLayer.module.css';
7
6
  import { getZIndex } from '@zohodesk/components/lib/Provider/ZindexProvider';
8
7
  import { getDotLibraryConfig } from '../Provider/Config';
8
+ import { isTextSelected } from '@zohodesk/components/es/utils/Common';
9
+ import style from './FreezeLayer.module.css';
9
10
  export default class FreezeLayer extends Component {
10
11
  constructor(props) {
11
12
  super(props);
@@ -15,6 +16,15 @@ export default class FreezeLayer extends Component {
15
16
  };
16
17
  this.getNextIndex = getZIndex(this);
17
18
  this.isFreezeLayerEnabled = false;
19
+ this.handleClick = this.handleClick.bind(this);
20
+ }
21
+ handleClick() {
22
+ const {
23
+ onClick
24
+ } = this.props;
25
+ if (onClick && !isTextSelected()) {
26
+ onClick();
27
+ }
18
28
  }
19
29
  enableFreeze() {
20
30
  if (!this.isFreezeLayerEnabled) {
@@ -100,7 +110,7 @@ export default class FreezeLayer extends Component {
100
110
  className: `
101
111
  ${style.container} ${customClass} ${style[`index${zIndex}`]} ${!isSvgMask ? style[palette] : ''}
102
112
  `,
103
- onClick: onClick ? onClick : null,
113
+ onClick: this.handleClick,
104
114
  ref: forwardRef
105
115
  }, children && /*#__PURE__*/React.createElement(React.Fragment, null, childAnimationName ? /*#__PURE__*/React.createElement(VelocityAnimationGroup, {
106
116
  name: childAnimationName,
@@ -27,7 +27,8 @@ export default class AvatarStatus extends React.Component {
27
27
  customTextClass,
28
28
  statusTitle,
29
29
  customProps,
30
- dataSelectorId
30
+ dataSelectorId,
31
+ needDefaultBorder
31
32
  } = this.props;
32
33
  let {
33
34
  AvatarStatusProps = {},
@@ -52,6 +53,7 @@ export default class AvatarStatus extends React.Component {
52
53
  initial: initial,
53
54
  shape: shape,
54
55
  needTitle: needTitle,
56
+ needDefaultBorder: needDefaultBorder,
55
57
  needBorder: needBorder
56
58
  }, AvatarProps)), /*#__PURE__*/React.createElement("span", {
57
59
  "data-title": statusTitle,
@@ -6,5 +6,7 @@ export const defaultProps = {
6
6
  palette: 'info',
7
7
  statusTitle: '',
8
8
  customProps: {},
9
- dataSelectorId: 'avatarStatus'
9
+ dataSelectorId: 'avatarStatus',
10
+ needDefaultBorder: false,
11
+ needBorder: false
10
12
  };
@@ -13,6 +13,8 @@ export const propTypes = {
13
13
  size: PropTypes.string,
14
14
  src: PropTypes.string,
15
15
  state: PropTypes.string,
16
+ needDefaultBorder: PropTypes.bool,
17
+ needBorder: PropTypes.bool,
16
18
  statusTitle: PropTypes.string,
17
19
  textPalette: PropTypes.oneOf(['white', 'black']),
18
20
  title: PropTypes.string,
@@ -22,7 +22,8 @@ export default class AvatarWithTeam extends React.Component {
22
22
  teamClassName,
23
23
  borderOnActive,
24
24
  customProps,
25
- dataSelectorId
25
+ dataSelectorId,
26
+ teamBorderActive
26
27
  } = this.props;
27
28
  let {
28
29
  AvatarWithTeamProps = {},
@@ -81,7 +82,7 @@ export default class AvatarWithTeam extends React.Component {
81
82
  customClass: {
82
83
  customAvatar: customTextClass
83
84
  },
84
- borderOnActive: borderOnActive
85
+ borderOnActive: teamBorderActive
85
86
  }, AvatarTeam2Props))) : null);
86
87
  }
87
88
  }
@@ -4,5 +4,6 @@ export const defaultProps = {
4
4
  teamClassName: '',
5
5
  borderOnActive: false,
6
6
  customProps: {},
7
- dataSelectorId: 'avatarWithTeam'
7
+ dataSelectorId: 'avatarWithTeam',
8
+ teamBorderActive: true
8
9
  };
@@ -14,6 +14,7 @@ export const propTypes = {
14
14
  textPalette: PropTypes.oneOf(['white', 'black']),
15
15
  title: PropTypes.string,
16
16
  borderOnActive: PropTypes.bool,
17
+ teamBorderActive: PropTypes.bool,
17
18
  customProps: PropTypes.shape({
18
19
  AvatarWithTeamProps: PropTypes.object,
19
20
  Avatar1Props: PropTypes.object,
@@ -30,7 +30,8 @@ export default class AvatarFlip extends Component {
30
30
  tourId,
31
31
  iconSize,
32
32
  isFilledCheckbox,
33
- channelTitle
33
+ channelTitle,
34
+ customProps
34
35
  } = this.props;
35
36
  return /*#__PURE__*/React.createElement(FlipCard, {
36
37
  id: id,
@@ -60,7 +61,8 @@ export default class AvatarFlip extends Component {
60
61
  needTitle: needTitle,
61
62
  tourId: tourId,
62
63
  isFilledCheckbox: isFilledCheckbox,
63
- channelTitle: channelTitle
64
+ channelTitle: channelTitle,
65
+ customProps: customProps
64
66
  });
65
67
  }
66
68
  }
@@ -1,5 +1,6 @@
1
1
  export const defaultProps = {
2
2
  size: 'xmedium',
3
3
  noNeedFlip: false,
4
- iconSize: '21'
4
+ iconSize: '21',
5
+ customProps: {}
5
6
  };
@@ -24,5 +24,6 @@ export const propTypes = {
24
24
  size: PropTypes.string,
25
25
  src: PropTypes.string,
26
26
  textPalette: PropTypes.oneOf(['white', 'black']),
27
- tourId: PropTypes.string
27
+ tourId: PropTypes.string,
28
+ customProps: PropTypes.object
28
29
  };
@@ -10,9 +10,10 @@ var _defaultProps = require("./props/defaultProps");
10
10
  var _propTypes = require("./props/propTypes");
11
11
  var _Layout = require("@zohodesk/components/lib/Layout");
12
12
  var _VelocityAnimationGroup = _interopRequireDefault(require("@zohodesk/components/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup"));
13
- var _FreezeLayerModule = _interopRequireDefault(require("./FreezeLayer.module.css"));
14
13
  var _ZindexProvider = require("@zohodesk/components/lib/Provider/ZindexProvider");
15
14
  var _Config = require("../Provider/Config");
15
+ var _Common = require("@zohodesk/components/es/utils/Common");
16
+ var _FreezeLayerModule = _interopRequireDefault(require("./FreezeLayer.module.css"));
16
17
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
17
18
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
18
19
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -41,9 +42,18 @@ var FreezeLayer = /*#__PURE__*/function (_Component) {
41
42
  };
42
43
  _this.getNextIndex = (0, _ZindexProvider.getZIndex)(_assertThisInitialized(_this));
43
44
  _this.isFreezeLayerEnabled = false;
45
+ _this.handleClick = _this.handleClick.bind(_assertThisInitialized(_this));
44
46
  return _this;
45
47
  }
46
48
  _createClass(FreezeLayer, [{
49
+ key: "handleClick",
50
+ value: function handleClick() {
51
+ var onClick = this.props.onClick;
52
+ if (onClick && !(0, _Common.isTextSelected)()) {
53
+ onClick();
54
+ }
55
+ }
56
+ }, {
47
57
  key: "enableFreeze",
48
58
  value: function enableFreeze() {
49
59
  if (!this.isFreezeLayerEnabled) {
@@ -132,7 +142,7 @@ var FreezeLayer = /*#__PURE__*/function (_Component) {
132
142
  zIndex: "".concat(this.getNextIndex())
133
143
  } : {},
134
144
  className: "\n ".concat(_FreezeLayerModule["default"].container, " ").concat(customClass, " ").concat(_FreezeLayerModule["default"]["index".concat(zIndex)], " ").concat(!isSvgMask ? _FreezeLayerModule["default"][palette] : '', "\n "),
135
- onClick: onClick ? onClick : null,
145
+ onClick: this.handleClick,
136
146
  ref: forwardRef
137
147
  }, children && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, childAnimationName ? /*#__PURE__*/_react["default"].createElement(_VelocityAnimationGroup["default"], {
138
148
  name: childAnimationName,
@@ -52,7 +52,8 @@ var AvatarStatus = /*#__PURE__*/function (_React$Component) {
52
52
  customTextClass = _this$props.customTextClass,
53
53
  statusTitle = _this$props.statusTitle,
54
54
  customProps = _this$props.customProps,
55
- dataSelectorId = _this$props.dataSelectorId;
55
+ dataSelectorId = _this$props.dataSelectorId,
56
+ needDefaultBorder = _this$props.needDefaultBorder;
56
57
  var _customProps$AvatarSt = customProps.AvatarStatusProps,
57
58
  AvatarStatusProps = _customProps$AvatarSt === void 0 ? {} : _customProps$AvatarSt,
58
59
  _customProps$AvatarPr = customProps.AvatarProps,
@@ -76,6 +77,7 @@ var AvatarStatus = /*#__PURE__*/function (_React$Component) {
76
77
  initial: initial,
77
78
  shape: shape,
78
79
  needTitle: needTitle,
80
+ needDefaultBorder: needDefaultBorder,
79
81
  needBorder: needBorder
80
82
  }, AvatarProps)), /*#__PURE__*/_react["default"].createElement("span", {
81
83
  "data-title": statusTitle,
@@ -12,6 +12,8 @@ var defaultProps = {
12
12
  palette: 'info',
13
13
  statusTitle: '',
14
14
  customProps: {},
15
- dataSelectorId: 'avatarStatus'
15
+ dataSelectorId: 'avatarStatus',
16
+ needDefaultBorder: false,
17
+ needBorder: false
16
18
  };
17
19
  exports.defaultProps = defaultProps;
@@ -4,29 +4,30 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.propTypes = void 0;
7
- var _propTypes = _interopRequireDefault(require("prop-types"));
7
+ var _propTypes2 = _interopRequireDefault(require("prop-types"));
8
+ var _propTypes;
8
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
9
- var propTypes = {
10
- className: _propTypes["default"].string,
11
- customTextClass: _propTypes["default"].string,
12
- dataId: _propTypes["default"].string,
13
- initial: _propTypes["default"].string,
14
- name: _propTypes["default"].string,
15
- needBorder: _propTypes["default"].bool,
16
- needTitle: _propTypes["default"].bool,
17
- onClick: _propTypes["default"].func,
18
- palette: _propTypes["default"].oneOf(['primary', 'secondary', 'info', 'default']),
19
- shape: _propTypes["default"].string,
20
- size: _propTypes["default"].string,
21
- src: _propTypes["default"].string,
22
- state: _propTypes["default"].string,
23
- statusTitle: _propTypes["default"].string,
24
- textPalette: _propTypes["default"].oneOf(['white', 'black']),
25
- title: _propTypes["default"].string,
26
- dataSelectorId: _propTypes["default"].string,
27
- customProps: _propTypes["default"].shape({
28
- AvatarStatusProps: _propTypes["default"].object,
29
- AvatarProps: _propTypes["default"].object
30
- })
31
- };
10
+ 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); }
11
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
12
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
13
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
14
+ var propTypes = (_propTypes = {
15
+ className: _propTypes2["default"].string,
16
+ customTextClass: _propTypes2["default"].string,
17
+ dataId: _propTypes2["default"].string,
18
+ initial: _propTypes2["default"].string,
19
+ name: _propTypes2["default"].string,
20
+ needBorder: _propTypes2["default"].bool,
21
+ needTitle: _propTypes2["default"].bool,
22
+ onClick: _propTypes2["default"].func,
23
+ palette: _propTypes2["default"].oneOf(['primary', 'secondary', 'info', 'default']),
24
+ shape: _propTypes2["default"].string,
25
+ size: _propTypes2["default"].string,
26
+ src: _propTypes2["default"].string,
27
+ state: _propTypes2["default"].string,
28
+ needDefaultBorder: _propTypes2["default"].bool
29
+ }, _defineProperty(_propTypes, "needBorder", _propTypes2["default"].bool), _defineProperty(_propTypes, "statusTitle", _propTypes2["default"].string), _defineProperty(_propTypes, "textPalette", _propTypes2["default"].oneOf(['white', 'black'])), _defineProperty(_propTypes, "title", _propTypes2["default"].string), _defineProperty(_propTypes, "dataSelectorId", _propTypes2["default"].string), _defineProperty(_propTypes, "customProps", _propTypes2["default"].shape({
30
+ AvatarStatusProps: _propTypes2["default"].object,
31
+ AvatarProps: _propTypes2["default"].object
32
+ })), _propTypes);
32
33
  exports.propTypes = propTypes;
@@ -51,7 +51,8 @@ var AvatarWithTeam = /*#__PURE__*/function (_React$Component) {
51
51
  teamClassName = _this$props.teamClassName,
52
52
  borderOnActive = _this$props.borderOnActive,
53
53
  customProps = _this$props.customProps,
54
- dataSelectorId = _this$props.dataSelectorId;
54
+ dataSelectorId = _this$props.dataSelectorId,
55
+ teamBorderActive = _this$props.teamBorderActive;
55
56
  var _customProps$AvatarWi = customProps.AvatarWithTeamProps,
56
57
  AvatarWithTeamProps = _customProps$AvatarWi === void 0 ? {} : _customProps$AvatarWi,
57
58
  _customProps$Avatar1P = customProps.Avatar1Props,
@@ -112,7 +113,7 @@ var AvatarWithTeam = /*#__PURE__*/function (_React$Component) {
112
113
  customClass: {
113
114
  customAvatar: customTextClass
114
115
  },
115
- borderOnActive: borderOnActive
116
+ borderOnActive: teamBorderActive
116
117
  }, AvatarTeam2Props))) : null);
117
118
  }
118
119
  }]);
@@ -10,6 +10,7 @@ var defaultProps = {
10
10
  teamClassName: '',
11
11
  borderOnActive: false,
12
12
  customProps: {},
13
- dataSelectorId: 'avatarWithTeam'
13
+ dataSelectorId: 'avatarWithTeam',
14
+ teamBorderActive: true
14
15
  };
15
16
  exports.defaultProps = defaultProps;
@@ -21,6 +21,7 @@ var propTypes = {
21
21
  textPalette: _propTypes["default"].oneOf(['white', 'black']),
22
22
  title: _propTypes["default"].string,
23
23
  borderOnActive: _propTypes["default"].bool,
24
+ teamBorderActive: _propTypes["default"].bool,
24
25
  customProps: _propTypes["default"].shape({
25
26
  AvatarWithTeamProps: _propTypes["default"].object,
26
27
  Avatar1Props: _propTypes["default"].object,
@@ -60,7 +60,8 @@ var AvatarFlip = /*#__PURE__*/function (_Component) {
60
60
  tourId = _this$props.tourId,
61
61
  iconSize = _this$props.iconSize,
62
62
  isFilledCheckbox = _this$props.isFilledCheckbox,
63
- channelTitle = _this$props.channelTitle;
63
+ channelTitle = _this$props.channelTitle,
64
+ customProps = _this$props.customProps;
64
65
  return /*#__PURE__*/_react["default"].createElement(_FlipCard["default"], {
65
66
  id: id,
66
67
  action: action,
@@ -89,7 +90,8 @@ var AvatarFlip = /*#__PURE__*/function (_Component) {
89
90
  needTitle: needTitle,
90
91
  tourId: tourId,
91
92
  isFilledCheckbox: isFilledCheckbox,
92
- channelTitle: channelTitle
93
+ channelTitle: channelTitle,
94
+ customProps: customProps
93
95
  });
94
96
  }
95
97
  }]);
@@ -7,6 +7,7 @@ exports.defaultProps = void 0;
7
7
  var defaultProps = {
8
8
  size: 'xmedium',
9
9
  noNeedFlip: false,
10
- iconSize: '21'
10
+ iconSize: '21',
11
+ customProps: {}
11
12
  };
12
13
  exports.defaultProps = defaultProps;
@@ -31,6 +31,7 @@ var propTypes = {
31
31
  size: _propTypes["default"].string,
32
32
  src: _propTypes["default"].string,
33
33
  textPalette: _propTypes["default"].oneOf(['white', 'black']),
34
- tourId: _propTypes["default"].string
34
+ tourId: _propTypes["default"].string,
35
+ customProps: _propTypes["default"].object
35
36
  };
36
37
  exports.propTypes = propTypes;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/dot",
3
- "version": "1.0.0-beta.247",
3
+ "version": "1.0.0-beta.249",
4
4
  "main": "lib/index",
5
5
  "module": "es/index.js",
6
6
  "private": false,
@@ -44,7 +44,7 @@
44
44
  "velocity-react": "1.4.3",
45
45
  "@zohodesk/variables": "1.0.0-beta.29",
46
46
  "@zohodesk/i18n": "1.0.0-beta.7",
47
- "@zohodesk/components": "1.0.0-alpha-258",
47
+ "@zohodesk/components": "1.0.0-alpha-260",
48
48
  "@zohodesk/icons": "1.0.0-beta.116",
49
49
  "@zohodesk/svg": "1.0.0-beta.49",
50
50
  "@zohodesk/virtualizer": "1.0.3",
@@ -55,7 +55,7 @@
55
55
  "velocity-react": "1.4.3",
56
56
  "@zohodesk/variables": "1.0.0-beta.29",
57
57
  "@zohodesk/i18n": "1.0.0-beta.7",
58
- "@zohodesk/components": "1.0.0-alpha-258",
58
+ "@zohodesk/components": "1.0.0-alpha-260",
59
59
  "@zohodesk/icons": "1.0.0-beta.116",
60
60
  "@zohodesk/svg": "1.0.0-beta.48",
61
61
  "@zohodesk/a11y": "1.3.7"
package/css_error.log DELETED
File without changes