@zohodesk/components 1.0.0-temp-208.2 → 1.0.0-temp-210

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.
Files changed (53) hide show
  1. package/README.md +7 -1
  2. package/es/Avatar/Avatar.module.css +175 -175
  3. package/es/AvatarTeam/AvatarTeam.module.css +189 -189
  4. package/es/Button/css/Button.module.css +527 -527
  5. package/es/Buttongroup/Buttongroup.module.css +104 -104
  6. package/es/CheckBox/CheckBox.module.css +157 -157
  7. package/es/DateTime/DateTime.module.css +248 -248
  8. package/es/DropBox/DropBoxElement/css/DropBoxElement.module.css +431 -431
  9. package/es/DropBox/css/DropBox.module.css +58 -58
  10. package/es/DropDown/DropDownHeading.module.css +53 -53
  11. package/es/DropDown/DropDownItem.module.css +94 -94
  12. package/es/Label/Label.module.css +57 -57
  13. package/es/ListItem/ListItem.module.css +205 -205
  14. package/es/PopOver/PopOver.module.css +8 -8
  15. package/es/Popup/Popup.js +96 -8
  16. package/es/Popup/props/propTypes.js +31 -0
  17. package/es/Radio/Radio.module.css +115 -115
  18. package/es/Ribbon/Ribbon.module.css +499 -499
  19. package/es/Switch/Switch.module.css +127 -127
  20. package/es/Tag/Tag.module.css +253 -253
  21. package/es/TextBox/TextBox.module.css +196 -196
  22. package/es/TextBoxIcon/TextBoxIcon.module.css +79 -79
  23. package/es/Textarea/Textarea.module.css +140 -140
  24. package/es/common/customscroll.module.css +141 -141
  25. package/es/v1/AppContainer/AppContainer.js +6 -0
  26. package/es/v1/Popup/Popup.js +96 -8
  27. package/lib/Avatar/Avatar.module.css +175 -175
  28. package/lib/AvatarTeam/AvatarTeam.module.css +189 -189
  29. package/lib/Button/css/Button.module.css +527 -527
  30. package/lib/Buttongroup/Buttongroup.module.css +104 -104
  31. package/lib/CheckBox/CheckBox.module.css +157 -157
  32. package/lib/DateTime/DateTime.module.css +248 -248
  33. package/lib/DropBox/DropBoxElement/css/DropBoxElement.module.css +431 -431
  34. package/lib/DropBox/css/DropBox.module.css +58 -58
  35. package/lib/DropDown/DropDownHeading.module.css +53 -53
  36. package/lib/DropDown/DropDownItem.module.css +94 -94
  37. package/lib/Label/Label.module.css +57 -57
  38. package/lib/ListItem/ListItem.module.css +205 -205
  39. package/lib/PopOver/PopOver.module.css +8 -8
  40. package/lib/Popup/Popup.js +105 -9
  41. package/lib/Popup/props/propTypes.js +44 -0
  42. package/lib/Radio/Radio.module.css +115 -115
  43. package/lib/Ribbon/Ribbon.module.css +499 -499
  44. package/lib/Switch/Switch.module.css +127 -127
  45. package/lib/Tag/Tag.module.css +253 -253
  46. package/lib/TextBox/TextBox.module.css +196 -196
  47. package/lib/TextBoxIcon/TextBoxIcon.module.css +79 -79
  48. package/lib/Textarea/Textarea.module.css +140 -140
  49. package/lib/common/customscroll.module.css +141 -141
  50. package/lib/v1/AppContainer/AppContainer.js +12 -0
  51. package/lib/v1/Popup/Popup.js +105 -9
  52. package/package.json +1 -1
  53. package/result.json +1 -1
