@zohodesk/dot 1.0.0-temp-187.4 → 1.0.0-temp-201

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 (37) hide show
  1. package/.cli/propValidation_report.html +1 -1
  2. package/README.md +6 -0
  3. package/es/form/fields/Fields.module.css +1 -1
  4. package/es/form/fields/RadioField/RadioField.js +69 -6
  5. package/es/form/fields/RadioField/props/defaultProps.js +1 -0
  6. package/es/form/fields/RadioField/props/propTypes.js +3 -0
  7. package/es/form/fields/TagsMultiSelect/TagsMultiSelect.js +2 -4
  8. package/es/form/fields/TagsMultiSelect/props/propTypes.js +1 -2
  9. package/es/list/DepartmentDropDown/DepartmentDropDown.js +2 -7
  10. package/es/list/DepartmentDropDown/props/defaultProps.js +1 -2
  11. package/es/list/DepartmentDropDown/props/propTypes.js +0 -3
  12. package/es/list/status/StatusListItem/StatusListItem.module.css +5 -35
  13. package/es/v1/form/fields/RadioField/RadioField.js +3 -2
  14. package/es/v1/form/fields/TagsMultiSelect/TagsMultiSelect.js +2 -4
  15. package/es/v1/form/fields/TagsMultiSelect/props/propTypes.js +1 -2
  16. package/es/v1/list/DepartmentDropDown/DepartmentDropDown.js +2 -7
  17. package/es/v1/list/DepartmentDropDown/props/defaultProps.js +1 -2
  18. package/es/v1/list/DepartmentDropDown/props/propTypes.js +0 -3
  19. package/lib/form/fields/Fields.module.css +1 -1
  20. package/lib/form/fields/RadioField/RadioField.js +100 -31
  21. package/lib/form/fields/RadioField/props/defaultProps.js +1 -0
  22. package/lib/form/fields/RadioField/props/propTypes.js +3 -0
  23. package/lib/form/fields/TagsMultiSelect/TagsMultiSelect.js +3 -5
  24. package/lib/form/fields/TagsMultiSelect/props/propTypes.js +1 -2
  25. package/lib/list/DepartmentDropDown/DepartmentDropDown.js +3 -8
  26. package/lib/list/DepartmentDropDown/props/defaultProps.js +1 -2
  27. package/lib/list/DepartmentDropDown/props/propTypes.js +0 -2
  28. package/lib/list/status/StatusListItem/StatusListItem.module.css +5 -35
  29. package/lib/v1/form/fields/RadioField/RadioField.js +3 -2
  30. package/lib/v1/form/fields/TagsMultiSelect/TagsMultiSelect.js +3 -5
  31. package/lib/v1/form/fields/TagsMultiSelect/props/propTypes.js +1 -2
  32. package/lib/v1/list/DepartmentDropDown/DepartmentDropDown.js +3 -8
  33. package/lib/v1/list/DepartmentDropDown/props/defaultProps.js +1 -2
  34. package/lib/v1/list/DepartmentDropDown/props/propTypes.js +0 -2
  35. package/package.json +6 -6
  36. package/result.json +1 -1
  37. package/unittest/index.html +1 -1
package/README.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  In this Library, we Provide Some Basic Components to Build Your Application
4
4
 
5
+ # 1.7.3
6
+
7
+ - **RadioField**
8
+ - `getRef`, `isBoxStyle` props supported
9
+ - Fixed the Radio box hover style applying when disabled
10
+
5
11
  # 1.7.2
6
12
 
7
13
  - **Lookup - Search** - renderChildren, isActive, hasSeparator & customStyle props supported & Some customization also opened for this compoenent.
@@ -74,7 +74,7 @@
74
74
  border: 1px solid var(--zdt_radiofield_box_border);
75
75
  border-radius: 6px
76
76
  }
