@zohodesk/components 1.0.0-alpha-219 → 1.0.0-alpha-220

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
@@ -1,6 +1,6 @@
1
1
  # DOT Style Guide
2
2
 
3
- In this Package we Provide Some Basic Components to Build Web App
3
+ In this Package, we Provide Some Basic Components to Build Web App
4
4
 
5
5
  - Avatar
6
6
  - AvatarTeam
@@ -32,9 +32,13 @@ In this Package we Provide Some Basic Components to Build Web App
32
32
  - TextBoxIcon
33
33
  - Tooltip
34
34
 
35
+ # 1.0.0-alpha-220
36
+
37
+ - Tooltip Delay Controlled to Improve Perf
35
38
  # 1.0.0-alpha-219
36
39
 
37
40
  - ContextOptimizer => ShallowEqal function issue solved
41
+
38
42
  # 1.0.0-alpha-218
39
43
 
40
44
  - Select => Custom props undefined issue solved
@@ -68,7 +72,7 @@ In this Package we Provide Some Basic Components to Build Web App
68
72
 
69
73
  # 1.0.0-alpha-211
70
74
 
71
- - Lato font reference changed from local to Zoho URL(webfonts)
75
+ - Lato font reference changed from local to Zoho URL(web fonts)
72
76
 
73
77
  # 1.0.0-alpha-210
74
78
 
@@ -112,7 +116,7 @@ In this Package we Provide Some Basic Components to Build Web App
112
116
 
113
117
  # 1.0.0-alpha-202
114
118
 
115
- - MultiSelect - scrolltop issue fix
119
+ - MultiSelect - scroll top issue fix
116
120
 
117
121
  # 1.0.0-alpha-201
118
122
 
@@ -173,7 +177,7 @@ In this Package we Provide Some Basic Components to Build Web App
173
177
 
174
178
  # 1.0.0-alpha-188
175
179
 
176
- - Popup => popup with in popup open body click issue fixed
180
+ - Popup => popup within popup open body click issue fixed
177
181
 
178
182
  # 1.0.0-alpha-187
179
183
 
@@ -189,7 +193,7 @@ In this Package we Provide Some Basic Components to Build Web App
189
193
 
190
194
  # 1.0.0-alpha-184
191
195
 
192
- - Palette Based Folder Structure Changed.
196
+ - Palette-Based Folder Structure Changed.
193
197
  - data-theme changed to data-mode
194
198
  - data-palette changed to data-theme
195
199
 
@@ -243,7 +247,7 @@ In this Package we Provide Some Basic Components to Build Web App
243
247
 
244
248
  # 1.0.0-alpha-173
245
249
 
246
- - code based issue fixed ( const to let)
250
+ - code-based issue fixed ( const to let)
247
251
 
248
252
  # 1.0.0-alpha-172
249
253
 
@@ -395,7 +399,7 @@ In this Package we Provide Some Basic Components to Build Web App
395
399
  # 1.0.0-alpha-144
396
400
 
397
401
  - PortalLayer Moved to deprecated folder
398
- - A11y Id Added For Select,MultiSelect Based Components
402
+ - A11y Id Added For Select, MultiSelect Based Components
399
403
  - Semantic Button Default Font and Padding Resetted.
400
404
  - LisItem - dataId setted default
401
405
 
@@ -458,7 +462,7 @@ In this Package we Provide Some Basic Components to Build Web App
458
462
  # 1.0.0-alpha-137
459
463
 
460
464
  - ally Fixes
461
- - htmlId prop added in select component
465
+ - htmlId prop added in the select component
462
466
  - AdvancedGroupMultiSelect => scroll fetch issue fix
463
467
 
464
468
  # 1.0.0-alpha-136
@@ -476,7 +480,7 @@ In this Package we Provide Some Basic Components to Build Web App
476
480
 
477
481
  # 1.0.0-alpha-134
478
482
 
479
- - Reset Code Spliting
483
+ - Reset Code Splitting
480
484
 
481
485
  # 1.0.0-alpha-133
482
486
 
@@ -511,7 +515,7 @@ In this Package we Provide Some Basic Components to Build Web App
511
515
 
512
516
  # 1.0.0-alpha-126
513
517
 
514
- - AllY implementation for button, textbox
518
+ - AllY implementation for the button, textbox
515
519
  - Semantic button added
516
520
 
517
521
  # 1.0.0-alpha-125
@@ -678,7 +682,7 @@ In this Package we Provide Some Basic Components to Build Web App
678
682
 
679
683
  # 1.0.0-alpha-94
680
684
 
681
- - Tab Maping Fix
685
+ - Tab Mapping Fix
682
686
 
683
687
  # 1.0.0-alpha-93
684
688
 
