@zohodesk/components 1.2.27 → 1.2.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/.cli/PropLessFiles.html +1 -1
  2. package/.cli/propValidation_report.html +1 -1
  3. package/README.md +12 -5
  4. package/es/CheckBox/CheckBox.js +10 -0
  5. package/es/CheckBox/props/propTypes.js +1 -0
  6. package/es/Radio/Radio.js +26 -7
  7. package/es/Radio/Radio.module.css +3 -0
  8. package/es/Radio/__tests__/__snapshots__/Radio.spec.js.snap +3 -3
  9. package/es/Radio/props/defaultProps.js +1 -0
  10. package/es/Radio/props/propTypes.js +7 -0
  11. package/es/v1/Animation/Animation.js +1 -1
  12. package/es/v1/Card/Card.js +1 -1
  13. package/es/v1/CheckBox/CheckBox.js +7 -1
  14. package/es/v1/CheckBox/props/propTypes.js +1 -0
  15. package/es/v1/DropBox/utils/isMobilePopover.js +1 -1
  16. package/es/v1/ListItem/ListContainer.js +1 -1
  17. package/es/v1/MultiSelect/AdvancedGroupMultiSelect.js +1 -1
  18. package/es/v1/MultiSelect/AdvancedMultiSelect.js +1 -1
  19. package/es/v1/MultiSelect/MultiSelectWithAvatar.js +1 -1
  20. package/es/v1/MultiSelect/props/defaultProps.js +1 -1
  21. package/es/v1/Radio/Radio.js +22 -7
  22. package/es/v1/Radio/props/defaultProps.js +1 -0
  23. package/es/v1/Radio/props/propTypes.js +7 -0
  24. package/es/v1/ResponsiveDropBox/ResponsiveDropBox.js +1 -1
  25. package/es/v1/Select/GroupSelect.js +1 -1
  26. package/es/v1/Select/Select.js +1 -1
  27. package/es/v1/Select/SelectWithAvatar.js +1 -1
  28. package/es/v1/Select/SelectWithIcon.js +1 -1
  29. package/es/v1/Select/props/defaultProps.js +1 -1
  30. package/es/v1/Tab/Tabs.js +2 -2
  31. package/es/v1/Tooltip/Tooltip.js +1 -1
  32. package/lib/CheckBox/CheckBox.js +34 -24
  33. package/lib/CheckBox/props/propTypes.js +1 -0
  34. package/lib/Radio/Radio.js +45 -26
  35. package/lib/Radio/Radio.module.css +3 -0
  36. package/lib/Radio/__tests__/__snapshots__/Radio.spec.js.snap +3 -3
  37. package/lib/Radio/props/defaultProps.js +1 -0
  38. package/lib/Radio/props/propTypes.js +7 -0
  39. package/lib/v1/Animation/Animation.js +1 -1
  40. package/lib/v1/Card/Card.js +1 -1
  41. package/lib/v1/CheckBox/CheckBox.js +7 -1
  42. package/lib/v1/CheckBox/props/propTypes.js +1 -0
  43. package/lib/v1/DropBox/utils/isMobilePopover.js +1 -1
  44. package/lib/v1/ListItem/ListContainer.js +1 -1
  45. package/lib/v1/MultiSelect/AdvancedGroupMultiSelect.js +1 -1
  46. package/lib/v1/MultiSelect/AdvancedMultiSelect.js +1 -1
  47. package/lib/v1/MultiSelect/props/defaultProps.js +1 -1
  48. package/lib/v1/Radio/Radio.js +22 -7
  49. package/lib/v1/Radio/props/defaultProps.js +1 -0
  50. package/lib/v1/Radio/props/propTypes.js +7 -0
  51. package/lib/v1/ResponsiveDropBox/ResponsiveDropBox.js +1 -1
  52. package/lib/v1/Select/GroupSelect.js +1 -1
  53. package/lib/v1/Select/Select.js +1 -1
  54. package/lib/v1/Select/SelectWithAvatar.js +1 -1
  55. package/lib/v1/Select/SelectWithIcon.js +1 -1
  56. package/lib/v1/Select/props/defaultProps.js +1 -1
  57. package/lib/v1/Tab/Tabs.js +2 -2
  58. package/lib/v1/Tooltip/Tooltip.js +1 -1
  59. package/package.json +4 -4
  60. package/result.json +1 -1
  61. package/es/v1/Provider/AvatarSize.js +0 -13
  62. package/es/v1/Provider/Config.js +0 -18
  63. package/es/v1/Provider/CssProvider.js +0 -16
  64. package/es/v1/Provider/IdProvider.js +0 -66
  65. package/es/v1/Provider/LibraryContext.js +0 -37
  66. package/es/v1/Provider/LibraryContextInit.js +0 -3
  67. package/es/v1/Provider/NumberGenerator/NumberGenerator.js +0 -136
  68. package/es/v1/Provider/ZindexProvider.js +0 -57
  69. package/es/v1/Provider/index.js +0 -4
  70. package/es/v1/Responsive/CustomResponsive.js +0 -195
  71. package/es/v1/Responsive/RefWrapper.js +0 -39
  72. package/es/v1/Responsive/ResizeComponent.js +0 -197
  73. package/es/v1/Responsive/ResizeObserver.js +0 -140
  74. package/es/v1/Responsive/Responsive.js +0 -194
  75. package/es/v1/Responsive/index.js +0 -9
  76. package/es/v1/Responsive/props/defaultProps.js +0 -13
  77. package/es/v1/Responsive/props/propTypes.js +0 -25
  78. package/lib/v1/Provider/AvatarSize.js +0 -24
  79. package/lib/v1/Provider/Config.js +0 -27
  80. package/lib/v1/Provider/CssProvider.js +0 -27
  81. package/lib/v1/Provider/IdProvider.js +0 -79
  82. package/lib/v1/Provider/LibraryContext.js +0 -76
  83. package/lib/v1/Provider/LibraryContextInit.js +0 -15
  84. package/lib/v1/Provider/NumberGenerator/NumberGenerator.js +0 -174
  85. package/lib/v1/Provider/ZindexProvider.js +0 -69
  86. package/lib/v1/Provider/index.js +0 -81
  87. package/lib/v1/Responsive/CustomResponsive.js +0 -242
  88. package/lib/v1/Responsive/RefWrapper.js +0 -57
  89. package/lib/v1/Responsive/ResizeComponent.js +0 -268
  90. package/lib/v1/Responsive/ResizeObserver.js +0 -168
  91. package/lib/v1/Responsive/Responsive.js +0 -274
  92. package/lib/v1/Responsive/index.js +0 -55
  93. package/lib/v1/Responsive/props/defaultProps.js +0 -23
  94. package/lib/v1/Responsive/props/propTypes.js +0 -39
