@zohodesk/components 1.0.0-temp-211.2 → 1.0.0-temp-217
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 +118 -31
- package/es/AvatarTeam/props/propTypes.js +2 -1
- package/es/CheckBox/CheckBox.js +6 -5
- package/es/CheckBox/CheckBox.module.css +5 -2
- package/es/CheckBox/__tests__/__snapshots__/CheckBox.spec.js.snap +64 -64
- package/es/DateTime/CalendarView.js +17 -12
- package/es/DateTime/DateTime.js +26 -8
- package/es/DateTime/DateTime.module.css +5 -5
- package/es/DateTime/DateWidget.js +13 -2
- package/es/DateTime/DaysRow.js +3 -2
- package/es/DateTime/__tests__/__snapshots__/DateTime.spec.js.snap +7 -7
- package/es/DateTime/props/defaultProps.js +9 -3
- package/es/DateTime/props/propTypes.js +16 -4
- package/es/DropBox/DropBoxElement/DropBoxElement.js +3 -1
- package/es/DropBox/DropBoxElement/__tests__/__snapshots__/DropBoxElement.spec.js.snap +1 -0
- package/es/DropBox/__tests__/__snapshots__/DropBox.spec.js.snap +1 -0
- package/es/DropDown/__tests__/__snapshots__/DropDown.spec.js.snap +1 -0
- package/es/ListItem/ListItemWithAvatar.js +7 -3
- package/es/ListItem/__tests__/__snapshots__/ListItemWithCheckBox.spec.js.snap +2 -2
- package/es/ListItem/__tests__/__snapshots__/ListItemWithRadio.spec.js.snap +1 -1
- package/es/ListItem/props/propTypes.js +6 -1
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +4 -2
- package/es/MultiSelect/AdvancedMultiSelect.js +4 -2
- package/es/MultiSelect/MultiSelect.js +11 -3
- package/es/MultiSelect/props/propTypes.js +6 -3
- package/es/Popup/Popup.js +125 -7
- package/es/Popup/intersectionObserver.js +49 -0
- package/es/Popup/props/propTypes.js +30 -0
- package/es/Radio/Radio.js +9 -7
- package/es/Radio/Radio.module.css +1 -1
- package/es/Radio/__tests__/__snapshots__/Radio.spec.js.snap +77 -77
- package/es/Responsive/ResizeObserver.js +21 -85
- package/es/Responsive/ResizeObserverWithPolyfill.js +140 -0
- package/es/ResponsiveDropBox/__tests__/__snapshots__/ResponsiveDropBox.spec.js.snap +1 -0
- package/es/Select/GroupSelect.js +15 -3
- package/es/Select/props/defaultProps.js +2 -1
- package/es/Select/props/propTypes.js +5 -1
- package/es/Tag/Tag.js +10 -3
- package/es/Tag/props/defaultProps.js +2 -1
- package/es/Tag/props/propTypes.js +7 -1
- package/es/TextBox/TextBox.js +1 -1
- package/es/Textarea/Textarea.js +4 -2
- package/es/Textarea/Textarea.module.css +1 -1
- package/es/Textarea/__tests__/__snapshots__/Textarea.spec.js.snap +41 -41
- package/es/Textarea/props/propTypes.js +2 -1
- package/es/Typography/Typography.js +38 -0
- package/es/Typography/css/Typography.module.css +489 -0
- package/es/Typography/css/cssJSLogic.js +56 -0
- package/es/Typography/props/defaultProps.js +8 -0
- package/es/Typography/props/propTypes.js +27 -0
- package/es/Typography/utils/index.js +50 -0
- package/es/index.js +1 -1
- package/es/v1/AppContainer/AppContainer.js +0 -6
- package/es/v1/DateTime/CalendarView.js +9 -6
- package/es/v1/DateTime/DateTime.js +18 -4
- package/es/v1/DateTime/DateWidget.js +5 -1
- package/es/v1/DateTime/DaysRow.js +3 -2
- package/es/v1/DateTime/props/defaultProps.js +9 -3
- package/es/v1/DateTime/props/propTypes.js +11 -4
- package/es/v1/MultiSelect/MultiSelect.js +7 -1
- package/es/v1/Select/GroupSelect.js +5 -0
- package/es/v1/Typography/Typography.js +1 -1
- package/lib/AvatarTeam/props/propTypes.js +3 -1
- package/lib/CheckBox/CheckBox.js +5 -4
- package/lib/CheckBox/CheckBox.module.css +5 -2
- package/lib/CheckBox/__tests__/__snapshots__/CheckBox.spec.js.snap +64 -64
- package/lib/DateTime/CalendarView.js +17 -12
- package/lib/DateTime/DateTime.js +38 -9
- package/lib/DateTime/DateTime.module.css +5 -5
- package/lib/DateTime/DateWidget.js +13 -2
- package/lib/DateTime/DaysRow.js +3 -2
- package/lib/DateTime/__tests__/__snapshots__/DateTime.spec.js.snap +7 -7
- package/lib/DateTime/props/defaultProps.js +9 -3
- package/lib/DateTime/props/propTypes.js +16 -4
- package/lib/DropBox/DropBoxElement/DropBoxElement.js +3 -1
- package/lib/DropBox/DropBoxElement/__tests__/__snapshots__/DropBoxElement.spec.js.snap +1 -0
- package/lib/DropBox/__tests__/__snapshots__/DropBox.spec.js.snap +1 -0
- package/lib/DropDown/__tests__/__snapshots__/DropDown.spec.js.snap +1 -0
- package/lib/ListItem/ListItemWithAvatar.js +8 -4
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithCheckBox.spec.js.snap +2 -2
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithRadio.spec.js.snap +1 -1
- package/lib/ListItem/props/propTypes.js +8 -1
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +4 -2
- package/lib/MultiSelect/AdvancedMultiSelect.js +4 -2
- package/lib/MultiSelect/MultiSelect.js +11 -3
- package/lib/MultiSelect/props/propTypes.js +8 -6
- package/lib/Popup/Popup.js +135 -8
- package/lib/Popup/intersectionObserver.js +72 -0
- package/lib/Popup/props/propTypes.js +51 -0
- package/lib/Radio/Radio.js +10 -7
- package/lib/Radio/Radio.module.css +1 -1
- package/lib/Radio/__tests__/__snapshots__/Radio.spec.js.snap +77 -77
- package/lib/Responsive/ResizeObserver.js +20 -88
- package/lib/Responsive/ResizeObserverWithPolyfill.js +168 -0
- package/lib/ResponsiveDropBox/__tests__/__snapshots__/ResponsiveDropBox.spec.js.snap +1 -0
- package/lib/Select/GroupSelect.js +17 -5
- package/lib/Select/props/defaultProps.js +2 -1
- package/lib/Select/props/propTypes.js +5 -1
- package/lib/Tag/Tag.js +10 -5
- package/lib/Tag/props/defaultProps.js +2 -1
- package/lib/Tag/props/propTypes.js +9 -1
- package/lib/TextBox/TextBox.js +1 -1
- package/lib/Textarea/Textarea.js +4 -2
- package/lib/Textarea/Textarea.module.css +1 -1
- package/lib/Textarea/__tests__/__snapshots__/Textarea.spec.js.snap +41 -41
- package/lib/Textarea/props/propTypes.js +2 -1
- package/lib/Typography/Typography.js +56 -0
- package/lib/Typography/css/Typography.module.css +489 -0
- package/lib/Typography/css/cssJSLogic.js +48 -0
- package/lib/Typography/props/defaultProps.js +15 -0
- package/lib/Typography/props/propTypes.js +38 -0
- package/lib/Typography/utils/index.js +59 -0
- package/lib/index.js +1 -1
- package/lib/v1/AppContainer/AppContainer.js +0 -12
- package/lib/v1/DateTime/CalendarView.js +9 -6
- package/lib/v1/DateTime/DateTime.js +27 -4
- package/lib/v1/DateTime/DateWidget.js +5 -1
- package/lib/v1/DateTime/DaysRow.js +3 -2
- package/lib/v1/DateTime/props/defaultProps.js +9 -3
- package/lib/v1/DateTime/props/propTypes.js +11 -4
- package/lib/v1/MultiSelect/MultiSelect.js +7 -1
- package/lib/v1/Select/GroupSelect.js +5 -0
- package/lib/v1/Typography/Typography.js +2 -2
- package/package.json +8 -8
- package/propValidationArg.json +1 -1
- /package/es/v1/Typography/css/{Typography.module.css → v1_Typography.module.css} +0 -0
- /package/lib/v1/Typography/css/{Typography.module.css → v1_Typography.module.css} +0 -0
|
@@ -1,68 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
function getSize(element) {
|
|
9
|
-
let {
|
|
10
|
-
offsetHeight,
|
|
11
|
-
offsetWidth
|
|
12
|
-
} = element; // const { height, width } = element.getBoundingClientRect();
|
|
1
|
+
function getBorderBoxSizeFromEntry(entry) {
|
|
2
|
+
const {
|
|
3
|
+
borderBoxSize
|
|
4
|
+
} = entry;
|
|
5
|
+
return borderBoxSize[0];
|
|
6
|
+
}
|
|
13
7
|
|
|
8
|
+
function getSize(entry) {
|
|
9
|
+
const borderBoxSize = getBorderBoxSizeFromEntry(entry);
|
|
14
10
|
return {
|
|
15
|
-
height:
|
|
16
|
-
width:
|
|
11
|
+
height: borderBoxSize.blockSize,
|
|
12
|
+
width: borderBoxSize.inlineSize
|
|
17
13
|
};
|
|
18
14
|
}
|
|
19
15
|
|
|
20
|
-
function dispatch() {
|
|
21
|
-
let resizeResponsive = new Event('resizeResponsive');
|
|
22
|
-
window.dispatchEvent(resizeResponsive);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
if (!hasResizeObserver) {
|
|
26
|
-
let interval = null;
|
|
27
|
-
window.addEventListener('resize', () => {
|
|
28
|
-
clearTimeout(interval);
|
|
29
|
-
interval = setTimeout(dispatch, 100);
|
|
30
|
-
});
|
|
31
|
-
} // NOTE: this is not full polyfill , we just wrote what types of changes wlli
|
|
32
|
-
|
|
33
|
-
|
|
34
16
|
export default class ResizeObserverPolyfill {
|
|
35
17
|
constructor(onResize) {
|
|
36
|
-
// method finding
|
|
37
|
-
this.transitionEndHandler = this.transitionEndHandler.bind(this);
|
|
38
|
-
this.resizeHandlerDispatch = this.resizeHandlerDispatch.bind(this);
|
|
39
18
|
this.resizeHandler = this.resizeHandler.bind(this);
|
|
40
|
-
this.replaceResizeHandler = this.replaceResizeHandler.bind(this);
|
|
41
|
-
this.debounce = this.debounce.bind(this);
|
|
42
19
|
this.onResize = onResize;
|
|
43
20
|
this.targetNode = null;
|
|
44
21
|
this.size = {
|
|
45
22
|
height: 0,
|
|
46
23
|
width: 0
|
|
47
24
|
};
|
|
48
|
-
|
|
49
|
-
if (hasResizeObserver) {
|
|
50
|
-
this.resizeObserverInstance = new window.ResizeObserver(this.resizeHandlerDispatch);
|
|
51
|
-
} else {
|
|
52
|
-
this.mutationObserverInstance = new window.MutationObserver(this.resizeHandlerDispatch);
|
|
53
|
-
}
|
|
25
|
+
this.resizeObserverInstance = new window.ResizeObserver(this.resizeHandler);
|
|
54
26
|
}
|
|
55
27
|
|
|
56
28
|
replaceResizeHandler(onResize) {
|
|
57
29
|
this.onResize = onResize;
|
|
58
30
|
}
|
|
59
31
|
|
|
60
|
-
|
|
61
|
-
|
|
32
|
+
getEntry(entries) {
|
|
33
|
+
return entries[0];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
resizeHandler(entries) {
|
|
37
|
+
if (!this.targetNode || !entries.length) {
|
|
62
38
|
return;
|
|
63
39
|
}
|
|
64
40
|
|
|
65
|
-
const
|
|
41
|
+
const entry = this.getEntry(entries);
|
|
42
|
+
const currentSize = getSize(entry);
|
|
66
43
|
|
|
67
44
|
if (this.size && currentSize.height === this.size.height && currentSize.width === this.size.width) {
|
|
68
45
|
return;
|
|
@@ -73,48 +50,9 @@ export default class ResizeObserverPolyfill {
|
|
|
73
50
|
return true;
|
|
74
51
|
}
|
|
75
52
|
|
|
76
|
-
resizeHandlerDispatch() {
|
|
77
|
-
if (!this.resizeHandler() || hasResizeObserver) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
dispatch();
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
debounce() {
|
|
85
|
-
clearTimeout(this.interval);
|
|
86
|
-
this.interval = setTimeout(this.resizeHandler, 100);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
transitionEndHandler(event) {
|
|
90
|
-
if (event.propertyName.indexOf('color') === -1) {
|
|
91
|
-
this.resizeHandlerDispatch();
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
addEventListeners(targetNode) {
|
|
96
|
-
targetNode.addEventListener('transitionend', this.transitionEndHandler);
|
|
97
|
-
window.addEventListener('resizeResponsive', this.debounce);
|
|
98
|
-
targetNode.addEventListener('animationend', this.resizeHandlerDispatch);
|
|
99
|
-
targetNode.addEventListener('webkitAnimationEnd', this.resizeHandlerDispatch);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
removeEventListeners(targetNode) {
|
|
103
|
-
targetNode.removeEventListener('transitionend', this.transitionEndHandler);
|
|
104
|
-
window.removeEventListener('resizeResponsive', this.debounce);
|
|
105
|
-
targetNode.removeEventListener('animationend', this.resizeHandlerDispatch);
|
|
106
|
-
targetNode.removeEventListener('webkitAnimationEnd', this.resizeHandlerDispatch);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
53
|
observe(targetNode) {
|
|
110
54
|
this.targetNode = targetNode;
|
|
111
|
-
|
|
112
|
-
if (hasResizeObserver) {
|
|
113
|
-
this.resizeObserverInstance.observe(targetNode);
|
|
114
|
-
} else {
|
|
115
|
-
this.addEventListeners(targetNode);
|
|
116
|
-
this.mutationObserverInstance.observe(targetNode, mutationObserverOptions);
|
|
117
|
-
}
|
|
55
|
+
this.resizeObserverInstance.observe(targetNode);
|
|
118
56
|
}
|
|
119
57
|
|
|
120
58
|
replaceObservationElement(targetNode) {
|
|
@@ -124,12 +62,10 @@ export default class ResizeObserverPolyfill {
|
|
|
124
62
|
|
|
125
63
|
this.targetNode && this.disconnect();
|
|
126
64
|
targetNode && this.observe(targetNode);
|
|
127
|
-
targetNode && this.resizeHandlerDispatch();
|
|
128
65
|
}
|
|
129
66
|
|
|
130
67
|
disconnect() {
|
|
131
|
-
this.
|
|
132
|
-
hasResizeObserver ? this.resizeObserverInstance.disconnect() : this.mutationObserverInstance.disconnect();
|
|
68
|
+
this.resizeObserverInstance.disconnect();
|
|
133
69
|
this.targetNode = null;
|
|
134
70
|
this.size = {
|
|
135
71
|
height: 0,
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
const hasResizeObserver = !!window.ResizeObserver;
|
|
2
|
+
const mutationObserverOptions = {
|
|
3
|
+
//NOTE: we donot consider child Count
|
|
4
|
+
// childList: true,
|
|
5
|
+
attributes: true
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
function getSize(element) {
|
|
9
|
+
let {
|
|
10
|
+
offsetHeight,
|
|
11
|
+
offsetWidth
|
|
12
|
+
} = element; // const { height, width } = element.getBoundingClientRect();
|
|
13
|
+
|
|
14
|
+
return {
|
|
15
|
+
height: offsetHeight,
|
|
16
|
+
width: offsetWidth
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function dispatch() {
|
|
21
|
+
let resizeResponsive = new Event('resizeResponsive');
|
|
22
|
+
window.dispatchEvent(resizeResponsive);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (!hasResizeObserver) {
|
|
26
|
+
let interval = null;
|
|
27
|
+
window.addEventListener('resize', () => {
|
|
28
|
+
clearTimeout(interval);
|
|
29
|
+
interval = setTimeout(dispatch, 100);
|
|
30
|
+
});
|
|
31
|
+
} // NOTE: this is not full polyfill , we just wrote what types of changes wlli
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
export default class ResizeObserverPolyfill {
|
|
35
|
+
constructor(onResize) {
|
|
36
|
+
// method finding
|
|
37
|
+
this.transitionEndHandler = this.transitionEndHandler.bind(this);
|
|
38
|
+
this.resizeHandlerDispatch = this.resizeHandlerDispatch.bind(this);
|
|
39
|
+
this.resizeHandler = this.resizeHandler.bind(this);
|
|
40
|
+
this.replaceResizeHandler = this.replaceResizeHandler.bind(this);
|
|
41
|
+
this.debounce = this.debounce.bind(this);
|
|
42
|
+
this.onResize = onResize;
|
|
43
|
+
this.targetNode = null;
|
|
44
|
+
this.size = {
|
|
45
|
+
height: 0,
|
|
46
|
+
width: 0
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
if (hasResizeObserver) {
|
|
50
|
+
this.resizeObserverInstance = new window.ResizeObserver(this.resizeHandlerDispatch);
|
|
51
|
+
} else {
|
|
52
|
+
this.mutationObserverInstance = new window.MutationObserver(this.resizeHandlerDispatch);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
replaceResizeHandler(onResize) {
|
|
57
|
+
this.onResize = onResize;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
resizeHandler() {
|
|
61
|
+
if (!this.targetNode) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const currentSize = getSize(this.targetNode); // if (this.size && shallowCompare(currentSize, this.size)) {
|
|
66
|
+
|
|
67
|
+
if (this.size && currentSize.height === this.size.height && currentSize.width === this.size.width) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
this.size = currentSize;
|
|
72
|
+
this.onResize(this.size, this.targetNode);
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
resizeHandlerDispatch() {
|
|
77
|
+
if (!this.resizeHandler() || hasResizeObserver) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
dispatch();
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
debounce() {
|
|
85
|
+
clearTimeout(this.interval);
|
|
86
|
+
this.interval = setTimeout(this.resizeHandler, 100);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
transitionEndHandler(event) {
|
|
90
|
+
if (event.propertyName.indexOf('color') === -1) {
|
|
91
|
+
this.resizeHandlerDispatch();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
addEventListeners(targetNode) {
|
|
96
|
+
targetNode.addEventListener('transitionend', this.transitionEndHandler);
|
|
97
|
+
window.addEventListener('resizeResponsive', this.debounce);
|
|
98
|
+
targetNode.addEventListener('animationend', this.resizeHandlerDispatch);
|
|
99
|
+
targetNode.addEventListener('webkitAnimationEnd', this.resizeHandlerDispatch);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
removeEventListeners(targetNode) {
|
|
103
|
+
targetNode.removeEventListener('transitionend', this.transitionEndHandler);
|
|
104
|
+
window.removeEventListener('resizeResponsive', this.debounce);
|
|
105
|
+
targetNode.removeEventListener('animationend', this.resizeHandlerDispatch);
|
|
106
|
+
targetNode.removeEventListener('webkitAnimationEnd', this.resizeHandlerDispatch);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
observe(targetNode) {
|
|
110
|
+
this.targetNode = targetNode;
|
|
111
|
+
|
|
112
|
+
if (hasResizeObserver) {
|
|
113
|
+
this.resizeObserverInstance.observe(targetNode);
|
|
114
|
+
} else {
|
|
115
|
+
this.addEventListeners(targetNode);
|
|
116
|
+
this.mutationObserverInstance.observe(targetNode, mutationObserverOptions);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
replaceObservationElement(targetNode) {
|
|
121
|
+
if (this.targetNode === targetNode) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
this.targetNode && this.disconnect();
|
|
126
|
+
targetNode && this.observe(targetNode);
|
|
127
|
+
targetNode && this.resizeHandlerDispatch();
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
disconnect() {
|
|
131
|
+
this.targetNode && this.removeEventListeners(this.targetNode);
|
|
132
|
+
hasResizeObserver ? this.resizeObserverInstance.disconnect() : this.mutationObserverInstance.disconnect();
|
|
133
|
+
this.targetNode = null;
|
|
134
|
+
this.size = {
|
|
135
|
+
height: 0,
|
|
136
|
+
width: 0
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
}
|
package/es/Select/GroupSelect.js
CHANGED
|
@@ -588,12 +588,17 @@ export class GroupSelectComponent extends PureComponent {
|
|
|
588
588
|
htmlId,
|
|
589
589
|
iconOnHover,
|
|
590
590
|
isLoading,
|
|
591
|
-
dataSelectorId
|
|
591
|
+
dataSelectorId,
|
|
592
|
+
customProps
|
|
592
593
|
} = this.props;
|
|
593
594
|
i18nKeys = Object.assign({}, i18nKeys, {
|
|
594
595
|
emptyText: i18nKeys.emptyText || emptyMessage,
|
|
595
596
|
searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage
|
|
596
597
|
});
|
|
598
|
+
const {
|
|
599
|
+
TextBoxIcon_i18n,
|
|
600
|
+
TextBox_ally_label = 'Click to select options'
|
|
601
|
+
} = i18nKeys;
|
|
597
602
|
let {
|
|
598
603
|
selectedId,
|
|
599
604
|
hoverIndex,
|
|
@@ -613,6 +618,10 @@ export class GroupSelectComponent extends PureComponent {
|
|
|
613
618
|
} = normalizedFormatOptions[selectedId] || {};
|
|
614
619
|
let setAriaId = this.getNextAriaId();
|
|
615
620
|
let ariaErrorId = this.getNextAriaId();
|
|
621
|
+
let {
|
|
622
|
+
TextBoxIconProps = {},
|
|
623
|
+
TextBoxProps = {}
|
|
624
|
+
} = customProps;
|
|
616
625
|
return /*#__PURE__*/React.createElement("div", {
|
|
617
626
|
className: `${style.container} ${style[`box_${size}`]} ${isReadOnly ? style.readonly : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''} ${iconOnHover && (isReadOnly || isDisabled) ? style.iconOnHoverReadonly : iconOnHover && !(isReadOnly || isDisabled) ? style.iconOnHoverStyle : ''}`,
|
|
618
627
|
"data-id": dataIdSlctComp,
|
|
@@ -653,8 +662,10 @@ export class GroupSelectComponent extends PureComponent {
|
|
|
653
662
|
ariaActivedescendant: selectedId,
|
|
654
663
|
ariaOwns: setAriaId
|
|
655
664
|
},
|
|
665
|
+
i18nKeys: TextBoxIcon_i18n,
|
|
656
666
|
isFocus: isPopupReady,
|
|
657
|
-
autoComplete: false
|
|
667
|
+
autoComplete: false,
|
|
668
|
+
...TextBoxIconProps
|
|
658
669
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
659
670
|
align: "both",
|
|
660
671
|
dataId: dataIdDownIcon
|
|
@@ -691,7 +702,8 @@ export class GroupSelectComponent extends PureComponent {
|
|
|
691
702
|
ariaOwns: setAriaId
|
|
692
703
|
},
|
|
693
704
|
autoComplete: false,
|
|
694
|
-
isFocus: isPopupReady
|
|
705
|
+
isFocus: isPopupReady,
|
|
706
|
+
...TextBoxProps
|
|
695
707
|
}))), !isReadOnly && !isDisabled && isPopupOpen ? /*#__PURE__*/React.createElement(ResponsiveReceiver, {
|
|
696
708
|
query: this.responsiveFunc,
|
|
697
709
|
responsiveId: "Helmet"
|
|
@@ -174,7 +174,11 @@ 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.shape({
|
|
179
|
+
TextBoxProps: PropTypes.object,
|
|
180
|
+
TextBoxIconProps: PropTypes.object
|
|
181
|
+
})
|
|
178
182
|
};
|
|
179
183
|
export const SelectWithAvatar_propTypes = { ...Select_propTypes,
|
|
180
184
|
textBoxClass: PropTypes.string,
|
package/es/Tag/Tag.js
CHANGED
|
@@ -83,8 +83,13 @@ export default class Tag extends PureComponent {
|
|
|
83
83
|
customAttributes,
|
|
84
84
|
a11y,
|
|
85
85
|
needEffect,
|
|
86
|
-
isReadOnly
|
|
86
|
+
isReadOnly,
|
|
87
|
+
customProps
|
|
87
88
|
} = this.props;
|
|
89
|
+
const {
|
|
90
|
+
avatarProps = {},
|
|
91
|
+
iconProps = {}
|
|
92
|
+
} = customProps;
|
|
88
93
|
let {
|
|
89
94
|
customTag = '',
|
|
90
95
|
customTagClose = '',
|
|
@@ -116,13 +121,15 @@ export default class Tag extends PureComponent {
|
|
|
116
121
|
size: "small",
|
|
117
122
|
src: imageURL,
|
|
118
123
|
textPalette: isDarkPalette ? 'white' : '',
|
|
119
|
-
customClass: customAvatar
|
|
124
|
+
customClass: customAvatar,
|
|
125
|
+
...avatarProps
|
|
120
126
|
})) : null, iconName ? /*#__PURE__*/React.createElement("div", {
|
|
121
127
|
className: `${style.icon} ${customTagIcon}`,
|
|
122
128
|
"aria-hidden": true
|
|
123
129
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
124
130
|
name: iconName,
|
|
125
|
-
size: iconSize
|
|
131
|
+
size: iconSize,
|
|
132
|
+
...iconProps
|
|
126
133
|
})) : null, /*#__PURE__*/React.createElement("div", {
|
|
127
134
|
className: `${style.text} ${textSizes}`,
|
|
128
135
|
"aria-hidden": true,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
+
import { propTypes as AvatarPropTypes } from '../../Avatar/props/propTypes.js';
|
|
3
|
+
import { IconProps as IconPropTypes } from '@zohodesk/icons/es/Icon/props/propTypes';
|
|
2
4
|
export const propTypes = {
|
|
3
5
|
active: PropTypes.bool,
|
|
4
6
|
avatarPalette: PropTypes.string,
|
|
@@ -32,5 +34,9 @@ export const propTypes = {
|
|
|
32
34
|
}),
|
|
33
35
|
needEffect: PropTypes.bool,
|
|
34
36
|
isReadOnly: PropTypes.bool,
|
|
35
|
-
dataSelectorId: PropTypes.string
|
|
37
|
+
dataSelectorId: PropTypes.string,
|
|
38
|
+
customProps: PropTypes.shape({
|
|
39
|
+
avatarProps: PropTypes.exact(AvatarPropTypes),
|
|
40
|
+
iconProps: PropTypes.exact(IconPropTypes)
|
|
41
|
+
})
|
|
36
42
|
};
|
package/es/TextBox/TextBox.js
CHANGED
|
@@ -169,7 +169,7 @@ export default class TextBox extends React.PureComponent {
|
|
|
169
169
|
ref: this.inputRef,
|
|
170
170
|
type: type,
|
|
171
171
|
value: value,
|
|
172
|
-
onScroll: isScrollPrevent ? this.handlePreventTextBoxScroll :
|
|
172
|
+
onScroll: isScrollPrevent ? this.handlePreventTextBoxScroll : null,
|
|
173
173
|
onKeyPress: onKeyPress,
|
|
174
174
|
onMouseDown: onMouseDown,
|
|
175
175
|
...options,
|
package/es/Textarea/Textarea.js
CHANGED
|
@@ -58,7 +58,8 @@ export default class Textarea extends React.Component {
|
|
|
58
58
|
autoFocus,
|
|
59
59
|
htmlId,
|
|
60
60
|
a11y,
|
|
61
|
-
customClass
|
|
61
|
+
customClass,
|
|
62
|
+
isFocus
|
|
62
63
|
} = this.props;
|
|
63
64
|
let {
|
|
64
65
|
ariaLabel,
|
|
@@ -84,7 +85,8 @@ export default class Textarea extends React.Component {
|
|
|
84
85
|
options.autoFocus = true;
|
|
85
86
|
}
|
|
86
87
|
|
|
87
|
-
|
|
88
|
+
const isEditable = !(isReadOnly || isDisabled);
|
|
89
|
+
let classList = needAppearance ? `${style.container} ${style[size]} ${style[variant]} ${needBorder ? style.needBorder : style.noBorder} ${resize ? style[resizes[resize]] : style[resizes.none]} ${animated ? `${style[`${size}animated`]}` : ''} ${isDisabled && !needEffect || isReadOnly && !needEffect ? '' : style.effect} ${isEditable && isFocus ? style.active : ''}` : `${style.basic}`;
|
|
88
90
|
return /*#__PURE__*/React.createElement("textarea", {
|
|
89
91
|
"aria-label": ariaLabel,
|
|
90
92
|
"aria-labelledby": ariaLabelledby,
|