@zohodesk/components 1.0.0-alpha-258 → 1.0.0-alpha-260
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 +23 -2
- package/assets/Appearance/dark/mode/darkMode.module.css +1 -0
- package/assets/Appearance/default/mode/defaultMode.module.css +1 -0
- package/assets/Appearance/pureDark/mode/pureDarkMode.module.css +1 -0
- package/es/Avatar/Avatar.js +8 -5
- package/es/Avatar/Avatar.module.css +6 -0
- package/es/Avatar/props/defaultProps.js +3 -1
- package/es/Avatar/props/propTypes.js +4 -2
- package/es/AvatarTeam/AvatarTeam.js +8 -2
- package/es/AvatarTeam/AvatarTeam.module.css +30 -3
- package/es/AvatarTeam/props/defaultProps.js +4 -1
- package/es/AvatarTeam/props/propTypes.js +4 -1
- package/es/DateTime/DateWidget.js +2 -3
- package/es/MultiSelect/Suggestions.js +4 -2
- package/es/Popup/Popup.js +2 -2
- package/es/Provider/AvatarSize.js +1 -0
- package/es/TextBoxIcon/TextBoxIcon.js +20 -3
- package/es/common/avatarsizes.module.css +6 -2
- package/es/utils/Common.js +17 -2
- package/lib/Avatar/Avatar.js +8 -5
- package/lib/Avatar/Avatar.module.css +6 -0
- package/lib/Avatar/props/defaultProps.js +3 -1
- package/lib/Avatar/props/propTypes.js +4 -2
- package/lib/AvatarTeam/AvatarTeam.js +8 -2
- package/lib/AvatarTeam/AvatarTeam.module.css +30 -3
- package/lib/AvatarTeam/props/defaultProps.js +4 -1
- package/lib/AvatarTeam/props/propTypes.js +4 -1
- package/lib/DateTime/DateWidget.js +1 -3
- package/lib/DateTime/validator.js +1 -1
- package/lib/MultiSelect/Suggestions.js +5 -3
- package/lib/Popup/Popup.js +1 -1
- package/lib/Provider/AvatarSize.js +1 -0
- package/lib/TextBoxIcon/TextBoxIcon.js +20 -3
- package/lib/common/avatarsizes.module.css +6 -2
- package/lib/utils/Common.js +18 -2
- package/package.json +1 -1
- package/css_error.log +0 -0
package/README.md
CHANGED
|
@@ -32,10 +32,31 @@ 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-260
|
|
36
|
+
|
|
37
|
+
- **TextBoxIcon** - OnClear Focus in TextBox issue Resolved.
|
|
38
|
+
|
|
39
|
+
- Suggestions - `listItemCustomProps` prop support given for all suggestion to control all listitems.
|
|
40
|
+
|
|
41
|
+
- `isTextSelected` - common method added in utils to know any text highlighted or not.
|
|
42
|
+
|
|
43
|
+
- **Popup** - Issue fix: While click on the document, popup won't close if any text highlighted in the product.
|
|
44
|
+
|
|
45
|
+
# 1.0.0-alpha-259
|
|
46
|
+
|
|
47
|
+
- **Avatar**
|
|
48
|
+
|
|
49
|
+
`needInnerBorder` and `needDefaultBorder` prop has been added.
|
|
50
|
+
|
|
51
|
+
`xxsmall` option added for size prop.
|
|
52
|
+
|
|
53
|
+
- **AvatarTeam** - `needInnerBorder`, `needBorder` and `needDefaultBorder` props has been added.
|
|
54
|
+
|
|
35
55
|
# 1.0.0-alpha-258
|
|
36
56
|
|
|
37
|
-
- **CheckBox** - dataSlector prop changed to dataSelectorId
|
|
38
|
-
|
|
57
|
+
- **CheckBox** - dataSlector prop changed to `dataSelectorId`.
|
|
58
|
+
|
|
59
|
+
- `dataSelectorId` prop added for all components
|
|
39
60
|
|
|
40
61
|
# 1.0.0-alpha-257
|
|
41
62
|
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
--zdt_avatarteam_secondary_bg: var(--dot_ebonyclay);
|
|
31
31
|
--zdt_avatarteam_nofill_border: var(--zdt_cta_grey_40_border);
|
|
32
32
|
--zdt_avatarteam_nofill_hover_border: var(--dot_oslogrey);
|
|
33
|
+
--zdt_avatarteam_innerCircle: var(--dot_ebonyclay);
|
|
33
34
|
|
|
34
35
|
/* button */
|
|
35
36
|
--zdt_button_default_text: var(--zdt_cta_alpha_text);
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
--zdt_avatarteam_secondary_bg: var(--dot_white);
|
|
31
31
|
--zdt_avatarteam_nofill_border: var(--zdt_cta_grey_40_border);
|
|
32
32
|
--zdt_avatarteam_nofill_hover_border: var(--dot_slateGrey);
|
|
33
|
+
--zdt_avatarteam_innerCircle: var(--dot_white);
|
|
33
34
|
|
|
34
35
|
/* button */
|
|
35
36
|
--zdt_button_default_text: var(--zdt_cta_alpha_text);
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
--zdt_avatarteam_secondary_bg: #212121;
|
|
31
31
|
--zdt_avatarteam_nofill_border: var(--zdt_cta_grey_40_border);
|
|
32
32
|
--zdt_avatarteam_nofill_hover_border: var(--dot_oslogrey);
|
|
33
|
+
--zdt_avatarteam_innerCircle: #212121;
|
|
33
34
|
|
|
34
35
|
/* button */
|
|
35
36
|
--zdt_button_default_text: var(--zdt_cta_alpha_text);
|
package/es/Avatar/Avatar.js
CHANGED
|
@@ -125,7 +125,9 @@ export default class Avatar extends React.Component {
|
|
|
125
125
|
alternateSrc,
|
|
126
126
|
isAnimate,
|
|
127
127
|
dataSelectorId,
|
|
128
|
-
customProps
|
|
128
|
+
customProps,
|
|
129
|
+
needInnerBorder,
|
|
130
|
+
needDefaultBorder
|
|
129
131
|
} = this.props;
|
|
130
132
|
let {
|
|
131
133
|
AvatarProps = {}
|
|
@@ -134,12 +136,13 @@ export default class Avatar extends React.Component {
|
|
|
134
136
|
let shapeStyle = shape === 'circle' ? 'circle' : `square_${size}`;
|
|
135
137
|
initial = initial || this.getInitialByFullName(name);
|
|
136
138
|
let isInvalidImageList = Avatar.invalidImageURLs.indexOf(src) !== -1;
|
|
137
|
-
let isValidImageList = Avatar.validImageURLs.indexOf(src) !== -1;
|
|
139
|
+
//let isValidImageList = Avatar.validImageURLs.indexOf(src) !== -1;
|
|
138
140
|
let showAvatar = src && !isInvalidImageList;
|
|
139
141
|
let showInitial = !showAvatar || showAvatar && isInvalidImageList;
|
|
140
142
|
const showAlternateAvatar = alternateSrc ? showInitial : false;
|
|
141
143
|
let border = borderOnHover || onClick;
|
|
142
|
-
let
|
|
144
|
+
let showDefaultBorder = src && !isInvalidImageList && needDefaultBorder;
|
|
145
|
+
let borderStyle = (showDefaultBorder || !src || !showAvatar || showInitial) && needBorder ? `${style.border} ${borderOnActive ? style.borderOnActive : border ? style.borderOnHover : ''} ` : '';
|
|
143
146
|
borderStyle = showAlternateAvatar ? '' : borderStyle;
|
|
144
147
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
145
148
|
className: `${style.avatar} ${style[size]} ${AvatarSize(size)} ${style[shapeStyle]} ${style[palette]} ${textStyle} ${borderStyle} ${customClass ? customClass : ''}`,
|
|
@@ -152,7 +155,7 @@ export default class Avatar extends React.Component {
|
|
|
152
155
|
"data-id": `${dataId}_AvatarInitial`,
|
|
153
156
|
"data-selector-id": `${dataSelectorId}_AvatarInitial`
|
|
154
157
|
}, initial), (showAvatar || showAlternateAvatar) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("img", {
|
|
155
|
-
className: `${style.image} ${isAnimate ? style.animate : ''}`,
|
|
158
|
+
className: `${style.image} ${isAnimate ? style.animate : ''} ${needInnerBorder ? style.innerBorder : ''}`,
|
|
156
159
|
"data-id": `${dataId}_AvatarImg`,
|
|
157
160
|
"data-selector-id": `${dataSelectorId}_AvatarImg`,
|
|
158
161
|
name: name,
|
|
@@ -160,7 +163,7 @@ export default class Avatar extends React.Component {
|
|
|
160
163
|
onLoad: this.putValidImageURLJSON,
|
|
161
164
|
src: showAlternateAvatar ? alternateSrc : src,
|
|
162
165
|
alt: name
|
|
163
|
-
}),
|
|
166
|
+
}), showDefaultBorder ? null : /*#__PURE__*/React.createElement("span", {
|
|
164
167
|
className: `${style.shadow} ${textStyle} `
|
|
165
168
|
})));
|
|
166
169
|
}
|
|
@@ -79,6 +79,9 @@
|
|
|
79
79
|
[dir=rtl] .animate{
|
|
80
80
|
animation-duration: var(--zd_transition2);
|
|
81
81
|
}
|
|
82
|
+
.innerBorder{
|
|
83
|
+
border: 1px solid var(--zdt_avatarteam_innerCircle);
|
|
84
|
+
}
|
|
82
85
|
.square_small {
|
|
83
86
|
--avatar_border_radius: 4px;
|
|
84
87
|
}
|
|
@@ -109,6 +112,9 @@
|
|
|
109
112
|
text-transform: var(--avatar_text_transform);
|
|
110
113
|
display: inline-block;
|
|
111
114
|
}
|
|
115
|
+
.xxsmall{
|
|
116
|
+
--avatar_font_size: var(--zd_font_size8);
|
|
117
|
+
}
|
|
112
118
|
.small {
|
|
113
119
|
--avatar_font_size: var(--zd_font_size9);
|
|
114
120
|
}
|
|
@@ -9,7 +9,7 @@ export const propTypes = {
|
|
|
9
9
|
onClick: PropTypes.func,
|
|
10
10
|
palette: PropTypes.oneOf(['primary', 'secondary', 'info', 'default']),
|
|
11
11
|
shape: PropTypes.oneOf(['circle', 'square']),
|
|
12
|
-
size: PropTypes.oneOf(['small', 'xsmall', 'medium', 'xmedium', 'large', 'xlarge']),
|
|
12
|
+
size: PropTypes.oneOf(['xxsmall', 'small', 'xsmall', 'medium', 'xmedium', 'large', 'xlarge']),
|
|
13
13
|
src: PropTypes.string,
|
|
14
14
|
textPalette: PropTypes.oneOf(['white', 'black']),
|
|
15
15
|
title: PropTypes.string,
|
|
@@ -20,5 +20,7 @@ export const propTypes = {
|
|
|
20
20
|
customProps: PropTypes.shape({
|
|
21
21
|
AvatarProps: PropTypes.object
|
|
22
22
|
}),
|
|
23
|
-
isAnimate: PropTypes.bool
|
|
23
|
+
isAnimate: PropTypes.bool,
|
|
24
|
+
needInnerBorder: PropTypes.bool,
|
|
25
|
+
needDefaultBorder: PropTypes.bool
|
|
24
26
|
};
|
|
@@ -32,7 +32,10 @@ export default class AvatarTeam extends React.Component {
|
|
|
32
32
|
borderOnActive,
|
|
33
33
|
borderOnHover,
|
|
34
34
|
dataSelectorId,
|
|
35
|
-
customProps
|
|
35
|
+
customProps,
|
|
36
|
+
needInnerBorder,
|
|
37
|
+
needBorder,
|
|
38
|
+
needDefaultBorder
|
|
36
39
|
} = this.props;
|
|
37
40
|
let {
|
|
38
41
|
AvatarTeamProps = {},
|
|
@@ -58,7 +61,10 @@ export default class AvatarTeam extends React.Component {
|
|
|
58
61
|
needTitle: needTitle,
|
|
59
62
|
customClass: customAvatar,
|
|
60
63
|
borderOnActive: borderOnActive,
|
|
61
|
-
borderOnHover: border
|
|
64
|
+
borderOnHover: border,
|
|
65
|
+
needInnerBorder: needInnerBorder,
|
|
66
|
+
needBorder: needBorder,
|
|
67
|
+
needDefaultBorder: needDefaultBorder
|
|
62
68
|
}, AvatarProps)), /*#__PURE__*/React.createElement("span", {
|
|
63
69
|
className: `${style.team} ${isFilled ? `${style[`${palette}Filled`]}` : style.nofill}
|
|
64
70
|
${style[`${size}team`]} ${customAvatarTeam}`
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
--avatarteam_border_width: var(--zd_size1);
|
|
4
4
|
--avatarteam_border_style: solid;
|
|
5
5
|
--avatarteam_border_color: var(--zdt_avatarteam_default_border);
|
|
6
|
+
--avatarteam_outline_width: var(--zd_size1);
|
|
7
|
+
--avatarteam_outline_style: solid;
|
|
8
|
+
--avatarteam_outline_color: var(--zdt_avatarteam_innerCircle);
|
|
6
9
|
--avatarteam_bg_color: var(--zdt_avatarteam_default_bg);
|
|
7
10
|
--avatarteam_width: var(--zd_size5);
|
|
8
11
|
--avatarteam_height: var(--zd_size5);
|
|
@@ -16,6 +19,7 @@
|
|
|
16
19
|
position: relative;
|
|
17
20
|
display: inline-block;
|
|
18
21
|
font-size: 0;
|
|
22
|
+
vertical-align: middle;
|
|
19
23
|
}
|
|
20
24
|
.team {
|
|
21
25
|
composes: varClass;
|
|
@@ -23,6 +27,9 @@
|
|
|
23
27
|
top: var(--avatarteam_top_top);
|
|
24
28
|
width: var(--avatarteam_width);
|
|
25
29
|
height: var(--avatarteam_height);
|
|
30
|
+
outline-width: var(--avatarteam_outline_width);
|
|
31
|
+
outline-style: var(--avatarteam_outline_style);
|
|
32
|
+
outline-color: var(--avatarteam_outline_color);
|
|
26
33
|
border-width: var(--avatarteam_border_width);
|
|
27
34
|
border-style: var(--avatarteam_border_style);
|
|
28
35
|
border-color: var(--avatarteam_border_color);
|
|
@@ -38,11 +45,11 @@
|
|
|
38
45
|
right: 50%;
|
|
39
46
|
}
|
|
40
47
|
.nofill {
|
|
41
|
-
--avatarteam_border_color: var(--
|
|
48
|
+
--avatarteam_border_color: var(--zdt_avatarteam_nofill_hover_border);
|
|
42
49
|
}
|
|
43
50
|
.primaryFilled,
|
|
44
51
|
.infoFilled {
|
|
45
|
-
--avatarteam_bg_color: var(--
|
|
52
|
+
--avatarteam_bg_color: var(--zdt_avatarteam_primary_hover_bg);
|
|
46
53
|
}
|
|
47
54
|
.secondaryFilled {
|
|
48
55
|
--avatarteam_bg_color: var(--zdt_avatarteam_secondary_bg);
|
|
@@ -64,6 +71,9 @@
|
|
|
64
71
|
height: inherit;
|
|
65
72
|
width: inherit;
|
|
66
73
|
top: var(--avatarteam_bottom_top);
|
|
74
|
+
outline-width: var(--avatarteam_outline_width);
|
|
75
|
+
outline-style: var(--avatarteam_outline_style);
|
|
76
|
+
outline-color: var( --avatarteam_outline_color);
|
|
67
77
|
}
|
|
68
78
|
.team:after, .team:before {
|
|
69
79
|
border: inherit;
|
|
@@ -80,7 +90,8 @@
|
|
|
80
90
|
left: var(--avatarteam_bottom_right);
|
|
81
91
|
}
|
|
82
92
|
.smallteam,
|
|
83
|
-
.xsmallteam
|
|
93
|
+
.xsmallteam,
|
|
94
|
+
.xxsmallteam {
|
|
84
95
|
--avatarteam_height: var(--zd_size3);
|
|
85
96
|
--avatarteam_width: var(--zd_size3);
|
|
86
97
|
}
|
|
@@ -94,6 +105,22 @@
|
|
|
94
105
|
--avatarteam_height: var(--zd_size7);
|
|
95
106
|
--avatarteam_width: var(--zd_size7);
|
|
96
107
|
}
|
|
108
|
+
|
|
109
|
+
.xxsmallteam {
|
|
110
|
+
--avatarteam_top_top: 0px;
|
|
111
|
+
}
|
|
112
|
+
.xxsmallteam::after,
|
|
113
|
+
.xxsmallteam:before {
|
|
114
|
+
--avatarteam_bottom_top: var(--zd_size13);
|
|
115
|
+
}
|
|
116
|
+
.xxsmallteam:after {
|
|
117
|
+
--avatarteam_bottom_left: calc(var(--zd_size8) * -1);
|
|
118
|
+
}
|
|
119
|
+
.xxsmallteam:before {
|
|
120
|
+
--avatarteam_bottom_right: calc(var(--zd_size8) * -1);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
|
|
97
124
|
.smallteam::after,
|
|
98
125
|
.smallteam:before {
|
|
99
126
|
--avatarteam_bottom_top: var(--zd_size17);
|
|
@@ -7,9 +7,10 @@ export const propTypes = {
|
|
|
7
7
|
needTitle: PropTypes.bool,
|
|
8
8
|
onClick: PropTypes.func,
|
|
9
9
|
palette: PropTypes.oneOf(['primary', 'secondary', 'info']),
|
|
10
|
-
size: PropTypes.oneOf(['small', 'xsmall', 'medium', 'xmedium', 'large', 'xlarge']),
|
|
10
|
+
size: PropTypes.oneOf(['xxsmall', 'small', 'xsmall', 'medium', 'xmedium', 'large', 'xlarge']),
|
|
11
11
|
src: PropTypes.string,
|
|
12
12
|
textPalette: PropTypes.oneOf(['white', 'black']),
|
|
13
|
+
needBorder: PropTypes.bool,
|
|
13
14
|
title: PropTypes.string,
|
|
14
15
|
customClass: PropTypes.shape({
|
|
15
16
|
customAvatar: PropTypes.string,
|
|
@@ -17,6 +18,8 @@ export const propTypes = {
|
|
|
17
18
|
}),
|
|
18
19
|
borderOnActive: PropTypes.bool,
|
|
19
20
|
borderOnHover: PropTypes.bool,
|
|
21
|
+
needInnerBorder: PropTypes.bool,
|
|
22
|
+
needDefaultBorder: PropTypes.bool,
|
|
20
23
|
customProps: PropTypes.shape({
|
|
21
24
|
AvatarTeamProps: PropTypes.object,
|
|
22
25
|
AvatarProps: PropTypes.object
|
|
@@ -829,10 +829,9 @@ class DateWidgetComponent extends React.Component {
|
|
|
829
829
|
isError: false
|
|
830
830
|
});
|
|
831
831
|
value && onSelect && onSelect('', id);
|
|
832
|
-
this.valueInput && this.valueInput.focus({
|
|
833
|
-
preventScroll: true
|
|
834
|
-
});
|
|
832
|
+
// this.valueInput && this.valueInput.focus({ preventScroll: true });
|
|
835
833
|
}
|
|
834
|
+
|
|
836
835
|
handleDateTimeClear(e) {
|
|
837
836
|
this.handleDateClear();
|
|
838
837
|
const {
|
|
@@ -52,7 +52,8 @@ export default class Suggestions extends React.PureComponent {
|
|
|
52
52
|
optionType,
|
|
53
53
|
iconSize,
|
|
54
54
|
isDisabled,
|
|
55
|
-
listItemProps
|
|
55
|
+
listItemProps,
|
|
56
|
+
listItemCustomProps = {}
|
|
56
57
|
} = suggestion;
|
|
57
58
|
const isActive = activeId === id || selectedOptions.indexOf(id) >= 0;
|
|
58
59
|
const isHighlight = hoverOption === index || id === hoverId ? true : false;
|
|
@@ -61,7 +62,8 @@ export default class Suggestions extends React.PureComponent {
|
|
|
61
62
|
ariaLabel: value
|
|
62
63
|
});
|
|
63
64
|
const commonProps = {
|
|
64
|
-
isDisabled
|
|
65
|
+
isDisabled,
|
|
66
|
+
...listItemCustomProps
|
|
65
67
|
};
|
|
66
68
|
if (listItemProps) {
|
|
67
69
|
commonProps.customProps = {
|
package/es/Popup/Popup.js
CHANGED
|
@@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
|
|
|
5
5
|
import hoistStatics from 'hoist-non-react-statics';
|
|
6
6
|
|
|
7
7
|
/**** Methods ****/
|
|
8
|
-
import { debounce, isDescendant } from '../utils/Common.js';
|
|
8
|
+
import { debounce, isDescendant, isTextSelected } from '../utils/Common.js';
|
|
9
9
|
import viewPort from './viewPort';
|
|
10
10
|
import { absolutePositionMapping, rtlAbsolutePositionMapping, rtlFixedPositionMapping } from './PositionMapping.json';
|
|
11
11
|
import ResizeObserver from '@zohodesk/virtualizer/lib/commons/ResizeObserver.js';
|
|
@@ -352,7 +352,7 @@ const Popup = function (Component) {
|
|
|
352
352
|
Object.keys(popups).forEach(groupName => {
|
|
353
353
|
const groupPopups = popups[groupName] || [];
|
|
354
354
|
groupPopups.forEach(popup => {
|
|
355
|
-
popup.state.isPopupOpen && (!popup.props.checkBeforeClose || popup.props.checkBeforeClose && popup.props.checkBeforeClose()) && popup.setState({
|
|
355
|
+
popup.state.isPopupOpen && (!popup.props.checkBeforeClose || popup.props.checkBeforeClose && popup.props.checkBeforeClose()) && !isTextSelected() && popup.setState({
|
|
356
356
|
isPopupOpen: false,
|
|
357
357
|
isPopupReady: false
|
|
358
358
|
});
|
|
@@ -17,6 +17,24 @@ export default class TextBoxIcon extends React.Component {
|
|
|
17
17
|
};
|
|
18
18
|
this.handleFocus = this.handleFocus.bind(this);
|
|
19
19
|
this.handleBlur = this.handleBlur.bind(this);
|
|
20
|
+
this.handleRef = this.handleRef.bind(this);
|
|
21
|
+
this.handleClear = this.handleClear.bind(this);
|
|
22
|
+
}
|
|
23
|
+
handleRef(ele) {
|
|
24
|
+
let {
|
|
25
|
+
inputRef
|
|
26
|
+
} = this.props;
|
|
27
|
+
this.inputEle = ele;
|
|
28
|
+
inputRef && inputRef(ele);
|
|
29
|
+
}
|
|
30
|
+
handleClear() {
|
|
31
|
+
let {
|
|
32
|
+
onClear
|
|
33
|
+
} = this.props;
|
|
34
|
+
onClear && onClear();
|
|
35
|
+
this.inputEle && this.inputEle.focus({
|
|
36
|
+
preventScroll: true
|
|
37
|
+
});
|
|
20
38
|
}
|
|
21
39
|
handleFocus(e) {
|
|
22
40
|
const {
|
|
@@ -49,7 +67,6 @@ export default class TextBoxIcon extends React.Component {
|
|
|
49
67
|
placeHolder,
|
|
50
68
|
size,
|
|
51
69
|
onKeyUp,
|
|
52
|
-
inputRef,
|
|
53
70
|
isReadOnly,
|
|
54
71
|
isDisabled,
|
|
55
72
|
children,
|
|
@@ -121,7 +138,7 @@ export default class TextBoxIcon extends React.Component {
|
|
|
121
138
|
onClick: onClick,
|
|
122
139
|
isReadOnly: isReadOnly,
|
|
123
140
|
isDisabled: isDisabled,
|
|
124
|
-
inputRef:
|
|
141
|
+
inputRef: this.handleRef,
|
|
125
142
|
needReadOnlyStyle: needReadOnlyStyle,
|
|
126
143
|
isClickable: isClickable,
|
|
127
144
|
onKeyPress: onKeyPress,
|
|
@@ -135,7 +152,7 @@ export default class TextBoxIcon extends React.Component {
|
|
|
135
152
|
alignBox: "row"
|
|
136
153
|
}, value && onClear && value.length > 1 && !isDisabled && !isReadOnly || showClearIcon ? /*#__PURE__*/React.createElement(Box, {
|
|
137
154
|
className: `${btnStyle.buttonReset} ${style.icon}`,
|
|
138
|
-
onClick:
|
|
155
|
+
onClick: this.handleClear,
|
|
139
156
|
dataId: `${dataId}_ClearIcon`,
|
|
140
157
|
"data-title": clearText,
|
|
141
158
|
tagName: "button"
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
.medium,
|
|
10
10
|
.xmedium,
|
|
11
11
|
.large,
|
|
12
|
-
.xlarge
|
|
12
|
+
.xlarge,
|
|
13
|
+
.xxsmall {
|
|
13
14
|
composes: varClass;
|
|
14
15
|
width: var(--avatar_width);
|
|
15
16
|
height: var(--avatar_height);
|
|
@@ -18,7 +19,10 @@
|
|
|
18
19
|
--avatar_height: var(--zd_size22);
|
|
19
20
|
--avatar_width: var(--zd_size22);
|
|
20
21
|
}
|
|
21
|
-
|
|
22
|
+
.xxsmall {
|
|
23
|
+
--avatar_height: var(--zd_size18);
|
|
24
|
+
--avatar_width: var(--zd_size18);
|
|
25
|
+
}
|
|
22
26
|
.xsmall {
|
|
23
27
|
--avatar_height: var(--zd_size30);
|
|
24
28
|
--avatar_width: var(--zd_size30);
|
package/es/utils/Common.js
CHANGED
|
@@ -338,8 +338,23 @@ export function findScrollEnd(element) {
|
|
|
338
338
|
if (scrollHeight <= Math.ceil(scrollTop + offsetHeight)) {
|
|
339
339
|
return true;
|
|
340
340
|
}
|
|
341
|
-
}
|
|
342
|
-
|
|
341
|
+
}
|
|
342
|
+
// else {
|
|
343
|
+
|
|
344
|
+
// throw 'Is scroll not present in this element';
|
|
345
|
+
// }
|
|
346
|
+
return false;
|
|
347
|
+
}
|
|
348
|
+
export function isTextSelected() {
|
|
349
|
+
let selectedText = '';
|
|
350
|
+
if (window.getSelection) {
|
|
351
|
+
selectedText = window.getSelection().toString();
|
|
352
|
+
console.log(selectedText, 'selectedText');
|
|
353
|
+
} else if (document.getSelection) {
|
|
354
|
+
selectedText = document.getSelection().toString();
|
|
355
|
+
}
|
|
356
|
+
if (selectedText !== '') {
|
|
357
|
+
return true;
|
|
343
358
|
}
|
|
344
359
|
return false;
|
|
345
360
|
}
|
package/lib/Avatar/Avatar.js
CHANGED
|
@@ -153,19 +153,22 @@ var Avatar = /*#__PURE__*/function (_React$Component) {
|
|
|
153
153
|
alternateSrc = _this$props2.alternateSrc,
|
|
154
154
|
isAnimate = _this$props2.isAnimate,
|
|
155
155
|
dataSelectorId = _this$props2.dataSelectorId,
|
|
156
|
-
customProps = _this$props2.customProps
|
|
156
|
+
customProps = _this$props2.customProps,
|
|
157
|
+
needInnerBorder = _this$props2.needInnerBorder,
|
|
158
|
+
needDefaultBorder = _this$props2.needDefaultBorder;
|
|
157
159
|
var _customProps$AvatarPr = customProps.AvatarProps,
|
|
158
160
|
AvatarProps = _customProps$AvatarPr === void 0 ? {} : _customProps$AvatarPr;
|
|
159
161
|
var textStyle = textPalette ? _AvatarModule["default"][textPalette] : palette === 'secondary' ? _AvatarModule["default"].white : _AvatarModule["default"].black;
|
|
160
162
|
var shapeStyle = shape === 'circle' ? 'circle' : "square_".concat(size);
|
|
161
163
|
initial = initial || this.getInitialByFullName(name);
|
|
162
164
|
var isInvalidImageList = Avatar.invalidImageURLs.indexOf(src) !== -1;
|
|
163
|
-
|
|
165
|
+
//let isValidImageList = Avatar.validImageURLs.indexOf(src) !== -1;
|
|
164
166
|
var showAvatar = src && !isInvalidImageList;
|
|
165
167
|
var showInitial = !showAvatar || showAvatar && isInvalidImageList;
|
|
166
168
|
var showAlternateAvatar = alternateSrc ? showInitial : false;
|
|
167
169
|
var border = borderOnHover || onClick;
|
|
168
|
-
var
|
|
170
|
+
var showDefaultBorder = src && !isInvalidImageList && needDefaultBorder;
|
|
171
|
+
var borderStyle = (showDefaultBorder || !src || !showAvatar || showInitial) && needBorder ? "".concat(_AvatarModule["default"].border, " ").concat(borderOnActive ? _AvatarModule["default"].borderOnActive : border ? _AvatarModule["default"].borderOnHover : '', " ") : '';
|
|
169
172
|
borderStyle = showAlternateAvatar ? '' : borderStyle;
|
|
170
173
|
return /*#__PURE__*/_react["default"].createElement("div", _extends({
|
|
171
174
|
className: "".concat(_AvatarModule["default"].avatar, " ").concat(_AvatarModule["default"][size], " ").concat((0, _AvatarSize["default"])(size), " ").concat(_AvatarModule["default"][shapeStyle], " ").concat(_AvatarModule["default"][palette], " ").concat(textStyle, " ").concat(borderStyle, " ").concat(customClass ? customClass : ''),
|
|
@@ -178,7 +181,7 @@ var Avatar = /*#__PURE__*/function (_React$Component) {
|
|
|
178
181
|
"data-id": "".concat(dataId, "_AvatarInitial"),
|
|
179
182
|
"data-selector-id": "".concat(dataSelectorId, "_AvatarInitial")
|
|
180
183
|
}, initial), (showAvatar || showAlternateAvatar) && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("img", {
|
|
181
|
-
className: "".concat(_AvatarModule["default"].image, " ").concat(isAnimate ? _AvatarModule["default"].animate : ''),
|
|
184
|
+
className: "".concat(_AvatarModule["default"].image, " ").concat(isAnimate ? _AvatarModule["default"].animate : '', " ").concat(needInnerBorder ? _AvatarModule["default"].innerBorder : ''),
|
|
182
185
|
"data-id": "".concat(dataId, "_AvatarImg"),
|
|
183
186
|
"data-selector-id": "".concat(dataSelectorId, "_AvatarImg"),
|
|
184
187
|
name: name,
|
|
@@ -186,7 +189,7 @@ var Avatar = /*#__PURE__*/function (_React$Component) {
|
|
|
186
189
|
onLoad: this.putValidImageURLJSON,
|
|
187
190
|
src: showAlternateAvatar ? alternateSrc : src,
|
|
188
191
|
alt: name
|
|
189
|
-
}),
|
|
192
|
+
}), showDefaultBorder ? null : /*#__PURE__*/_react["default"].createElement("span", {
|
|
190
193
|
className: "".concat(_AvatarModule["default"].shadow, " ").concat(textStyle, " ")
|
|
191
194
|
})));
|
|
192
195
|
}
|
|
@@ -79,6 +79,9 @@
|
|
|
79
79
|
[dir=rtl] .animate{
|
|
80
80
|
animation-duration: var(--zd_transition2);
|
|
81
81
|
}
|
|
82
|
+
.innerBorder{
|
|
83
|
+
border: 1px solid var(--zdt_avatarteam_innerCircle);
|
|
84
|
+
}
|
|
82
85
|
.square_small {
|
|
83
86
|
--avatar_border_radius: 4px;
|
|
84
87
|
}
|
|
@@ -109,6 +112,9 @@
|
|
|
109
112
|
text-transform: var(--avatar_text_transform);
|
|
110
113
|
display: inline-block;
|
|
111
114
|
}
|
|
115
|
+
.xxsmall{
|
|
116
|
+
--avatar_font_size: var(--zd_font_size8);
|
|
117
|
+
}
|
|
112
118
|
.small {
|
|
113
119
|
--avatar_font_size: var(--zd_font_size9);
|
|
114
120
|
}
|
|
@@ -16,7 +16,7 @@ var propTypes = {
|
|
|
16
16
|
onClick: _propTypes["default"].func,
|
|
17
17
|
palette: _propTypes["default"].oneOf(['primary', 'secondary', 'info', 'default']),
|
|
18
18
|
shape: _propTypes["default"].oneOf(['circle', 'square']),
|
|
19
|
-
size: _propTypes["default"].oneOf(['small', 'xsmall', 'medium', 'xmedium', 'large', 'xlarge']),
|
|
19
|
+
size: _propTypes["default"].oneOf(['xxsmall', 'small', 'xsmall', 'medium', 'xmedium', 'large', 'xlarge']),
|
|
20
20
|
src: _propTypes["default"].string,
|
|
21
21
|
textPalette: _propTypes["default"].oneOf(['white', 'black']),
|
|
22
22
|
title: _propTypes["default"].string,
|
|
@@ -27,6 +27,8 @@ var propTypes = {
|
|
|
27
27
|
customProps: _propTypes["default"].shape({
|
|
28
28
|
AvatarProps: _propTypes["default"].object
|
|
29
29
|
}),
|
|
30
|
-
isAnimate: _propTypes["default"].bool
|
|
30
|
+
isAnimate: _propTypes["default"].bool,
|
|
31
|
+
needInnerBorder: _propTypes["default"].bool,
|
|
32
|
+
needDefaultBorder: _propTypes["default"].bool
|
|
31
33
|
};
|
|
32
34
|
exports.propTypes = propTypes;
|
|
@@ -58,7 +58,10 @@ var AvatarTeam = /*#__PURE__*/function (_React$Component) {
|
|
|
58
58
|
borderOnActive = _this$props.borderOnActive,
|
|
59
59
|
borderOnHover = _this$props.borderOnHover,
|
|
60
60
|
dataSelectorId = _this$props.dataSelectorId,
|
|
61
|
-
customProps = _this$props.customProps
|
|
61
|
+
customProps = _this$props.customProps,
|
|
62
|
+
needInnerBorder = _this$props.needInnerBorder,
|
|
63
|
+
needBorder = _this$props.needBorder,
|
|
64
|
+
needDefaultBorder = _this$props.needDefaultBorder;
|
|
62
65
|
var _customProps$AvatarTe = customProps.AvatarTeamProps,
|
|
63
66
|
AvatarTeamProps = _customProps$AvatarTe === void 0 ? {} : _customProps$AvatarTe,
|
|
64
67
|
_customProps$AvatarPr = customProps.AvatarProps,
|
|
@@ -83,7 +86,10 @@ var AvatarTeam = /*#__PURE__*/function (_React$Component) {
|
|
|
83
86
|
needTitle: needTitle,
|
|
84
87
|
customClass: customAvatar,
|
|
85
88
|
borderOnActive: borderOnActive,
|
|
86
|
-
borderOnHover: border
|
|
89
|
+
borderOnHover: border,
|
|
90
|
+
needInnerBorder: needInnerBorder,
|
|
91
|
+
needBorder: needBorder,
|
|
92
|
+
needDefaultBorder: needDefaultBorder
|
|
87
93
|
}, AvatarProps)), /*#__PURE__*/_react["default"].createElement("span", {
|
|
88
94
|
className: "".concat(_AvatarTeamModule["default"].team, " ").concat(isFilled ? "".concat(_AvatarTeamModule["default"]["".concat(palette, "Filled")]) : _AvatarTeamModule["default"].nofill, " \n ").concat(_AvatarTeamModule["default"]["".concat(size, "team")], " ").concat(customAvatarTeam)
|
|
89
95
|
}));
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
--avatarteam_border_width: var(--zd_size1);
|
|
4
4
|
--avatarteam_border_style: solid;
|
|
5
5
|
--avatarteam_border_color: var(--zdt_avatarteam_default_border);
|
|
6
|
+
--avatarteam_outline_width: var(--zd_size1);
|
|
7
|
+
--avatarteam_outline_style: solid;
|
|
8
|
+
--avatarteam_outline_color: var(--zdt_avatarteam_innerCircle);
|
|
6
9
|
--avatarteam_bg_color: var(--zdt_avatarteam_default_bg);
|
|
7
10
|
--avatarteam_width: var(--zd_size5);
|
|
8
11
|
--avatarteam_height: var(--zd_size5);
|
|
@@ -16,6 +19,7 @@
|
|
|
16
19
|
position: relative;
|
|
17
20
|
display: inline-block;
|
|
18
21
|
font-size: 0;
|
|
22
|
+
vertical-align: middle;
|
|
19
23
|
}
|
|
20
24
|
.team {
|
|
21
25
|
composes: varClass;
|
|
@@ -23,6 +27,9 @@
|
|
|
23
27
|
top: var(--avatarteam_top_top);
|
|
24
28
|
width: var(--avatarteam_width);
|
|
25
29
|
height: var(--avatarteam_height);
|
|
30
|
+
outline-width: var(--avatarteam_outline_width);
|
|
31
|
+
outline-style: var(--avatarteam_outline_style);
|
|
32
|
+
outline-color: var(--avatarteam_outline_color);
|
|
26
33
|
border-width: var(--avatarteam_border_width);
|
|
27
34
|
border-style: var(--avatarteam_border_style);
|
|
28
35
|
border-color: var(--avatarteam_border_color);
|
|
@@ -38,11 +45,11 @@
|
|
|
38
45
|
right: 50%;
|
|
39
46
|
}
|
|
40
47
|
.nofill {
|
|
41
|
-
--avatarteam_border_color: var(--
|
|
48
|
+
--avatarteam_border_color: var(--zdt_avatarteam_nofill_hover_border);
|
|
42
49
|
}
|
|
43
50
|
.primaryFilled,
|
|
44
51
|
.infoFilled {
|
|
45
|
-
--avatarteam_bg_color: var(--
|
|
52
|
+
--avatarteam_bg_color: var(--zdt_avatarteam_primary_hover_bg);
|
|
46
53
|
}
|
|
47
54
|
.secondaryFilled {
|
|
48
55
|
--avatarteam_bg_color: var(--zdt_avatarteam_secondary_bg);
|
|
@@ -64,6 +71,9 @@
|
|
|
64
71
|
height: inherit;
|
|
65
72
|
width: inherit;
|
|
66
73
|
top: var(--avatarteam_bottom_top);
|
|
74
|
+
outline-width: var(--avatarteam_outline_width);
|
|
75
|
+
outline-style: var(--avatarteam_outline_style);
|
|
76
|
+
outline-color: var( --avatarteam_outline_color);
|
|
67
77
|
}
|
|
68
78
|
.team:after, .team:before {
|
|
69
79
|
border: inherit;
|
|
@@ -80,7 +90,8 @@
|
|
|
80
90
|
left: var(--avatarteam_bottom_right);
|
|
81
91
|
}
|
|
82
92
|
.smallteam,
|
|
83
|
-
.xsmallteam
|
|
93
|
+
.xsmallteam,
|
|
94
|
+
.xxsmallteam {
|
|
84
95
|
--avatarteam_height: var(--zd_size3);
|
|
85
96
|
--avatarteam_width: var(--zd_size3);
|
|
86
97
|
}
|
|
@@ -94,6 +105,22 @@
|
|
|
94
105
|
--avatarteam_height: var(--zd_size7);
|
|
95
106
|
--avatarteam_width: var(--zd_size7);
|
|
96
107
|
}
|
|
108
|
+
|
|
109
|
+
.xxsmallteam {
|
|
110
|
+
--avatarteam_top_top: 0px;
|
|
111
|
+
}
|
|
112
|
+
.xxsmallteam::after,
|
|
113
|
+
.xxsmallteam:before {
|
|
114
|
+
--avatarteam_bottom_top: var(--zd_size13);
|
|
115
|
+
}
|
|
116
|
+
.xxsmallteam:after {
|
|
117
|
+
--avatarteam_bottom_left: calc(var(--zd_size8) * -1);
|
|
118
|
+
}
|
|
119
|
+
.xxsmallteam:before {
|
|
120
|
+
--avatarteam_bottom_right: calc(var(--zd_size8) * -1);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
|
|
97
124
|
.smallteam::after,
|
|
98
125
|
.smallteam:before {
|
|
99
126
|
--avatarteam_bottom_top: var(--zd_size17);
|
|
@@ -14,9 +14,10 @@ var propTypes = {
|
|
|
14
14
|
needTitle: _propTypes["default"].bool,
|
|
15
15
|
onClick: _propTypes["default"].func,
|
|
16
16
|
palette: _propTypes["default"].oneOf(['primary', 'secondary', 'info']),
|
|
17
|
-
size: _propTypes["default"].oneOf(['small', 'xsmall', 'medium', 'xmedium', 'large', 'xlarge']),
|
|
17
|
+
size: _propTypes["default"].oneOf(['xxsmall', 'small', 'xsmall', 'medium', 'xmedium', 'large', 'xlarge']),
|
|
18
18
|
src: _propTypes["default"].string,
|
|
19
19
|
textPalette: _propTypes["default"].oneOf(['white', 'black']),
|
|
20
|
+
needBorder: _propTypes["default"].bool,
|
|
20
21
|
title: _propTypes["default"].string,
|
|
21
22
|
customClass: _propTypes["default"].shape({
|
|
22
23
|
customAvatar: _propTypes["default"].string,
|
|
@@ -24,6 +25,8 @@ var propTypes = {
|
|
|
24
25
|
}),
|
|
25
26
|
borderOnActive: _propTypes["default"].bool,
|
|
26
27
|
borderOnHover: _propTypes["default"].bool,
|
|
28
|
+
needInnerBorder: _propTypes["default"].bool,
|
|
29
|
+
needDefaultBorder: _propTypes["default"].bool,
|
|
27
30
|
customProps: _propTypes["default"].shape({
|
|
28
31
|
AvatarTeamProps: _propTypes["default"].object,
|
|
29
32
|
AvatarProps: _propTypes["default"].object
|
|
@@ -816,9 +816,7 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
816
816
|
isError: false
|
|
817
817
|
});
|
|
818
818
|
value && onSelect && onSelect('', id);
|
|
819
|
-
this.valueInput && this.valueInput.focus({
|
|
820
|
-
preventScroll: true
|
|
821
|
-
});
|
|
819
|
+
// this.valueInput && this.valueInput.focus({ preventScroll: true });
|
|
822
820
|
}
|
|
823
821
|
}, {
|
|
824
822
|
key: "handleDateTimeClear",
|
|
@@ -283,7 +283,7 @@ var validator = {
|
|
|
283
283
|
datetime: /^(\d{4,6})[/-](1[0-2]|0[1-9])[/\-:](0[1-9]|1[0-9]|2[0-9]|3[0-1])[T](([0-9]|0[0-9]|1[0-9]|2[0-3])[-/:][0-5][0-9])$/,
|
|
284
284
|
datetimezone: /^(\d{4,6})[/-](1[0-2]|0[1-9])[/\-:](0[1-9]|1[0-9]|2[0-9]|3[0-1])[T](([0-9]|0[0-9]|1[0-9]|2[0-3])[-/:][0-5][0-9][-/:.][0-9]{3}[Z])$/,
|
|
285
285
|
url: /^(ht|f)tp(s?):\/\/[-.\w]+[.][\w]+(\/?)([A-z0-9\-.?,:'/+=&%$#_@]*)?$/,
|
|
286
|
-
cleartextpattern: /^([\t-\r !\$',-:\?-z\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]|(?:(?![\
|
|
286
|
+
cleartextpattern: /^([\t-\r !\$',-:\?-z\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]|(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))+$/
|
|
287
287
|
}
|
|
288
288
|
};
|
|
289
289
|
var _default = validator;
|
|
@@ -77,16 +77,18 @@ var Suggestions = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
77
77
|
optionType = suggestion.optionType,
|
|
78
78
|
iconSize = suggestion.iconSize,
|
|
79
79
|
isDisabled = suggestion.isDisabled,
|
|
80
|
-
listItemProps = suggestion.listItemProps
|
|
80
|
+
listItemProps = suggestion.listItemProps,
|
|
81
|
+
_suggestion$listItemC = suggestion.listItemCustomProps,
|
|
82
|
+
listItemCustomProps = _suggestion$listItemC === void 0 ? {} : _suggestion$listItemC;
|
|
81
83
|
var isActive = activeId === id || selectedOptions.indexOf(id) >= 0;
|
|
82
84
|
var isHighlight = hoverOption === index || id === hoverId ? true : false;
|
|
83
85
|
var list_a11y = Object.assign({}, a11y, {
|
|
84
86
|
ariaSelected: isActive,
|
|
85
87
|
ariaLabel: value
|
|
86
88
|
});
|
|
87
|
-
var commonProps = {
|
|
89
|
+
var commonProps = _objectSpread({
|
|
88
90
|
isDisabled: isDisabled
|
|
89
|
-
};
|
|
91
|
+
}, listItemCustomProps);
|
|
90
92
|
if (listItemProps) {
|
|
91
93
|
commonProps.customProps = {
|
|
92
94
|
ListItemProps: _objectSpread({}, listItemProps)
|
package/lib/Popup/Popup.js
CHANGED
|
@@ -387,7 +387,7 @@ var Popup = function Popup(Component) {
|
|
|
387
387
|
Object.keys(popups).forEach(function (groupName) {
|
|
388
388
|
var groupPopups = popups[groupName] || [];
|
|
389
389
|
groupPopups.forEach(function (popup) {
|
|
390
|
-
popup.state.isPopupOpen && (!popup.props.checkBeforeClose || popup.props.checkBeforeClose && popup.props.checkBeforeClose()) && popup.setState({
|
|
390
|
+
popup.state.isPopupOpen && (!popup.props.checkBeforeClose || popup.props.checkBeforeClose && popup.props.checkBeforeClose()) && !(0, _Common.isTextSelected)() && popup.setState({
|
|
391
391
|
isPopupOpen: false,
|
|
392
392
|
isPopupReady: false
|
|
393
393
|
});
|
|
@@ -9,6 +9,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
9
9
|
var styleList = {
|
|
10
10
|
small: _avatarsizesModule["default"].small,
|
|
11
11
|
xsmall: _avatarsizesModule["default"].xsmall,
|
|
12
|
+
xxsmall: _avatarsizesModule["default"].xxsmall,
|
|
12
13
|
medium: _avatarsizesModule["default"].medium,
|
|
13
14
|
xmedium: _avatarsizesModule["default"].xmedium,
|
|
14
15
|
large: _avatarsizesModule["default"].large,
|
|
@@ -40,9 +40,27 @@ var TextBoxIcon = /*#__PURE__*/function (_React$Component) {
|
|
|
40
40
|
};
|
|
41
41
|
_this.handleFocus = _this.handleFocus.bind(_assertThisInitialized(_this));
|
|
42
42
|
_this.handleBlur = _this.handleBlur.bind(_assertThisInitialized(_this));
|
|
43
|
+
_this.handleRef = _this.handleRef.bind(_assertThisInitialized(_this));
|
|
44
|
+
_this.handleClear = _this.handleClear.bind(_assertThisInitialized(_this));
|
|
43
45
|
return _this;
|
|
44
46
|
}
|
|
45
47
|
_createClass(TextBoxIcon, [{
|
|
48
|
+
key: "handleRef",
|
|
49
|
+
value: function handleRef(ele) {
|
|
50
|
+
var inputRef = this.props.inputRef;
|
|
51
|
+
this.inputEle = ele;
|
|
52
|
+
inputRef && inputRef(ele);
|
|
53
|
+
}
|
|
54
|
+
}, {
|
|
55
|
+
key: "handleClear",
|
|
56
|
+
value: function handleClear() {
|
|
57
|
+
var onClear = this.props.onClear;
|
|
58
|
+
onClear && onClear();
|
|
59
|
+
this.inputEle && this.inputEle.focus({
|
|
60
|
+
preventScroll: true
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}, {
|
|
46
64
|
key: "handleFocus",
|
|
47
65
|
value: function handleFocus(e) {
|
|
48
66
|
var _this$props = this.props,
|
|
@@ -76,7 +94,6 @@ var TextBoxIcon = /*#__PURE__*/function (_React$Component) {
|
|
|
76
94
|
placeHolder = _this$props2.placeHolder,
|
|
77
95
|
size = _this$props2.size,
|
|
78
96
|
onKeyUp = _this$props2.onKeyUp,
|
|
79
|
-
inputRef = _this$props2.inputRef,
|
|
80
97
|
isReadOnly = _this$props2.isReadOnly,
|
|
81
98
|
isDisabled = _this$props2.isDisabled,
|
|
82
99
|
children = _this$props2.children,
|
|
@@ -145,7 +162,7 @@ var TextBoxIcon = /*#__PURE__*/function (_React$Component) {
|
|
|
145
162
|
onClick: onClick,
|
|
146
163
|
isReadOnly: isReadOnly,
|
|
147
164
|
isDisabled: isDisabled,
|
|
148
|
-
inputRef:
|
|
165
|
+
inputRef: this.handleRef,
|
|
149
166
|
needReadOnlyStyle: needReadOnlyStyle,
|
|
150
167
|
isClickable: isClickable,
|
|
151
168
|
onKeyPress: onKeyPress,
|
|
@@ -159,7 +176,7 @@ var TextBoxIcon = /*#__PURE__*/function (_React$Component) {
|
|
|
159
176
|
alignBox: "row"
|
|
160
177
|
}, value && onClear && value.length > 1 && !isDisabled && !isReadOnly || showClearIcon ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
161
178
|
className: "".concat(_semanticButtonModule["default"].buttonReset, " ").concat(_TextBoxIconModule["default"].icon),
|
|
162
|
-
onClick:
|
|
179
|
+
onClick: this.handleClear,
|
|
163
180
|
dataId: "".concat(dataId, "_ClearIcon"),
|
|
164
181
|
"data-title": clearText,
|
|
165
182
|
tagName: "button"
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
.medium,
|
|
10
10
|
.xmedium,
|
|
11
11
|
.large,
|
|
12
|
-
.xlarge
|
|
12
|
+
.xlarge,
|
|
13
|
+
.xxsmall {
|
|
13
14
|
composes: varClass;
|
|
14
15
|
width: var(--avatar_width);
|
|
15
16
|
height: var(--avatar_height);
|
|
@@ -18,7 +19,10 @@
|
|
|
18
19
|
--avatar_height: var(--zd_size22);
|
|
19
20
|
--avatar_width: var(--zd_size22);
|
|
20
21
|
}
|
|
21
|
-
|
|
22
|
+
.xxsmall {
|
|
23
|
+
--avatar_height: var(--zd_size18);
|
|
24
|
+
--avatar_width: var(--zd_size18);
|
|
25
|
+
}
|
|
22
26
|
.xsmall {
|
|
23
27
|
--avatar_height: var(--zd_size30);
|
|
24
28
|
--avatar_width: var(--zd_size30);
|
package/lib/utils/Common.js
CHANGED
|
@@ -26,6 +26,7 @@ exports.getSearchString = getSearchString;
|
|
|
26
26
|
exports.getStringifiedOutputForJson = getStringifiedOutputForJson;
|
|
27
27
|
exports.getTotalDimension = void 0;
|
|
28
28
|
exports.isDescendant = isDescendant;
|
|
29
|
+
exports.isTextSelected = isTextSelected;
|
|
29
30
|
exports.mapValues = mapValues;
|
|
30
31
|
exports.merge = merge;
|
|
31
32
|
exports.parseDecimal = void 0;
|
|
@@ -384,8 +385,23 @@ function findScrollEnd(element) {
|
|
|
384
385
|
if (scrollHeight <= Math.ceil(scrollTop + offsetHeight)) {
|
|
385
386
|
return true;
|
|
386
387
|
}
|
|
387
|
-
}
|
|
388
|
-
|
|
388
|
+
}
|
|
389
|
+
// else {
|
|
390
|
+
|
|
391
|
+
// throw 'Is scroll not present in this element';
|
|
392
|
+
// }
|
|
393
|
+
return false;
|
|
394
|
+
}
|
|
395
|
+
function isTextSelected() {
|
|
396
|
+
var selectedText = '';
|
|
397
|
+
if (window.getSelection) {
|
|
398
|
+
selectedText = window.getSelection().toString();
|
|
399
|
+
console.log(selectedText, 'selectedText');
|
|
400
|
+
} else if (document.getSelection) {
|
|
401
|
+
selectedText = document.getSelection().toString();
|
|
402
|
+
}
|
|
403
|
+
if (selectedText !== '') {
|
|
404
|
+
return true;
|
|
389
405
|
}
|
|
390
406
|
return false;
|
|
391
407
|
}
|
package/package.json
CHANGED
package/css_error.log
DELETED
|
File without changes
|