@zohodesk/components 1.0.0-temp-169 → 1.0.0-temp-171

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 (216) hide show
  1. package/.cli/PropLessFiles.html +1 -1
  2. package/.cli/PropValidationExcludeFilesArray.js +1 -13
  3. package/.cli/propValidation_report.html +1 -1
  4. package/README.md +19 -0
  5. package/assets/Appearance/dark/mode/Component_DarkMode.module.css +1 -0
  6. package/assets/Appearance/light/mode/Component_LightMode.module.css +1 -0
  7. package/assets/Appearance/pureDark/mode/Component_PureDarkMode.module.css +1 -0
  8. package/coverage/Avatar/Avatar.js.html +649 -0
  9. package/coverage/Avatar/Avatar.module.css.html +556 -0
  10. package/coverage/Avatar/index.html +131 -0
  11. package/coverage/Avatar/props/defaultProps.js.html +136 -0
  12. package/coverage/Avatar/props/index.html +131 -0
  13. package/coverage/Avatar/props/propTypes.js.html +166 -0
  14. package/coverage/AvatarTeam/AvatarTeam.js.html +340 -0
  15. package/coverage/AvatarTeam/AvatarTeam.module.css.html +610 -0
  16. package/coverage/AvatarTeam/index.html +131 -0
  17. package/coverage/AvatarTeam/props/defaultProps.js.html +136 -0
  18. package/coverage/AvatarTeam/props/index.html +131 -0
  19. package/coverage/AvatarTeam/props/propTypes.js.html +169 -0
  20. package/coverage/Button/Button.js.html +1 -1
  21. package/coverage/Button/css/Button.module.css.html +1 -1
  22. package/coverage/Button/css/cssJSLogic.js.html +1 -1
  23. package/coverage/Button/css/index.html +1 -1
  24. package/coverage/Button/index.html +1 -1
  25. package/coverage/Button/props/defaultProps.js.html +1 -1
  26. package/coverage/Button/props/index.html +1 -1
  27. package/coverage/Button/props/propTypes.js.html +1 -1
  28. package/coverage/Buttongroup/Buttongroup.js.html +1 -1
  29. package/coverage/Buttongroup/Buttongroup.module.css.html +1 -1
  30. package/coverage/Buttongroup/index.html +1 -1
  31. package/coverage/Buttongroup/props/defaultProps.js.html +1 -1
  32. package/coverage/Buttongroup/props/index.html +1 -1
  33. package/coverage/Buttongroup/props/propTypes.js.html +1 -1
  34. package/coverage/Label/Label.js.html +253 -0
  35. package/coverage/Label/Label.module.css.html +241 -0
  36. package/coverage/Label/LabelColors.module.css.html +145 -0
  37. package/coverage/Label/index.html +146 -0
  38. package/coverage/Label/props/defaultProps.js.html +118 -0
  39. package/coverage/Label/props/index.html +131 -0
  40. package/coverage/Label/props/propTypes.js.html +145 -0
  41. package/coverage/Layout/Box.js.html +367 -0
  42. package/coverage/Layout/Container.js.html +439 -0
  43. package/coverage/Layout/Layout.module.css.html +1090 -0
  44. package/coverage/Layout/index.html +176 -0
  45. package/coverage/Layout/index.js.html +118 -0
  46. package/coverage/Layout/props/defaultProps.js.html +136 -0
  47. package/coverage/Layout/props/index.html +131 -0
  48. package/coverage/Layout/props/propTypes.js.html +262 -0
  49. package/coverage/Layout/utils.js.html +199 -0
  50. package/coverage/Provider/AvatarSize.js.html +124 -0
  51. package/coverage/Provider/CssProvider.js.html +133 -0
  52. package/coverage/Provider/index.html +131 -0
  53. package/coverage/Radio/Radio.js.html +415 -0
  54. package/coverage/Radio/Radio.module.css.html +403 -0
  55. package/coverage/Radio/index.html +131 -0
  56. package/coverage/Radio/props/defaultProps.js.html +127 -0
  57. package/coverage/Radio/props/index.html +131 -0
  58. package/coverage/Radio/props/propTypes.js.html +187 -0
  59. package/coverage/Ribbon/Ribbon.js.html +229 -0
  60. package/coverage/Ribbon/Ribbon.module.css.html +1210 -0
  61. package/coverage/Ribbon/index.html +131 -0
  62. package/coverage/Ribbon/props/defaultProps.js.html +112 -0
  63. package/coverage/Ribbon/props/index.html +131 -0
  64. package/coverage/Ribbon/props/propTypes.js.html +121 -0
  65. package/coverage/RippleEffect/RippleEffect.js.html +172 -0
  66. package/coverage/RippleEffect/RippleEffect.module.css.html +415 -0
  67. package/coverage/RippleEffect/index.html +131 -0
  68. package/coverage/RippleEffect/props/defaultProps.js.html +112 -0
  69. package/coverage/RippleEffect/props/index.html +131 -0
  70. package/coverage/RippleEffect/props/propTypes.js.html +121 -0
  71. package/coverage/Stencils/Stencils.js.html +163 -0
  72. package/coverage/Stencils/Stencils.module.css.html +319 -0
  73. package/coverage/Stencils/index.html +131 -0
  74. package/coverage/Stencils/props/defaultProps.js.html +103 -0
  75. package/coverage/Stencils/props/index.html +131 -0
  76. package/coverage/Stencils/props/propTypes.js.html +109 -0
  77. package/coverage/Switch/Switch.js.html +379 -0
  78. package/coverage/Switch/Switch.module.css.html +481 -0
  79. package/coverage/Switch/index.html +131 -0
  80. package/coverage/Switch/props/defaultProps.js.html +118 -0
  81. package/coverage/Switch/props/index.html +131 -0
  82. package/coverage/Switch/props/propTypes.js.html +172 -0
  83. package/coverage/common/avatarsizes.module.css.html +229 -0
  84. package/coverage/common/common.module.css.html +1519 -0
  85. package/coverage/common/index.html +131 -0
  86. package/coverage/coverage-final.json +55 -10
  87. package/coverage/coverage-summary.json +56 -11
  88. package/coverage/index.html +311 -11
  89. package/coverage/utils/dummyFunction.js.html +1 -1
  90. package/coverage/utils/getInitial.js.html +139 -0
  91. package/coverage/utils/index.html +25 -10
  92. package/es/Avatar/__tests__/Avatar.spec.js +181 -0
  93. package/es/Avatar/__tests__/__snapshots__/Avatar.spec.js.snap +591 -0
  94. package/es/AvatarTeam/__tests__/AvatarTeam.spec.js +138 -0
  95. package/es/AvatarTeam/__tests__/__snapshots__/AvatarTeam.spec.js.snap +704 -0
  96. package/es/DateTime/DateTime.module.css +12 -1
  97. package/es/Label/__tests__/Label.spec.js +99 -0
  98. package/es/Label/__tests__/__snapshots__/Label.spec.js.snap +312 -0
  99. package/es/ListItem/ListContainer.js +1 -1
  100. package/es/MultiSelect/Suggestions.js +2 -1
  101. package/es/MultiSelect/props/propTypes.js +140 -138
  102. package/es/Radio/__tests__/Radio.spec.js +241 -0
  103. package/es/Radio/__tests__/__snapshots__/Radio.spec.js.snap +1837 -0
  104. package/es/Ribbon/__tests__/Ribbon.spec.js +52 -0
  105. package/es/Ribbon/__tests__/__snapshots__/Ribbon.spec.js.snap +374 -0
  106. package/es/RippleEffect/__tests__/RippleEffect.spec.js +69 -0
  107. package/es/RippleEffect/__tests__/__snapshots__/RippleEffect.spec.js.snap +171 -0
  108. package/es/Select/Select.js +4 -3
  109. package/es/Select/props/propTypes.js +3 -1
  110. package/es/Stencils/__tests__/Stencils.spec.js +46 -0
  111. package/es/Stencils/__tests__/__snapshots__/Stencils.spec.js.snap +89 -0
  112. package/es/Switch/__tests__/Switch.spec.js +156 -0
  113. package/es/Switch/__tests__/__snapshots__/Switch.spec.js.snap +831 -0
  114. package/es/TextBox/TextBox.module.css +4 -5
  115. package/es/Textarea/Textarea.module.css +4 -3
  116. package/es/v1/AppContainer/AppContainer.js +75 -92
  117. package/es/v1/Card/Card.js +143 -177
  118. package/es/v1/Card/index.js +4 -0
  119. package/es/v1/DateTime/CalendarView.js +43 -10
  120. package/es/v1/DateTime/DateTime.js +8 -4
  121. package/es/v1/DateTime/DateTimePopupFooter.js +2 -2
  122. package/es/v1/DateTime/DateTimePopupHeader.js +1 -1
  123. package/es/v1/DateTime/DateWidget.js +8 -4
  124. package/es/v1/DateTime/DaysRow.js +1 -1
  125. package/es/v1/DateTime/Time.js +2 -2
  126. package/es/v1/DateTime/YearView.js +2 -2
  127. package/es/v1/DateTime/props/defaultProps.js +57 -0
  128. package/es/v1/DateTime/props/propTypes.js +195 -0
  129. package/es/v1/DropDown/DropDown.js +31 -52
  130. package/es/v1/DropDown/DropDownHeading.js +29 -37
  131. package/es/v1/DropDown/DropDownItem.js +38 -58
  132. package/es/v1/DropDown/DropDownSearch.js +41 -49
  133. package/es/v1/DropDown/DropDownSeparator.js +7 -10
  134. package/es/v1/ListItem/ListItemWithAvatar.js +7 -8
  135. package/es/v1/MultiSelect/MultiSelect.js +1 -0
  136. package/es/v1/MultiSelect/MultiSelectWithAvatar.js +1 -0
  137. package/es/v1/Provider/AvatarSize.js +13 -0
  138. package/es/v1/Provider/Config.js +18 -0
  139. package/es/v1/Provider/CssProvider.js +16 -0
  140. package/es/v1/Provider/IdProvider.js +66 -0
  141. package/es/v1/Provider/LibraryContext.js +37 -0
  142. package/es/v1/Provider/LibraryContextInit.js +3 -0
  143. package/es/v1/Provider/NumberGenerator/NumberGenerator.js +136 -0
  144. package/es/v1/Provider/ZindexProvider.js +57 -0
  145. package/es/v1/Provider/index.js +4 -0
  146. package/es/v1/Tag/Tag.js +6 -2
  147. package/es/v1/TextBox/TextBox.js +10 -10
  148. package/es/v1/Typography/Typography.js +4 -4
  149. package/es/v1/Typography/css/Typography.module.css +33 -0
  150. package/es/v1/Typography/css/cssJSLogic.js +14 -8
  151. package/es/v1/Typography/props/defaultProps.js +4 -4
  152. package/es/v1/Typography/props/propTypes.js +8 -5
  153. package/lib/Avatar/__tests__/Avatar.spec.js +188 -0
  154. package/lib/Avatar/__tests__/__snapshots__/Avatar.spec.js.snap +591 -0
  155. package/lib/AvatarTeam/__tests__/AvatarTeam.spec.js +145 -0
  156. package/lib/AvatarTeam/__tests__/__snapshots__/AvatarTeam.spec.js.snap +704 -0
  157. package/lib/DateTime/DateTime.module.css +12 -1
  158. package/lib/Label/__tests__/Label.spec.js +106 -0
  159. package/lib/Label/__tests__/__snapshots__/Label.spec.js.snap +312 -0
  160. package/lib/ListItem/ListContainer.js +1 -1
  161. package/lib/MultiSelect/Suggestions.js +2 -1
  162. package/lib/MultiSelect/props/propTypes.js +146 -141
  163. package/lib/Radio/__tests__/Radio.spec.js +250 -0
  164. package/lib/Radio/__tests__/__snapshots__/Radio.spec.js.snap +1837 -0
  165. package/lib/Ribbon/__tests__/Ribbon.spec.js +59 -0
  166. package/lib/Ribbon/__tests__/__snapshots__/Ribbon.spec.js.snap +374 -0
  167. package/lib/RippleEffect/__tests__/RippleEffect.spec.js +76 -0
  168. package/lib/RippleEffect/__tests__/__snapshots__/RippleEffect.spec.js.snap +171 -0
  169. package/lib/Select/Select.js +4 -3
  170. package/lib/Select/props/propTypes.js +12 -2
  171. package/lib/Stencils/__tests__/Stencils.spec.js +53 -0
  172. package/lib/Stencils/__tests__/__snapshots__/Stencils.spec.js.snap +89 -0
  173. package/lib/Switch/__tests__/Switch.spec.js +163 -0
  174. package/lib/Switch/__tests__/__snapshots__/Switch.spec.js.snap +831 -0
  175. package/lib/TextBox/TextBox.module.css +4 -5
  176. package/lib/Textarea/Textarea.module.css +4 -3
  177. package/lib/v1/AppContainer/AppContainer.js +87 -138
  178. package/lib/v1/Card/Card.js +190 -286
  179. package/lib/v1/Card/index.js +37 -0
  180. package/lib/v1/DateTime/CalendarView.js +44 -10
  181. package/lib/v1/DateTime/DateTime.js +8 -4
  182. package/lib/v1/DateTime/DateTimePopupFooter.js +2 -2
  183. package/lib/v1/DateTime/DateTimePopupHeader.js +1 -1
  184. package/lib/v1/DateTime/DateWidget.js +8 -4
  185. package/lib/v1/DateTime/DaysRow.js +1 -1
  186. package/lib/v1/DateTime/Time.js +2 -2
  187. package/lib/v1/DateTime/YearView.js +2 -2
  188. package/lib/v1/DateTime/props/defaultProps.js +70 -0
  189. package/lib/v1/DateTime/props/propTypes.js +227 -0
  190. package/lib/v1/DropDown/DropDown.js +34 -130
  191. package/lib/v1/DropDown/DropDownHeading.js +29 -75
  192. package/lib/v1/DropDown/DropDownItem.js +50 -102
  193. package/lib/v1/DropDown/DropDownSearch.js +50 -89
  194. package/lib/v1/DropDown/DropDownSeparator.js +8 -48
  195. package/lib/v1/ListItem/ListItemWithAvatar.js +14 -9
  196. package/lib/v1/MultiSelect/MultiSelect.js +3 -1
  197. package/lib/v1/MultiSelect/MultiSelectWithAvatar.js +3 -1
  198. package/lib/v1/Provider/AvatarSize.js +24 -0
  199. package/lib/v1/Provider/Config.js +27 -0
  200. package/lib/v1/Provider/CssProvider.js +27 -0
  201. package/lib/v1/Provider/IdProvider.js +79 -0
  202. package/lib/v1/Provider/LibraryContext.js +76 -0
  203. package/lib/v1/Provider/LibraryContextInit.js +15 -0
  204. package/lib/v1/Provider/NumberGenerator/NumberGenerator.js +174 -0
  205. package/lib/v1/Provider/ZindexProvider.js +69 -0
  206. package/lib/v1/Provider/index.js +81 -0
  207. package/lib/v1/Tag/Tag.js +7 -4
  208. package/lib/v1/TextBox/TextBox.js +8 -9
  209. package/lib/v1/Typography/Typography.js +3 -3
  210. package/lib/v1/Typography/css/Typography.module.css +33 -0
  211. package/lib/v1/Typography/css/cssJSLogic.js +8 -5
  212. package/lib/v1/Typography/props/defaultProps.js +4 -4
  213. package/lib/v1/Typography/props/propTypes.js +8 -5
  214. package/package.json +11 -11
  215. package/result.json +1 -1
  216. package/unittest/index.html +1 -1
