@zohodesk/components 1.0.0-temp-210.1 → 1.0.0-temp-199.2
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 +4 -4
- package/es/DateTime/CalendarView.js +9 -7
- package/es/ListItem/ListItem.js +2 -2
- package/es/ListItem/ListItem.module.css +85 -18
- package/es/ListItem/ListItemWithAvatar.js +3 -3
- package/es/ListItem/ListItemWithIcon.js +2 -2
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +7 -2
- package/es/MultiSelect/AdvancedMultiSelect.js +2 -1
- package/es/MultiSelect/MultiSelect.js +7 -2
- package/es/MultiSelect/Suggestions.js +8 -4
- package/es/MultiSelect/props/defaultProps.js +6 -4
- package/es/MultiSelect/props/propTypes.js +4 -2
- package/es/Popup/Popup.js +8 -97
- package/es/Select/GroupSelect.js +7 -2
- package/es/Select/SelectWithAvatar.js +7 -2
- package/es/Select/SelectWithIcon.js +4 -2
- package/es/Select/props/defaultProps.js +4 -2
- package/es/Select/props/propTypes.js +4 -2
- package/es/v1/Popup/Popup.js +8 -96
- package/lib/DateTime/CalendarView.js +9 -7
- package/lib/ListItem/ListItem.js +2 -2
- package/lib/ListItem/ListItem.module.css +85 -18
- package/lib/ListItem/ListItemWithAvatar.js +3 -3
- package/lib/ListItem/ListItemWithIcon.js +2 -2
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +7 -3
- package/lib/MultiSelect/AdvancedMultiSelect.js +3 -1
- package/lib/MultiSelect/MultiSelect.js +6 -3
- package/lib/MultiSelect/Suggestions.js +8 -4
- package/lib/MultiSelect/props/defaultProps.js +6 -4
- package/lib/MultiSelect/props/propTypes.js +6 -5
- package/lib/Popup/Popup.js +9 -106
- package/lib/Select/GroupSelect.js +8 -3
- package/lib/Select/SelectWithAvatar.js +8 -3
- package/lib/Select/SelectWithIcon.js +5 -3
- package/lib/Select/props/defaultProps.js +4 -2
- package/lib/Select/props/propTypes.js +4 -2
- package/lib/v1/Popup/Popup.js +9 -105
- package/package.json +4 -4
- package/result.json +1 -1
- package/es/Popup/props/propTypes.js +0 -31
- package/lib/Popup/props/propTypes.js +0 -44
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';
|
|
3
4
|
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,11 +89,6 @@ 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);
|
|
97
92
|
this.popupObserver = new ResizeObserver(this.handlePopupResize); //dropBoxSize
|
|
98
93
|
|
|
99
94
|
this.size = null;
|
|
@@ -106,7 +101,6 @@ const Popup = function (Component) {
|
|
|
106
101
|
scrollDebounceTime
|
|
107
102
|
} = this.getScrollDebounceTime(this);
|
|
108
103
|
this.handleScroll = debounce(this.handleScroll.bind(this), scrollDebounceTime);
|
|
109
|
-
this.handleDebouncedPositionChange = debounce(this.handlePositionChange.bind(this), 100);
|
|
110
104
|
}
|
|
111
105
|
|
|
112
106
|
componentDidMount() {
|
|
@@ -150,9 +144,7 @@ const Popup = function (Component) {
|
|
|
150
144
|
dropElement
|
|
151
145
|
} = this;
|
|
152
146
|
const {
|
|
153
|
-
needResizeHandling: propResizeHandling
|
|
154
|
-
isAbsolutePositioningNeeded,
|
|
155
|
-
isBlockedOutsideScroll
|
|
147
|
+
needResizeHandling: propResizeHandling
|
|
156
148
|
} = this.props;
|
|
157
149
|
|
|
158
150
|
if (oldStateOpen !== isPopupReady) {
|
|
@@ -162,14 +154,6 @@ const Popup = function (Component) {
|
|
|
162
154
|
this.size = null;
|
|
163
155
|
this.popupObserver.disconnect();
|
|
164
156
|
}
|
|
165
|
-
|
|
166
|
-
if (isBlockedOutsideScroll && !isAbsolutePositioningNeeded) {
|
|
167
|
-
if (isPopupReady) {
|
|
168
|
-
this.addScrollBlockListeners();
|
|
169
|
-
} else {
|
|
170
|
-
this.removeScrollBlockListeners();
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
157
|
}
|
|
174
158
|
}
|
|
175
159
|
|
|
@@ -185,7 +169,6 @@ const Popup = function (Component) {
|
|
|
185
169
|
|
|
186
170
|
return res;
|
|
187
171
|
}, popups);
|
|
188
|
-
this.removeScrollBlockListeners();
|
|
189
172
|
let noPopups = true;
|
|
190
173
|
|
|
191
174
|
for (const i in popups) {
|
|
@@ -210,77 +193,6 @@ const Popup = function (Component) {
|
|
|
210
193
|
}
|
|
211
194
|
}
|
|
212
195
|
|
|
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
|
-
this.closePopupOnly(event);
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
preventKeyboardScroll(event) {
|
|
276
|
-
const containerElement = this.dropElement;
|
|
277
|
-
const keys = [32, 37, 38, 39, 40]; // Space, Arrow keys
|
|
278
|
-
|
|
279
|
-
if (containerElement && containerElement !== event.target && !containerElement.contains(event.target) && keys.includes(event.keyCode)) {
|
|
280
|
-
event.preventDefault();
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
|
|
284
196
|
getGroup() {
|
|
285
197
|
const {
|
|
286
198
|
popupGroup
|
|
@@ -611,15 +523,13 @@ const Popup = function (Component) {
|
|
|
611
523
|
} = betterPosition || {};
|
|
612
524
|
const {
|
|
613
525
|
left: oldLeft = '',
|
|
614
|
-
top: oldTop = ''
|
|
615
|
-
bottom: oldBottom = ''
|
|
526
|
+
top: oldTop = ''
|
|
616
527
|
} = positionsOffset[position] || {};
|
|
617
528
|
const {
|
|
618
529
|
left = '',
|
|
619
|
-
top = ''
|
|
620
|
-
bottom = ''
|
|
530
|
+
top = ''
|
|
621
531
|
} = viewsOffset[view] || {};
|
|
622
|
-
const changeState = isAbsolute ? position !== view : oldLeft !== left || oldTop !== top
|
|
532
|
+
const changeState = isAbsolute ? position !== view : oldLeft !== left || oldTop !== top; // let isInViewPort = viewPort.isInViewPort(
|
|
623
533
|
// placeHolderElement,
|
|
624
534
|
// scrollContainer
|
|
625
535
|
// );
|
|
@@ -725,8 +635,9 @@ const Popup = function (Component) {
|
|
|
725
635
|
}
|
|
726
636
|
|
|
727
637
|
Popup.displayName = Component.displayName || Component.name || Popup.name;
|
|
728
|
-
Popup.contextTypes =
|
|
729
|
-
|
|
638
|
+
Popup.contextTypes = {
|
|
639
|
+
direction: PropTypes.string
|
|
640
|
+
};
|
|
730
641
|
return hoistStatics(Popup, Component);
|
|
731
642
|
};
|
|
732
643
|
|
package/es/Select/GroupSelect.js
CHANGED
|
@@ -588,8 +588,12 @@ export class GroupSelectComponent extends PureComponent {
|
|
|
588
588
|
htmlId,
|
|
589
589
|
iconOnHover,
|
|
590
590
|
isLoading,
|
|
591
|
-
dataSelectorId
|
|
591
|
+
dataSelectorId,
|
|
592
|
+
customProps
|
|
592
593
|
} = this.props;
|
|
594
|
+
const {
|
|
595
|
+
suggestionsProps = {}
|
|
596
|
+
} = customProps;
|
|
593
597
|
i18nKeys = Object.assign({}, i18nKeys, {
|
|
594
598
|
emptyText: i18nKeys.emptyText || emptyMessage,
|
|
595
599
|
searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage
|
|
@@ -782,7 +786,8 @@ export class GroupSelectComponent extends PureComponent {
|
|
|
782
786
|
ariaParentRole: 'listbox',
|
|
783
787
|
role: 'option'
|
|
784
788
|
},
|
|
785
|
-
dataId: `${dataId}_Options
|
|
789
|
+
dataId: `${dataId}_Options`,
|
|
790
|
+
...suggestionsProps
|
|
786
791
|
}));
|
|
787
792
|
}) : /*#__PURE__*/React.createElement(EmptyState, {
|
|
788
793
|
options: revampedGroups,
|
|
@@ -163,8 +163,12 @@ class SelectWithAvatarComponent extends SelectComponent {
|
|
|
163
163
|
needEffect,
|
|
164
164
|
isLoading,
|
|
165
165
|
dataSelectorId,
|
|
166
|
-
getTargetRef
|
|
166
|
+
getTargetRef,
|
|
167
|
+
customProps
|
|
167
168
|
} = this.props;
|
|
169
|
+
const {
|
|
170
|
+
suggestionsProps = {}
|
|
171
|
+
} = customProps;
|
|
168
172
|
i18nKeys = Object.assign({}, i18nKeys, {
|
|
169
173
|
emptyText: i18nKeys.emptyText || emptyMessage,
|
|
170
174
|
searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage
|
|
@@ -321,7 +325,8 @@ class SelectWithAvatarComponent extends SelectComponent {
|
|
|
321
325
|
a11y: {
|
|
322
326
|
ariaParentRole: 'listbox',
|
|
323
327
|
role: 'option'
|
|
324
|
-
}
|
|
328
|
+
},
|
|
329
|
+
...suggestionsProps
|
|
325
330
|
}) : /*#__PURE__*/React.createElement(EmptyState, {
|
|
326
331
|
isLoading: isFetchingOptions,
|
|
327
332
|
options: options,
|
|
@@ -367,7 +367,8 @@ class SelectWithIcon extends Component {
|
|
|
367
367
|
let {
|
|
368
368
|
TextBoxProps = {},
|
|
369
369
|
DropdownSearchTextBoxProps = {},
|
|
370
|
-
TextBoxIconProps = {}
|
|
370
|
+
TextBoxIconProps = {},
|
|
371
|
+
listItemProps = {}
|
|
371
372
|
} = customProps;
|
|
372
373
|
return /*#__PURE__*/React.createElement("div", {
|
|
373
374
|
className: `${style.container} ${style[`box_${size}`]} ${isReadOnly ? style.readonly : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''}`,
|
|
@@ -530,7 +531,8 @@ class SelectWithIcon extends Component {
|
|
|
530
531
|
role: 'option',
|
|
531
532
|
ariaSelected: selectedId === options[idKey],
|
|
532
533
|
ariaLabel: options[valueKey]
|
|
533
|
-
}
|
|
534
|
+
},
|
|
535
|
+
...listItemProps
|
|
534
536
|
});
|
|
535
537
|
})) : /*#__PURE__*/React.createElement(EmptyState, {
|
|
536
538
|
isLoading: isFetchingOptions,
|
|
@@ -69,7 +69,8 @@ export const GroupSelect_defaultProps = {
|
|
|
69
69
|
isRestrictScroll: false,
|
|
70
70
|
i18nKeys: {},
|
|
71
71
|
iconOnHover: false,
|
|
72
|
-
isLoading: false
|
|
72
|
+
isLoading: false,
|
|
73
|
+
customProps: {}
|
|
73
74
|
};
|
|
74
75
|
export const SelectWithAvatar_defaultProps = {
|
|
75
76
|
animationStyle: 'bounce',
|
|
@@ -95,7 +96,8 @@ export const SelectWithAvatar_defaultProps = {
|
|
|
95
96
|
isRestrictScroll: false,
|
|
96
97
|
i18nKeys: {},
|
|
97
98
|
needEffect: true,
|
|
98
|
-
isLoading: false
|
|
99
|
+
isLoading: false,
|
|
100
|
+
customProps: {}
|
|
99
101
|
};
|
|
100
102
|
export const SelectWithIcon_defaultProps = {
|
|
101
103
|
isReadOnly: false,
|
|
@@ -174,7 +174,8 @@ export const GroupSelect_propTypes = {
|
|
|
174
174
|
}),
|
|
175
175
|
isLoading: PropTypes.bool,
|
|
176
176
|
dataSelectorId: PropTypes.string,
|
|
177
|
-
isDefaultSelectValue: PropTypes.bool
|
|
177
|
+
isDefaultSelectValue: PropTypes.bool,
|
|
178
|
+
customProps: PropTypes.string
|
|
178
179
|
};
|
|
179
180
|
export const SelectWithAvatar_propTypes = { ...Select_propTypes,
|
|
180
181
|
textBoxClass: PropTypes.string,
|
|
@@ -235,7 +236,8 @@ export const SelectWithAvatar_propTypes = { ...Select_propTypes,
|
|
|
235
236
|
htmlId: PropTypes.string,
|
|
236
237
|
needEffect: PropTypes.bool,
|
|
237
238
|
isLoading: PropTypes.bool,
|
|
238
|
-
dataSelectorId: PropTypes.string
|
|
239
|
+
dataSelectorId: PropTypes.string,
|
|
240
|
+
customProps: PropTypes.string
|
|
239
241
|
};
|
|
240
242
|
export const SelectWithIcon_propTypes = {
|
|
241
243
|
animationStyle: PropTypes.oneOf(['default', 'bounce']),
|
package/es/v1/Popup/Popup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**** Libraries ****/
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
3
4
|
import hoistStatics from 'hoist-non-react-statics';
|
|
4
|
-
import { PopupPropTypes, ContextTypes } from "../../Popup/props/propTypes.js";
|
|
5
5
|
/**** Methods ****/
|
|
6
6
|
|
|
7
7
|
import { debounce, isDescendant, isTextSelected, cancelBubblingEffect } from "../../utils/Common.js";
|
|
@@ -89,11 +89,6 @@ 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);
|
|
97
92
|
this.popupObserver = new ResizeObserver(this.handlePopupResize); //dropBoxSize
|
|
98
93
|
|
|
99
94
|
this.size = null;
|
|
@@ -106,7 +101,6 @@ const Popup = function (Component) {
|
|
|
106
101
|
scrollDebounceTime
|
|
107
102
|
} = this.getScrollDebounceTime(this);
|
|
108
103
|
this.handleScroll = debounce(this.handleScroll.bind(this), scrollDebounceTime);
|
|
109
|
-
this.handleDebouncedPositionChange = debounce(this.handlePositionChange.bind(this), 100);
|
|
110
104
|
}
|
|
111
105
|
|
|
112
106
|
componentDidMount() {
|
|
@@ -150,9 +144,7 @@ const Popup = function (Component) {
|
|
|
150
144
|
dropElement
|
|
151
145
|
} = this;
|
|
152
146
|
const {
|
|
153
|
-
needResizeHandling: propResizeHandling
|
|
154
|
-
isAbsolutePositioningNeeded,
|
|
155
|
-
isBlockedOutsideScroll
|
|
147
|
+
needResizeHandling: propResizeHandling
|
|
156
148
|
} = this.props;
|
|
157
149
|
|
|
158
150
|
if (oldStateOpen !== isPopupReady) {
|
|
@@ -162,14 +154,6 @@ const Popup = function (Component) {
|
|
|
162
154
|
this.size = null;
|
|
163
155
|
this.popupObserver.disconnect();
|
|
164
156
|
}
|
|
165
|
-
|
|
166
|
-
if (isBlockedOutsideScroll && !isAbsolutePositioningNeeded) {
|
|
167
|
-
if (isPopupReady) {
|
|
168
|
-
this.addScrollBlockListeners();
|
|
169
|
-
} else {
|
|
170
|
-
this.removeScrollBlockListeners();
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
157
|
}
|
|
174
158
|
}
|
|
175
159
|
|
|
@@ -185,7 +169,6 @@ const Popup = function (Component) {
|
|
|
185
169
|
|
|
186
170
|
return res;
|
|
187
171
|
}, popups);
|
|
188
|
-
this.removeScrollBlockListeners();
|
|
189
172
|
let noPopups = true;
|
|
190
173
|
|
|
191
174
|
for (const i in popups) {
|
|
@@ -210,76 +193,6 @@ const Popup = function (Component) {
|
|
|
210
193
|
}
|
|
211
194
|
}
|
|
212
195
|
|
|
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
|
-
|
|
283
196
|
getGroup() {
|
|
284
197
|
const {
|
|
285
198
|
popupGroup
|
|
@@ -610,15 +523,13 @@ const Popup = function (Component) {
|
|
|
610
523
|
} = betterPosition || {};
|
|
611
524
|
const {
|
|
612
525
|
left: oldLeft = '',
|
|
613
|
-
top: oldTop = ''
|
|
614
|
-
bottom: oldBottom = ''
|
|
526
|
+
top: oldTop = ''
|
|
615
527
|
} = positionsOffset[position] || {};
|
|
616
528
|
const {
|
|
617
529
|
left = '',
|
|
618
|
-
top = ''
|
|
619
|
-
bottom = ''
|
|
530
|
+
top = ''
|
|
620
531
|
} = viewsOffset[view] || {};
|
|
621
|
-
const changeState = isAbsolute ? position !== view : oldLeft !== left || oldTop !== top
|
|
532
|
+
const changeState = isAbsolute ? position !== view : oldLeft !== left || oldTop !== top; // let isInViewPort = viewPort.isInViewPort(
|
|
622
533
|
// placeHolderElement,
|
|
623
534
|
// scrollContainer
|
|
624
535
|
// );
|
|
@@ -724,8 +635,9 @@ const Popup = function (Component) {
|
|
|
724
635
|
}
|
|
725
636
|
|
|
726
637
|
Popup.displayName = Component.displayName || Component.name || Popup.name;
|
|
727
|
-
Popup.contextTypes =
|
|
728
|
-
|
|
638
|
+
Popup.contextTypes = {
|
|
639
|
+
direction: PropTypes.string
|
|
640
|
+
};
|
|
729
641
|
return hoistStatics(Popup, Component);
|
|
730
642
|
};
|
|
731
643
|
|
|
@@ -110,6 +110,7 @@ var CalendarView = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
110
110
|
var output = null;
|
|
111
111
|
|
|
112
112
|
for (var i = 1; i < 8; i++) {
|
|
113
|
+
isSelectedDay = false;
|
|
113
114
|
var tdclass = "".concat(_DateTimeModule["default"].datesStr, " ").concat(_DateTimeModule["default"].grid);
|
|
114
115
|
|
|
115
116
|
if (i === 1) {
|
|
@@ -150,8 +151,8 @@ var CalendarView = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
150
151
|
|
|
151
152
|
var prevMonthEnd = (0, _common.getMonthEnd)(prevMonth, prevYear);
|
|
152
153
|
var prevDate = prevMonthEnd - (userSeeDay - 1) + incremleti; // isSelectedDay =
|
|
153
|
-
|
|
154
|
-
|
|
154
|
+
// prevDate === parseInt(date) && parseInt(month) === prevMonth && parseInt(year) === prevYear ? true : false;
|
|
155
|
+
// isToday = prevDate === incremday && todayMonth === userSeeMonth && todayYear === userSeeYear ? true : false;
|
|
155
156
|
|
|
156
157
|
output = /*#__PURE__*/_react["default"].createElement(Span, {
|
|
157
158
|
i: i //isActive={isSelectedDay}
|
|
@@ -161,7 +162,7 @@ var CalendarView = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
161
162
|
incremday: prevDate,
|
|
162
163
|
userSeeMonth: prevMonth,
|
|
163
164
|
userSeeYear: prevYear,
|
|
164
|
-
dataId:
|
|
165
|
+
dataId: "".concat(dataId, "_invalidDate") // isToday={isToday}
|
|
165
166
|
|
|
166
167
|
});
|
|
167
168
|
} else if (incremleti > monthEnd) {
|
|
@@ -173,9 +174,10 @@ var CalendarView = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
173
174
|
nextYear = userSeeYear + 1;
|
|
174
175
|
}
|
|
175
176
|
|
|
176
|
-
var nextDate = incremleti - (userSeeDay - 1) - monthEnd; //
|
|
177
|
-
|
|
178
|
-
nextDate === parseInt(date) && parseInt(month) === nextMonth && parseInt(year) === nextYear ? true : false;
|
|
177
|
+
var nextDate = incremleti - (userSeeDay - 1) - monthEnd; // console.log('last dates',incremleti, monthEnd,'nextDate',nextDate,'monthEnd',monthEnd,'userSeeDay',userSeeDay)
|
|
178
|
+
// isSelectedDay =
|
|
179
|
+
// nextDate === parseInt(date) && parseInt(month) === nextMonth && parseInt(year) === nextYear ? true : false;
|
|
180
|
+
// isToday = nextDate === incremday && todayMonth === userSeeMonth && todayYear === userSeeYear ? true : false;
|
|
179
181
|
|
|
180
182
|
output = /*#__PURE__*/_react["default"].createElement(Span, {
|
|
181
183
|
i: i // isActive={isSelectedDay}
|
|
@@ -185,7 +187,7 @@ var CalendarView = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
185
187
|
incremday: nextDate,
|
|
186
188
|
userSeeMonth: nextMonth,
|
|
187
189
|
userSeeYear: nextYear,
|
|
188
|
-
dataId:
|
|
190
|
+
dataId: "".concat(dataId, "_invalidDate") //isToday={isToday}
|
|
189
191
|
|
|
190
192
|
});
|
|
191
193
|
} else {
|
package/lib/ListItem/ListItem.js
CHANGED
|
@@ -150,7 +150,7 @@ var ListItem = /*#__PURE__*/function (_React$Component) {
|
|
|
150
150
|
autoHover: autoHover,
|
|
151
151
|
needTick: needTick,
|
|
152
152
|
needBorder: needBorder,
|
|
153
|
-
customClass: customListItem,
|
|
153
|
+
customClass: "".concat(needMultiLineText ? _ListItemModule["default"].txtAlignBaseLine + ' ' + _ListItemModule["default"].autoHeight : '', " ").concat(customListItem),
|
|
154
154
|
dataId: dataIdString,
|
|
155
155
|
dataSelectorId: "".concat(dataSelectorId),
|
|
156
156
|
isLink: isLink,
|
|
@@ -171,7 +171,7 @@ var ListItem = /*#__PURE__*/function (_React$Component) {
|
|
|
171
171
|
adjust: true,
|
|
172
172
|
className: _ListItemModule["default"].children
|
|
173
173
|
}, children) : null, needTick && active ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
174
|
-
className: "".concat(_ListItemModule["default"].tickIcon, " ").concat(tickIconPalette, " ").concat(customTickIcon),
|
|
174
|
+
className: "".concat(_ListItemModule["default"].tickIcon, " ").concat(tickIconPalette, " ").concat(customTickIcon, " ").concat(needMultiLineText ? _ListItemModule["default"].tickIconCenter : ''),
|
|
175
175
|
"aria-hidden": ariaHidden,
|
|
176
176
|
dataId: "".concat(dataIdString, "_tickIcon"),
|
|
177
177
|
dataSelectorId: "".concat(dataSelectorId, "_tickIcon")
|