package/README.md CHANGED
@@ -32,17 +32,24 @@ In this Package, we Provide Some Basic Components to Build Web App
32
32
  - TextBoxIcon
33
33
  - Tooltip
34
34
 
35
+ # 1.2.29
36
+
37
+ - Common providers update for v1 components
38
+
39
+ # 1.2.28
40
+
41
+ - **CheckBox** - getContainerRef prop supported
42
+ - **Radio** - children, customProps, getRef props supported. tabIndex option supported inside a11y prop
43
+
35
44
  # 1.2.27
36
45
 
37
46
  - **DateWidget** - The issue with the YearView Open State Reset on Blur Event in DidMount has been resolved
38
47
 
39
-
40
48
  # 1.2.26
41
49
 
42
- - ** MultiSelect, MultiSelectWithAvatar ** - Mobile Header Render Issue in Mobile Responsive Fixed.
43
- - ** isMobilePopover ** - Function added in Dropbox.
44
- - ** Tag ** - closeTitle not working issue fixed ( because value sends in wrong prop key data-title)
45
-
50
+ - **MultiSelect, MultiSelectWithAvatar** - Mobile Header Render Issue in Mobile Responsive Fixed.
51
+ - **isMobilePopover** - Function added in Dropbox.
52
+ - **Tag** - closeTitle not working issue fixed ( because value sends in wrong prop key data-title)
46
53
 
47
54
  # 1.2.25
48
55
 