@@ -1,142 +1,4 @@
1
1
  import PropTypes from 'prop-types';
2
- export const AdvancedGroupMultiSelect_propTypes = {
3
- animationStyle: PropTypes.string,
4
- autoComplete: PropTypes.bool,
5
- borderColor: PropTypes.oneOf(['transparent', 'default']),
6
- customClass: PropTypes.string,
7
- dataId: PropTypes.string,
8
- defaultDropBoxPosition: PropTypes.oneOf(['bottom', 'top', 'left', 'right']),
9
- dropBoxSize: PropTypes.oneOf(['small', 'medium', 'large']),
10
- emptyMessage: PropTypes.string.isRequired,
11
- getContainerRef: PropTypes.func,
12
- getFooter: PropTypes.func,
13
- groupedOptions: PropTypes.array.isRequired,
14
- i18nKeys: PropTypes.shape({
15
- loadingText: PropTypes.string,
16
- emptyText: PropTypes.string,
17
- noMoreText: PropTypes.string,
18
- searchEmptyText: PropTypes.string
19
- }),
20
- a11y: PropTypes.shape({
21
- clearLabel: PropTypes.string
22
- }),
23
- isDataLoaded: PropTypes.bool,
24
- isDisabled: PropTypes.bool,
25
- isPadding: PropTypes.bool,
26
- isPopupOpen: PropTypes.bool,
27
- isPopupReady: PropTypes.bool,
28
- isReadOnly: PropTypes.bool,
29
- listItemSize: PropTypes.oneOf(['small', 'medium', 'large']),
30
- needBorder: PropTypes.bool,
31
- needResponsive: PropTypes.bool,
32
- needSelectAll: PropTypes.bool,
33
- notifyPopupToggle: PropTypes.func,
34
- onFocus: PropTypes.func,
35
- onKeyDown: PropTypes.func,
36
- onSearch: PropTypes.func,
37
- placeHolder: PropTypes.string,
38
- position: PropTypes.string,
39
- removeClose: PropTypes.func,
40
- searchDebounceTime: PropTypes.number,
41
- searchEmptyMessage: PropTypes.string,
42
- selectAllText: PropTypes.string,
43
- selectedGroupOptions: PropTypes.array.isRequired,
44
- selectedOptionDetails: PropTypes.object,
45
- size: PropTypes.oneOf(['medium', 'xmedium']),
46
- textBoxSize: PropTypes.oneOf(['small', 'medium', 'xmedium']),
47
- title: PropTypes.string,
48
- variant: PropTypes.string,
49
- htmlId: PropTypes.string,
50
- isSearchClearOnSelect: PropTypes.bool,
51
- palette: PropTypes.oneOf(['default', 'dark']),
52
- needEffect: true,
53
- dataSelectorId: PropTypes.string,
54
- valueField: PropTypes.string,
55
- textField: PropTypes.string,
56
- getTargetRef: PropTypes.func,
57
- togglePopup: PropTypes.func,
58
- needLocalSearch: PropTypes.bool,
59
- isNextOptions: PropTypes.bool,
60
- getNextOptions: PropTypes.func,
61
- isPopupOpenOnEnter: PropTypes.bool,
62
- onChange: PropTypes.func,
63
- needToCloseOnSelect: PropTypes.func,
64
- searchStr: PropTypes.string,
65
- children: PropTypes.node,
66
- dataSelectorId: PropTypes.string
67
- };
68
- export const AdvancedMultiSelect_propTypes = {
69
- id: PropTypes.string.isRequired,
70
- options: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])), PropTypes.arrayOf(PropTypes.shape({
71
- id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
72
- text: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
73
- photoURL: PropTypes.string
74
- }))]).isRequired,
75
- selectedOptions: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])).isRequired,
76
- selectedOptionsLimit: PropTypes.number,
77
- getSelectedOptionDetails: PropTypes.func,
78
- emptyMessage: PropTypes.string.isRequired,
79
- isDisabled: PropTypes.bool,
80
- isReadOnly: PropTypes.bool,
81
- needLocalSearch: PropTypes.bool,
82
- needSelectAll: PropTypes.bool,
83
- onChange: PropTypes.func.isRequired,
84
- searchEmptyMessage: PropTypes.string,
85
- placeHolder: PropTypes.string,
86
- selectAllText: PropTypes.string,
87
- textField: PropTypes.string,
88
- valueField: PropTypes.string,
89
- imageField: PropTypes.string,
90
- iconName: PropTypes.string,
91
- prefixText: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
92
- //For grouping multiSelect
93
- optionType: PropTypes.oneOf(['default', 'avatar', 'icon']),
94
- needEffect: PropTypes.bool,
95
- animationStyle: PropTypes.string,
96
- defaultDropBoxPosition: PropTypes.oneOf(['bottom', 'top', 'left', 'right']),
97
- dropBoxSize: PropTypes.oneOf(['small', 'medium', 'large']),
98
- isAnimate: PropTypes.bool,
99
- size: PropTypes.oneOf(['medium', 'xmedium']),
100
- textBoxSize: PropTypes.oneOf(['small', 'medium', 'xmedium']),
101
- title: PropTypes.string,
102
- variant: PropTypes.string,
103
- dataIdClearIcon: PropTypes.string,
104
- dataIdLoading: PropTypes.string,
105
- dataIdMultiSelectComp: PropTypes.string,
106
- dataIdSelectAllEle: PropTypes.string,
107
-
108
- /**** Popup Props ****/
109
- isPopupOpen: PropTypes.bool,
110
- isPopupReady: PropTypes.bool,
111
- togglePopup: PropTypes.func,
112
- getContainerRef: PropTypes.func,
113
- position: PropTypes.string,
114
- removeClose: PropTypes.func,
115
- listItemSize: PropTypes.oneOf(['small', 'medium', 'large']),
116
- needBorder: PropTypes.bool,
117
- htmlId: PropTypes.string,
118
- i18nKeys: PropTypes.shape({
119
- clearText: PropTypes.string,
120
- loadingText: PropTypes.string,
121
- emptyText: PropTypes.string,
122
- noMoreText: PropTypes.string,
123
- searchEmptyText: PropTypes.string
124
- }),
125
- a11y: PropTypes.shape({
126
- clearLabel: PropTypes.string
127
- }),
128
- borderColor: PropTypes.oneOf(['transparent', 'default', 'dark']),
129
- isBoxPaddingNeed: PropTypes.bool,
130
- isSearchClearOnSelect: PropTypes.bool,
131
- disabledOptions: PropTypes.arrayOf(PropTypes.string),
132
- getFooter: PropTypes.func,
133
- customProps: PropTypes.shape({
134
- SuggestionsProps: PropTypes.object,
135
- DropBoxProps: PropTypes.object
136
- }),
137
- isLoading: PropTypes.bool,
138
- dataSelectorId: PropTypes.string
139
- };
140
2
  export const EmptyState_propTypes = {
141
3
  dataId: PropTypes.string,
142
4
  emptyMessage: PropTypes.string,
@@ -307,4 +169,144 @@ export const Suggestions_propTypes = {
307
169
  optionType: PropTypes.string,
308
170
  listItemProps: PropTypes.object
309
171
  }))