@@ -1,205 +1,205 @@
1
- .varClass {
2
- /* listitem default variables */
3
- --listitem_text_color: var(--zdt_listitem_default_text);
4
- --listitem_padding: var(--zd_size9) var(--zd_size20);
5
- --listitem_border_width: 0;
6
- --listitem_border_color: var(--zdt_listitem_default_border);
7
- --listitem_bg_color: var(--zdt_listitem_default_bg);
8
- --listitem_active_bg_color: var(--zdt_listitem_primary_bg);
9
- --listitem_height: auto;
10
- --listitem_min_height: 0;
11
-
12
- /* listitem hover default variable */
13
- --listitem_highlight_bg_color: var(--zdt_listitem_highlight_bg);
14
-
15
- /* listitem tick icon default variables */
16
- --listitem_tickicon_color: var(--zdt_listitem_default_tickicon);
17
- }[dir=ltr] .varClass {
18
- --listitem_avatar_margin: 0 var(--zd_size15) 0 0;
19
- }[dir=rtl] .varClass {
20
- --listitem_avatar_margin: 0 0 0 var(--zd_size15);
21
- }
22
- .list {
23
- composes: varClass;
24
- position: relative;
25
- list-style: none;
26
- color: var(--listitem_text_color);
27
- font-size: var(--zd_font_size13) ;
28
- height: var(--listitem_height);
29
- min-height: var(--listitem_min_height);
30
- text-decoration: none;
31
- padding: var(--listitem_padding);
32
- border-width: var(--listitem_border_width);
33
- border-style: solid;
34
- border-color: var(--listitem_border_color);
35
- cursor: pointer;
36
- }
37
- .list, .default, .secondary {
38
- background-color: var(--listitem_bg_color);
39
- }
40
- [dir=ltr] .withBorder {
41
- --listitem_border_width: 0 0 0 1px /*rtl: 0 1px 0 0*/;
42
- }
43
- [dir=rtl] .withBorder {
44
- --listitem_border_width: 0 1px 0 0;
45
- }
46
- .active {
47
- --listitem_border_color: var(--zdt_listitem_active_border);
48
- }
49
- [dir=ltr] .small {
50
- --listitem_padding: var(--zd_size7) var(--zd_size3) var(--zd_size7) var(--zd_size5);
51
- }
52
- [dir=rtl] .small {
53
- --listitem_padding: var(--zd_size7) var(--zd_size5) var(--zd_size7) var(--zd_size3);
54
- }
55
- .medium {
56
- --listitem_padding: var(--zd_size7) var(--zd_size20);
57
- --listitem_min_height: var(--zd_size35);
58
- }
59
- .large {
60
- --listitem_height: var(--zd_size48);
61
- }
62
- [dir=ltr] .large {
63
- --listitem_padding: var(--zd_size10) var(--zd_size3) var(--zd_size10) var(--zd_size25);
64
- }
65
- [dir=rtl] .large {
66
- --listitem_padding: var(--zd_size10) var(--zd_size25) var(--zd_size10) var(--zd_size3);
67
- }
68
- .value,
69
- .children {
70
- composes: dotted from '../common/common.module.css';
71
- }
72
- .value, .multiLineValue {
73
- line-height: 1.5385;
74
- }
75
- .multiLineValue{
76
- word-break: break-word;
77
- composes: clamp from '../common/common.module.css'
78
- }
79
- .iconBox {
80
- width: var(--zd_size20) ;
81
- text-align: center;
82
- }
83
- [dir=ltr] .iconBox {
84
- margin-right: var(--zd_size10) ;
85
- }
86
- [dir=rtl] .iconBox {
87
- margin-left: var(--zd_size10) ;
88
- }
89
- .iconBox,
90
- .leftAvatar {
91
- font-size: 0 ;
92
- }
93
- .leftAvatar {
94
- margin: var(--listitem_avatar_margin);
95
- }
96
-
97
- .defaultHover, .primaryHover, .secondaryHover, .darkHover {
98
- background-color: var(--listitem_highlight_bg_color);
99
- }
100
- .activewithBorder {
101
- --listitem_border_color: var(--zdt_listitem_active_border);
102
- }
103
- [dir=ltr] .activewithBorder {
104
- --listitem_border_width: 0 0 0 1px /*rtl: 0 1px 0 0*/;
105
- }
106
- [dir=rtl] .activewithBorder {
107
- --listitem_border_width: 0 1px 0 0;
108
- }
109
-
110
- .defaultHover,
111
- .defaultEffect:hover
112
- /* .defaultEffect:focus */
113
- {
114
- --listitem_bg_color: var(--zdt_listitem_highlight_bg);
115
- }
116
- .primaryHover,
117
- .primaryEffect:hover
118
- /* .primaryEffect:focus */
119
- {
120
- --listitem_bg_color: var(--zdt_listitem_primary_bg);
121
- --listitem_highlight_bg_color: var(--zdt_listitem_primary_bg);
122
- }
123
- .secondaryHover,
124
- .secondaryEffect:hover
125
- /* .secondaryEffect:focus */
126
- {
127
- --listitem_bg_color: var(--zdt_listitem_secondary_bg);
128
- --listitem_highlight_bg_color: var(--zdt_listitem_secondary_bg);
129
- --listitem_text_color: var(--zdt_listitem_secondary_text);
130
- }
131
- .darkHover,
132
- .darkEffect:hover
133
- /* .darkEffect:focus */
134
- {
135
- --listitem_bg_color: var(--zdt_listitem_dark_effect_bg);
136
- --listitem_highlight_bg_color: var(--zdt_listitem_dark_effect_bg);
137
- }
138
- .activedefault, .activeprimary, .activesecondary, .activedark {
139
- background-color: var(--listitem_active_bg_color);
140
- }
141
- .activedefault,
142
- .activedefault:hover,
143
- .activeprimary,
144
- .activeprimary:hover {
145
- --listitem_active_bg_color: var(--zdt_listitem_primary_bg);
146
- }
147
- .activesecondary {
148
- --listitem_active_bg_color: var(--zdt_listitem_secondary_bg);
149
- --listitem_text_color: var(--zdt_listitem_secondary_text);
150
- }
151
- .dark {
152
- --listitem_bg_color: var(--zdt_listitem_dark_bg);
153
- --listitem_text_color: var(--zdt_listitem_dark_text);
154
- }
155
- .activedark {
156
- --listitem_active_bg_color: var(--zdt_listitem_dark_active_bg);
157
- }
158
-
159
- .tickIcon,
160
- .defaultTick,
161
- .darkTick {
162
- position: absolute;
163
- color: var(--listitem_tickicon_color);
164
- }
165
-
166
- [dir=ltr] .tickIcon, [dir=ltr] .defaultTick, [dir=ltr] .darkTick {
167
- right: var(--zd_size20) ;
168
- }
169
-
170
- [dir=rtl] .tickIcon, [dir=rtl] .defaultTick, [dir=rtl] .darkTick {
171
- left: var(--zd_size20) ;
172
- }
173
- .defaultTick {
174
- --listitem_tickicon_color: var(--zdt_listitem_default_tickicon);
175
- }
176
- .darkTick {
177
- --listitem_tickicon_color: var(--zdt_listitem_dark_tickicon);
178
- }
179
- .defaultTick > i {
180
- display: block;
181
- }
182
- [dir=ltr] .smallwithTick {
183
- --listitem_padding: var(--zd_size7) var(--zd_size39) var(--zd_size7) var(--zd_size5);
184
- }
185
- [dir=rtl] .smallwithTick {
186
- --listitem_padding: var(--zd_size7) var(--zd_size5) var(--zd_size7) var(--zd_size39);
187
- }
188
- [dir=ltr] .mediumwithTick {
189
- --listitem_padding: var(--zd_size7) var(--zd_size39) var(--zd_size7) var(--zd_size20);
190
- }
191
- [dir=rtl] .mediumwithTick {
192
- --listitem_padding: var(--zd_size7) var(--zd_size20) var(--zd_size7) var(--zd_size39);
193
- }
194
- [dir=ltr] .largewithTick {
195
- --listitem_padding: var(--zd_size10) var(--zd_size39) var(--zd_size10) var(--zd_size25);
196
- }
197
- [dir=rtl] .largewithTick {
198
- --listitem_padding: var(--zd_size10) var(--zd_size25) var(--zd_size10) var(--zd_size39);
199
- }
200
- .responsiveHeight {
201
- --listitem_min_height: var(--zd_size45);
202
- font-size: var(--zd_font_size15) ;
203
- padding-top: var(--zd_size10) ;
204
- padding-bottom: var(--zd_size10) ;
205
- }
1
+ .varClass {
2
+ /* listitem default variables */
3
+ --listitem_text_color: var(--zdt_listitem_default_text);
4
+ --listitem_padding: var(--zd_size9) var(--zd_size20);
5
+ --listitem_border_width: 0;
6
+ --listitem_border_color: var(--zdt_listitem_default_border);
7
+ --listitem_bg_color: var(--zdt_listitem_default_bg);
8
+ --listitem_active_bg_color: var(--zdt_listitem_primary_bg);
9
+ --listitem_height: auto;
10
+ --listitem_min_height: 0;
11
+
12
+ /* listitem hover default variable */
13
+ --listitem_highlight_bg_color: var(--zdt_listitem_highlight_bg);
14
+
15
+ /* listitem tick icon default variables */
16
+ --listitem_tickicon_color: var(--zdt_listitem_default_tickicon);
17
+ }[dir=ltr] .varClass {
18
+ --listitem_avatar_margin: 0 var(--zd_size15) 0 0;
19
+ }[dir=rtl] .varClass {
20
+ --listitem_avatar_margin: 0 0 0 var(--zd_size15);
21
+ }
22
+ .list {
23
+ composes: varClass;
24
+ position: relative;
25
+ list-style: none;
26
+ color: var(--listitem_text_color);
27
+ font-size: var(--zd_font_size13) ;
28
+ height: var(--listitem_height);
29
+ min-height: var(--listitem_min_height);
30
+ text-decoration: none;
31
+ padding: var(--listitem_padding);
32
+ border-width: var(--listitem_border_width);
33
+ border-style: solid;
34
+ border-color: var(--listitem_border_color);
35
+ cursor: pointer;
36
+ }
37
+ .list, .default, .secondary {
38
+ background-color: var(--listitem_bg_color);
39
+ }
40
+ [dir=ltr] .withBorder {
41
+ --listitem_border_width: 0 0 0 1px /*rtl: 0 1px 0 0*/;
42
+ }
43
+ [dir=rtl] .withBorder {
44
+ --listitem_border_width: 0 1px 0 0;
45
+ }
46
+ .active {
47
+ --listitem_border_color: var(--zdt_listitem_active_border);
48
+ }
49
+ [dir=ltr] .small {
50
+ --listitem_padding: var(--zd_size7) var(--zd_size3) var(--zd_size7) var(--zd_size5);
51
+ }
52
+ [dir=rtl] .small {
53
+ --listitem_padding: var(--zd_size7) var(--zd_size5) var(--zd_size7) var(--zd_size3);
54
+ }
55
+ .medium {
56
+ --listitem_padding: var(--zd_size7) var(--zd_size20);
57
+ --listitem_min_height: var(--zd_size35);
58
+ }
59
+ .large {
60
+ --listitem_height: var(--zd_size48);
61
+ }
62
+ [dir=ltr] .large {
63
+ --listitem_padding: var(--zd_size10) var(--zd_size3) var(--zd_size10) var(--zd_size25);
64
+ }
65
+ [dir=rtl] .large {
66
+ --listitem_padding: var(--zd_size10) var(--zd_size25) var(--zd_size10) var(--zd_size3);
67
+ }
68
+ .value,
69
+ .children {
70
+ composes: dotted from '../common/common.module.css';
71
+ }
72
+ .value, .multiLineValue {
73
+ line-height: 1.5385;
74
+ }
75
+ .multiLineValue{
76
+ word-break: break-word;
77
+ composes: clamp from '../common/common.module.css'
78
+ }
79
+ .iconBox {
80
+ width: var(--zd_size20) ;
81
+ text-align: center;
82
+ }
83
+ [dir=ltr] .iconBox {
84
+ margin-right: var(--zd_size10) ;
85
+ }
86
+ [dir=rtl] .iconBox {
87
+ margin-left: var(--zd_size10) ;
88
+ }
89
+ .iconBox,
90
+ .leftAvatar {
91
+ font-size: 0 ;
92
+ }
93
+ .leftAvatar {
94
+ margin: var(--listitem_avatar_margin);
95
+ }
96
+
97
+ .defaultHover, .primaryHover, .secondaryHover, .darkHover {
98
+ background-color: var(--listitem_highlight_bg_color);
99
+ }
100
+ .activewithBorder {
101
+ --listitem_border_color: var(--zdt_listitem_active_border);
102
+ }
103
+ [dir=ltr] .activewithBorder {
104
+ --listitem_border_width: 0 0 0 1px /*rtl: 0 1px 0 0*/;
105
+ }
106
+ [dir=rtl] .activewithBorder {
107
+ --listitem_border_width: 0 1px 0 0;
108
+ }
109
+
110
+ .defaultHover,
111
+ .defaultEffect:hover
112
+ /* .defaultEffect:focus */
113
+ {
114
+ --listitem_bg_color: var(--zdt_listitem_highlight_bg);
115
+ }
116
+ .primaryHover,
117
+ .primaryEffect:hover
118
+ /* .primaryEffect:focus */
119
+ {
120
+ --listitem_bg_color: var(--zdt_listitem_primary_bg);
121
+ --listitem_highlight_bg_color: var(--zdt_listitem_primary_bg);
122
+ }
123
+ .secondaryHover,
124
+ .secondaryEffect:hover
125
+ /* .secondaryEffect:focus */
126
+ {
127
+ --listitem_bg_color: var(--zdt_listitem_secondary_bg);
128
+ --listitem_highlight_bg_color: var(--zdt_listitem_secondary_bg);
129
+ --listitem_text_color: var(--zdt_listitem_secondary_text);
130
+ }
131
+ .darkHover,
132
+ .darkEffect:hover
133
+ /* .darkEffect:focus */
134
+ {
135
+ --listitem_bg_color: var(--zdt_listitem_dark_effect_bg);
136
+ --listitem_highlight_bg_color: var(--zdt_listitem_dark_effect_bg);
137
+ }
138
+ .activedefault, .activeprimary, .activesecondary, .activedark {
139
+ background-color: var(--listitem_active_bg_color);
140
+ }
141
+ .activedefault,
142
+ .activedefault:hover,
143
+ .activeprimary,
144
+ .activeprimary:hover {
145
+ --listitem_active_bg_color: var(--zdt_listitem_primary_bg);
146
+ }
147
+ .activesecondary {
148
+ --listitem_active_bg_color: var(--zdt_listitem_secondary_bg);
149
+ --listitem_text_color: var(--zdt_listitem_secondary_text);
150
+ }
151
+ .dark {
152
+ --listitem_bg_color: var(--zdt_listitem_dark_bg);
153
+ --listitem_text_color: var(--zdt_listitem_dark_text);
154
+ }
155
+ .activedark {
156
+ --listitem_active_bg_color: var(--zdt_listitem_dark_active_bg);
157
+ }
158
+
159
+ .tickIcon,
160
+ .defaultTick,
161
+ .darkTick {
162
+ position: absolute;
163
+ color: var(--listitem_tickicon_color);
164
+ }
165
+
166
+ [dir=ltr] .tickIcon, [dir=ltr] .defaultTick, [dir=ltr] .darkTick {
167
+ right: var(--zd_size20) ;
168
+ }
169
+
170
+ [dir=rtl] .tickIcon, [dir=rtl] .defaultTick, [dir=rtl] .darkTick {
171
+ left: var(--zd_size20) ;
172
+ }
173
+ .defaultTick {
174
+ --listitem_tickicon_color: var(--zdt_listitem_default_tickicon);
175
+ }
176
+ .darkTick {
177
+ --listitem_tickicon_color: var(--zdt_listitem_dark_tickicon);
178
+ }
179
+ .defaultTick > i {
180
+ display: block;
181
+ }
182
+ [dir=ltr] .smallwithTick {
183
+ --listitem_padding: var(--zd_size7) var(--zd_size39) var(--zd_size7) var(--zd_size5);
184
+ }
185
+ [dir=rtl] .smallwithTick {
186
+ --listitem_padding: var(--zd_size7) var(--zd_size5) var(--zd_size7) var(--zd_size39);
187
+ }
188
+ [dir=ltr] .mediumwithTick {
189
+ --listitem_padding: var(--zd_size7) var(--zd_size39) var(--zd_size7) var(--zd_size20);
190
+ }
191
+ [dir=rtl] .mediumwithTick {
192
+ --listitem_padding: var(--zd_size7) var(--zd_size20) var(--zd_size7) var(--zd_size39);
193
+ }
194
+ [dir=ltr] .largewithTick {
195
+ --listitem_padding: var(--zd_size10) var(--zd_size39) var(--zd_size10) var(--zd_size25);
196
+ }
197
+ [dir=rtl] .largewithTick {
198
+ --listitem_padding: var(--zd_size10) var(--zd_size25) var(--zd_size10) var(--zd_size39);
199
+ }
200
+ .responsiveHeight {
201
+ --listitem_min_height: var(--zd_size45);
202
+ font-size: var(--zd_font_size15) ;
203
+ padding-top: var(--zd_size10) ;
204
+ padding-bottom: var(--zd_size10) ;
205
+ }
@@ -1,9 +1,9 @@
1
- .popup {
2
- position: relative;
3
- background-color: var(--zdt_popover_default_bg);
4
- }
5
-
6
- .target {
7
- composes: offSelection from '../common/common.module.css';
8
- cursor: pointer;
1
+ .popup {
2
+ position: relative;
3
+ background-color: var(--zdt_popover_default_bg);
4
+ }
5
+
6
+ .target {
7
+ composes: offSelection from '../common/common.module.css';
8
+ cursor: pointer;
9
9
  }
package/es/Popup/Popup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**** Libraries ****/
2
2
  import React from 'react';
3
- import PropTypes from 'prop-types';
4
3
  import hoistStatics from 'hoist-non-react-statics';
4
+ import { PopupPropTypes, ContextTypes } from "./props/propTypes";
5
5
  /**** Methods ****/
6
6
 
7
7
  import { debounce, isDescendant, isTextSelected, cancelBubblingEffect } from "../utils/Common.js";
@@ -89,6 +89,11 @@ const Popup = function (Component) {
89
89
  this.handleDocumentMouseDown = this.handleDocumentMouseDown.bind(this);
90
90
  this.handleDocumentFocus = this.handleDocumentFocus.bind(this);
91
91
  this.handleGetNeedPrevent = this.handleGetNeedPrevent.bind(this);
92
+ this.handleBlockScroll = this.handleBlockScroll.bind(this);
93
+ this.handlePositionChange = this.handlePositionChange.bind(this);
94
+ this.preventKeyboardScroll = this.preventKeyboardScroll.bind(this);
95
+ this.addScrollBlockListeners = this.addScrollBlockListeners.bind(this);
96
+ this.removeScrollBlockListeners = this.removeScrollBlockListeners.bind(this);
92
97
  this.popupObserver = new ResizeObserver(this.handlePopupResize); //dropBoxSize
93
98
 
94
99
  this.size = null;
@@ -101,6 +106,7 @@ const Popup = function (Component) {
101
106
  scrollDebounceTime
102
107
  } = this.getScrollDebounceTime(this);
103
108
  this.handleScroll = debounce(this.handleScroll.bind(this), scrollDebounceTime);
109
+ this.handleDebouncedPositionChange = debounce(this.handlePositionChange.bind(this), 100);
104
110
  }
105
111
 
106
112
  componentDidMount() {
@@ -144,7 +150,9 @@ const Popup = function (Component) {
144
150
  dropElement
145
151
  } = this;
146
152
  const {
147
- needResizeHandling: propResizeHandling
153
+ needResizeHandling: propResizeHandling,
154
+ isAbsolutePositioningNeeded,
155
+ isBlockedOutsideScroll
148
156
  } = this.props;
149
157
 
150
158
  if (oldStateOpen !== isPopupReady) {
@@ -154,6 +162,14 @@ const Popup = function (Component) {
154
162
  this.size = null;
155
163
  this.popupObserver.disconnect();
156
164
  }
165
+
166
+ if (isBlockedOutsideScroll && !isAbsolutePositioningNeeded) {
167
+ if (isPopupReady) {
168
+ this.addScrollBlockListeners();
169
+ } else {
170
+ this.removeScrollBlockListeners();
171
+ }
172
+ }
157
173
  }
158
174
  }
159
175
 
@@ -169,6 +185,7 @@ const Popup = function (Component) {
169
185
 
170
186
  return res;
171
187
  }, popups);