@@ -11,6 +11,7 @@ export default class CheckBox extends React.Component {
11
11
  constructor(props) {
12
12
  super(props);
13
13
  this.onChange = this.onChange.bind(this);
14
+ this.handleGetContainerRef = this.handleGetContainerRef.bind(this);
14
15
  }
15
16
 
16
17
  onChange(e) {
@@ -21,6 +22,14 @@ export default class CheckBox extends React.Component {
21
22
  onChange && onChange(!checked, e);
22
23
  }
23
24
 
25
+ handleGetContainerRef(ele) {
26
+ let {
27
+ getContainerRef,
28
+ id
29
+ } = this.props;
30
+ getContainerRef && getContainerRef(ele, id);
31
+ }
32
+
24
33
  render() {
25
34
  let {
26
35
  id,
@@ -78,6 +87,7 @@ export default class CheckBox extends React.Component {
78
87
  onClick: isReadOnly || disabled ? null : this.onChange,
79
88
  tabIndex: isReadOnly || disabled || ariaHidden ? '-1' : '0',
80
89
  "aria-checked": ariaChecked,
90
+ eleRef: this.handleGetContainerRef,
81
91
  role: role,
82
92
  "aria-label": ariaLabel,
83
93
  "aria-labelledby": ariaLabelledby,
@@ -8,6 +8,7 @@ export const propTypes = {
8
8
  disabled: PropTypes.bool,
9
9
  disabledTitle: PropTypes.string,
10
10
  getRef: PropTypes.func,
11
+ getContainerRef: PropTypes.func,
11
12
  id: PropTypes.string,
12
13
  isFilled: PropTypes.bool,
13
14
  isClipped: PropTypes.bool,
package/es/Radio/Radio.js CHANGED
@@ -1,3 +1,5 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
1
3
  /* eslint css-modules/no-unused-class: [2, { markAsUsed: ['small', 'medium'] }] */
2
4
  import React from 'react';
3
5
  import { defaultProps } from './props/defaultProps';
@@ -9,6 +11,7 @@ export default class Radio extends React.Component {
9
11
  constructor(props) {
10
12
  super(props);
11
13
  this.onChange = this.onChange.bind(this);
14
+ this.handleGetRef = this.handleGetRef.bind(this);
12
15
  }
13
16
 
14
17
  onChange(e) {
@@ -19,6 +22,14 @@ export default class Radio extends React.Component {
19
22
  onChange && onChange(value, e);
20
23
  }
21
24
 
25
+ handleGetRef(ele) {
26
+ let {
27
+ getRef,
28
+ value
29
+ } = this.props;
30
+ getRef && getRef(ele, value);
31
+ }
32
+
22
33
  render() {
23
34
  let {
24
35
  id,
@@ -38,6 +49,8 @@ export default class Radio extends React.Component {
38
49
  active,
39
50
  isFilled,
40
51
  customClass,
52
+ customProps,
53
+ children,
41
54
  a11y
42
55
  } = this.props;
43
56
  let {
@@ -50,12 +63,17 @@ export default class Radio extends React.Component {
50
63
  let {
51
64
  ariaHidden,
52
65
  role = 'radio',
66
+ tabIndex,
53
67
  ariaChecked = checked,
54
68
  ariaLabel,
55
69
  ariaLabelledby,
56
70
  ariaReadonly = isReadOnly || disabled ? true : false
57
71
  } = a11y;
58
- return /*#__PURE__*/React.createElement(Container, {
72
+ let {
73
+ ContainerProps = {},
74
+ LabelProps = {}
75
+ } = customProps;
76
+ return /*#__PURE__*/React.createElement(Container, _extends({
59
77
  dataId: value ? value.toLowerCase() : 'RadioComp',
60
78
  isCover: false,
61
79
  isInline: text ? false : true,
@@ -65,13 +83,14 @@ export default class Radio extends React.Component {
65
83
  "data-title": toolTip,
66
84
  onClick: !isReadOnly && !disabled ? this.onChange : '',
67
85
  "aria-checked": ariaChecked,
68
- tabindex: isReadOnly || disabled || ariaHidden ? '-1' : '0',
86
+ tabindex: isReadOnly || disabled || ariaHidden ? '-1' : tabIndex || '0',
87
+ eleRef: this.handleGetRef,
69
88
  role: role,
70
89
  "aria-Hidden": ariaHidden,
71
90
  "aria-label": ariaLabel,
72
91
  "aria-labelledby": ariaLabelledby,
73
92
  "aria-readonly": ariaReadonly
74
- }, /*#__PURE__*/React.createElement(Box, {
93
+ }, ContainerProps), /*#__PURE__*/React.createElement(Box, {
75
94
  className: `${style.radio} ${checked ? `${style[`rdBox${palette}`]}` : ''}
76
95
  ${isReadOnly || disabled ? '' : `${style[`hover${palette}`]}`} ${style[size]} ${isFilled ? style.filled : ''} ${style[`centerPath${palette}`]} ${customRadio}`
77
96
  }, /*#__PURE__*/React.createElement("input", {
@@ -97,18 +116,18 @@ export default class Radio extends React.Component {
97
116
  }) : null))), text && /*#__PURE__*/React.createElement(Box, {
98
117
  flexible: true,
99
118
  className: style.text
100
- }, /*#__PURE__*/React.createElement(Label, {
119
+ }, /*#__PURE__*/React.createElement(Label, _extends({
101
120
  text: text,
102
- palette: disabled ? 'disable' : labelPalette,
121
+ palette: labelPalette,
103
122
  size: labelSize,
104
123
  type: "title",
105
124
  clipped: true,
106
125
  dataId: `${text}_label`,
107
126
  variant: variant,
108
127
  title: toolTip ? toolTip : text,
109
- customClass: `${checked && active && !disabled ? `${style[`${palette}checkedActive`]}` : ''}
128
+ customClass: `${checked && active ? `${style[`${palette}checkedActive`]}` : ''}
110
129
  ${style[`${palette}Label`]} ${accessMode} ${customLabel}`
111
- })));
130
+ }, LabelProps))), children);
112
131
  }
113
132
 
114
133
  }
@@ -21,6 +21,9 @@
21
21
  .readonly, .disabled {
22
22
  cursor: not-allowed;
23
23
  }
24
+ .disabled {
25
+ opacity: 0.7
26
+ }
24
27
  .radio {
25
28
  composes: offSelection from '../common/common.module.css';
26
29
  width: var(--radio_width);
@@ -1145,7 +1145,7 @@ exports[`Radio rendering the accessMode when disabled 1`] = `
1145
1145
  data-test-id="boxComponent"
1146
1146
  >
1147
1147
  <label
1148
- class="label title medium disable font_default
1148
+ class="label title medium default font_default
1149
1149
  dotted cursor
1150
1150
  primaryLabel disabled "
1151
1151
  data-id="RadioText_label"
@@ -1505,7 +1505,7 @@ exports[`Radio rendering the disabled is true 1`] = `
1505
1505
  data-test-id="boxComponent"
1506
1506
  >
1507
1507
  <label
1508
- class="label title medium disable font_default
1508
+ class="label title medium default font_default
1509
1509
  dotted cursor
1510
1510
  undefined disabled "
1511
1511
  data-id="RadioText_label"
@@ -1567,7 +1567,7 @@ exports[`Radio rendering the disabledTitle 1`] = `
1567
1567
  data-test-id="boxComponent"
1568
1568
  >
1569
1569
  <label
1570
- class="label title medium disable font_default
1570
+ class="label title medium default font_default
1571
1571
  dotted cursor
1572
1572
  primaryLabel disabled "
1573
1573
  data-id="RadioText_label"
@@ -10,5 +10,6 @@ export const defaultProps = {
10
10
  variant: 'default',
11
11
  isFilled: true,
12
12
  customClass: {},
13
+ customProps: {},
13
14
  a11y: {}
14
15
  };
@@ -4,6 +4,7 @@ export const propTypes = {
4
4
  checked: PropTypes.bool,
5
5
  disabled: PropTypes.bool,
6
6
  disabledTitle: PropTypes.string,
7
+ getRef: PropTypes.func,
7
8
  id: PropTypes.string,
8
9
  isFilled: PropTypes.bool,
9
10
  isReadOnly: PropTypes.bool,
@@ -20,14 +21,20 @@ export const propTypes = {
20
21
  customRadio: PropTypes.string,
21
22
  customLabel: PropTypes.string
22
23
  }),
24
+ customProps: PropTypes.exact({
25
+ ContainerProps: PropTypes.object,
26
+ LabelProps: PropTypes.object
27
+ }),
23
28
  a11y: PropTypes.shape({
24
29
  ariaChecked: PropTypes.bool,
25
30
  ariaHidden: PropTypes.bool,
26
31
  role: PropTypes.string,
32
+ tabIndex: PropTypes.oneOfType(PropTypes.string, PropTypes.number),
27
33
  ariaLabelledby: PropTypes.string,
28
34
  ariaLabel: PropTypes.string,
29
35
  ariaReadonly: PropTypes.bool
30
36
  }),
37
+ children: PropTypes.node,
31
38
  onChange: PropTypes.func,
32
39
  text: PropTypes.string
33
40
  };
@@ -17,7 +17,7 @@ export default function Animation(props) {
17
17
  } = props;
18
18
  let newClassNames = delayClassName ? Object.assign({}, animationStyle[name], {
19
19
  exit: `${delayClassName} ${animationStyle[name].exit}`
20
- }) : animaanimationStyletion[name];
20
+ }) : animationStyle[name];
21
21
  return /*#__PURE__*/React.createElement(CSSTransition, {
22
22
  classNames: newClassNames && newClassNames,
23
23
  in: isActive,
@@ -3,7 +3,7 @@ import { useEffectCallOnlyAfterState } from '@zohodesk/hooks';
3
3
  import { CardHeader_propTypes, CardContent_propTypes, Card_propTypes, CardFooter_propTypes } from './props/propTypes';
4
4
  import { Card_defaultProps, CardHeader_defaultProps, CardContent_defaultProps, CardFooter_defaultProps } from './props/defaultProps';
5
5
  import { Container, Box } from '../Layout';
6
- import { getLibraryConfig } from '../Provider/Config';
6
+ import { getLibraryConfig } from '../../Provider/Config';
7
7
  import style from '../../Card/Card.module.css';
8
8
  /* eslint-disable react/forbid-component-props */
9
9
 
@@ -5,7 +5,7 @@ import { propTypes } from './props/propTypes';
5
5
  import { defaultProps } from './props/defaultProps';
6
6
  import Label from '../Label/Label';
7
7
  import { Container, Box } from '../Layout';
8
- import CssProvider from '../Provider/CssProvider';
8
+ import CssProvider from '../../Provider/CssProvider';
9
9
  import style from '../../CheckBox/CheckBox.module.css';
10
10
 
11
11
  const CheckBox = props => {
@@ -24,6 +24,7 @@ const CheckBox = props => {
24
24
  isFilled,
25
25
  isClipped,
26
26
  getRef,
27
+ getContainerRef,
27
28
  variant,
28
29
  active,
29
30
  dataId,
@@ -42,6 +43,10 @@ const CheckBox = props => {
42
43
  onChange && onChange(!checked, e);
43
44
  }
44
45
 
46
+ function handleGetContainerRef(ele) {
47
+ getContainerRef && getContainerRef(ele, id);
48
+ }
49
+
45
50
  let {
46
51
  CheckBoxProps = {},
47
52
  LabelProps = {}
@@ -73,6 +78,7 @@ const CheckBox = props => {
73
78
  onClick: isReadOnly || disabled ? null : onChange,
74
79
  tabIndex: isReadOnly || disabled || ariaHidden ? '-1' : '0',
75
80
  "aria-checked": ariaChecked,
81
+ eleRef: handleGetContainerRef,
76
82
  role: role,
77
83
  "aria-label": ariaLabel,
78
84
  "aria-labelledby": ariaLabelledby,
@@ -8,6 +8,7 @@ export const propTypes = {
8
8
  disabled: PropTypes.bool,
9
9
  disabledTitle: PropTypes.string,
10
10
  getRef: PropTypes.func,
11
+ getContainerRef: PropTypes.func,
11
12
  id: PropTypes.string,
12
13
  isFilled: PropTypes.bool,
13
14
  isClipped: PropTypes.bool,
@@ -1,4 +1,4 @@
1
- import { getLibraryConfig } from '../../Provider/Config';
1
+ import { getLibraryConfig } from '../../../Provider/Config';
2
2
  export default function isMobilePopover(needResponsive) {
3
3
  // let { needResponsive } = props;
4
4
  let windowWidth,
@@ -7,7 +7,7 @@ import CssProvider from '../../Provider/CssProvider';
7
7
  import style from '../../ListItem/ListItem.module.css';
8
8
  import { ListContainerDefaultProps } from './props/defaultProps';
9
9
  import { ListContainer_Props } from './props/propTypes';
10
- import { useResponsiveReceiver } from '../Responsive/CustomResponsive';
10
+ import { useResponsiveReceiver } from '../../Responsive/CustomResponsive';
11
11
 
12
12
  const ListContainer = props => {
13
13
  const {
@@ -15,7 +15,7 @@ import EmptyState from './EmptyState';
15
15
  import Card, { CardContent, CardHeader, CardFooter } from '../Card/Card';
16
16
  import { getUniqueId } from '../../Provider/IdProvider';
17
17
  import ResponsiveDropBox from '../ResponsiveDropBox/ResponsiveDropBox';
18
- import { ResponsiveReceiver } from '../Responsive/CustomResponsive';
18
+ import { ResponsiveReceiver } from '../../Responsive/CustomResponsive';
19
19
  /**** Icons ****/
20
20
 
21
21
  import { Icon } from '@zohodesk/icons';
@@ -18,7 +18,7 @@ import Card, { CardContent, CardHeader, CardFooter } from '../Card/Card';
18
18
  import { Icon } from '@zohodesk/icons';
19
19
  import { getUniqueId } from '../../Provider/IdProvider';
20
20
  import ResponsiveDropBox from '../ResponsiveDropBox/ResponsiveDropBox';
21
- import { ResponsiveReceiver } from '../Responsive/CustomResponsive';
21
+ import { ResponsiveReceiver } from '../../Responsive/CustomResponsive';
22
22
  import Loader from '@zohodesk/svg/lib/Loader/Loader';
23
23
  /**** CSS ****/
24
24
 
@@ -17,7 +17,7 @@ import MobileHeader from './MobileHeader/MobileHeader';
17
17
  import MultiSelectHeader from './MultiSelectHeader';
18
18
  import CssProvider from '../../Provider/CssProvider';
19
19
  import { getUniqueId } from '../../Provider/IdProvider';
20
- import ResponsiveDropBox from '../ResponsiveDropBox/ResponsiveDropBox'; // import { ResponsiveReceiver } from '../Responsive/CustomResponsive';
20
+ import ResponsiveDropBox from '../ResponsiveDropBox/ResponsiveDropBox'; // import { ResponsiveReceiver } from '../../Responsive/CustomResponsive';
21
21
 
22
22
  import Loader from '@zohodesk/svg/lib/Loader/Loader';
23
23
  import isMobilePopover from '../DropBox/utils/isMobilePopover';
@@ -1,4 +1,4 @@
1
- import { getLibraryConfig } from '../../Provider/Config';
1
+ import { getLibraryConfig } from '../../../Provider/Config';
2
2
  export const AdvancedGroupMultiSelect_defaultProps = {
3
3
  animationStyle: 'bounce',
4
4
  autoComplete: getLibraryConfig('autoComplete'),
@@ -1,3 +1,5 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
1
3
  import React from 'react';
2
4
  import { defaultProps } from './props/defaultProps';
3
5
  import { propTypes } from './props/propTypes';
@@ -24,6 +26,9 @@ const Radio = props => {
24
26
  active,
25
27
  isFilled,
26
28
  customClass,
29
+ customProps,
30
+ getRef,
31
+ children,
27
32
  a11y
28
33
  } = props;
29
34
  let {
@@ -36,11 +41,16 @@ const Radio = props => {
36
41
  let {
37
42
  ariaHidden,
38
43
  role = 'radio',
44
+ tabIndex,
39
45
  ariaChecked = checked,
40
46
  ariaLabel,
41
47
  ariaLabelledby,
42
48
  ariaReadonly = isReadOnly || disabled ? true : false
43
49
  } = a11y;
50
+ let {
51
+ ContainerProps = {},
52
+ LabelProps = {}
53
+ } = customProps;
44
54
 
45
55
  function onChange(e) {
46
56
  const {
@@ -49,7 +59,11 @@ const Radio = props => {
49
59
  onChange && onChange(value, e);
50
60
  }
51
61
 
52
- return /*#__PURE__*/React.createElement(Container, {
62
+ function handleGetRef(ele) {
63
+ getRef && getRef(ele, value);
64
+ }
65
+
66
+ return /*#__PURE__*/React.createElement(Container, _extends({
53
67
  dataId: value ? value.toLowerCase() : 'RadioComp',
54
68
  isCover: false,
55
69
  isInline: text ? false : true,
@@ -59,13 +73,14 @@ const Radio = props => {
59
73
  "data-title": toolTip,
60
74
  onClick: !isReadOnly && !disabled ? onChange : '',
61
75
  "aria-checked": ariaChecked,
62
- tabindex: isReadOnly || disabled || ariaHidden ? '-1' : '0',
76
+ tabindex: isReadOnly || disabled || ariaHidden ? '-1' : tabIndex || '0',
77
+ eleRef: handleGetRef,
63
78
  role: role,
64
79
  "aria-Hidden": ariaHidden,
65
80
  "aria-label": ariaLabel,
66
81
  "aria-labelledby": ariaLabelledby,
67
82
  "aria-readonly": ariaReadonly
68
- }, /*#__PURE__*/React.createElement(Box, {
83
+ }, ContainerProps), /*#__PURE__*/React.createElement(Box, {
69
84
  className: `${style.radio} ${checked ? `${style[`rdBox${palette}`]}` : ''}
70
85
  ${isReadOnly || disabled ? '' : `${style[`hover${palette}`]}`} ${style[size]} ${isFilled ? style.filled : ''} ${style[`centerPath${palette}`]} ${customRadio}`
71
86
  }, /*#__PURE__*/React.createElement("input", {
@@ -91,18 +106,18 @@ const Radio = props => {
91
106
  }) : null))), text && /*#__PURE__*/React.createElement(Box, {
92
107
  flexible: true,
93
108
  className: style.text
94
- }, /*#__PURE__*/React.createElement(Label, {
109
+ }, /*#__PURE__*/React.createElement(Label, _extends({
95
110
  text: text,
96
- palette: disabled ? 'disable' : labelPalette,
111
+ palette: labelPalette,
97
112
  size: labelSize,
98
113
  type: "title",
99
114
  clipped: true,
100
115
  dataId: `${text}_label`,
101
116
  variant: variant,
102
117
  title: toolTip ? toolTip : text,
103
- customClass: `${checked && active && !disabled ? `${style[`${palette}checkedActive`]}` : ''}
118
+ customClass: `${checked && active ? `${style[`${palette}checkedActive`]}` : ''}
104
119
  ${style[`${palette}Label`]} ${accessMode} ${customLabel}`
105
- })));
120
+ }, LabelProps))), children);
106
121
  };
107
122
 
108
123
  export default Radio;
@@ -10,5 +10,6 @@ export const defaultProps = {
10
10
  variant: 'default',
11
11
  isFilled: true,
12
12
  customClass: {},
13
+ customProps: {},
13
14
  a11y: {}
14
15
  };
@@ -4,6 +4,7 @@ export const propTypes = {
4
4
  checked: PropTypes.bool,
5
5
  disabled: PropTypes.bool,
6
6
  disabledTitle: PropTypes.string,
7
+ getRef: PropTypes.func,
7
8
  id: PropTypes.string,
8
9
  isFilled: PropTypes.bool,
9
10
  isReadOnly: PropTypes.bool,
@@ -20,14 +21,20 @@ export const propTypes = {
20
21
  customRadio: PropTypes.string,
21
22
  customLabel: PropTypes.string
22
23
  }),
24
+ customProps: PropTypes.exact({
25
+ ContainerProps: PropTypes.object,
26
+ LabelProps: PropTypes.object
27
+ }),
23
28
  a11y: PropTypes.shape({
24
29
  ariaChecked: PropTypes.bool,
25
30
  ariaHidden: PropTypes.bool,
26
31
  role: PropTypes.string,
32
+ tabIndex: PropTypes.oneOfType(PropTypes.string, PropTypes.number),
27
33
  ariaLabelledby: PropTypes.string,
28
34
  ariaLabel: PropTypes.string,
29
35
  ariaReadonly: PropTypes.bool
30
36
  }),
37
+ children: PropTypes.node,
31
38
  onChange: PropTypes.func,
32
39
  text: PropTypes.string
33
40
  };
@@ -5,7 +5,7 @@ import { defaultProps } from './props/defaultProps';
5
5
  import { propTypes } from './props/propTypes';
6
6
  import DropBox from '../DropBox/DropBox';
7
7
  import { Container } from '../Layout';
8
- import { ResponsiveReceiver } from '../Responsive/CustomResponsive';
8
+ import { ResponsiveReceiver } from '../../Responsive/CustomResponsive';
9
9
  import style from '../../ResponsiveDropBox/ResponsiveDropBox.module.css';
10
10
  export default function ResponsiveDropBox(props) {
11
11
  const {
@@ -16,7 +16,7 @@ import DropDownHeading from '../DropDown/DropDownHeading';
16
16
  import { Container, Box } from '../Layout';
17
17
  import { getUniqueId } from '../../Provider/IdProvider';
18
18
  import ResponsiveDropBox from '../ResponsiveDropBox/ResponsiveDropBox';
19
- import { ResponsiveReceiver } from '../Responsive/CustomResponsive';
19
+ import { ResponsiveReceiver } from '../../Responsive/CustomResponsive';
20
20
  import style from '../../Select/Select.module.css';
21
21
  /**** Methods ****/
22
22
 
@@ -16,7 +16,7 @@ import EmptyState from '../MultiSelect/EmptyState';
16
16
  import { getUniqueId } from '../../Provider/IdProvider';
17
17
  import { Icon } from '@zohodesk/icons';
18
18
  import ResponsiveDropBox from '../ResponsiveDropBox/ResponsiveDropBox';
19
- import { ResponsiveReceiver } from '../Responsive/CustomResponsive';
19
+ import { ResponsiveReceiver } from '../../Responsive/CustomResponsive';
20
20
  import Loader from '@zohodesk/svg/lib/Loader/Loader';
21
21
  /**** Methods ****/
22
22
 
@@ -16,7 +16,7 @@ import EmptyState from '../MultiSelect/EmptyState';
16
16
  import DropDownHeading from '../DropDown/DropDownHeading';
17
17
  import { getUniqueId } from '../../Provider/IdProvider';
18
18
  import ResponsiveDropBox from '../ResponsiveDropBox/ResponsiveDropBox';
19
- import { ResponsiveReceiver } from '../Responsive/CustomResponsive';
19
+ import { ResponsiveReceiver } from '../../Responsive/CustomResponsive';
20
20
  import Loader from '@zohodesk/svg/lib/Loader/Loader';
21
21
  /**** CSS ****/
22
22
 
@@ -12,7 +12,7 @@ import EmptyState from '../MultiSelect/EmptyState';
12
12
  import { Container, Box } from '../Layout';
13
13
  import { getUniqueId } from '../../Provider/IdProvider';
14
14
  import ResponsiveDropBox from '../ResponsiveDropBox/ResponsiveDropBox';
15
- import { ResponsiveReceiver } from '../Responsive/CustomResponsive';
15
+ import { ResponsiveReceiver } from '../../Responsive/CustomResponsive';
16
16
  import Loader from '@zohodesk/svg/lib/Loader/Loader';
17
17
  /**** Methods ****/
18
18
 
@@ -1,4 +1,4 @@
1
- import { getLibraryConfig } from '../../Provider/Config';
1
+ import { getLibraryConfig } from '../../../Provider/Config';
2
2
  export const Select_defaultProps = {
3
3
  animationStyle: 'bounce',
4
4
  autoComplete: getLibraryConfig('autoComplete'),
package/es/v1/Tab/Tabs.js CHANGED
@@ -7,13 +7,13 @@ import { Tabs_defaultProps } from './props/defaultProps';
7
7
  import { Tabs_propTypes } from './props/propTypes';
8
8
  import { remConvert, getTotalDimension, cs, throttle, cancelBubblingEffect } from '../../utils/Common';
9
9
  import { Box, Container } from '../Layout';
10
- import ResizeObserver from '../Responsive/ResizeObserver';
10
+ import ResizeObserver from '../../Responsive/ResizeObserver';
11
11
  import ListItem from '../ListItem/ListItem';
12
12
  import { Icon } from '@zohodesk/icons';
13
13
  import tabsStyle from './v1Tabs.module.css';
14
14
  import Popup from '../Popup/Popup';
15
15
  import ResponsiveDropBox from '../ResponsiveDropBox/ResponsiveDropBox';
16
- import { ResponsiveReceiver } from '../Responsive/CustomResponsive';
16
+ import { ResponsiveReceiver } from '../../Responsive/CustomResponsive';
17
17
  import btnstyle from '../../semantic/Button/semanticButton.module.css';
18
18
 
19
19
  const Tabs = props => {
@@ -3,7 +3,7 @@ import { defaultProps } from './props/defaultProps';
3
3
  import { propTypes } from './props/propTypes';
4
4
  import { getLibraryConfig } from '../../Provider/Config';
5
5
  import style from '../../Tooltip/Tooltip.module.css';
6
- import ResizeObserver from '../Responsive/ResizeObserver';
6
+ import ResizeObserver from '../../Responsive/ResizeObserver';
7
7
  import selectn from 'selectn';
8
8
  export default class Tooltip extends React.Component {
9
9
  constructor(props) {
@@ -57,6 +57,7 @@ var CheckBox = /*#__PURE__*/function (_React$Component) {
57
57
 
58
58
  _this = _super.call(this, props);
59
59
  _this.onChange = _this.onChange.bind(_assertThisInitialized(_this));
60
+ _this.handleGetContainerRef = _this.handleGetContainerRef.bind(_assertThisInitialized(_this));
60
61
  return _this;
61
62
  }
62
63
 
@@ -68,33 +69,41 @@ var CheckBox = /*#__PURE__*/function (_React$Component) {
68
69
  checked = _this$props.checked;
69
70
  onChange && onChange(!checked, e);
70
71
  }
72
+ }, {
73
+ key: "handleGetContainerRef",
74
+ value: function handleGetContainerRef(ele) {
75
+ var _this$props2 = this.props,
76
+ getContainerRef = _this$props2.getContainerRef,
77
+ id = _this$props2.id;
78
+ getContainerRef && getContainerRef(ele, id);
79
+ }
71
80
  }, {
72
81
  key: "render",
73
82
  value: function render() {
74
- var _this$props2 = this.props,
75
- id = _this$props2.id,
76
- checked = _this$props2.checked,
77
- disabled = _this$props2.disabled,
78
- isReadOnly = _this$props2.isReadOnly,
79
- disabledTitle = _this$props2.disabledTitle,
80
- title = _this$props2.title,
81
- palette = _this$props2.palette,
82
- text = _this$props2.text,
83
- size = _this$props2.size,
84
- labelPalette = _this$props2.labelPalette,
85
- labelSize = _this$props2.labelSize,
86
- isFilled = _this$props2.isFilled,
87
- isClipped = _this$props2.isClipped,
88
- getRef = _this$props2.getRef,
89
- variant = _this$props2.variant,
90
- active = _this$props2.active,
91
- dataId = _this$props2.dataId,
92
- name = _this$props2.name,
93
- activeStyle = _this$props2.activeStyle,
94
- a11y = _this$props2.a11y,
95
- customClass = _this$props2.customClass,
96
- customProps = _this$props2.customProps,
97
- dataSelectorId = _this$props2.dataSelectorId;
83
+ var _this$props3 = this.props,
84
+ id = _this$props3.id,
85
+ checked = _this$props3.checked,
86
+ disabled = _this$props3.disabled,
87
+ isReadOnly = _this$props3.isReadOnly,
88
+ disabledTitle = _this$props3.disabledTitle,
89
+ title = _this$props3.title,
90
+ palette = _this$props3.palette,
91
+ text = _this$props3.text,
92
+ size = _this$props3.size,
93
+ labelPalette = _this$props3.labelPalette,
94
+ labelSize = _this$props3.labelSize,
95
+ isFilled = _this$props3.isFilled,
96
+ isClipped = _this$props3.isClipped,
97
+ getRef = _this$props3.getRef,
98
+ variant = _this$props3.variant,
99
+ active = _this$props3.active,
100
+ dataId = _this$props3.dataId,
101
+ name = _this$props3.name,
102
+ activeStyle = _this$props3.activeStyle,
103
+ a11y = _this$props3.a11y,
104
+ customClass = _this$props3.customClass,
105
+ customProps = _this$props3.customProps,
106
+ dataSelectorId = _this$props3.dataSelectorId;
98
107
  var _customProps$CheckBox = customProps.CheckBoxProps,
99
108
  CheckBoxProps = _customProps$CheckBox === void 0 ? {} : _customProps$CheckBox,
100
109
  _customProps$LabelPro = customProps.LabelProps,
@@ -127,6 +136,7 @@ var CheckBox = /*#__PURE__*/function (_React$Component) {
127
136
  onClick: isReadOnly || disabled ? null : this.onChange,
128
137
  tabIndex: isReadOnly || disabled || ariaHidden ? '-1' : '0',
129
138
  "aria-checked": ariaChecked,
139
+ eleRef: this.handleGetContainerRef,
130
140
  role: role,
131
141
  "aria-label": ariaLabel,
132
142
  "aria-labelledby": ariaLabelledby,