172
+ };
173
+ export const AdvancedGroupMultiSelect_propTypes = {
174
+ animationStyle: PropTypes.string,
175
+ autoComplete: PropTypes.bool,
176
+ borderColor: PropTypes.oneOf(['transparent', 'default']),
177
+ customClass: PropTypes.string,
178
+ dataId: PropTypes.string,
179
+ defaultDropBoxPosition: PropTypes.oneOf(['bottom', 'top', 'left', 'right']),
180
+ dropBoxSize: PropTypes.oneOf(['small', 'medium', 'large']),
181
+ emptyMessage: PropTypes.string.isRequired,
182
+ getContainerRef: PropTypes.func,
183
+ getFooter: PropTypes.func,
184
+ groupedOptions: PropTypes.array.isRequired,
185
+ i18nKeys: PropTypes.shape({
186
+ loadingText: PropTypes.string,
187
+ emptyText: PropTypes.string,
188
+ noMoreText: PropTypes.string,
189
+ searchEmptyText: PropTypes.string
190
+ }),
191
+ a11y: PropTypes.shape({
192
+ clearLabel: PropTypes.string
193
+ }),
194
+ isDataLoaded: PropTypes.bool,
195
+ isDisabled: PropTypes.bool,
196
+ isPadding: PropTypes.bool,
197
+ isPopupOpen: PropTypes.bool,
198
+ isPopupReady: PropTypes.bool,
199
+ isReadOnly: PropTypes.bool,
200
+ listItemSize: PropTypes.oneOf(['small', 'medium', 'large']),
201
+ needBorder: PropTypes.bool,
202
+ needResponsive: PropTypes.bool,
203
+ needSelectAll: PropTypes.bool,
204
+ notifyPopupToggle: PropTypes.func,
205
+ onFocus: PropTypes.func,
206
+ onKeyDown: PropTypes.func,
207
+ onSearch: PropTypes.func,
208
+ placeHolder: PropTypes.string,
209
+ position: PropTypes.string,
210
+ removeClose: PropTypes.func,
211
+ searchDebounceTime: PropTypes.number,
212
+ searchEmptyMessage: PropTypes.string,
213
+ selectAllText: PropTypes.string,
214
+ selectedGroupOptions: PropTypes.array.isRequired,
215
+ selectedOptionDetails: PropTypes.object,
216
+ size: PropTypes.oneOf(['medium', 'xmedium']),
217
+ textBoxSize: PropTypes.oneOf(['small', 'medium', 'xmedium']),
218
+ title: PropTypes.string,
219
+ variant: PropTypes.string,
220
+ htmlId: PropTypes.string,
221
+ isSearchClearOnSelect: PropTypes.bool,
222
+ palette: PropTypes.oneOf(['default', 'dark']),
223
+ needEffect: true,
224
+ dataSelectorId: PropTypes.string,
225
+ valueField: PropTypes.string,
226
+ textField: PropTypes.string,
227
+ getTargetRef: PropTypes.func,
228
+ togglePopup: PropTypes.func,
229
+ needLocalSearch: PropTypes.bool,
230
+ isNextOptions: PropTypes.bool,
231
+ getNextOptions: PropTypes.func,
232
+ isPopupOpenOnEnter: PropTypes.bool,
233
+ onChange: PropTypes.func,
234
+ needToCloseOnSelect: PropTypes.func,
235
+ searchStr: PropTypes.string,
236
+ children: PropTypes.node,
237
+ dataSelectorId: PropTypes.string
238
+ };
239
+ export const AdvancedMultiSelect_propTypes = { ...MultiSelect_propTypes,
240
+ selectedOptionDetails: PropTypes.string,
241
+ iconSize: PropTypes.string,
242
+ id: PropTypes.string.isRequired,
243
+ options: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])), PropTypes.arrayOf(PropTypes.shape({
244
+ id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
245
+ text: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
246
+ photoURL: PropTypes.string
247
+ }))]).isRequired,
248
+ selectedOptions: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])).isRequired,
249
+ selectedOptionsLimit: PropTypes.number,
250
+ getSelectedOptionDetails: PropTypes.func,
251
+ emptyMessage: PropTypes.string.isRequired,
252
+ isDisabled: PropTypes.bool,
253
+ isReadOnly: PropTypes.bool,
254
+ needLocalSearch: PropTypes.bool,
255
+ needSelectAll: PropTypes.bool,
256
+ onChange: PropTypes.func.isRequired,
257
+ searchEmptyMessage: PropTypes.string,
258
+ placeHolder: PropTypes.string,
259
+ selectAllText: PropTypes.string,
260
+ textField: PropTypes.string,
261
+ valueField: PropTypes.string,
262
+ imageField: PropTypes.string,
263
+ iconName: PropTypes.string,
264
+ prefixText: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
265
+ //For grouping multiSelect
266
+ optionType: PropTypes.oneOf(['default', 'avatar', 'icon']),
267
+ needEffect: PropTypes.bool,
268
+ animationStyle: PropTypes.string,
269
+ defaultDropBoxPosition: PropTypes.oneOf(['bottom', 'top', 'left', 'right']),
270
+ dropBoxSize: PropTypes.oneOf(['small', 'medium', 'large']),
271
+ isAnimate: PropTypes.bool,
272
+ size: PropTypes.oneOf(['medium', 'xmedium']),
273
+ textBoxSize: PropTypes.oneOf(['small', 'medium', 'xmedium']),
274
+ title: PropTypes.string,
275
+ variant: PropTypes.string,
276
+ dataIdClearIcon: PropTypes.string,
277
+ dataIdLoading: PropTypes.string,
278
+ dataIdMultiSelectComp: PropTypes.string,
279
+ dataIdSelectAllEle: PropTypes.string,
280
+
281
+ /**** Popup Props ****/
282
+ isPopupOpen: PropTypes.bool,
283
+ isPopupReady: PropTypes.bool,
284
+ togglePopup: PropTypes.func,
285
+ getContainerRef: PropTypes.func,
286
+ position: PropTypes.string,
287
+ removeClose: PropTypes.func,
288
+ listItemSize: PropTypes.oneOf(['small', 'medium', 'large']),
289
+ needBorder: PropTypes.bool,
290
+ htmlId: PropTypes.string,
291
+ i18nKeys: PropTypes.shape({
292
+ clearText: PropTypes.string,
293
+ loadingText: PropTypes.string,
294
+ emptyText: PropTypes.string,
295
+ noMoreText: PropTypes.string,
296
+ searchEmptyText: PropTypes.string
297
+ }),
298
+ a11y: PropTypes.shape({
299
+ clearLabel: PropTypes.string
300
+ }),
301
+ borderColor: PropTypes.oneOf(['transparent', 'default', 'dark']),
302
+ isBoxPaddingNeed: PropTypes.bool,
303
+ isSearchClearOnSelect: PropTypes.bool,
304
+ disabledOptions: PropTypes.arrayOf(PropTypes.string),
305
+ getFooter: PropTypes.func,
306
+ customProps: PropTypes.shape({
307
+ SuggestionsProps: PropTypes.object,
308
+ DropBoxProps: PropTypes.object
309
+ }),
310
+ isLoading: PropTypes.bool,
311
+ dataSelectorId: PropTypes.string
310
312
  };
