@zohodesk/components 1.2.37 → 1.2.38
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/.cli/propValidation_report.html +1 -1
- package/README.md +14 -0
- package/es/CheckBox/CheckBox.js +3 -2
- package/es/CheckBox/props/propTypes.js +2 -1
- package/es/DateTime/DateWidget.js +8 -3
- package/es/DateTime/DateWidget.module.css +1 -0
- package/es/DateTime/__tests__/__snapshots__/DateTime.spec.js.snap +3 -3
- package/es/DateTime/__tests__/__snapshots__/DateWidget.spec.js.snap +1 -1
- package/es/DateTime/__tests__/__snapshots__/Time.spec.js.snap +3 -3
- package/es/DropBox/DropBoxElement/DropBoxElement.js +1 -1
- package/es/DropBox/DropBoxPositionMapping.js +142 -0
- package/es/MultiSelect/MultiSelect.js +11 -3
- package/es/MultiSelect/MultiSelect.module.css +4 -0
- package/es/MultiSelect/__tests__/__snapshots__/MultiSelect.spec.js.snap +1 -1
- package/es/MultiSelect/__tests__/__snapshots__/MultiSelectWithAvatar.spec.js.snap +1 -1
- package/es/MultiSelect/props/defaultProps.js +2 -1
- package/es/MultiSelect/props/propTypes.js +4 -1
- package/es/Popup/Popup.js +1 -1
- package/es/Popup/PositionMapping.js +72 -0
- package/es/Select/Select.js +13 -8
- package/es/Select/Select.module.css +3 -0
- package/es/Select/SelectWithIcon.js +24 -4
- package/es/Select/__tests__/__snapshots__/Select.spec.js.snap +1 -1
- package/es/Select/__tests__/__snapshots__/SelectWithIcon.spec.js.snap +1 -1
- package/es/Select/props/defaultProps.js +2 -1
- package/es/Select/props/propTypes.js +6 -1
- package/es/TextBoxIcon/TextBoxIcon.js +3 -2
- package/es/TextBoxIcon/props/propTypes.js +2 -1
- package/es/v1/DropBox/DropBoxElement/DropBoxElement.js +1 -1
- package/es/v1/Popup/Popup.js +1 -1
- package/lib/CheckBox/CheckBox.js +3 -2
- package/lib/CheckBox/props/propTypes.js +2 -1
- package/lib/DateTime/DateWidget.js +11 -4
- package/lib/DateTime/DateWidget.module.css +1 -0
- package/lib/DateTime/__tests__/__snapshots__/DateTime.spec.js.snap +3 -3
- package/lib/DateTime/__tests__/__snapshots__/DateWidget.spec.js.snap +1 -1
- package/lib/DateTime/__tests__/__snapshots__/Time.spec.js.snap +3 -3
- package/lib/DropBox/DropBoxElement/DropBoxElement.js +1 -1
- package/lib/DropBox/DropBoxPositionMapping.js +149 -0
- package/lib/MultiSelect/MultiSelect.js +12 -4
- package/lib/MultiSelect/MultiSelect.module.css +4 -0
- package/lib/MultiSelect/__tests__/__snapshots__/MultiSelect.spec.js.snap +1 -1
- package/lib/MultiSelect/__tests__/__snapshots__/MultiSelectWithAvatar.spec.js.snap +1 -1
- package/lib/MultiSelect/props/defaultProps.js +2 -1
- package/lib/MultiSelect/props/propTypes.js +4 -1
- package/lib/Popup/Popup.js +1 -1
- package/lib/Popup/PositionMapping.js +81 -0
- package/lib/Select/Select.js +14 -9
- package/lib/Select/Select.module.css +3 -0
- package/lib/Select/SelectWithIcon.js +33 -6
- package/lib/Select/__tests__/__snapshots__/Select.spec.js.snap +1 -1
- package/lib/Select/__tests__/__snapshots__/SelectWithIcon.spec.js.snap +1 -1
- package/lib/Select/props/defaultProps.js +1 -1
- package/lib/Select/props/propTypes.js +6 -1
- package/lib/TextBoxIcon/TextBoxIcon.js +3 -2
- package/lib/TextBoxIcon/props/propTypes.js +2 -1
- package/lib/v1/DropBox/DropBoxElement/DropBoxElement.js +1 -1
- package/lib/v1/Popup/Popup.js +1 -1
- package/package.json +1 -1
- package/result.json +1 -1
- package/es/DropBox/DropBoxPositionMapping.json +0 -145
- package/es/Popup/PositionMapping.json +0 -74
- package/lib/DropBox/DropBoxPositionMapping.json +0 -145
- package/lib/Popup/PositionMapping.json +0 -74
package/README.md
CHANGED
|
@@ -32,6 +32,20 @@ In this Package, we Provide Some Basic Components to Build Web App
|
|
|
32
32
|
- TextBoxIcon
|
|
33
33
|
- Tooltip
|
|
34
34
|
|
|
35
|
+
# 1.2.38
|
|
36
|
+
|
|
37
|
+
- **renderRightPlaceholderNode**
|
|
38
|
+
- renderRightPlaceholderNode support given for `CheckBox` `Textarea` `Select` `MultiSelect` `TextBoxIcon`.
|
|
39
|
+
- Json File Import Changed to JS modules in `Popup/PositionMapping` `DropBox/DropBoxPositionMapping`.
|
|
40
|
+
- **DateWidget**
|
|
41
|
+
- TextBoxIconProps key supported in customProps prop
|
|
42
|
+
- **MultiSelect**
|
|
43
|
+
- customProps prop added and TextBoxIconProps customization given (Prop Spreaded).
|
|
44
|
+
- **Select**
|
|
45
|
+
- TextBoxIconProps key supported in customProps prop
|
|
46
|
+
- **SelectWithIcon**
|
|
47
|
+
- customProps prop added and tooltip supported for dotted case
|
|
48
|
+
|
|
35
49
|
# 1.2.37
|
|
36
50
|
|
|
37
51
|
- **Tabs**
|
package/es/CheckBox/CheckBox.js
CHANGED
|
@@ -52,7 +52,8 @@ export default class CheckBox extends React.Component {
|
|
|
52
52
|
a11y,
|
|
53
53
|
customClass,
|
|
54
54
|
customProps,
|
|
55
|
-
dataSelectorId
|
|
55
|
+
dataSelectorId,
|
|
56
|
+
renderRightPlaceholderNode
|
|
56
57
|
} = this.props;
|
|
57
58
|
let {
|
|
58
59
|
CheckBoxProps = {},
|
|
@@ -157,7 +158,7 @@ export default class CheckBox extends React.Component {
|
|
|
157
158
|
${accessMode} ${customLabel}`,
|
|
158
159
|
title: toolTip ? toolTip : text,
|
|
159
160
|
...LabelProps
|
|
160
|
-
})));
|
|
161
|
+
})), renderRightPlaceholderNode ? renderRightPlaceholderNode : null);
|
|
161
162
|
}
|
|
162
163
|
|
|
163
164
|
}
|
|
@@ -1008,7 +1008,8 @@ class DateWidgetComponent extends React.Component {
|
|
|
1008
1008
|
} = this.props;
|
|
1009
1009
|
const {
|
|
1010
1010
|
DateTimeProps = {},
|
|
1011
|
-
TextBoxProps = {}
|
|
1011
|
+
TextBoxProps = {},
|
|
1012
|
+
TextBoxIconProps = {}
|
|
1012
1013
|
} = customProps;
|
|
1013
1014
|
const {
|
|
1014
1015
|
selected: value = '',
|
|
@@ -1062,11 +1063,15 @@ class DateWidgetComponent extends React.Component {
|
|
|
1062
1063
|
isFocus: isPopupReady,
|
|
1063
1064
|
autoComplete: false,
|
|
1064
1065
|
a11y: a11y,
|
|
1065
|
-
customProps: TextBoxProps
|
|
1066
|
+
customProps: TextBoxProps,
|
|
1067
|
+
...TextBoxIconProps
|
|
1066
1068
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
1069
|
+
isInline: true,
|
|
1067
1070
|
align: "both",
|
|
1071
|
+
isCover: false,
|
|
1068
1072
|
onClick: isDisabled || isReadOnly ? null : this.handleDateIconClick,
|
|
1069
|
-
dataId: `${dataId}_datePicker
|
|
1073
|
+
dataId: `${dataId}_datePicker`,
|
|
1074
|
+
className: style.datePickIcon
|
|
1070
1075
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
1071
1076
|
name: "ZD-datepicker",
|
|
1072
1077
|
size: "12"
|
|
@@ -670,7 +670,7 @@ exports[`DateTime rendering the isActive is true and isDefaultPosition is true 1
|
|
|
670
670
|
data-test-id="boxComponent"
|
|
671
671
|
>
|
|
672
672
|
<div
|
|
673
|
-
class="
|
|
673
|
+
class="rightPlaceholder inflex rowdir both"
|
|
674
674
|
data-id="containerComponent"
|
|
675
675
|
data-selector-id="container"
|
|
676
676
|
data-test-id="containerComponent"
|
|
@@ -770,7 +770,7 @@ exports[`DateTime rendering the isActive is true and isDefaultPosition is true 1
|
|
|
770
770
|
data-test-id="boxComponent"
|
|
771
771
|
>
|
|
772
772
|
<div
|
|
773
|
-
class="
|
|
773
|
+
class="rightPlaceholder inflex rowdir both"
|
|
774
774
|
data-id="containerComponent"
|
|
775
775
|
data-selector-id="container"
|
|
776
776
|
data-test-id="containerComponent"
|
|
@@ -870,7 +870,7 @@ exports[`DateTime rendering the isActive is true and isDefaultPosition is true 1
|
|
|
870
870
|
data-test-id="boxComponent"
|
|
871
871
|
>
|
|
872
872
|
<div
|
|
873
|
-
class="
|
|
873
|
+
class="rightPlaceholder inflex rowdir both"
|
|
874
874
|
data-id="containerComponent"
|
|
875
875
|
data-selector-id="container"
|
|
876
876
|
data-test-id="containerComponent"
|
|
@@ -52,7 +52,7 @@ exports[`DateWidget rendering the defult props 1`] = `
|
|
|
52
52
|
data-test-id="boxComponent"
|
|
53
53
|
>
|
|
54
54
|
<div
|
|
55
|
-
class="
|
|
55
|
+
class="datePickIcon inflex coldir both"
|
|
56
56
|
data-id="dateWidget_datePicker"
|
|
57
57
|
data-selector-id="container"
|
|
58
58
|
data-test-id="dateWidget_datePicker"
|
|
@@ -77,7 +77,7 @@ exports[`Time rendering the defult props 1`] = `
|
|
|
77
77
|
data-test-id="boxComponent"
|
|
78
78
|
>
|
|
79
79
|
<div
|
|
80
|
-
class="
|
|
80
|
+
class="rightPlaceholder inflex rowdir both"
|
|
81
81
|
data-id="containerComponent"
|
|
82
82
|
data-selector-id="container"
|
|
83
83
|
data-test-id="containerComponent"
|
|
@@ -175,7 +175,7 @@ exports[`Time rendering the defult props 1`] = `
|
|
|
175
175
|
data-test-id="boxComponent"
|
|
176
176
|
>
|
|
177
177
|
<div
|
|
178
|
-
class="
|
|
178
|
+
class="rightPlaceholder inflex rowdir both"
|
|
179
179
|
data-id="containerComponent"
|
|
180
180
|
data-selector-id="container"
|
|
181
181
|
data-test-id="containerComponent"
|
|
@@ -273,7 +273,7 @@ exports[`Time rendering the defult props 1`] = `
|
|
|
273
273
|
data-test-id="boxComponent"
|
|
274
274
|
>
|
|
275
275
|
<div
|
|
276
|
-
class="
|
|
276
|
+
class="rightPlaceholder inflex rowdir both"
|
|
277
277
|
data-id="containerComponent"
|
|
278
278
|
data-selector-id="container"
|
|
279
279
|
data-test-id="containerComponent"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import useDropboxPosCalc from "./useDropboxPosCalc";
|
|
3
3
|
import cssJSLogic from "./css/cssJSLogic";
|
|
4
|
-
import { positionMapping } from "../DropBoxPositionMapping.
|
|
4
|
+
import { positionMapping } from "../DropBoxPositionMapping.js";
|
|
5
5
|
import { DropBoxElementDefaultProps } from "./props/defaultProps";
|
|
6
6
|
import { DropBoxElementPropTypes } from "./props/propTypes";
|
|
7
7
|
import { mergeStyle } from '@zohodesk/utils';
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
export const positionMapping = {
|
|
2
|
+
"bottomCenter": {
|
|
3
|
+
"direction": "bottom",
|
|
4
|
+
"arrowPosition": "mid",
|
|
5
|
+
"positionStyle": "bottomMid"
|
|
6
|
+
},
|
|
7
|
+
"bottomLeftToRight": {
|
|
8
|
+
"direction": "bottom",
|
|
9
|
+
"arrowPosition": "start",
|
|
10
|
+
"positionStyle": "bottomEnd"
|
|
11
|
+
},
|
|
12
|
+
"bottomCenterToRight": {
|
|
13
|
+
"direction": "bottom",
|
|
14
|
+
"arrowPosition": "start",
|
|
15
|
+
"positionStyle": "bottomEnd"
|
|
16
|
+
},
|
|
17
|
+
"bottomRightToLeft": {
|
|
18
|
+
"direction": "bottom",
|
|
19
|
+
"arrowPosition": "end",
|
|
20
|
+
"positionStyle": "bottomStart"
|
|
21
|
+
},
|
|
22
|
+
"bottomCenterToLeft": {
|
|
23
|
+
"direction": "bottom",
|
|
24
|
+
"arrowPosition": "end",
|
|
25
|
+
"positionStyle": "bottomStart"
|
|
26
|
+
},
|
|
27
|
+
"topCenter": {
|
|
28
|
+
"direction": "top",
|
|
29
|
+
"arrowPosition": "mid",
|
|
30
|
+
"positionStyle": "topMid"
|
|
31
|
+
},
|
|
32
|
+
"topLeftToRight": {
|
|
33
|
+
"direction": "top",
|
|
34
|
+
"arrowPosition": "start",
|
|
35
|
+
"positionStyle": "topEnd"
|
|
36
|
+
},
|
|
37
|
+
"topCenterToRight": {
|
|
38
|
+
"direction": "top",
|
|
39
|
+
"arrowPosition": "start",
|
|
40
|
+
"positionStyle": "topEnd"
|
|
41
|
+
},
|
|
42
|
+
"topRightToLeft": {
|
|
43
|
+
"direction": "top",
|
|
44
|
+
"arrowPosition": "end",
|
|
45
|
+
"positionStyle": "topStart"
|
|
46
|
+
},
|
|
47
|
+
"topCenterToLeft": {
|
|
48
|
+
"direction": "top",
|
|
49
|
+
"arrowPosition": "end",
|
|
50
|
+
"positionStyle": "topStart"
|
|
51
|
+
},
|
|
52
|
+
"rightCenter": {
|
|
53
|
+
"direction": "right",
|
|
54
|
+
"arrowPosition": "mid",
|
|
55
|
+
"positionStyle": "rightMid"
|
|
56
|
+
},
|
|
57
|
+
"rightTopToBottom": {
|
|
58
|
+
"direction": "right",
|
|
59
|
+
"arrowPosition": "start",
|
|
60
|
+
"positionStyle": "rightEnd"
|
|
61
|
+
},
|
|
62
|
+
"rightCenterToBottom": {
|
|
63
|
+
"direction": "right",
|
|
64
|
+
"arrowPosition": "start",
|
|
65
|
+
"positionStyle": "rightEnd"
|
|
66
|
+
},
|
|
67
|
+
"rightBottomToTop": {
|
|
68
|
+
"direction": "right",
|
|
69
|
+
"arrowPosition": "end",
|
|
70
|
+
"positionStyle": "rightStart"
|
|
71
|
+
},
|
|
72
|
+
"rightCenterToTop": {
|
|
73
|
+
"direction": "right",
|
|
74
|
+
"arrowPosition": "end",
|
|
75
|
+
"positionStyle": "rightStart"
|
|
76
|
+
},
|
|
77
|
+
"leftCenter": {
|
|
78
|
+
"direction": "left",
|
|
79
|
+
"arrowPosition": "mid",
|
|
80
|
+
"positionStyle": "leftMid"
|
|
81
|
+
},
|
|
82
|
+
"leftTopToBottom": {
|
|
83
|
+
"direction": "left",
|
|
84
|
+
"arrowPosition": "start",
|
|
85
|
+
"positionStyle": "leftEnd"
|
|
86
|
+
},
|
|
87
|
+
"leftCenterToBottom": {
|
|
88
|
+
"direction": "left",
|
|
89
|
+
"arrowPosition": "start",
|
|
90
|
+
"positionStyle": "leftEnd"
|
|
91
|
+
},
|
|
92
|
+
"leftBottomToTop": {
|
|
93
|
+
"direction": "left",
|
|
94
|
+
"arrowPosition": "end",
|
|
95
|
+
"positionStyle": "leftStart"
|
|
96
|
+
},
|
|
97
|
+
"leftCenterToTop": {
|
|
98
|
+
"direction": "left",
|
|
99
|
+
"arrowPosition": "end",
|
|
100
|
+
"positionStyle": "leftStart"
|
|
101
|
+
},
|
|
102
|
+
"bottomRight": {
|
|
103
|
+
"direction": "bottom",
|
|
104
|
+
"arrowPosition": "start",
|
|
105
|
+
"positionStyle": "bottomEnd"
|
|
106
|
+
},
|
|
107
|
+
"bottomLeft": {
|
|
108
|
+
"direction": "bottom",
|
|
109
|
+
"arrowPosition": "end",
|
|
110
|
+
"positionStyle": "bottomStart"
|
|
111
|
+
},
|
|
112
|
+
"topRight": {
|
|
113
|
+
"direction": "top",
|
|
114
|
+
"arrowPosition": "start",
|
|
115
|
+
"positionStyle": "topEnd"
|
|
116
|
+
},
|
|
117
|
+
"topLeft": {
|
|
118
|
+
"direction": "top",
|
|
119
|
+
"arrowPosition": "end",
|
|
120
|
+
"positionStyle": "topStart"
|
|
121
|
+
},
|
|
122
|
+
"rightBottom": {
|
|
123
|
+
"direction": "right",
|
|
124
|
+
"arrowPosition": "start",
|
|
125
|
+
"positionStyle": "rightEnd"
|
|
126
|
+
},
|
|
127
|
+
"rightTop": {
|
|
128
|
+
"direction": "right",
|
|
129
|
+
"arrowPosition": "end",
|
|
130
|
+
"positionStyle": "rightStart"
|
|
131
|
+
},
|
|
132
|
+
"leftBottom": {
|
|
133
|
+
"direction": "left",
|
|
134
|
+
"arrowPosition": "start",
|
|
135
|
+
"positionStyle": "leftEnd"
|
|
136
|
+
},
|
|
137
|
+
"leftTop": {
|
|
138
|
+
"direction": "left",
|
|
139
|
+
"arrowPosition": "end",
|
|
140
|
+
"positionStyle": "leftStart"
|
|
141
|
+
}
|
|
142
|
+
};
|
|
@@ -864,7 +864,8 @@ export class MultiSelectComponent extends React.Component {
|
|
|
864
864
|
dataId,
|
|
865
865
|
setAriaId,
|
|
866
866
|
isPopupOpen,
|
|
867
|
-
ariaErrorId
|
|
867
|
+
ariaErrorId,
|
|
868
|
+
customProps
|
|
868
869
|
} = this.props;
|
|
869
870
|
let {
|
|
870
871
|
isActive,
|
|
@@ -886,6 +887,9 @@ export class MultiSelectComponent extends React.Component {
|
|
|
886
887
|
disabledOptions
|
|
887
888
|
});
|
|
888
889
|
const isShowClearIcon = !isReadOnly && !isDisabled && !disableAction && isShowClear;
|
|
890
|
+
let {
|
|
891
|
+
TextBoxIconProps = {}
|
|
892
|
+
} = customProps;
|
|
889
893
|
return /*#__PURE__*/React.createElement(Container, {
|
|
890
894
|
align: "vertical",
|
|
891
895
|
alignBox: "row",
|
|
@@ -941,10 +945,14 @@ export class MultiSelectComponent extends React.Component {
|
|
|
941
945
|
ariaDescribedby: ariaErrorId,
|
|
942
946
|
ariaLabelledby: ariaLabelledby
|
|
943
947
|
},
|
|
944
|
-
autoComplete: autoComplete
|
|
948
|
+
autoComplete: autoComplete,
|
|
949
|
+
...TextBoxIconProps
|
|
945
950
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
951
|
+
isInline: true,
|
|
952
|
+
isCover: false,
|
|
946
953
|
alignBox: "row",
|
|
947
|
-
align: "vertical"
|
|
954
|
+
align: "vertical",
|
|
955
|
+
className: style.rightPlaceholder
|
|
948
956
|
}, isShowClearIcon ? /*#__PURE__*/React.createElement(Box, {
|
|
949
957
|
className: `${style.delete} ${style[`${palette}Delete`]}`,
|
|
950
958
|
dataId: `${dataId}_clearIcon`,
|
|
@@ -70,7 +70,7 @@ exports[`MultiSelect rendering the defult props 1`] = `
|
|
|
70
70
|
data-test-id="boxComponent"
|
|
71
71
|
>
|
|
72
72
|
<div
|
|
73
|
-
class="
|
|
73
|
+
class="rightPlaceholder inflex rowdir vCenter"
|
|
74
74
|
data-id="containerComponent"
|
|
75
75
|
data-selector-id="container"
|
|
76
76
|
data-test-id="containerComponent"
|
|
@@ -69,7 +69,7 @@ exports[`MultiSelectWithAvatar rendering the defult props 1`] = `
|
|
|
69
69
|
data-test-id="boxComponent"
|
|
70
70
|
>
|
|
71
71
|
<div
|
|
72
|
-
class="
|
|
72
|
+
class="rightPlaceholder inflex rowdir vCenter"
|
|
73
73
|
data-id="containerComponent"
|
|
74
74
|
data-selector-id="container"
|
|
75
75
|
data-test-id="containerComponent"
|
|
@@ -111,7 +111,8 @@ export const MultiSelect_defaultProps = {
|
|
|
111
111
|
keepSelectedOptions: false,
|
|
112
112
|
selectedOptionsCount: 0,
|
|
113
113
|
cardHeaderName: '',
|
|
114
|
-
needResponsive: true
|
|
114
|
+
needResponsive: true,
|
|
115
|
+
customProps: {}
|
|
115
116
|
};
|
|
116
117
|
export const MultiSelectHeader_defaultProps = {
|
|
117
118
|
dataId: 'MultiSelectHeader'
|
|
@@ -104,7 +104,10 @@ export const MultiSelect_propTypes = {
|
|
|
104
104
|
needSelectAll: PropTypes.bool,
|
|
105
105
|
selectAllText: PropTypes.string,
|
|
106
106
|
setAriaId: PropTypes.string,
|
|
107
|
-
ariaErrorId: PropTypes.string
|
|
107
|
+
ariaErrorId: PropTypes.string,
|
|
108
|
+
customProps: PropTypes.shape({
|
|
109
|
+
TextBoxIconProps: PropTypes.object
|
|
110
|
+
})
|
|
108
111
|
};
|
|
109
112
|
export const MultiSelectHeader_propTypes = {
|
|
110
113
|
dataId: PropTypes.string,
|
package/es/Popup/Popup.js
CHANGED
|
@@ -6,7 +6,7 @@ import hoistStatics from 'hoist-non-react-statics';
|
|
|
6
6
|
|
|
7
7
|
import { debounce, isDescendant, isTextSelected, cancelBubblingEffect } from "../utils/Common.js";
|
|
8
8
|
import viewPort from "./viewPort";
|
|
9
|
-
import { absolutePositionMapping, rtlAbsolutePositionMapping, rtlFixedPositionMapping } from "./PositionMapping.
|
|
9
|
+
import { absolutePositionMapping, rtlAbsolutePositionMapping, rtlFixedPositionMapping } from "./PositionMapping.js";
|
|
10
10
|
import ResizeObserver from '@zohodesk/virtualizer/lib/commons/ResizeObserver.js';
|
|
11
11
|
let lastOpenedGroup = [];
|
|
12
12
|
let popups = {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export const absolutePositionMapping = {
|
|
2
|
+
"bottomCenter": "bottomCenter",
|
|
3
|
+
"bottomRight": "bottomLeftToRight",
|
|
4
|
+
"bottomLeft": "bottomRightToLeft",
|
|
5
|
+
"topCenter": "topCenter",
|
|
6
|
+
"topRight": "topLeftToRight",
|
|
7
|
+
"topLeft": "topRightToLeft",
|
|
8
|
+
"rightCenter": "rightCenter",
|
|
9
|
+
"rightBottom": "rightTopToBottom",
|
|
10
|
+
"rightTop": "rightBottomToTop",
|
|
11
|
+
"leftCenter": "leftCenter",
|
|
12
|
+
"leftBottom": "leftTopToBottom",
|
|
13
|
+
"leftTop": "leftBottomToTop",
|
|
14
|
+
"bottomLeftToRight": "bottomLeftToRight",
|
|
15
|
+
"bottomRightToLeft": "bottomRightToLeft",
|
|
16
|
+
"topLeftToRight": "topLeftToRight",
|
|
17
|
+
"topRightToLeft": "topRightToLeft",
|
|
18
|
+
"rightTopToBottom": "rightTopToBottom",
|
|
19
|
+
"rightBottomToTop": "rightBottomToTop",
|
|
20
|
+
"leftTopToBottom": "leftTopToBottom"
|
|
21
|
+
};
|
|
22
|
+
export const rtlAbsolutePositionMapping = {
|
|
23
|
+
"bottomCenter": "bottomCenter",
|
|
24
|
+
"bottomRight": "bottomRightToLeft",
|
|
25
|
+
"bottomLeft": "bottomLeftToRight",
|
|
26
|
+
"topCenter": "topCenter",
|
|
27
|
+
"topRight": "topRightToLeft",
|
|
28
|
+
"topLeft": "topLeftToRight",
|
|
29
|
+
"rightCenter": "leftCenter",
|
|
30
|
+
"rightBottom": "leftTopToBottom",
|
|
31
|
+
"rightTop": "leftBottomToTop",
|
|
32
|
+
"leftCenter": "rightCenter",
|
|
33
|
+
"leftBottom": "rightTopToBottom",
|
|
34
|
+
"leftTop": "rightBottomToTop",
|
|
35
|
+
"bottomLeftToRight": "bottomLeftToRight",
|
|
36
|
+
"bottomRightToLeft": "bottomRightToLeft",
|
|
37
|
+
"topLeftToRight": "topLeftToRight",
|
|
38
|
+
"topRightToLeft": "topRightToLeft",
|
|
39
|
+
"rightTopToBottom": "rightTopToBottom",
|
|
40
|
+
"rightBottomToTop": "rightBottomToTop",
|
|
41
|
+
"leftTopToBottom": "leftTopToBottom"
|
|
42
|
+
};
|
|
43
|
+
export const rtlFixedPositionMapping = {
|
|
44
|
+
"bottomCenter": "bottomCenter",
|
|
45
|
+
"bottomLeftToRight": "bottomRightToLeft",
|
|
46
|
+
"bottomCenterToRight": "bottomCenterToLeft",
|
|
47
|
+
"bottomRightToLeft": "bottomLeftToRight",
|
|
48
|
+
"bottomCenterToLeft": "bottomCenterToRight",
|
|
49
|
+
"topCenter": "topCenter",
|
|
50
|
+
"topLeftToRight": "topRightToLeft",
|
|
51
|
+
"topCenterToRight": "topCenterToLeft",
|
|
52
|
+
"topRightToLeft": "topLeftToRight",
|
|
53
|
+
"topCenterToLeft": "topCenterToRight",
|
|
54
|
+
"rightTopToBottom": "leftTopToBottom",
|
|
55
|
+
"rightCenterToBottom": "leftCenterToBottom",
|
|
56
|
+
"rightCenter": "leftCenter",
|
|
57
|
+
"rightBottomToTop": "leftBottomToTop",
|
|
58
|
+
"rightCenterToTop": "leftCenterToTop",
|
|
59
|
+
"leftTopToBottom": "rightTopToBottom",
|
|
60
|
+
"leftCenterToBottom": "rightCenterToBottom",
|
|
61
|
+
"leftCenter": "rightCenter",
|
|
62
|
+
"leftBottomToTop": "rightBottomToTop",
|
|
63
|
+
"leftCenterToTop": "rightCenterToTop",
|
|
64
|
+
"bottomRight": "bottomLeft",
|
|
65
|
+
"bottomLeft": "bottomRight",
|
|
66
|
+
"topRight": "topLeft",
|
|
67
|
+
"topLeft": "topRight",
|
|
68
|
+
"rightBottom": "leftBottom",
|
|
69
|
+
"rightTop": "leftTop",
|
|
70
|
+
"leftBottom": "rightBottom",
|
|
71
|
+
"leftTop": "rightTop"
|
|
72
|
+
};
|
package/es/Select/Select.js
CHANGED
|
@@ -749,7 +749,8 @@ export class SelectComponent extends Component {
|
|
|
749
749
|
let {
|
|
750
750
|
TextBoxProps = {},
|
|
751
751
|
DropdownSearchTextBoxProps = {},
|
|
752
|
-
SuggestionsProps = {}
|
|
752
|
+
SuggestionsProps = {},
|
|
753
|
+
TextBoxIconProps = {}
|
|
753
754
|
} = customProps;
|
|
754
755
|
return /*#__PURE__*/React.createElement("div", {
|
|
755
756
|
className: `${isParentBased || isReadOnly || isDisabled ? style.container : ''} ${style[`box_${size}`]} ${isReadOnly ? style.readonly : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''} ${iconOnHover && (isReadOnly || isDisabled) ? style.iconOnHoverReadonly : iconOnHover && !(isReadOnly || isDisabled) ? style.iconOnHoverStyle : ''}`,
|
|
@@ -803,14 +804,15 @@ export class SelectComponent extends Component {
|
|
|
803
804
|
'data-title': title || selected,
|
|
804
805
|
...TextBoxProps
|
|
805
806
|
}
|
|
806
|
-
}
|
|
807
|
+
},
|
|
808
|
+
...TextBoxIconProps
|
|
807
809
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
810
|
+
isInline: true,
|
|
811
|
+
isCover: false,
|
|
808
812
|
alignBox: "row",
|
|
809
|
-
align: "both"
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
dataId: `${dataId}_children`
|
|
813
|
-
}, children) : null, /*#__PURE__*/React.createElement(Container, {
|
|
813
|
+
align: "both",
|
|
814
|
+
className: style.rightPlaceholder
|
|
815
|
+
}, /*#__PURE__*/React.createElement(Container, {
|
|
814
816
|
align: "both",
|
|
815
817
|
dataId: `${dataId}_downIcon`,
|
|
816
818
|
"aria-hidden": true,
|
|
@@ -818,7 +820,10 @@ export class SelectComponent extends Component {
|
|
|
818
820
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
819
821
|
name: "ZD-down",
|
|
820
822
|
size: "7"
|
|
821
|
-
}))
|
|
823
|
+
})), children ? /*#__PURE__*/React.createElement(Box, {
|
|
824
|
+
className: isPopupOpen ? style.rotate : '',
|
|
825
|
+
dataId: `${dataId}_children`
|
|
826
|
+
}, children) : null)) : /*#__PURE__*/React.createElement(Textbox, {
|
|
822
827
|
a11y: {
|
|
823
828
|
role: 'Menuitem',
|
|
824
829
|
ariaLabel: TextBox_ally_label,
|
|
@@ -345,7 +345,8 @@ class SelectWithIcon extends Component {
|
|
|
345
345
|
i18nKeys,
|
|
346
346
|
htmlId,
|
|
347
347
|
isLoading,
|
|
348
|
-
dataSelectorId
|
|
348
|
+
dataSelectorId,
|
|
349
|
+
customProps
|
|
349
350
|
} = this.props;
|
|
350
351
|
i18nKeys = Object.assign({}, i18nKeys, {
|
|
351
352
|
emptyText: i18nKeys.emptyText || emptyMessage,
|
|
@@ -359,6 +360,11 @@ class SelectWithIcon extends Component {
|
|
|
359
360
|
} = this.state;
|
|
360
361
|
let setAriaId = this.getNextAriaId();
|
|
361
362
|
let ariaErrorId = this.getNextAriaId();
|
|
363
|
+
let {
|
|
364
|
+
TextBoxProps = {},
|
|
365
|
+
DropdownSearchTextBoxProps = {},
|
|
366
|
+
TextBoxIconProps = {}
|
|
367
|
+
} = customProps;
|
|
362
368
|
return /*#__PURE__*/React.createElement("div", {
|
|
363
369
|
className: `${style.container} ${style[`box_${size}`]} ${isReadOnly ? style.readonly : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''}`,
|
|
364
370
|
"data-title": isDisabled ? title : null,
|
|
@@ -413,10 +419,21 @@ class SelectWithIcon extends Component {
|
|
|
413
419
|
needEffect: isReadOnly || isDisabled ? false : true,
|
|
414
420
|
borderColor: borderColor,
|
|
415
421
|
autoComplete: false,
|
|
416
|
-
isFocus: isPopupReady
|
|
422
|
+
isFocus: isPopupReady,
|
|
423
|
+
customProps: {
|
|
424
|
+
TextBoxProps: {
|
|
425
|
+
'data-title': title || selectedValue,
|
|
426
|
+
...TextBoxProps
|
|
427
|
+
}
|
|
428
|
+
},
|
|
429
|
+
...TextBoxIconProps
|
|
417
430
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
431
|
+
isInline: true,
|
|
432
|
+
isCover: false,
|
|
418
433
|
align: "both",
|
|
419
|
-
dataId: `${dataId}_downIcon
|
|
434
|
+
dataId: `${dataId}_downIcon`,
|
|
435
|
+
alignBox: "both",
|
|
436
|
+
className: style.rightPlaceholder
|
|
420
437
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
421
438
|
name: "ZD-down",
|
|
422
439
|
size: "7"
|
|
@@ -467,7 +484,10 @@ class SelectWithIcon extends Component {
|
|
|
467
484
|
a11y: {
|
|
468
485
|
ariaDescribedby: ariaErrorId
|
|
469
486
|
},
|
|
470
|
-
autoComplete: false
|
|
487
|
+
autoComplete: false,
|
|
488
|
+
customProps: {
|
|
489
|
+
TextBoxProps: DropdownSearchTextBoxProps
|
|
490
|
+
}
|
|
471
491
|
}))) : null, /*#__PURE__*/React.createElement(CardContent, {
|
|
472
492
|
customClass: `${tabletMode ? style.responsivedropBoxList : style.dropBoxList} ${!tabletMode && dropBoxSize ? style[dropBoxSize] : ''}`,
|
|
473
493
|
shrink: true,
|
|
@@ -62,7 +62,7 @@ exports[`Select rendering the defult props 1`] = `
|
|
|
62
62
|
data-test-id="boxComponent"
|
|
63
63
|
>
|
|
64
64
|
<div
|
|
65
|
-
class="
|
|
65
|
+
class="rightPlaceholder inflex rowdir both"
|
|
66
66
|
data-id="containerComponent"
|
|
67
67
|
data-selector-id="container"
|
|
68
68
|
data-test-id="containerComponent"
|
|
@@ -79,7 +79,7 @@ exports[`SelectWithIcon rendering the defult props 1`] = `
|
|
|
79
79
|
data-test-id="boxComponent"
|
|
80
80
|
>
|
|
81
81
|
<div
|
|
82
|
-
class="
|
|
82
|
+
class="rightPlaceholder inflex both"
|
|
83
83
|
data-id="selectWithIcon_downIcon"
|
|
84
84
|
data-selector-id="container"
|
|
85
85
|
data-test-id="selectWithIcon_downIcon"
|
|
@@ -284,5 +284,10 @@ export const SelectWithIcon_propTypes = {
|
|
|
284
284
|
searchBoxSize: PropTypes.string,
|
|
285
285
|
needResponsive: PropTypes.bool,
|
|
286
286
|
boxSize: PropTypes.string,
|
|
287
|
-
emptyMessage: PropTypes.string
|
|
287
|
+
emptyMessage: PropTypes.string,
|
|
288
|
+
customProps: PropTypes.shape({
|
|
289
|
+
TextBoxProps: PropTypes.object,
|
|
290
|
+
DropdownSearchTextBoxProps: PropTypes.object,
|
|
291
|
+
TextBoxIconProps: PropTypes.object
|
|
292
|
+
})
|
|
288
293
|
};
|
|
@@ -100,7 +100,8 @@ export default class TextBoxIcon extends React.Component {
|
|
|
100
100
|
isFocus,
|
|
101
101
|
onClearMouseDown,
|
|
102
102
|
isScrollPrevent,
|
|
103
|
-
customProps
|
|
103
|
+
customProps,
|
|
104
|
+
renderRightPlaceholderNode
|
|
104
105
|
} = this.props;
|
|
105
106
|
const {
|
|
106
107
|
isActive
|
|
@@ -172,7 +173,7 @@ export default class TextBoxIcon extends React.Component {
|
|
|
172
173
|
size: "14"
|
|
173
174
|
}))) : null, children ? /*#__PURE__*/React.createElement(Box, {
|
|
174
175
|
className: `${style.icon} ${iconRotated ? style.rotated : ''}`
|
|
175
|
-
}, children) : null)), needBorder && /*#__PURE__*/React.createElement("div", {
|
|
176
|
+
}, children) : null, renderRightPlaceholderNode ? /*#__PURE__*/React.createElement(Box, null, renderRightPlaceholderNode) : null)), needBorder && /*#__PURE__*/React.createElement("div", {
|
|
176
177
|
className: `${style.line} ${style[`borderColor_${borderColor}`]} ${customTBoxLine}`
|
|
177
178
|
}));
|
|
178
179
|
}
|