@@ -687,7 +691,7 @@ In this Package we Provide Some Basic Components to Build Web App
687
691
  # 1.0.0-alpha-92
688
692
 
689
693
  - Tab Custom Element Fix
690
- - Avatar xlarge sze changes
694
+ - Avatar xlarge size changes
691
695
 
692
696
  # 1.0.0-alpha-91
693
697
 
@@ -713,7 +717,7 @@ In this Package we Provide Some Basic Components to Build Web App
713
717
  # 1.0.0-alpha-87
714
718
 
715
719
  - Date Component TimeZone Fix
716
- - Unwanted Funtctions Removed from utils/Common
720
+ - Unwanted Functions Removed from utils/Common
717
721
 
718
722
  # 1.0.0-alpha-86
719
723
 
@@ -743,7 +747,7 @@ In this Package we Provide Some Basic Components to Build Web App
743
747
 
744
748
  # 1.0.0-alpha-81
745
749
 
746
- - variant - secondary type removed in Label component
750
+ - variant - secondary type removed in a Label component
747
751
  - customClass Added For Label component
748
752
  - Radio, CheckBox SVG Updated, and Palette Danger Added, isFilled Added For Transparent BG
749
753
  - MultiSelect Avatar DataId Changes
@@ -754,7 +758,7 @@ In this Package we Provide Some Basic Components to Build Web App
754
758
 
755
759
  # 1.0.0-alpha-79
756
760
 
757
- - Tag danger,default color changed to dot_bg_hawkesBlue
761
+ - Tag danger, default color changed to dot_bg_hawkesBlue
758
762
  - MultiSelectWithAvatar size prop passed for tags Parent
759
763
 
760
764
  # 1.0.0-alpha-78
@@ -819,7 +823,7 @@ In this Package we Provide Some Basic Components to Build Web App
819
823
  # 1.0.0-alpha-67
820
824
 
821
825
  - Adding TourId and isAbsolutePositioningNeeded key in DropBox
822
- - Adding TourId in Box, Container and Tab components
826
+ - Adding TourId in Box, Container, and Tab components
823
827
 
824
828
  # 1.0.0-alpha-66
825
829
 
@@ -835,7 +839,7 @@ In this Package we Provide Some Basic Components to Build Web App
835
839
 
836
840
  - isDisabled Option added for List Item Based Atoms
837
841
  - needBorder and disableAction Option added for MultiSelect
838
- - Select BoxSize Added for Drop Box
842
+ - Select BoxSize Added for DropBox
839
843
 
840
844
  # 1.0.0-alpha-62
841
845
 
@@ -863,7 +867,7 @@ In this Package we Provide Some Basic Components to Build Web App
863
867
  # 1.0.0-alpha-57
864
868
 
865
869
  - Base Font Version 3 Updated
866
- - Advanced Group Multi Select Added
870
+ - Advanced Group Multi-Select Added
867
871
 
868
872
  # 1.0.0-alpha-56
869
873
 
@@ -882,14 +886,14 @@ In this Package we Provide Some Basic Components to Build Web App
882
886
 
883
887
  # 1.0.0-alpha-53
884
888
 
885
- - CustomScroll Maked Optional
889
+ - CustomScroll Make Optional
886
890
  - Reset Code Implemented in Portal
887
891
  - Icon Line-Height Remove
888
892
  - New Reports Icons Added
889
893
 
890
894
  # 1.0.0-alpha-52
891
895
 
892
- - Advance Multi Select Added
896
+ - Advance Multi-Select Added
893
897
 
894
898
  # 1.0.0-alpha-51
895
899
 
@@ -13,30 +13,71 @@ import '@zohodesk/variables/lib/fontFamilyVariables.module.css';
13
13
  import '@zohodesk/variables/lib/transitionVariables.module.css';
14
14
  import '@zohodesk/variables/lib/no_transitionVariables.module.css';
15
15
  import style from './AppContainer.module.css';