188
+ this.removeScrollBlockListeners();
172
189
  let noPopups = true;
173
190
 
174
191
  for (const i in popups) {
@@ -193,6 +210,76 @@ const Popup = function (Component) {
193
210
  }
194
211
  }
195
212
 
213
+ addScrollBlockListeners() {
214
+ document.addEventListener('wheel', this.handleBlockScroll, {
215
+ capture: true,
216
+ passive: false
217
+ });
218
+ document.addEventListener('touchmove', this.handleBlockScroll, {
219
+ capture: true,
220
+ passive: false
221
+ });
222
+ document.addEventListener('scroll', this.handleDebouncedPositionChange, {
223
+ capture: true,
224
+ passive: false
225
+ });
226
+ document.addEventListener('keydown', this.preventKeyboardScroll, {
227
+ capture: true,
228
+ passive: false
229
+ });
230
+ }
231
+
232
+ removeScrollBlockListeners() {
233
+ document.removeEventListener('wheel', this.handleBlockScroll, {
234
+ capture: true,
235
+ passive: false
236
+ });
237
+ document.removeEventListener('touchmove', this.handleBlockScroll, {
238
+ capture: true,
239
+ passive: false
240
+ });
241
+ document.removeEventListener('scroll', this.handleDebouncedPositionChange, {
242
+ capture: true,
243
+ passive: false
244
+ });
245
+ document.removeEventListener('keydown', this.preventKeyboardScroll, {
246
+ capture: true,
247
+ passive: false
248
+ });
249
+ }
250
+
251
+ handleBlockScroll(event) {
252
+ // const targetElement = this.placeHolderElement;
253
+ const containerElement = this.dropElement;
254
+
255
+ if (containerElement && containerElement !== event.target && !containerElement.contains(event.target)) {
256
+ // --- Scroll exclude Target & Container elements --- For reference. Will adopt in future
257
+ // if(
258
+ // (containerElement && (containerElement !== event.target && !containerElement.contains(event.target)))
259
+ // && (targetElement && (targetElement !== event.target && !targetElement.contains(event.target)))
260
+ // ) {
261
+ event.preventDefault();
262
+ }
263
+ }
264
+
265
+ handlePositionChange(event) {
266
+ const targetElement = this.placeHolderElement;
267
+ const containerElement = this.dropElement;
268
+
269
+ if (containerElement && containerElement !== event.target && !containerElement.contains(event.target) && targetElement && targetElement !== event.target && !targetElement.contains(event.target) && event.target.contains(targetElement)) {
270
+ this.handlePopupPosition(this.state.position);
271
+ }
272
+ }
273
+
274
+ preventKeyboardScroll(event) {
275
+ const containerElement = this.dropElement;
276
+ const keys = [32, 37, 38, 39, 40]; // Space, Arrow keys
277
+
278
+ if (containerElement && containerElement !== event.target && !containerElement.contains(event.target) && keys.includes(event.keyCode)) {
279
+ event.preventDefault();
280
+ }
281
+ }
282
+
196
283
  getGroup() {
197
284
  const {
198
285
  popupGroup
@@ -523,13 +610,15 @@ const Popup = function (Component) {
523
610
  } = betterPosition || {};
524
611
  const {
525
612
  left: oldLeft = '',
526
- top: oldTop = ''
613
+ top: oldTop = '',
614
+ bottom: oldBottom = ''
527
615
  } = positionsOffset[position] || {};
528
616
  const {
529
617
  left = '',
530
- top = ''
618
+ top = '',
619
+ bottom = ''
531
620
  } = viewsOffset[view] || {};
532
- const changeState = isAbsolute ? position !== view : oldLeft !== left || oldTop !== top; // let isInViewPort = viewPort.isInViewPort(
621
+ const changeState = isAbsolute ? position !== view : oldLeft !== left || oldTop !== top || oldBottom !== bottom; // let isInViewPort = viewPort.isInViewPort(
533
622
  // placeHolderElement,
534
623
  // scrollContainer
535
624
  // );
@@ -635,9 +724,8 @@ const Popup = function (Component) {
635
724
  }
636
725
 
637
726
  Popup.displayName = Component.displayName || Component.name || Popup.name;
638
- Popup.contextTypes = {
639
- direction: PropTypes.string
640
- };
727
+ Popup.contextTypes = ContextTypes;
728
+ Popup.propTypes = PopupPropTypes;
641
729
  return hoistStatics(Popup, Component);
642
730
  };
643
731
 
@@ -0,0 +1,31 @@
1
+ import PropTypes from 'prop-types';
2
+ export const ContextTypes = {
3
+ direction: PropTypes.string
4
+ };
5
+ export const PopupPropTypes = {
6
+ popupGroup: PropTypes.string,
7
+ isArrow: PropTypes.bool,
8
+ isPopupOpen: PropTypes.bool,
9
+ closeOnScroll: PropTypes.bool,
10
+ isBlockedOutsideScroll: PropTypes.bool,
11
+ needResizeHandling: PropTypes.bool,
12
+ isAbsolutePositioningNeeded: PropTypes.bool,
13
+ scrollDebounceTime: PropTypes.number,
14
+ customOrder: PropTypes.arrayOf(PropTypes.string),
15
+ checkBeforeClose: PropTypes.func
16
+ };
17
+ export const PopupWrappersPropTypes = {
18
+ openPopupOnly: PropTypes.func,
19
+ closePopupOnly: PropTypes.func,
20
+ togglePopup: PropTypes.func,
21
+ removeClose: PropTypes.func,
22
+ isPopupOpen: PropTypes.bool,
23
+ isPopupReady: PropTypes.bool,
24
+ position: PropTypes.oneOf(['bottomRight', 'bottomLeft', 'bottomCenter', 'topRight', 'topLeft', 'topCenter', 'rightTop', 'rightBottom', 'rightCenter', 'leftTop', 'leftBottom', 'leftCenter']),
25
+ getTargetRef: PropTypes.func,
26
+ getContainerRef: PropTypes.func,
27
+ isAbsolutePositioningNeeded: PropTypes.bool,
28
+ isRestrictScroll: PropTypes.bool,
29
+ positionsOffset: PropTypes.object,
30
+ targetOffset: PropTypes.object
31
+ };