@workday/canvas-kit-preview-react 8.0.0-alpha.254-next.23 → 8.0.0-alpha.428-next.2

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 (315) hide show
  1. package/color-picker/lib/ColorPicker.tsx +1 -1
  2. package/dist/commonjs/color-picker/lib/ColorPicker.js +25 -48
  3. package/dist/commonjs/color-picker/lib/parts/ColorReset.js +32 -23
  4. package/dist/commonjs/color-picker/lib/parts/SwatchBook.js +26 -39
  5. package/dist/commonjs/form-field/lib/FormField.d.ts +4 -10
  6. package/dist/commonjs/form-field/lib/FormField.d.ts.map +1 -1
  7. package/dist/commonjs/form-field/lib/FormField.js +10 -33
  8. package/dist/commonjs/form-field/lib/FormFieldHint.d.ts +1 -1
  9. package/dist/commonjs/form-field/lib/FormFieldHint.js +8 -31
  10. package/dist/commonjs/form-field/lib/FormFieldInput.d.ts +1 -1
  11. package/dist/commonjs/form-field/lib/FormFieldInput.js +6 -17
  12. package/dist/commonjs/form-field/lib/FormFieldLabel.d.ts +2 -8
  13. package/dist/commonjs/form-field/lib/FormFieldLabel.d.ts.map +1 -1
  14. package/dist/commonjs/form-field/lib/FormFieldLabel.js +8 -31
  15. package/dist/commonjs/form-field/lib/hooks/useFormFieldHint.d.ts +3 -5
  16. package/dist/commonjs/form-field/lib/hooks/useFormFieldHint.d.ts.map +1 -1
  17. package/dist/commonjs/form-field/lib/hooks/useFormFieldHint.js +4 -5
  18. package/dist/commonjs/form-field/lib/hooks/useFormFieldInput.d.ts +3 -5
  19. package/dist/commonjs/form-field/lib/hooks/useFormFieldInput.d.ts.map +1 -1
  20. package/dist/commonjs/form-field/lib/hooks/useFormFieldInput.js +5 -6
  21. package/dist/commonjs/form-field/lib/hooks/useFormFieldLabel.d.ts +3 -5
  22. package/dist/commonjs/form-field/lib/hooks/useFormFieldLabel.d.ts.map +1 -1
  23. package/dist/commonjs/form-field/lib/hooks/useFormFieldLabel.js +4 -5
  24. package/dist/commonjs/form-field/lib/hooks/useFormFieldModel.d.ts +2 -12
  25. package/dist/commonjs/form-field/lib/hooks/useFormFieldModel.d.ts.map +1 -1
  26. package/dist/commonjs/form-field/lib/hooks/useFormFieldModel.js +9 -19
  27. package/dist/commonjs/form-field/lib/hooks/useFormFieldOrientation.d.ts +4 -4
  28. package/dist/commonjs/form-field/lib/hooks/useFormFieldOrientation.d.ts.map +1 -1
  29. package/dist/commonjs/form-field/lib/hooks/useFormFieldOrientation.js +5 -5
  30. package/dist/commonjs/menu/lib/Menu.d.ts +16 -9
  31. package/dist/commonjs/menu/lib/Menu.d.ts.map +1 -1
  32. package/dist/commonjs/menu/lib/Menu.js +108 -132
  33. package/dist/commonjs/menu/lib/MenuItem.d.ts +17 -7
  34. package/dist/commonjs/menu/lib/MenuItem.d.ts.map +1 -1
  35. package/dist/commonjs/menu/lib/MenuItem.js +111 -114
  36. package/dist/commonjs/pill/lib/Pill.d.ts +103 -5
  37. package/dist/commonjs/pill/lib/Pill.d.ts.map +1 -1
  38. package/dist/commonjs/pill/lib/Pill.js +158 -64
  39. package/dist/commonjs/pill/lib/PillAvatar.js +6 -17
  40. package/dist/commonjs/pill/lib/PillCount.js +7 -30
  41. package/dist/commonjs/pill/lib/PillIcon.js +8 -31
  42. package/dist/commonjs/pill/lib/PillIconButton.js +13 -36
  43. package/dist/commonjs/pill/lib/PillLabel.js +10 -33
  44. package/dist/commonjs/pill/lib/usePillModel.js +8 -16
  45. package/dist/commonjs/segmented-control/index.d.ts +2 -0
  46. package/dist/commonjs/segmented-control/index.d.ts.map +1 -1
  47. package/dist/commonjs/segmented-control/index.js +4 -0
  48. package/dist/commonjs/segmented-control/lib/SegmentedControl.d.ts +267 -82
  49. package/dist/commonjs/segmented-control/lib/SegmentedControl.d.ts.map +1 -1
  50. package/dist/commonjs/segmented-control/lib/SegmentedControl.js +42 -7
  51. package/dist/commonjs/segmented-control/lib/SegmentedControlItem.d.ts +9 -5
  52. package/dist/commonjs/segmented-control/lib/SegmentedControlItem.d.ts.map +1 -1
  53. package/dist/commonjs/segmented-control/lib/SegmentedControlItem.js +24 -49
  54. package/dist/commonjs/segmented-control/lib/SegmentedControlList.d.ts +71 -2
  55. package/dist/commonjs/segmented-control/lib/SegmentedControlList.d.ts.map +1 -1
  56. package/dist/commonjs/segmented-control/lib/SegmentedControlList.js +15 -40
  57. package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlItem.d.ts +28 -9
  58. package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlItem.d.ts.map +1 -1
  59. package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlItem.js +8 -10
  60. package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlModel.d.ts +233 -83
  61. package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlModel.d.ts.map +1 -1
  62. package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlModel.js +33 -32
  63. package/dist/commonjs/select/lib/Select.js +147 -187
  64. package/dist/commonjs/select/lib/SelectBase.js +106 -101
  65. package/dist/commonjs/select/lib/SelectMenu.js +53 -84
  66. package/dist/commonjs/select/lib/SelectOption.js +33 -47
  67. package/dist/commonjs/select/lib/scrolling.js +6 -7
  68. package/dist/commonjs/select/lib/utils.js +4 -4
  69. package/dist/commonjs/side-panel/lib/SidePanel.d.ts +13 -26
  70. package/dist/commonjs/side-panel/lib/SidePanel.d.ts.map +1 -1
  71. package/dist/commonjs/side-panel/lib/SidePanel.js +95 -133
  72. package/dist/commonjs/side-panel/lib/SidePanelToggleButton.d.ts +17 -0
  73. package/dist/commonjs/side-panel/lib/SidePanelToggleButton.d.ts.map +1 -0
  74. package/dist/commonjs/side-panel/lib/SidePanelToggleButton.js +65 -0
  75. package/dist/commonjs/side-panel/lib/hooks.d.ts +20 -0
  76. package/dist/commonjs/side-panel/lib/hooks.d.ts.map +1 -1
  77. package/dist/commonjs/side-panel/lib/hooks.js +40 -21
  78. package/dist/commonjs/status-indicator/index.d.ts +2 -0
  79. package/dist/commonjs/status-indicator/index.d.ts.map +1 -1
  80. package/dist/commonjs/status-indicator/index.js +4 -0
  81. package/dist/commonjs/status-indicator/lib/StatusIndicator.d.ts +32 -8
  82. package/dist/commonjs/status-indicator/lib/StatusIndicator.d.ts.map +1 -1
  83. package/dist/commonjs/status-indicator/lib/StatusIndicator.js +37 -35
  84. package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.d.ts +10 -0
  85. package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.d.ts.map +1 -1
  86. package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.js +11 -23
  87. package/dist/commonjs/status-indicator/lib/StatusIndicatorLabel.js +5 -28
  88. package/dist/commonjs/status-indicator/lib/hooks/useStatusIndicatorModel.js +6 -15
  89. package/dist/commonjs/table/index.d.ts +2 -0
  90. package/dist/commonjs/table/index.d.ts.map +1 -0
  91. package/dist/commonjs/{text-area/lib/hooks → table}/index.js +1 -1
  92. package/dist/commonjs/table/lib/Table.d.ts +207 -0
  93. package/dist/commonjs/table/lib/Table.d.ts.map +1 -0
  94. package/dist/commonjs/table/lib/Table.js +229 -0
  95. package/dist/commonjs/table/lib/TableBody.d.ts +2 -0
  96. package/dist/commonjs/table/lib/TableBody.d.ts.map +1 -0
  97. package/dist/commonjs/table/lib/TableBody.js +35 -0
  98. package/dist/commonjs/table/lib/TableCaption.d.ts +2 -0
  99. package/dist/commonjs/table/lib/TableCaption.d.ts.map +1 -0
  100. package/dist/commonjs/table/lib/TableCaption.js +16 -0
  101. package/dist/commonjs/table/lib/TableCell.d.ts +2 -0
  102. package/dist/commonjs/table/lib/TableCell.d.ts.map +1 -0
  103. package/dist/commonjs/table/lib/TableCell.js +16 -0
  104. package/dist/commonjs/table/lib/TableFooter.d.ts +2 -0
  105. package/dist/commonjs/table/lib/TableFooter.d.ts.map +1 -0
  106. package/dist/commonjs/table/lib/TableFooter.js +15 -0
  107. package/dist/commonjs/table/lib/TableHead.d.ts +2 -0
  108. package/dist/commonjs/table/lib/TableHead.d.ts.map +1 -0
  109. package/dist/commonjs/table/lib/TableHead.js +23 -0
  110. package/dist/commonjs/table/lib/TableHeader.d.ts +2 -0
  111. package/dist/commonjs/table/lib/TableHeader.d.ts.map +1 -0
  112. package/dist/commonjs/table/lib/TableHeader.js +16 -0
  113. package/dist/commonjs/table/lib/TableRow.d.ts +2 -0
  114. package/dist/commonjs/table/lib/TableRow.d.ts.map +1 -0
  115. package/dist/commonjs/table/lib/TableRow.js +19 -0
  116. package/dist/commonjs/text-area/lib/TextArea.d.ts +2 -2
  117. package/dist/commonjs/text-area/lib/TextArea.d.ts.map +1 -1
  118. package/dist/commonjs/text-area/lib/TextArea.js +9 -33
  119. package/dist/commonjs/text-area/lib/TextAreaField.d.ts +1 -1
  120. package/dist/commonjs/text-area/lib/TextAreaField.d.ts.map +1 -1
  121. package/dist/commonjs/text-area/lib/TextAreaField.js +12 -36
  122. package/dist/commonjs/text-input/lib/TextInput.d.ts +4 -4
  123. package/dist/commonjs/text-input/lib/TextInput.d.ts.map +1 -1
  124. package/dist/commonjs/text-input/lib/TextInput.js +9 -33
  125. package/dist/commonjs/text-input/lib/TextInputField.d.ts +1 -1
  126. package/dist/commonjs/text-input/lib/TextInputField.d.ts.map +1 -1
  127. package/dist/commonjs/text-input/lib/TextInputField.js +13 -25
  128. package/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts +3 -5
  129. package/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts.map +1 -1
  130. package/dist/commonjs/text-input/lib/hooks/useTextInputField.js +3 -3
  131. package/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts +1 -0
  132. package/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts.map +1 -1
  133. package/dist/commonjs/text-input/lib/hooks/useTextInputModel.js +2 -1
  134. package/dist/es6/color-picker/lib/ColorPicker.js +16 -39
  135. package/dist/es6/color-picker/lib/parts/ColorReset.js +27 -18
  136. package/dist/es6/color-picker/lib/parts/SwatchBook.js +21 -34
  137. package/dist/es6/form-field/lib/FormField.d.ts +4 -10
  138. package/dist/es6/form-field/lib/FormField.d.ts.map +1 -1
  139. package/dist/es6/form-field/lib/FormField.js +5 -28
  140. package/dist/es6/form-field/lib/FormFieldHint.d.ts +1 -1
  141. package/dist/es6/form-field/lib/FormFieldHint.js +4 -27
  142. package/dist/es6/form-field/lib/FormFieldInput.d.ts +1 -1
  143. package/dist/es6/form-field/lib/FormFieldInput.js +3 -14
  144. package/dist/es6/form-field/lib/FormFieldLabel.d.ts +2 -8
  145. package/dist/es6/form-field/lib/FormFieldLabel.d.ts.map +1 -1
  146. package/dist/es6/form-field/lib/FormFieldLabel.js +5 -28
  147. package/dist/es6/form-field/lib/hooks/useFormFieldHint.d.ts +3 -5
  148. package/dist/es6/form-field/lib/hooks/useFormFieldHint.d.ts.map +1 -1
  149. package/dist/es6/form-field/lib/hooks/useFormFieldHint.js +2 -3
  150. package/dist/es6/form-field/lib/hooks/useFormFieldInput.d.ts +3 -5
  151. package/dist/es6/form-field/lib/hooks/useFormFieldInput.d.ts.map +1 -1
  152. package/dist/es6/form-field/lib/hooks/useFormFieldInput.js +3 -4
  153. package/dist/es6/form-field/lib/hooks/useFormFieldLabel.d.ts +3 -5
  154. package/dist/es6/form-field/lib/hooks/useFormFieldLabel.d.ts.map +1 -1
  155. package/dist/es6/form-field/lib/hooks/useFormFieldLabel.js +2 -3
  156. package/dist/es6/form-field/lib/hooks/useFormFieldModel.d.ts +2 -12
  157. package/dist/es6/form-field/lib/hooks/useFormFieldModel.d.ts.map +1 -1
  158. package/dist/es6/form-field/lib/hooks/useFormFieldModel.js +9 -19
  159. package/dist/es6/form-field/lib/hooks/useFormFieldOrientation.d.ts +4 -4
  160. package/dist/es6/form-field/lib/hooks/useFormFieldOrientation.d.ts.map +1 -1
  161. package/dist/es6/form-field/lib/hooks/useFormFieldOrientation.js +4 -4
  162. package/dist/es6/menu/lib/Menu.d.ts +16 -9
  163. package/dist/es6/menu/lib/Menu.d.ts.map +1 -1
  164. package/dist/es6/menu/lib/Menu.js +103 -128
  165. package/dist/es6/menu/lib/MenuItem.d.ts +17 -7
  166. package/dist/es6/menu/lib/MenuItem.d.ts.map +1 -1
  167. package/dist/es6/menu/lib/MenuItem.js +107 -111
  168. package/dist/es6/pill/lib/Pill.d.ts +103 -5
  169. package/dist/es6/pill/lib/Pill.d.ts.map +1 -1
  170. package/dist/es6/pill/lib/Pill.js +149 -55
  171. package/dist/es6/pill/lib/PillAvatar.js +3 -14
  172. package/dist/es6/pill/lib/PillCount.js +4 -27
  173. package/dist/es6/pill/lib/PillIcon.js +3 -26
  174. package/dist/es6/pill/lib/PillIconButton.js +7 -30
  175. package/dist/es6/pill/lib/PillLabel.js +5 -28
  176. package/dist/es6/pill/lib/usePillModel.js +8 -16
  177. package/dist/es6/segmented-control/index.d.ts +2 -0
  178. package/dist/es6/segmented-control/index.d.ts.map +1 -1
  179. package/dist/es6/segmented-control/index.js +2 -0
  180. package/dist/es6/segmented-control/lib/SegmentedControl.d.ts +267 -82
  181. package/dist/es6/segmented-control/lib/SegmentedControl.d.ts.map +1 -1
  182. package/dist/es6/segmented-control/lib/SegmentedControl.js +38 -3
  183. package/dist/es6/segmented-control/lib/SegmentedControlItem.d.ts +9 -5
  184. package/dist/es6/segmented-control/lib/SegmentedControlItem.d.ts.map +1 -1
  185. package/dist/es6/segmented-control/lib/SegmentedControlItem.js +17 -42
  186. package/dist/es6/segmented-control/lib/SegmentedControlList.d.ts +71 -2
  187. package/dist/es6/segmented-control/lib/SegmentedControlList.d.ts.map +1 -1
  188. package/dist/es6/segmented-control/lib/SegmentedControlList.js +9 -34
  189. package/dist/es6/segmented-control/lib/hooks/useSegmentedControlItem.d.ts +28 -9
  190. package/dist/es6/segmented-control/lib/hooks/useSegmentedControlItem.d.ts.map +1 -1
  191. package/dist/es6/segmented-control/lib/hooks/useSegmentedControlItem.js +5 -7
  192. package/dist/es6/segmented-control/lib/hooks/useSegmentedControlModel.d.ts +233 -83
  193. package/dist/es6/segmented-control/lib/hooks/useSegmentedControlModel.d.ts.map +1 -1
  194. package/dist/es6/segmented-control/lib/hooks/useSegmentedControlModel.js +31 -30
  195. package/dist/es6/select/lib/Select.js +144 -184
  196. package/dist/es6/select/lib/SelectBase.js +99 -94
  197. package/dist/es6/select/lib/SelectMenu.js +49 -80
  198. package/dist/es6/select/lib/SelectOption.js +30 -44
  199. package/dist/es6/select/lib/scrolling.js +6 -7
  200. package/dist/es6/select/lib/utils.js +4 -4
  201. package/dist/es6/side-panel/lib/SidePanel.d.ts +13 -26
  202. package/dist/es6/side-panel/lib/SidePanel.d.ts.map +1 -1
  203. package/dist/es6/side-panel/lib/SidePanel.js +93 -130
  204. package/dist/es6/side-panel/lib/SidePanelToggleButton.d.ts +17 -0
  205. package/dist/es6/side-panel/lib/SidePanelToggleButton.d.ts.map +1 -0
  206. package/dist/es6/side-panel/lib/SidePanelToggleButton.js +43 -0
  207. package/dist/es6/side-panel/lib/hooks.d.ts +20 -0
  208. package/dist/es6/side-panel/lib/hooks.d.ts.map +1 -1
  209. package/dist/es6/side-panel/lib/hooks.js +37 -18
  210. package/dist/es6/status-indicator/index.d.ts +2 -0
  211. package/dist/es6/status-indicator/index.d.ts.map +1 -1
  212. package/dist/es6/status-indicator/index.js +2 -0
  213. package/dist/es6/status-indicator/lib/StatusIndicator.d.ts +32 -8
  214. package/dist/es6/status-indicator/lib/StatusIndicator.d.ts.map +1 -1
  215. package/dist/es6/status-indicator/lib/StatusIndicator.js +33 -31
  216. package/dist/es6/status-indicator/lib/StatusIndicatorIcon.d.ts +10 -0
  217. package/dist/es6/status-indicator/lib/StatusIndicatorIcon.d.ts.map +1 -1
  218. package/dist/es6/status-indicator/lib/StatusIndicatorIcon.js +6 -18
  219. package/dist/es6/status-indicator/lib/StatusIndicatorLabel.js +3 -26
  220. package/dist/es6/status-indicator/lib/hooks/useStatusIndicatorModel.js +6 -15
  221. package/dist/es6/table/index.d.ts +2 -0
  222. package/dist/es6/table/index.d.ts.map +1 -0
  223. package/dist/es6/table/index.js +1 -0
  224. package/dist/es6/table/lib/Table.d.ts +207 -0
  225. package/dist/es6/table/lib/Table.d.ts.map +1 -0
  226. package/dist/es6/table/lib/Table.js +223 -0
  227. package/dist/es6/table/lib/TableBody.d.ts +2 -0
  228. package/dist/es6/table/lib/TableBody.d.ts.map +1 -0
  229. package/dist/es6/table/lib/TableBody.js +29 -0
  230. package/dist/es6/table/lib/TableCaption.d.ts +2 -0
  231. package/dist/es6/table/lib/TableCaption.d.ts.map +1 -0
  232. package/dist/es6/table/lib/TableCaption.js +10 -0
  233. package/dist/es6/table/lib/TableCell.d.ts +2 -0
  234. package/dist/es6/table/lib/TableCell.d.ts.map +1 -0
  235. package/dist/es6/table/lib/TableCell.js +10 -0
  236. package/dist/es6/table/lib/TableFooter.d.ts +2 -0
  237. package/dist/es6/table/lib/TableFooter.d.ts.map +1 -0
  238. package/dist/es6/table/lib/TableFooter.js +9 -0
  239. package/dist/es6/table/lib/TableHead.d.ts +2 -0
  240. package/dist/es6/table/lib/TableHead.d.ts.map +1 -0
  241. package/dist/es6/table/lib/TableHead.js +17 -0
  242. package/dist/es6/table/lib/TableHeader.d.ts +2 -0
  243. package/dist/es6/table/lib/TableHeader.d.ts.map +1 -0
  244. package/dist/es6/table/lib/TableHeader.js +10 -0
  245. package/dist/es6/table/lib/TableRow.d.ts +2 -0
  246. package/dist/es6/table/lib/TableRow.d.ts.map +1 -0
  247. package/dist/es6/table/lib/TableRow.js +13 -0
  248. package/dist/es6/text-area/lib/TextArea.d.ts +2 -2
  249. package/dist/es6/text-area/lib/TextArea.d.ts.map +1 -1
  250. package/dist/es6/text-area/lib/TextArea.js +7 -31
  251. package/dist/es6/text-area/lib/TextAreaField.d.ts +1 -1
  252. package/dist/es6/text-area/lib/TextAreaField.d.ts.map +1 -1
  253. package/dist/es6/text-area/lib/TextAreaField.js +9 -33
  254. package/dist/es6/text-input/lib/TextInput.d.ts +4 -4
  255. package/dist/es6/text-input/lib/TextInput.d.ts.map +1 -1
  256. package/dist/es6/text-input/lib/TextInput.js +7 -31
  257. package/dist/es6/text-input/lib/TextInputField.d.ts +1 -1
  258. package/dist/es6/text-input/lib/TextInputField.d.ts.map +1 -1
  259. package/dist/es6/text-input/lib/TextInputField.js +12 -24
  260. package/dist/es6/text-input/lib/hooks/useTextInputField.d.ts +3 -5
  261. package/dist/es6/text-input/lib/hooks/useTextInputField.d.ts.map +1 -1
  262. package/dist/es6/text-input/lib/hooks/useTextInputField.js +1 -1
  263. package/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts +1 -0
  264. package/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts.map +1 -1
  265. package/dist/es6/text-input/lib/hooks/useTextInputModel.js +2 -1
  266. package/form-field/lib/FormField.tsx +5 -10
  267. package/form-field/lib/FormFieldLabel.tsx +6 -11
  268. package/form-field/lib/hooks/useFormFieldModel.tsx +1 -3
  269. package/form-field/lib/hooks/useFormFieldOrientation.tsx +6 -6
  270. package/menu/lib/Menu.tsx +16 -9
  271. package/menu/lib/MenuItem.tsx +19 -8
  272. package/package.json +4 -5
  273. package/pill/lib/Pill.tsx +109 -10
  274. package/pill/lib/PillCount.tsx +1 -1
  275. package/pill/lib/PillIcon.tsx +1 -1
  276. package/segmented-control/index.ts +2 -0
  277. package/segmented-control/lib/SegmentedControl.tsx +36 -0
  278. package/segmented-control/lib/SegmentedControlList.tsx +1 -1
  279. package/segmented-control/lib/hooks/useSegmentedControlItem.tsx +1 -5
  280. package/side-panel/lib/SidePanel.tsx +119 -169
  281. package/side-panel/lib/SidePanelToggleButton.tsx +78 -0
  282. package/side-panel/lib/hooks.ts +20 -0
  283. package/status-indicator/index.ts +2 -0
  284. package/status-indicator/lib/StatusIndicator.tsx +32 -6
  285. package/status-indicator/lib/StatusIndicatorIcon.tsx +1 -1
  286. package/table/LICENSE +51 -0
  287. package/table/README.md +5 -0
  288. package/table/index.ts +1 -0
  289. package/table/lib/Table.tsx +236 -0
  290. package/table/lib/TableBody.tsx +35 -0
  291. package/table/lib/TableCaption.tsx +22 -0
  292. package/table/lib/TableCell.tsx +27 -0
  293. package/table/lib/TableFooter.tsx +14 -0
  294. package/table/lib/TableHead.tsx +23 -0
  295. package/table/lib/TableHeader.tsx +28 -0
  296. package/table/lib/TableRow.tsx +26 -0
  297. package/table/package.json +6 -0
  298. package/text-area/lib/TextArea.tsx +9 -6
  299. package/text-area/lib/TextAreaField.tsx +6 -2
  300. package/text-input/lib/TextInput.tsx +9 -6
  301. package/text-input/lib/TextInputField.tsx +9 -5
  302. package/text-input/lib/hooks/useTextInputModel.ts +1 -0
  303. package/dist/commonjs/text-area/lib/hooks/index.d.ts +0 -2
  304. package/dist/commonjs/text-area/lib/hooks/index.d.ts.map +0 -1
  305. package/dist/commonjs/text-area/lib/hooks/useTextAreaModel.d.ts +0 -28
  306. package/dist/commonjs/text-area/lib/hooks/useTextAreaModel.d.ts.map +0 -1
  307. package/dist/commonjs/text-area/lib/hooks/useTextAreaModel.js +0 -5
  308. package/dist/es6/text-area/lib/hooks/index.d.ts +0 -2
  309. package/dist/es6/text-area/lib/hooks/index.d.ts.map +0 -1
  310. package/dist/es6/text-area/lib/hooks/index.js +0 -1
  311. package/dist/es6/text-area/lib/hooks/useTextAreaModel.d.ts +0 -28
  312. package/dist/es6/text-area/lib/hooks/useTextAreaModel.d.ts.map +0 -1
  313. package/dist/es6/text-area/lib/hooks/useTextAreaModel.js +0 -2
  314. package/text-area/lib/hooks/index.ts +0 -1
  315. package/text-area/lib/hooks/useTextAreaModel.ts +0 -3