16
+ import { getLibraryConfig } from '../Provider/Config';
16
17
  export default class AppContainer extends React.Component {
17
18
  constructor(props) {
18
19
  super(props);
19
20
  this.setTooltipRef = this.setTooltipRef.bind(this);
20
21
  this.handleOver = this.handleOver.bind(this);
22
+ this.mouseOverDispatch = this.mouseOverDispatch.bind(this);
23
+ this.removeTimeout = this.removeTimeout.bind(this);
24
+ this.getContainerRef = this.getContainerRef.bind(this);
25
+ this.timer = null;
26
+ this.tooltipDebounce = getLibraryConfig('tooltipDebounce');
21
27
  }
22
28
 
23
- handleOver(e) {
29
+ mouseOverDispatch(e) {
24
30
  if (this.tooltipRef) {
25
31
  this.tooltipRef.handleOver(e);
26
32
  }
27
33
  }
28
34
 
35
+ removeTimeout() {
36
+ if (this.timer) {
37
+ this.timer = clearTimeout(this.timer);
38
+ }
39
+ }
40
+
41
+ handleOver(e) {
42
+ if (this.timer) {
43
+ this.timer = clearTimeout(this.timer);
44
+ }
45
+
46
+ this.timer = setTimeout(() => this.mouseOverDispatch(e), this.tooltipDebounce);
47
+ }
48
+
49
+ getContainerRef(ref) {
50
+ let {
51
+ eleRef
52
+ } = this.props;
53
+ this.containerElement = ref;
54
+ eleRef && eleRef(ref);
55
+ }
56
+
29
57
  setTooltipRef(ref) {
30
58
  this.tooltipRef = ref;
31
59
  }
32
60
 
61
+ componentDidMount() {
62
+ if (this.containerElement) {
63
+ this.containerElement.addEventListener('mouseover', this.handleOver, false);
64
+ this.containerElement.addEventListener('mouseout', this.removeTimeout, false);
65
+ }
66
+ }
67
+
68
+ componentWillUnmount() {
69
+ if (this.containerElement) {
70
+ this.containerElement.removeEventListener('mouseover', this.handleOver, false);
71
+ this.containerElement.addEventListener('mouseout', this.removeTimeout, false);
72
+ }
73
+ }
74
+
33
75
  render() {
34
76
  let {
35
77
  className,
36
78
  children,
37
79
  tagName,
38
80
  dataId,
39
- eleRef,
40
81
  tooltipClass,
41
82
  tooltipParentClass,
42
83
  customProps
@@ -47,11 +88,11 @@ export default class AppContainer extends React.Component {
47
88
  ExtraProps = {}
48
89
  } = customProps;
49
90
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Container, _extends({
50
- className: `${style.container} ${className}`,
51
- onMouseOver: this.handleOver,
91
+ className: `${style.container} ${className}` //onMouseOver={this.handleOver}
92
+ ,
52
93
  dataId: dataId,
53
94
  tagName: tagName,
54
- eleRef: eleRef
95
+ eleRef: this.getContainerRef
55
96
  }, ContainerProps, ExtraProps), /*#__PURE__*/React.createElement(Box, {
56
97
  flexible: true
57
98
  }, children)), /*#__PURE__*/React.createElement("div", _extends({}, ExtraProps, {
@@ -5,7 +5,8 @@ let id = {
5
5
  idPrefix: 'ZD',
6
6
  scrollFetchLimit: 80,
7
7
  isReducedMotion: false,
8
- direction: 'ltr'
8
+ direction: 'ltr',
9
+ tooltipDebounce: 175
9
10
  };
10
11
  export function getLibraryConfig(key) {
11
12
  return id[key];
@@ -42,7 +42,7 @@ export default class ResizeComponent extends React.Component {
42
42
  let newAdded = false;
43
43
  mutation.addedNodes.forEach(mut => {
44
44
  // Here we can listen for icon nodes. Confirm with bk
45
- if (mut.attributes['data-responsive'] && (childrenList.length !== this.querySelector().length || this.childrenCurrentList.length !== this.querySelector().length)) {
45
+ if (mut.attributes && mut.attributes['data-responsive'] && (childrenList.length !== this.querySelector().length || this.childrenCurrentList.length !== this.querySelector().length)) {
46
46
  newAdded = true;
47
47
  }
48
48
  });
@@ -33,6 +33,8 @@ require("@zohodesk/variables/lib/no_transitionVariables.module.css");
33
33
 
34
34
  var _AppContainerModule = _interopRequireDefault(require("./AppContainer.module.css"));
35
35
 
36
+ var _Config = require("../Provider/Config");
37
+
36
38
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
37
39
 
38
40
  function _extends() { _extends = Object.assign || 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); }
@@ -70,21 +72,69 @@ var AppContainer = /*#__PURE__*/function (_React$Component) {
70
72
  _this = _super.call(this, props);
71
73
  _this.setTooltipRef = _this.setTooltipRef.bind(_assertThisInitialized(_this));
72
74
  _this.handleOver = _this.handleOver.bind(_assertThisInitialized(_this));
75
+ _this.mouseOverDispatch = _this.mouseOverDispatch.bind(_assertThisInitialized(_this));
76
+ _this.removeTimeout = _this.removeTimeout.bind(_assertThisInitialized(_this));
77
+ _this.getContainerRef = _this.getContainerRef.bind(_assertThisInitialized(_this));
78
+ _this.timer = null;
79
+ _this.tooltipDebounce = (0, _Config.getLibraryConfig)('tooltipDebounce');
73
80
  return _this;
74
81
  }
75
82
 
76
83
  _createClass(AppContainer, [{
77
- key: "handleOver",
78
- value: function handleOver(e) {
84
+ key: "mouseOverDispatch",
85
+ value: function mouseOverDispatch(e) {
79
86
  if (this.tooltipRef) {
80
87
  this.tooltipRef.handleOver(e);
81
88
  }
82
89
  }
90
+ }, {
91
+ key: "removeTimeout",
92
+ value: function removeTimeout() {
93
+ if (this.timer) {
94
+ this.timer = clearTimeout(this.timer);
95
+ }
96
+ }
97
+ }, {
98
+ key: "handleOver",
99
+ value: function handleOver(e) {
100
+ var _this2 = this;
101
+
102
+ if (this.timer) {
103
+ this.timer = clearTimeout(this.timer);
104
+ }
105
+
106
+ this.timer = setTimeout(function () {
107
+ return _this2.mouseOverDispatch(e);
108
+ }, this.tooltipDebounce);
109
+ }
110
+ }, {
111
+ key: "getContainerRef",
112
+ value: function getContainerRef(ref) {
113
+ var eleRef = this.props.eleRef;
114
+ this.containerElement = ref;
115
+ eleRef && eleRef(ref);
116
+ }
83
117
  }, {
84
118
  key: "setTooltipRef",
85
119
  value: function setTooltipRef(ref) {
86
120
  this.tooltipRef = ref;
87
121
  }
122
+ }, {
123
+ key: "componentDidMount",
124
+ value: function componentDidMount() {
125
+ if (this.containerElement) {
126
+ this.containerElement.addEventListener('mouseover', this.handleOver, false);
127
+ this.containerElement.addEventListener('mouseout', this.removeTimeout, false);
128
+ }
129
+ }
130
+ }, {
131
+ key: "componentWillUnmount",
132
+ value: function componentWillUnmount() {
133
+ if (this.containerElement) {
134
+ this.containerElement.removeEventListener('mouseover', this.handleOver, false);
135
+ this.containerElement.addEventListener('mouseout', this.removeTimeout, false);
136
+ }
137
+ }
88
138
  }, {
89
139
  key: "render",
90
140
  value: function render() {
@@ -93,7 +143,6 @@ var AppContainer = /*#__PURE__*/function (_React$Component) {
93
143
  children = _this$props.children,
94
144
  tagName = _this$props.tagName,
95
145
  dataId = _this$props.dataId,
96
- eleRef = _this$props.eleRef,
97
146
  tooltipClass = _this$props.tooltipClass,
98
147
  tooltipParentClass = _this$props.tooltipParentClass,
99
148
  customProps = _this$props.customProps;
@@ -104,11 +153,11 @@ var AppContainer = /*#__PURE__*/function (_React$Component) {
104
153
  _customProps$ExtraPro = customProps.ExtraProps,
105
154
  ExtraProps = _customProps$ExtraPro === void 0 ? {} : _customProps$ExtraPro;
106
155
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_Layout.Container, _extends({
107
- className: "".concat(_AppContainerModule["default"].container, " ").concat(className),
108
- onMouseOver: this.handleOver,
156
+ className: "".concat(_AppContainerModule["default"].container, " ").concat(className) //onMouseOver={this.handleOver}
157
+ ,
109
158
  dataId: dataId,
110
159
  tagName: tagName,
111
- eleRef: eleRef
160
+ eleRef: this.getContainerRef
112
161
  }, ContainerProps, ExtraProps), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
113
162
  flexible: true
114
163
  }, children)), /*#__PURE__*/_react["default"].createElement("div", _extends({}, ExtraProps, {
@@ -12,7 +12,8 @@ var id = {
12
12
  idPrefix: 'ZD',
13
13
  scrollFetchLimit: 80,
14
14
  isReducedMotion: false,
15
- direction: 'ltr'
15
+ direction: 'ltr',
16
+ tooltipDebounce: 175
16
17
  };
17
18
 
18
19
  function getLibraryConfig(key) {
@@ -97,7 +97,7 @@ var ResizeComponent = /*#__PURE__*/function (_React$Component) {
97
97
  var newAdded = false;
98
98
  mutation.addedNodes.forEach(function (mut) {
99
99
  // Here we can listen for icon nodes. Confirm with bk
100
- if (mut.attributes['data-responsive'] && (childrenList.length !== _this2.querySelector().length || _this2.childrenCurrentList.length !== _this2.querySelector().length)) {
100
+ if (mut.attributes && mut.attributes['data-responsive'] && (childrenList.length !== _this2.querySelector().length || _this2.childrenCurrentList.length !== _this2.querySelector().length)) {
101
101
  newAdded = true;
102
102
  }
103
103
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/components",
3
- "version": "1.0.0-alpha-219",
3
+ "version": "1.0.0-alpha-220",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.js",
6
6
  "jsnext:main": "es/index.js",