77
- .radioBox:hover, .radioBoxActive {
77
+ .hoverableRadioBox:hover, .radioBoxActive {
78
78
  border-color: var(--zdt_radiofield_box_active_border)
79
79
  }
80
80
  .radioBoxActive {
@@ -14,7 +14,40 @@ import style from "../Fields.module.css";
14
14
  export default class RadioField extends PureComponent {
15
15
  constructor(props) {
16
16
  super(props);
17
+ this.data = {
18
+ radios: {},
19
+ focus: this.handleFocus
20
+ };
17
21
  this.handleChange = this.handleChange.bind(this);
22
+ this.updateData = this.updateData.bind(this);
23
+ this.handleFocus = this.handleFocus.bind(this);
24
+ }
25
+
26
+ componentDidMount() {
27
+ const {
28
+ getRef,
29
+ id
30
+ } = this.props;
31
+ getRef && getRef(this.data, id);
32
+ }
33
+
34
+ componentDidUpdate(prevProps) {
35
+ const {
36
+ getRef,
37
+ id
38
+ } = this.props;
39
+
40
+ if (getRef !== prevProps.getRef) {
41
+ getRef && getRef(this.data, id);
42
+ }
43
+ }
44
+
45
+ componentWillUnmount() {
46
+ const {
47
+ getRef,
48
+ id
49
+ } = this.props;
50
+ getRef && getRef(null, id);
18
51
  }
19
52
 
20
53
  handleChange(value) {
@@ -25,6 +58,24 @@ export default class RadioField extends PureComponent {
25
58
  onChange && onChange(id, value);
26
59
  }
27
60
 
61
+ updateData(ele, val) {
62
+ this.data.radios[val] = ele;
63
+ }
64
+
65
+ handleFocus() {
66
+ const {
67
+ selectedValue,
68
+ options
69
+ } = this.props;
70
+ const firstRadioValue = options[0].value;
71
+
72
+ if (selectedValue) {
73
+ this.data.radios[selectedValue].focus();
74
+ } else {
75
+ this.data.radios[firstRadioValue].focus();
76
+ }
77
+ }
78
+
28
79
  render() {
29
80
  let {
30
81
  labelName,
@@ -46,6 +97,7 @@ export default class RadioField extends PureComponent {
46
97
  validationRuleMessage,
47
98
  validationRulePalette,
48
99
  isReadOnly,
100
+ isBoxStyle,
49
101
  variant,
50
102
  customProps
51
103
  } = this.props;
@@ -69,7 +121,7 @@ export default class RadioField extends PureComponent {
69
121
  dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`,
70
122
  ...LabelProps
71
123
  }), /*#__PURE__*/React.createElement("div", {
72
- className: `${style.fieldContainer} ${labelName ? style.fieldMargin_medium : ''} ${style.radioContainer}`
124
+ className: `${style.fieldContainer} ${isBoxStyle ? style.radiosWrapper : ''} ${labelName ? style.fieldMargin_medium : ''} ${style.radioContainer}`
73
125
  }, options.map((option, index) => {
74
126
  let {
75
127
  text,
@@ -78,9 +130,11 @@ export default class RadioField extends PureComponent {
78
130
  tooltip,
79
131
  infoTooltip
80
132
  } = option;
133
+ let isDisabledState = disabled || isDisabled;
134
+ let isChecked = selectedValue == value;
81
135
  return /*#__PURE__*/React.createElement("span", {
82
136
  key: index,
83
- className: `${style.radio}`
137
+ className: `${!isBoxStyle ? style.radio : ''} ${style.radioWrap}`
84
138
  }, /*#__PURE__*/React.createElement(Radio, {
85
139
  id: index,
86
140
  value: value,
@@ -88,17 +142,26 @@ export default class RadioField extends PureComponent {
88
142
  text: text,
89
143
  labelPalette: labelPalette,
90
144
  labelSize: labelSize,
91
- active: isActive,
92
- disabled: disabled || isDisabled,
145
+ active: isActive || isBoxStyle && isChecked,
146
+ disabled: isDisabledState,
93
147
  disabledTitle: tooltip,
94
148
  title: tooltip,
95
149
  onChange: this.handleChange,
150
+ getRef: this.updateData,
96
151
  size: size,
97
- checked: selectedValue == value,
152
+ checked: isChecked,
98
153
  dataId: dataId,
99
154
  isReadOnly: isReadOnly,
100
155
  variant: variant,
101
- ...RadioProps
156
+ ...RadioProps,
157
+ a11y: {
158
+ tabIndex: !!selectedValue ? isChecked ? '0' : '-1' : index === 0 ? '0' : '-1',
159
+ ...RadioProps.a11y
160
+ },
161
+ customClass: {
162
+ customRadioWrap: isBoxStyle ? `${style.radioBox} ${!isDisabledState ? style.hoverableRadioBox : ''} ${isChecked ? style.radioBoxActive : ''}` : '',
163
+ ...RadioProps.customClass
164
+ }
102
165
  }, !!infoTooltip ? /*#__PURE__*/React.createElement(Icon, {
103
166
  name: "ZD-GN-info",
104
167
  size: "16",
@@ -1,5 +1,6 @@
1
1
  export const defaultProps = {
2
2
  errorType: 'primary',
3
+ isBoxStyle: false,
3
4
  isMandatory: false,
4
5
  isDisabled: false,
5
6
  isReadOnly: false,
@@ -2,8 +2,10 @@ import PropTypes from 'prop-types';
2
2
  export const propTypes = {
3
3
  dataId: PropTypes.string,
4
4
  errorType: PropTypes.oneOf(['primary', 'secondary']),
5
+ getRef: PropTypes.func,
5
6
  id: PropTypes.string,
6
7
  isActive: PropTypes.bool,
8
+ isBoxStyle: PropTypes.bool,
7
9
  isDisabled: PropTypes.bool,
8
10
  isMandatory: PropTypes.bool,
9
11
  isReadOnly: PropTypes.bool,
@@ -23,6 +25,7 @@ export const propTypes = {
23
25
  customProps: PropTypes.shape({
24
26
  LabelProps: PropTypes.object,
25
27
  RadioProps: PropTypes.object,
28
+ InfoIconProps: PropTypes.object,
26
29
  ValidationMessageProps1: PropTypes.object,
27
30
  ValidationMessageProps2: PropTypes.object
28
31
  }),
@@ -164,8 +164,7 @@ export default class TagsMultiSelect extends React.Component {
164
164
  const {
165
165
  TextBoxIconProps = {},
166
166
  TagWrapperProps = {},
167
- TagProps = {},
168
- listProps = {}
167
+ TagProps = {}
169
168
  } = customProps;
170
169
  return /*#__PURE__*/React.createElement("div", {
171
170
  className: `${style.container} ${!isReadOnly ? ` ${needBorder ? style.hasBorder : ''}
@@ -299,8 +298,7 @@ export default class TagsMultiSelect extends React.Component {
299
298
  getRef: this.getSelectedItemRef,
300
299
  isDisabled: listDisabled,
301
300
  customProps: listItemProps,
302
- customClass: listItemClass,
303
- ...listProps
301
+ customClass: listItemClass
304
302
  }, isNew ? /*#__PURE__*/React.createElement(Container, {
305
303
  alignBox: "row",
306
304
  align: "vertical"
@@ -52,7 +52,6 @@ export const propTypes = {
52
52
  customProps: PropTypes.shape({
53
53
  TextBoxIconProps: PropTypes.object,
54
54
  TagWrapperProps: PropTypes.object,
55
- TagProps: PropTypes.object,
56
- listProps: PropTypes.object
55
+ TagProps: PropTypes.object
57
56
  })
58
57
  };
@@ -48,12 +48,8 @@ class DepartmentDropDown extends Component {
48
48
  onSearch,
49
49
  needSearchFetching,
50
50
  searchStr,
51
- i18nKeys,
52
- customProps
51
+ i18nKeys
53
52
  } = this.props;
54
- const {
55
- toggleDropDownProps = {}
56
- } = customProps;
57
53
  let {
58
54
  title = 'Move Department',
59
55
  searchEmptyText = 'No results found',
@@ -88,8 +84,7 @@ class DepartmentDropDown extends Component {
88
84
  getNextOptions: getNextOptions,
89
85
  isNextOptions: isNextOptions,
90
86
  onSearch: onSearch,
91
- needSearchFetching: needSearchFetching,
92
- ...toggleDropDownProps
87
+ needSearchFetching: needSearchFetching
93
88
  });
94
89
  }
95
90
 
@@ -3,6 +3,5 @@ export const defaultProps = {
3
3
  isPopupActive: true,
4
4
  isNextOptions: false,
5
5
  searchStr: '',
6
- i18nKeys: {},
7
- customProps: {}
6
+ i18nKeys: {}
8
7
  };
@@ -20,8 +20,5 @@ export const propTypes = {
20
20
  searchEmptyText: PropTypes.string,
21
21
  searchErrorText: PropTypes.string,
22
22
  placeholder: PropTypes.string
23
- }),
24
- customProps: PropTypes.shape({
25
- toggleDropDownProps: PropTypes.object
26
23
  })
27
24
  };
@@ -6,58 +6,43 @@
6
6
  min-height: var(--zd_size35) ;
7
7
  cursor: pointer;
8
8
  }
9
-
10
9
  [dir=ltr] .withBorder {
11
10
  border-left: 1px solid var(--zdt_statuslistitem_default_border);
12
11
  }
13
-
14
12
  [dir=rtl] .withBorder {
15
13
  border-right: 1px solid var(--zdt_statuslistitem_default_border);
16
14
  }
17
-
18
15
  [dir=ltr] .small {
19
16
  padding: var(--zd_size7) var(--zd_size3) var(--zd_size7) var(--zd_size5) ;
20
17
  }
21
-
22
18
  [dir=rtl] .small {
23
19
  padding: var(--zd_size7) var(--zd_size5) var(--zd_size7) var(--zd_size3) ;
24
20
  }
25
-
26
21
  .medium {
27
22
  padding: var(--zd_size7) var(--zd_size20) ;
28
23
  }
29
-
30
24
  .large {
31
25
  height: var(--zd_size48) ;
32
26
  }
33
-
34
27
  [dir=ltr] .large {
35
28
  padding: var(--zd_size10) var(--zd_size3) var(--zd_size10) var(--zd_size25) ;
36
29
  }
37
-
38
30
  [dir=rtl] .large {
39
31
  padding: var(--zd_size10) var(--zd_size25) var(--zd_size10) var(--zd_size3) ;
40
32
  }
41
-
42
- .value,
43
- .multiLineValue {
33
+ .value,.multiLineValue {
44
34
  line-height: 1.5385;
45
35
  }
46
-
47
36
  .value {
48
37
  composes: dotted from '~@zohodesk/components/lib/common/common.module.css';
49
38
  }
50
-
51
- .multiLineValue {
39
+ .multiLineValue{
52
40
  word-break: break-word;
53
- -webkit-line-clamp: 3;
54
41
  composes: clamp from '~@zohodesk/components/lib/common/common.module.css';
55
42
  }
56
-
57
43
  [dir=ltr] .withBorder.active {
58
44
  border-left-color: var(--zdt_statuslistitem_default_active_border);
59
45
  }
60
-
61
46
  [dir=rtl] .withBorder.active {
62
47
  border-right-color: var(--zdt_statuslistitem_default_active_border);
63
48
  }
@@ -65,56 +50,44 @@
65
50
  .default.hover, .default.effect:hover {
66
51
  background-color: var(--zdt_statuslistitem_default_effect_bg);
67
52
  }
68
-
69
53
  .primary.hover, .primary.effect:hover, .selected {
70
54
  background-color: var(--zdt_statuslistitem_primary_efffect_bg);
71
55
  }
72
-
73
56
  .secondary.hover, .secondary.effect:hover {
74
57
  background-color: var(--zdt_statuslistitem_secondary_effect_bg);
75
58
  }
76
-
77
59
  .list.active.default, .list.active.primary {
78
60
  background-color: var(--zdt_statuslistitem_primary_efffect_bg);
79
61
  }
80
-
81
62
  .list.active.secondary {
82
63
  background-color: var(--zdt_statuslistitem_secondary_effect_bg);
83
64
  }
84
-
85
65
  .secondary.hover,
86
66
  .secondary.effect:hover,
87
67
  .list.active.secondary {
88
68
  color: var(--zdt_statuslistitem_secondary_effect_text);
89
69
  }
90
-
91
70
  .tickIcon {
92
71
  color: var(--zdt_statuslistitem_tickicon);
93
72
  position: absolute;
94
- top: 50% ;
73
+ top:50% ;
95
74
  transform: translateY(-50%);
96
75
  }
97
-
98
76
  [dir=ltr] .tickIcon {
99
77
  right: var(--zd_size20) ;
100
78
  }
101
-
102
79
  [dir=rtl] .tickIcon {
103
80
  left: var(--zd_size20) ;
104
81
  }
105
-
106
- .tickIcon>i {
82
+ .tickIcon > i {
107
83
  display: block;
108
84
  }
109
-
110
85
  [dir=ltr] .active.withTick {
111
86
  padding-right: var(--zd_size39) ;
112
87
  }
113
-
114
88
  [dir=rtl] .active.withTick {
115
89
  padding-left: var(--zd_size39) ;
116
90
  }
117
-
118
91
  /* Status Type */
119
92
  .statusType {
120
93
  width: var(--zd_size8) ;
@@ -127,15 +100,12 @@
127
100
  [dir=rtl] .statusType {
128
101
  margin-left: var(--zd_size13) ;
129
102
  }
130
-
131
103
  .black {
132
104
  background-color: var(--zdt_statuslistitem_black_bg);
133
105
  }
134
-
135
106
  .orange {
136
107
  background-color: var(--zdt_statuslistitem_orange_bg);
137
108
  }
138
-
139
109
  .green {
140
110
  background-color: var(--zdt_statuslistitem_green_bg);
141
- }
111
+ }
@@ -81,6 +81,7 @@ const RadioField = props => {
81
81
  tooltip,
82
82
  infoTooltip
83
83
  } = option;
84
+ let isDisabledState = disabled || isDisabled;
84
85
  let isChecked = selectedValue == value;
85
86
  return /*#__PURE__*/React.createElement("span", {
86
87
  key: index,
@@ -93,7 +94,7 @@ const RadioField = props => {
93
94
  labelPalette: labelPalette,
94
95
  labelSize: labelSize,
95
96
  active: isActive || isBoxStyle && isChecked,
96
- disabled: disabled || isDisabled,
97
+ disabled: isDisabledState,
97
98
  disabledTitle: tooltip,
98
99
  title: tooltip,
99
100
  onChange: handleChange,
@@ -109,7 +110,7 @@ const RadioField = props => {
109
110
  ...RadioProps.a11y
110
111
  },
111
112
  customClass: {
112
- customRadioWrap: `${isBoxStyle ? style.radioBox : ''} ${isBoxStyle && isChecked ? style.radioBoxActive : ''}`,
113
+ customRadioWrap: isBoxStyle ? `${style.radioBox} ${!isDisabledState ? style.hoverableRadioBox : ''} ${isChecked ? style.radioBoxActive : ''}` : '',
113
114
  ...RadioProps.customClass
114
115
  }
115
116
  }, !!infoTooltip ? /*#__PURE__*/React.createElement(Icon, {
@@ -164,8 +164,7 @@ export default class TagsMultiSelect extends React.Component {
164
164
  const {
165
165
  TextBoxIconProps = {},
166
166
  TagWrapperProps = {},
167
- TagProps = {},
168
- listProps = {}
167
+ TagProps = {}
169
168
  } = customProps;
170
169
  return /*#__PURE__*/React.createElement("div", {
171
170
  className: `${style.container} ${!isReadOnly ? ` ${needBorder ? style.hasBorder : ''}
@@ -299,8 +298,7 @@ export default class TagsMultiSelect extends React.Component {
299
298
  getRef: this.getSelectedItemRef,
300
299
  isDisabled: listDisabled,
301
300
  customProps: listItemProps,
302
- customClass: listItemClass,
303
- ...listProps
301
+ customClass: listItemClass
304
302
  }, isNew ? /*#__PURE__*/React.createElement(Container, {
305
303
  alignBox: "row",
306
304
  align: "vertical"
@@ -52,7 +52,6 @@ export const propTypes = {
52
52
  customProps: PropTypes.shape({
53
53
  TextBoxIconProps: PropTypes.object,
54
54
  TagWrapperProps: PropTypes.object,
55
- TagProps: PropTypes.object,
56
- listProps: PropTypes.object
55
+ TagProps: PropTypes.object
57
56
  })
58
57
  };
@@ -21,12 +21,8 @@ function DepartmentDropDown(props) {
21
21
  searchStr,
22
22
  i18nKeys,
23
23
  onMoveDepartment,
24
- getDepartment,
25
- customProps
24
+ getDepartment
26
25
  } = props;
27
- const {
28
- toggleDropDownProps = {}
29
- } = customProps;
30
26
  let {
31
27
  title = 'Move Department',
32
28
  searchEmptyText = 'No results found',
@@ -75,8 +71,7 @@ function DepartmentDropDown(props) {
75
71
  getNextOptions: getNextOptions,
76
72
  isNextOptions: isNextOptions,
77
73
  onSearch: onSearch,
78
- needSearchFetching: needSearchFetching,
79
- ...toggleDropDownProps
74
+ needSearchFetching: needSearchFetching
80
75
  });
81
76
  }
82
77
 
@@ -3,6 +3,5 @@ export const defaultProps = {
3
3
  isPopupActive: true,
4
4
  isNextOptions: false,
5
5
  searchStr: '',
6
- i18nKeys: {},
7
- customProps: {}
6
+ i18nKeys: {}
8
7
  };
@@ -20,8 +20,5 @@ export const propTypes = {
20
20
  searchEmptyText: PropTypes.string,
21
21
  searchErrorText: PropTypes.string,
22
22
  placeholder: PropTypes.string
23
- }),
24
- customProps: PropTypes.shape({
25
- toggleDropDownProps: PropTypes.object
26
23
  })
27
24
  };
@@ -74,7 +74,7 @@
74
74
  border: 1px solid var(--zdt_radiofield_box_border);
75
75
  border-radius: 6px
76
76
  }
77
- .radioBox:hover, .radioBoxActive {
77
+ .hoverableRadioBox:hover, .radioBoxActive {
78
78
  border-color: var(--zdt_radiofield_box_active_border)
79
79
  }
80
80
  .radioBoxActive {