@@ -1,28 +1,4 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- extendStatics(d, b);
11
- function __() { this.constructor = d; }
12
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
- };
14
- })();
15
- var __assign = (this && this.__assign) || function () {
16
- __assign = Object.assign || function(t) {
17
- for (var s, i = 1, n = arguments.length; i < n; i++) {
18
- s = arguments[i];
19
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
20
- t[p] = s[p];
21
- }
22
- return t;
23
- };
24
- return __assign.apply(this, arguments);
25
- };
26
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
27
3
  if (k2 === undefined) k2 = k;
28
4
  Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
@@ -42,42 +18,30 @@ var __importStar = (this && this.__importStar) || function (mod) {
42
18
  __setModuleDefault(result, mod);
43
19
  return result;
44
20
  };
45
- var __rest = (this && this.__rest) || function (s, e) {
46
- var t = {};
47
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
48
- t[p] = s[p];
49
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
50
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
51
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
52
- t[p[i]] = s[p[i]];
53
- }
54
- return t;
55
- };
56
21
  Object.defineProperty(exports, "__esModule", { value: true });
57
22
  exports.Select = void 0;
58
- var React = __importStar(require("react"));
59
- var common_1 = require("@workday/canvas-kit-react/common");
60
- var SelectMenu_1 = require("./SelectMenu");
61
- var SelectBase_1 = require("./SelectBase");
62
- var utils_1 = require("./utils");
63
- var SelectContainer = /** @class */ (function (_super) {
64
- __extends(SelectContainer, _super);
65
- function SelectContainer(props) {
66
- var _this = _super.call(this, props) || this;
67
- _this.state = {
23
+ const React = __importStar(require("react"));
24
+ const common_1 = require("@workday/canvas-kit-react/common");
25
+ const SelectMenu_1 = require("./SelectMenu");
26
+ const SelectBase_1 = require("./SelectBase");
27
+ const utils_1 = require("./utils");
28
+ class SelectContainer extends React.Component {
29
+ constructor(props) {
30
+ super(props);
31
+ this.state = {
68
32
  focusedOptionIndex: 0,
69
33
  menuVisibility: 'closed',
70
34
  };
71
- _this.localButtonRef = React.createRef();
72
- _this.inputRef = React.createRef();
73
- _this.menuRef = React.createRef();
35
+ this.localButtonRef = React.createRef();
36
+ this.inputRef = React.createRef();
37
+ this.menuRef = React.createRef();
74
38
  // For type-ahead functionality
75
- _this.keysSoFar = '';
76
- _this.clearKeysSoFarTimeout = 500;
39
+ this.keysSoFar = '';
40
+ this.clearKeysSoFarTimeout = 500;
77
41
  // Cached values
78
- _this.normalizedOptions = [];
79
- _this.areOptionsDefined = function () {
80
- var options = _this.props.options;
42
+ this.normalizedOptions = [];
43
+ this.areOptionsDefined = () => {
44
+ const { options } = this.props;
81
45
  if (!options || options.length === 0) {
82
46
  return false;
83
47
  }
@@ -86,15 +50,15 @@ var SelectContainer = /** @class */ (function (_super) {
86
50
  // Store normalized options since the options prop can take on multiple
87
51
  // forms: an array of strings or an array of objects (sometimes with
88
52
  // arbitrary keys)
89
- _this.setNormalizedOptions = function () {
90
- var options = _this.props.options;
53
+ this.setNormalizedOptions = () => {
54
+ const { options } = this.props;
91
55
  // Abort if options weren't defined
92
- if (!_this.areOptionsDefined()) {
56
+ if (!this.areOptionsDefined()) {
93
57
  return;
94
58
  }
95
- _this.normalizedOptions = options.map(function (option) {
96
- var data = {};
97
- var disabled, id, label, value;
59
+ this.normalizedOptions = options.map(option => {
60
+ let data = {};
61
+ let disabled, id, label, value;
98
62
  if (typeof option === 'string') {
99
63
  disabled = false;
100
64
  id = common_1.generateUniqueId();
@@ -109,21 +73,19 @@ var SelectContainer = /** @class */ (function (_super) {
109
73
  label = option.label || option.value;
110
74
  }
111
75
  return {
112
- data: data,
113
- disabled: disabled,
114
- id: id,
115
- label: label,
116
- value: value,
76
+ data,
77
+ disabled,
78
+ id,
79
+ label,
80
+ value,
117
81
  };
118
82
  });
119
83
  };
120
- _this.getIndexByStartString = function (startIndex, startString, endIndex, ignoreDisabled) {
121
- if (endIndex === void 0) { endIndex = _this.normalizedOptions.length; }
122
- if (ignoreDisabled === void 0) { ignoreDisabled = true; }
123
- for (var i = startIndex; i < endIndex; i++) {
124
- var label = _this.normalizedOptions[i].label.toLowerCase();
84
+ this.getIndexByStartString = (startIndex, startString, endIndex = this.normalizedOptions.length, ignoreDisabled = true) => {
85
+ for (let i = startIndex; i < endIndex; i++) {
86
+ const label = this.normalizedOptions[i].label.toLowerCase();
125
87
  if (label.indexOf(startString.toLowerCase()) === 0) {
126
- if (!ignoreDisabled || (ignoreDisabled && !_this.normalizedOptions[i].disabled)) {
88
+ if (!ignoreDisabled || (ignoreDisabled && !this.normalizedOptions[i].disabled)) {
127
89
  return i;
128
90
  }
129
91
  }
@@ -139,64 +101,64 @@ var SelectContainer = /** @class */ (function (_super) {
139
101
  // Up/Down key means "focus the first enabled option above/below the currently
140
102
  // focused option", or pressing the Home/End key means "focus the first/last
141
103
  // enabled option on the menu."
142
- _this.focusNextEnabledOption = function (startIndex, direction) {
104
+ this.focusNextEnabledOption = (startIndex, direction) => {
143
105
  // Ensure direction is non-zero
144
106
  if (direction === 0) {
145
107
  return;
146
108
  }
147
- var numOptions = _this.normalizedOptions.length;
148
- var currentIndex = startIndex;
109
+ const numOptions = this.normalizedOptions.length;
110
+ let currentIndex = startIndex;
149
111
  // Check if currentIndex refers to an enabled option. If not, keep moving
150
112
  // the index in the prescribed direction until we find an enabled option.
151
113
  while (currentIndex >= 0 &&
152
114
  currentIndex < numOptions &&
153
- _this.normalizedOptions[currentIndex].disabled) {
115
+ this.normalizedOptions[currentIndex].disabled) {
154
116
  currentIndex += direction;
155
117
  }
156
118
  // Update the focused index only if currentIndex is inbounds and
157
119
  // refers to an enabled option
158
120
  if (currentIndex >= 0 &&
159
121
  currentIndex < numOptions &&
160
- !_this.normalizedOptions[currentIndex].disabled) {
161
- _this.setState({ focusedOptionIndex: currentIndex });
122
+ !this.normalizedOptions[currentIndex].disabled) {
123
+ this.setState({ focusedOptionIndex: currentIndex });
162
124
  }
163
125
  };
164
- _this.updateStateFromValue = function () {
165
- _this.setState({
166
- focusedOptionIndex: utils_1.getCorrectedIndexByValue(_this.normalizedOptions, _this.props.value),
126
+ this.updateStateFromValue = () => {
127
+ this.setState({
128
+ focusedOptionIndex: utils_1.getCorrectedIndexByValue(this.normalizedOptions, this.props.value),
167
129
  });
168
130
  };
169
- _this.focusButton = function () {
170
- if (_this.localButtonRef.current) {
171
- _this.localButtonRef.current.focus();
131
+ this.focusButton = () => {
132
+ if (this.localButtonRef.current) {
133
+ this.localButtonRef.current.focus();
172
134
  }
173
135
  };
174
- _this.setMenuAnimationTimeout = function (callback) {
175
- if (_this.menuAnimationTimer) {
176
- clearTimeout(_this.menuAnimationTimer);
136
+ this.setMenuAnimationTimeout = (callback) => {
137
+ if (this.menuAnimationTimer) {
138
+ clearTimeout(this.menuAnimationTimer);
177
139
  }
178
- _this.menuAnimationTimer = setTimeout(callback, SelectMenu_1.menuAnimationDuration);
140
+ this.menuAnimationTimer = setTimeout(callback, SelectMenu_1.menuAnimationDuration);
179
141
  };
180
- _this.openMenu = function () {
181
- _this.setState({ menuVisibility: 'opening' });
182
- _this.setMenuAnimationTimeout(function () {
183
- _this.setState({ menuVisibility: 'opened' });
142
+ this.openMenu = () => {
143
+ this.setState({ menuVisibility: 'opening' });
144
+ this.setMenuAnimationTimeout(() => {
145
+ this.setState({ menuVisibility: 'opened' });
184
146
  });
185
147
  };
186
- _this.closeMenu = function () {
187
- _this.setState({ menuVisibility: 'closing' });
188
- _this.setMenuAnimationTimeout(function () {
189
- _this.setState({
148
+ this.closeMenu = () => {
149
+ this.setState({ menuVisibility: 'closing' });
150
+ this.setMenuAnimationTimeout(() => {
151
+ this.setState({
190
152
  // Reset the focused option to the currently selected option in case
191
153
  // the user focused a different option but chose not to select it. The
192
154
  // next time the menu opens, focus should begin on the selected option.
193
- focusedOptionIndex: utils_1.getCorrectedIndexByValue(_this.normalizedOptions, _this.props.value),
155
+ focusedOptionIndex: utils_1.getCorrectedIndexByValue(this.normalizedOptions, this.props.value),
194
156
  menuVisibility: 'closed',
195
157
  });
196
158
  });
197
159
  };
198
- _this.toggleMenu = function (open) {
199
- var menuVisibility = _this.state.menuVisibility;
160
+ this.toggleMenu = (open) => {
161
+ const { menuVisibility } = this.state;
200
162
  if (open) {
201
163
  switch (menuVisibility) {
202
164
  // We're opening a menu which is currently closed: set the menu state
@@ -204,14 +166,14 @@ var SelectContainer = /** @class */ (function (_super) {
204
166
  // from 0 opacity in the open state to the targeted 1.0 opacity in
205
167
  // the opening state.
206
168
  case 'closed':
207
- _this.setState({ menuVisibility: 'open' }, _this.openMenu);
169
+ this.setState({ menuVisibility: 'open' }, this.openMenu);
208
170
  break;
209
171
  // We're opening a menu which is in the process of closing. Since the
210
172
  // menu isn't closed, there's no need to set the open state: kick off
211
173
  // openMenu immediately.
212
174
  case 'close':
213
175
  case 'closing':
214
- _this.openMenu();
176
+ this.openMenu();
215
177
  break;
216
178
  // Otherwise, we're opening a menu is already opened or in the process of
217
179
  // opening; no need to do anything further.
@@ -224,14 +186,14 @@ var SelectContainer = /** @class */ (function (_super) {
224
186
  // We're closing a menu which is currently opened: set the menu state to
225
187
  // close before kicking off closeMenu.
226
188
  case 'opened':
227
- _this.setState({ menuVisibility: 'close' }, _this.closeMenu);
189
+ this.setState({ menuVisibility: 'close' }, this.closeMenu);
228
190
  break;
229
191
  // We're closing a menu which is in the process of opening. Since the
230
192
  // menu isn't opened, there's no need to set the close state: kick off
231
193
  // closeMenu immediately.
232
194
  case 'open':
233
195
  case 'opening':
234
- _this.closeMenu();
196
+ this.closeMenu();
235
197
  break;
236
198
  // Otherwise, we're closing a menu which is already closed or in the process
237
199
  // of closing; no need to do anything further.
@@ -244,28 +206,28 @@ var SelectContainer = /** @class */ (function (_super) {
244
206
  // In order for Select to be usable as a controlled component, we
245
207
  // need to programmatically change the value of the SelectInput
246
208
  // in such a way that triggers its change event
247
- _this.fireChangeEvent = function (value) {
248
- if (_this.inputRef && _this.inputRef.current) {
249
- var nativeInputValue = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(_this.inputRef.current), 'value');
209
+ this.fireChangeEvent = (value) => {
210
+ if (this.inputRef && this.inputRef.current) {
211
+ const nativeInputValue = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this.inputRef.current), 'value');
250
212
  if (nativeInputValue && nativeInputValue.set) {
251
- nativeInputValue.set.call(_this.inputRef.current, value);
213
+ nativeInputValue.set.call(this.inputRef.current, value);
252
214
  }
253
- var event_1;
215
+ let event;
254
216
  if (typeof Event === 'function') {
255
217
  // Modern browsers
256
- event_1 = new Event('change', { bubbles: true });
218
+ event = new Event('change', { bubbles: true });
257
219
  }
258
220
  else {
259
221
  // IE 11
260
- event_1 = document.createEvent('Event');
261
- event_1.initEvent('change', true, true);
222
+ event = document.createEvent('Event');
223
+ event.initEvent('change', true, true);
262
224
  }
263
- _this.inputRef.current.dispatchEvent(event_1);
225
+ this.inputRef.current.dispatchEvent(event);
264
226
  }
265
227
  };
266
- _this.handleKeyboardTypeAhead = function (key, numOptions) {
228
+ this.handleKeyboardTypeAhead = (key, numOptions) => {
267
229
  // Abort immediately if the menu is the process of closing
268
- if (_this.state.menuVisibility === 'closing') {
230
+ if (this.state.menuVisibility === 'closing') {
269
231
  return;
270
232
  }
271
233
  // Set the starting point of the search to one of two locations
@@ -282,45 +244,45 @@ var SelectContainer = /** @class */ (function (_super) {
282
244
  // "San Francisco" as you type "san " (because "san " still matches
283
245
  // "San Francisco") and then advances focus to "San Jose" after you
284
246
  // type the "j" at the end.
285
- var start = _this.keysSoFar.length === 0
286
- ? _this.state.focusedOptionIndex + 1
287
- : _this.state.focusedOptionIndex;
247
+ let start = this.keysSoFar.length === 0
248
+ ? this.state.focusedOptionIndex + 1
249
+ : this.state.focusedOptionIndex;
288
250
  // If the starting point is beyond the list of options, reset it
289
251
  // to the beginning of the list
290
252
  start = start === numOptions ? 0 : start;
291
- _this.keysSoFar += key;
292
- _this.startClearKeysSoFarTimer();
253
+ this.keysSoFar += key;
254
+ this.startClearKeysSoFarTimer();
293
255
  // First, look for a match from start to end
294
- var matchIndex;
295
- matchIndex = _this.getIndexByStartString(start, _this.keysSoFar);
256
+ let matchIndex;
257
+ matchIndex = this.getIndexByStartString(start, this.keysSoFar);
296
258
  // If a match isn't found between start and end, wrap the search
297
259
  // around and search again from the beginning (0) to start
298
260
  if (matchIndex === -1) {
299
- matchIndex = _this.getIndexByStartString(0, _this.keysSoFar, start);
261
+ matchIndex = this.getIndexByStartString(0, this.keysSoFar, start);
300
262
  }
301
263
  // A match was found...
302
264
  if (matchIndex > -1) {
303
- if (_this.state.menuVisibility === 'closed') {
265
+ if (this.state.menuVisibility === 'closed') {
304
266
  // If the menu is closed, fire the change event
305
- _this.fireChangeEvent(_this.normalizedOptions[matchIndex].value);
267
+ this.fireChangeEvent(this.normalizedOptions[matchIndex].value);
306
268
  }
307
269
  else {
308
270
  // Otherwise the menu is visible (or at least partially visible);
309
271
  // focus the matched option
310
- _this.setState({ focusedOptionIndex: matchIndex });
272
+ this.setState({ focusedOptionIndex: matchIndex });
311
273
  }
312
274
  }
313
275
  };
314
- _this.startClearKeysSoFarTimer = function () {
315
- if (_this.clearKeysSoFarTimer) {
316
- clearTimeout(_this.clearKeysSoFarTimer);
276
+ this.startClearKeysSoFarTimer = () => {
277
+ if (this.clearKeysSoFarTimer) {
278
+ clearTimeout(this.clearKeysSoFarTimer);
317
279
  }
318
- _this.clearKeysSoFarTimer = setTimeout(function () {
319
- _this.keysSoFar = '';
320
- }, _this.clearKeysSoFarTimeout);
280
+ this.clearKeysSoFarTimer = setTimeout(() => {
281
+ this.keysSoFar = '';
282
+ }, this.clearKeysSoFarTimeout);
321
283
  };
322
- _this.handleClick = function (event) {
323
- var menuVisibility = _this.state.menuVisibility;
284
+ this.handleClick = (event) => {
285
+ const { menuVisibility } = this.state;
324
286
  switch (menuVisibility) {
325
287
  // If we click the button while the menu is in the process of closing,
326
288
  // we want to toggle the menu back on. However, we also need to focus
@@ -328,48 +290,48 @@ var SelectContainer = /** @class */ (function (_super) {
328
290
  // callback (because the menu already exists).
329
291
  case 'close':
330
292
  case 'closing':
331
- if (_this.menuRef.current) {
332
- _this.menuRef.current.focus();
293
+ if (this.menuRef.current) {
294
+ this.menuRef.current.focus();
333
295
  }
334
- _this.toggleMenu(true);
296
+ this.toggleMenu(true);
335
297
  break;
336
298
  case 'closed':
337
- _this.toggleMenu(true);
299
+ this.toggleMenu(true);
338
300
  break;
339
301
  // Otherwise, the menu is opened or in the process of opening; toggle
340
302
  // the menu off.
341
303
  default:
342
- _this.toggleMenu(false);
304
+ this.toggleMenu(false);
343
305
  break;
344
306
  }
345
307
  };
346
- _this.handleOptionSelection = function (index) {
308
+ this.handleOptionSelection = (index) => {
347
309
  // Abort if a disabled option was clicked (we ignore these clicks)
348
- if (_this.normalizedOptions[index].disabled) {
310
+ if (this.normalizedOptions[index].disabled) {
349
311
  return;
350
312
  }
351
313
  // Toggle menu off, shift focus back to the button, and fire change event
352
- _this.toggleMenu(false);
353
- _this.focusButton();
354
- _this.fireChangeEvent(_this.normalizedOptions[index].value);
314
+ this.toggleMenu(false);
315
+ this.focusButton();
316
+ this.fireChangeEvent(this.normalizedOptions[index].value);
355
317
  };
356
- _this.handleMenuCloseOnKeyPress = function () {
318
+ this.handleMenuCloseOnKeyPress = () => {
357
319
  // Toggle menu off and shift focus back to the button
358
- _this.handleClose();
359
- _this.focusButton();
320
+ this.handleClose();
321
+ this.focusButton();
360
322
  };
361
- _this.handleClose = function () {
362
- _this.toggleMenu(false);
323
+ this.handleClose = () => {
324
+ this.toggleMenu(false);
363
325
  };
364
- _this.handleKeyDown = function (event) {
365
- var options = _this.props.options;
366
- var numOptions = options.length;
367
- var _a = _this.state, focusedOptionIndex = _a.focusedOptionIndex, menuVisibility = _a.menuVisibility;
368
- var isShortcut = false;
326
+ this.handleKeyDown = (event) => {
327
+ const { options } = this.props;
328
+ const numOptions = options.length;
329
+ const { focusedOptionIndex, menuVisibility } = this.state;
330
+ let isShortcut = false;
369
331
  // Check for type-ahead first
370
332
  if (event.key.length === 1 && event.key.match(/\S/)) {
371
333
  isShortcut = true;
372
- _this.handleKeyboardTypeAhead(event.key, numOptions);
334
+ this.handleKeyboardTypeAhead(event.key, numOptions);
373
335
  }
374
336
  else {
375
337
  switch (event.key) {
@@ -379,25 +341,25 @@ var SelectContainer = /** @class */ (function (_super) {
379
341
  case 'Down': // IE/Edge specific value
380
342
  isShortcut = true;
381
343
  if (menuVisibility === 'closed' || menuVisibility === 'closing') {
382
- _this.toggleMenu(true);
344
+ this.toggleMenu(true);
383
345
  }
384
346
  else {
385
- var direction_1 = event.key === 'ArrowUp' || event.key === 'Up' ? -1 : 1;
386
- var startIndex_1 = focusedOptionIndex + direction_1;
387
- _this.focusNextEnabledOption(startIndex_1, direction_1);
347
+ const direction = event.key === 'ArrowUp' || event.key === 'Up' ? -1 : 1;
348
+ const startIndex = focusedOptionIndex + direction;
349
+ this.focusNextEnabledOption(startIndex, direction);
388
350
  }
389
351
  break;
390
352
  case 'Home':
391
353
  case 'End':
392
354
  isShortcut = true;
393
- var direction = event.key === 'Home' ? 1 : -1;
394
- var startIndex = event.key === 'Home' ? 0 : numOptions - 1;
395
- _this.focusNextEnabledOption(startIndex, direction);
355
+ const direction = event.key === 'Home' ? 1 : -1;
356
+ const startIndex = event.key === 'Home' ? 0 : numOptions - 1;
357
+ this.focusNextEnabledOption(startIndex, direction);
396
358
  break;
397
359
  case 'Tab':
398
360
  if (menuVisibility !== 'closed') {
399
361
  isShortcut = true;
400
- _this.handleMenuCloseOnKeyPress();
362
+ this.handleMenuCloseOnKeyPress();
401
363
  }
402
364
  break;
403
365
  case 'Spacebar':
@@ -405,14 +367,14 @@ var SelectContainer = /** @class */ (function (_super) {
405
367
  isShortcut = true;
406
368
  // If the user is in the middle of typing a string, treat
407
369
  // space key as type-ahead rather than option selection
408
- if (_this.keysSoFar !== '') {
409
- _this.handleKeyboardTypeAhead(' ', numOptions);
370
+ if (this.keysSoFar !== '') {
371
+ this.handleKeyboardTypeAhead(' ', numOptions);
410
372
  }
411
373
  else if (menuVisibility === 'closed' || menuVisibility === 'closing') {
412
- _this.toggleMenu(true);
374
+ this.toggleMenu(true);
413
375
  }
414
376
  else {
415
- _this.handleOptionSelection(focusedOptionIndex);
377
+ this.handleOptionSelection(focusedOptionIndex);
416
378
  }
417
379
  break;
418
380
  case 'Enter':
@@ -422,7 +384,7 @@ var SelectContainer = /** @class */ (function (_super) {
422
384
  isShortcut = false;
423
385
  }
424
386
  else {
425
- _this.handleOptionSelection(focusedOptionIndex);
387
+ this.handleOptionSelection(focusedOptionIndex);
426
388
  }
427
389
  break;
428
390
  default:
@@ -443,7 +405,7 @@ var SelectContainer = /** @class */ (function (_super) {
443
405
  event.preventDefault();
444
406
  }
445
407
  };
446
- _this.setNormalizedOptions();
408
+ this.setNormalizedOptions();
447
409
  // We need a local ref (RefObject) to the Select component's underlying
448
410
  // button to manage focus within the component and to serve as its Popper
449
411
  // Menu's anchorElement. If the buttonRef prop (to be forwarded to the
@@ -462,14 +424,13 @@ var SelectContainer = /** @class */ (function (_super) {
462
424
  // or call buttonRef with the underlying button element if it was a
463
425
  // callback ref.
464
426
  // eslint-disable-next-line react-hooks/rules-of-hooks
465
- _this.forwardedButtonRef = common_1.useForkRef(props.buttonRef, _this.localButtonRef);
466
- return _this;
427
+ this.forwardedButtonRef = common_1.useForkRef(props.buttonRef, this.localButtonRef);
467
428
  }
468
- SelectContainer.prototype.componentDidMount = function () {
429
+ componentDidMount() {
469
430
  this.updateStateFromValue();
470
- };
471
- SelectContainer.prototype.componentDidUpdate = function (prevProps) {
472
- var _a = this.props, options = _a.options, value = _a.value;
431
+ }
432
+ componentDidUpdate(prevProps) {
433
+ const { options, value } = this.props;
473
434
  if (options !== prevProps.options) {
474
435
  this.setNormalizedOptions();
475
436
  this.updateStateFromValue();
@@ -477,8 +438,8 @@ var SelectContainer = /** @class */ (function (_super) {
477
438
  if (value !== prevProps.value) {
478
439
  this.updateStateFromValue();
479
440
  }
480
- };
481
- SelectContainer.prototype.componentWillUnmount = function () {
441
+ }
442
+ componentWillUnmount() {
482
443
  // Clear timers
483
444
  if (this.menuAnimationTimer) {
484
445
  clearTimeout(this.menuAnimationTimer);
@@ -486,14 +447,14 @@ var SelectContainer = /** @class */ (function (_super) {
486
447
  if (this.clearKeysSoFarTimer) {
487
448
  clearTimeout(this.clearKeysSoFarTimer);
488
449
  }
489
- };
490
- SelectContainer.prototype.render = function () {
491
- var _a = this.props, value = _a.value,
450
+ }
451
+ render() {
452
+ const { value,
492
453
  // Strip props we don't want to pass down from elemProps
493
- buttonRef = _a.buttonRef, options = _a.options, onKeyDown = _a.onKeyDown, elemProps = __rest(_a, ["value", "buttonRef", "options", "onKeyDown"]);
494
- var _b = this.state, focusedOptionIndex = _b.focusedOptionIndex, menuVisibility = _b.menuVisibility;
454
+ buttonRef, options, onKeyDown, ...elemProps } = this.props;
455
+ const { focusedOptionIndex, menuVisibility } = this.state;
495
456
  // Don't pass in event handlers if options weren't defined
496
- var eventHandlers = this.areOptionsDefined()
457
+ const eventHandlers = this.areOptionsDefined()
497
458
  ? {
498
459
  onClick: this.handleClick,
499
460
  onKeyDown: this.handleKeyDown,
@@ -501,17 +462,16 @@ var SelectContainer = /** @class */ (function (_super) {
501
462
  onOptionSelection: this.handleOptionSelection,
502
463
  }
503
464
  : {};
504
- return (React.createElement(SelectBase_1.SelectBase, __assign({ forwardedButtonRef: this.forwardedButtonRef, localButtonRef: this.localButtonRef, focusedOptionIndex: focusedOptionIndex, inputRef: this.inputRef, menuRef: this.menuRef, menuVisibility: menuVisibility, options: this.normalizedOptions, value: value }, eventHandlers, elemProps)));
505
- };
506
- SelectContainer.ErrorType = common_1.ErrorType;
507
- return SelectContainer;
508
- }(React.Component));
465
+ return (React.createElement(SelectBase_1.SelectBase, Object.assign({ forwardedButtonRef: this.forwardedButtonRef, localButtonRef: this.localButtonRef, focusedOptionIndex: focusedOptionIndex, inputRef: this.inputRef, menuRef: this.menuRef, menuVisibility: menuVisibility, options: this.normalizedOptions, value: value }, eventHandlers, elemProps)));
466
+ }
467
+ }
468
+ SelectContainer.ErrorType = common_1.ErrorType;
509
469
  exports.Select = common_1.createComponent('button')({
510
470
  displayName: 'Select',
511
- Component: function (props, ref, Element) { return (
471
+ Component: (props, ref, Element) => (
512
472
  // Select is still a class component, so we render a renamed version of it
513
473
  // (SelectContainer) and pass it ref and Element
514
- React.createElement(SelectContainer, __assign({ as: Element, buttonRef: ref }, props))); },
474
+ React.createElement(SelectContainer, Object.assign({ as: Element, buttonRef: ref }, props))),
515
475
  subComponents: {
516
476
  ErrorType: common_1.ErrorType,
517
477
  },