@@ -0,0 +1,241 @@
1
+ import React from 'react';
2
+ import { render } from '@testing-library/react';
3
+ import Radio from '../Radio.js';
4
+ describe('Radio', () => {
5
+ test('rendering the defult props', () => {
6
+ const {
7
+ asFragment
8
+ } = render( /*#__PURE__*/React.createElement(Radio, null));
9
+ expect(asFragment()).toMatchSnapshot();
10
+ });
11
+ test('rendering the ID', () => {
12
+ const {
13
+ asFragment
14
+ } = render( /*#__PURE__*/React.createElement(Radio, {
15
+ id: "RadioID"
16
+ }));
17
+ expect(asFragment()).toMatchSnapshot();
18
+ });
19
+ test('rendering the Name', () => {
20
+ const {
21
+ asFragment
22
+ } = render( /*#__PURE__*/React.createElement(Radio, {
23
+ name: "RadioName"
24
+ }));
25
+ expect(asFragment()).toMatchSnapshot();
26
+ });
27
+ test('rendering the Value', () => {
28
+ const {
29
+ asFragment
30
+ } = render( /*#__PURE__*/React.createElement(Radio, {
31
+ value: "RadioValue"
32
+ }));
33
+ expect(asFragment()).toMatchSnapshot();
34
+ });
35
+ const palette = ['primary', 'danger'];
36
+ test.each(palette)('rendering palette - %s', palette => {
37
+ const {
38
+ asFragment
39
+ } = render( /*#__PURE__*/React.createElement(Radio, {
40
+ palette: palette
41
+ }));
42
+ expect(asFragment()).toMatchSnapshot();
43
+ });
44
+ test('rendering the Checked is true', () => {
45
+ const {
46
+ asFragment
47
+ } = render( /*#__PURE__*/React.createElement(Radio, {
48
+ palette: palette,
49
+ active: true,
50
+ text: "RadioText"
51
+ }));
52
+ expect(asFragment()).toMatchSnapshot();
53
+ });
54
+ test('rendering the disabled is true', () => {
55
+ const {
56
+ asFragment
57
+ } = render( /*#__PURE__*/React.createElement(Radio, {
58
+ disabled: true,
59
+ palette: palette,
60
+ text: "RadioText"
61
+ }));
62
+ expect(asFragment()).toMatchSnapshot();
63
+ });
64
+ test('rendering the isReadOnly is true', () => {
65
+ const {
66
+ asFragment
67
+ } = render( /*#__PURE__*/React.createElement(Radio, {
68
+ isReadOnly: true
69
+ }));
70
+ expect(asFragment()).toMatchSnapshot();
71
+ });
72
+ test('rendering the disabledTitle', () => {
73
+ const {
74
+ asFragment
75
+ } = render( /*#__PURE__*/React.createElement(Radio, {
76
+ disabled: true,
77
+ disabledTitle: "radioDisableTitle",
78
+ text: "RadioText"
79
+ }));
80
+ expect(asFragment()).toMatchSnapshot();
81
+ });
82
+ test('rendering the title', () => {
83
+ const {
84
+ asFragment
85
+ } = render( /*#__PURE__*/React.createElement(Radio, {
86
+ title: "radioTitle",
87
+ text: "RadioText"
88
+ }));
89
+ expect(asFragment()).toMatchSnapshot();
90
+ });
91
+ test('rendering the text', () => {
92
+ const {
93
+ asFragment
94
+ } = render( /*#__PURE__*/React.createElement(Radio, {
95
+ text: "RadioText"
96
+ }));
97
+ expect(asFragment()).toMatchSnapshot();
98
+ });
99
+ const labelPalette = ['default', 'primary', 'danger', 'mandatory'];
100
+ test.each(labelPalette)('rendering labelPalette - %s', labelPalette => {
101
+ const {
102
+ asFragment
103
+ } = render( /*#__PURE__*/React.createElement(Radio, {
104
+ labelPalette: labelPalette,
105
+ text: "RadioText"
106
+ }));
107
+ expect(asFragment()).toMatchSnapshot();
108
+ });
109
+ const size = ['small', 'medium'];
110
+ test.each(size)('rendering size - %s', size => {
111
+ const {
112
+ asFragment
113
+ } = render( /*#__PURE__*/React.createElement(Radio, {
114
+ size: size
115
+ }));
116
+ expect(asFragment()).toMatchSnapshot();
117
+ });
118
+ const labelSize = ['small', 'medium', 'large'];
119
+ test.each(labelSize)('rendering labelSize - %s', labelSize => {
120
+ const {
121
+ asFragment
122
+ } = render( /*#__PURE__*/React.createElement(Radio, {
123
+ labelSize: labelSize,
124
+ text: "RadioText"
125
+ }));
126
+ expect(asFragment()).toMatchSnapshot();
127
+ });
128
+ const variant = ['primary', 'default'];
129
+ test.each(variant)('rendering labelSize - %s', variant => {
130
+ const {
131
+ asFragment
132
+ } = render( /*#__PURE__*/React.createElement(Radio, {
133
+ variant: variant,
134
+ text: "RadioText"
135
+ }));
136
+ expect(asFragment()).toMatchSnapshot();
137
+ });
138
+ test.each(palette)('rendering the active is true - %s', palette => {
139
+ const {
140
+ asFragment
141
+ } = render( /*#__PURE__*/React.createElement(Radio, {
142
+ palette: palette,
143
+ active: true,
144
+ checked: true,
145
+ text: "RadioText"
146
+ }));
147
+ expect(asFragment()).toMatchSnapshot();
148
+ });
149
+ test('rendering the isFilled is false', () => {
150
+ const {
151
+ asFragment
152
+ } = render( /*#__PURE__*/React.createElement(Radio, {
153
+ isFilled: false
154
+ }));
155
+ expect(asFragment()).toMatchSnapshot();
156
+ });
157
+ test('rendering the customClass of customRadioWrap,customRadio,customLabel ', () => {
158
+ const {
159
+ asFragment
160
+ } = render( /*#__PURE__*/React.createElement(Radio, {
161
+ customClass: {
162
+ customRadioWrap: 'CustomClassCustomRadioWrap',
163
+ customRadio: 'CustomClassCustomRadio',
164
+ customLabel: 'CustomClassCustomLabel'
165
+ },
166
+ text: "RadioText"
167
+ }));
168
+ expect(asFragment()).toMatchSnapshot();
169
+ });
170
+ test('rendering ally ariaChecked true', () => {
171
+ const {
172
+ asFragment
173
+ } = render( /*#__PURE__*/React.createElement(Radio, {
174
+ checked: true
175
+ }));
176
+ expect(asFragment()).toMatchSnapshot();
177
+ });
178
+ test('rendering ally ariaHidden , ariaChecked, ariaReadonly fasle true', () => {
179
+ const {
180
+ asFragment
181
+ } = render( /*#__PURE__*/React.createElement(Radio, {
182
+ checked: true,
183
+ isReadOnly: true,
184
+ disabled: true,
185
+ a11y: {
186
+ ariaHidden: true,
187
+ ariaChecked: true,
188
+ ariaReadonly: true
189
+ }
190
+ }));
191
+ expect(asFragment()).toMatchSnapshot();
192
+ });
193
+ test('rendering ally ariaHidden , ariaChecked, ariaReadonly is false', () => {
194
+ const {
195
+ asFragment
196
+ } = render( /*#__PURE__*/React.createElement(Radio, {
197
+ a11y: {
198
+ ariaHidden: false
199
+ }
200
+ }));
201
+ expect(asFragment()).toMatchSnapshot();
202
+ });
203
+ test('rendering the accessMode when isReadOnly ', () => {
204
+ const {
205
+ asFragment
206
+ } = render( /*#__PURE__*/React.createElement(Radio, {
207
+ isReadOnly: true,
208
+ text: "RadioText"
209
+ }));
210
+ expect(asFragment()).toMatchSnapshot();
211
+ });
212
+ test('rendering the accessMode when disabled ', () => {
213
+ const {
214
+ asFragment
215
+ } = render( /*#__PURE__*/React.createElement(Radio, {
216
+ disabled: true,
217
+ text: "RadioText"
218
+ }));
219
+ expect(asFragment()).toMatchSnapshot();
220
+ });
221
+ test('eleRef prop is a function', () => {
222
+ // Create a mock function
223
+ const mockEleRef = jest.fn();
224
+ const {
225
+ asFragment
226
+ } = render( /*#__PURE__*/React.createElement(Radio, {
227
+ eleRef: mockEleRef
228
+ }));
229
+ expect(asFragment()).toMatchSnapshot();
230
+ });
231
+ test('renders with different onClick props', () => {
232
+ const onClickFunction = jest.fn();
233
+ const {
234
+ asFragment
235
+ } = render( /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Radio, {
236
+ value: "radioValue",
237
+ onChange: onClickFunction
238
+ })));
239
+ expect(asFragment()).toMatchSnapshot();
240
+ });
241
+ });