@webiny/ui 0.0.0-mt-3 → 0.0.0-unstable.8c4d9f045a

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 (449) hide show
  1. package/Accordion/Accordion.d.ts +4 -4
  2. package/Accordion/Accordion.js +27 -13
  3. package/Accordion/Accordion.js.map +1 -0
  4. package/Accordion/Accordion.stories.js +34 -23
  5. package/Accordion/Accordion.stories.js.map +1 -0
  6. package/Accordion/AccordionItem.d.ts +8 -8
  7. package/Accordion/AccordionItem.js +67 -38
  8. package/Accordion/AccordionItem.js.map +1 -0
  9. package/Accordion/index.js +31 -2
  10. package/Accordion/index.js.map +1 -0
  11. package/Alert/Alert.d.ts +4 -4
  12. package/Alert/Alert.js +21 -10
  13. package/Alert/Alert.js.map +1 -0
  14. package/Alert/Alert.stories.js +22 -13
  15. package/Alert/Alert.stories.js.map +1 -0
  16. package/Alert/index.js +18 -1
  17. package/Alert/index.js.map +1 -0
  18. package/AutoComplete/AutoComplete.d.ts +12 -19
  19. package/AutoComplete/AutoComplete.js +150 -101
  20. package/AutoComplete/AutoComplete.js.map +1 -0
  21. package/AutoComplete/AutoComplete.stories.js +27 -17
  22. package/AutoComplete/AutoComplete.stories.js.map +1 -0
  23. package/AutoComplete/MultiAutoComplete.d.ts +44 -40
  24. package/AutoComplete/MultiAutoComplete.js +317 -248
  25. package/AutoComplete/MultiAutoComplete.js.map +1 -0
  26. package/AutoComplete/MultiAutoComplete.stories.js +39 -28
  27. package/AutoComplete/MultiAutoComplete.stories.js.map +1 -0
  28. package/AutoComplete/index.js +31 -2
  29. package/AutoComplete/index.js.map +1 -0
  30. package/AutoComplete/styles.js +14 -4
  31. package/AutoComplete/styles.js.map +1 -0
  32. package/AutoComplete/types.d.ts +4 -3
  33. package/AutoComplete/types.js +5 -1
  34. package/AutoComplete/types.js.map +1 -0
  35. package/AutoComplete/utils.d.ts +11 -5
  36. package/AutoComplete/utils.js +21 -6
  37. package/AutoComplete/utils.js.map +1 -0
  38. package/Avatar/Avatar.d.ts +5 -11
  39. package/Avatar/Avatar.js +39 -19
  40. package/Avatar/Avatar.js.map +1 -0
  41. package/Avatar/Avatar.stories.js +19 -10
  42. package/Avatar/Avatar.stories.js.map +1 -0
  43. package/Avatar/index.js +18 -1
  44. package/Avatar/index.js.map +1 -0
  45. package/Button/Button.d.ts +9 -23
  46. package/Button/Button.js +57 -41
  47. package/Button/Button.js.map +1 -0
  48. package/Button/Button.stories.js +42 -29
  49. package/Button/Button.stories.js.map +1 -0
  50. package/Button/Button.styles.d.ts +6 -0
  51. package/Button/Button.styles.js +15 -0
  52. package/Button/Button.styles.js.map +1 -0
  53. package/Button/CopyButton/CopyButton.d.ts +4 -7
  54. package/Button/CopyButton/CopyButton.js +24 -14
  55. package/Button/CopyButton/CopyButton.js.map +1 -0
  56. package/Button/CopyButton/CopyButton.stories.js +20 -10
  57. package/Button/CopyButton/CopyButton.stories.js.map +1 -0
  58. package/Button/IconButton/IconButton.d.ts +4 -7
  59. package/Button/IconButton/IconButton.js +14 -7
  60. package/Button/IconButton/IconButton.js.map +1 -0
  61. package/Button/IconButton/IconButton.stories.js +31 -19
  62. package/Button/IconButton/IconButton.stories.js.map +1 -0
  63. package/Button/index.js +44 -3
  64. package/Button/index.js.map +1 -0
  65. package/Carousel/Carousel.d.ts +3 -3
  66. package/Carousel/Carousel.js +34 -21
  67. package/Carousel/Carousel.js.map +1 -0
  68. package/Carousel/Carouser.stories.js +27 -17
  69. package/Carousel/Carouser.stories.js.map +1 -0
  70. package/Carousel/index.js +15 -1
  71. package/Carousel/index.js.map +1 -0
  72. package/Checkbox/Checkbox.d.ts +5 -9
  73. package/Checkbox/Checkbox.js +42 -28
  74. package/Checkbox/Checkbox.js.map +1 -0
  75. package/Checkbox/Checkbox.stories.js +27 -16
  76. package/Checkbox/Checkbox.stories.js.map +1 -0
  77. package/Checkbox/Checkbox.styles.js +11 -4
  78. package/Checkbox/Checkbox.styles.js.map +1 -0
  79. package/Checkbox/CheckboxGroup.d.ts +2 -2
  80. package/Checkbox/CheckboxGroup.js +36 -20
  81. package/Checkbox/CheckboxGroup.js.map +1 -0
  82. package/Checkbox/CheckboxGroup.stories.js +29 -18
  83. package/Checkbox/CheckboxGroup.stories.js.map +1 -0
  84. package/Checkbox/index.js +23 -2
  85. package/Checkbox/index.js.map +1 -0
  86. package/Chips/Chip.d.ts +3 -8
  87. package/Chips/Chip.js +21 -7
  88. package/Chips/Chip.js.map +1 -0
  89. package/Chips/Chips.d.ts +4 -4
  90. package/Chips/Chips.js +29 -12
  91. package/Chips/Chips.js.map +1 -0
  92. package/Chips/Chips.stories.js +33 -18
  93. package/Chips/Chips.stories.js.map +1 -0
  94. package/Chips/index.d.ts +0 -1
  95. package/Chips/index.js +31 -3
  96. package/Chips/index.js.map +1 -0
  97. package/Chips/styles.js +21 -9
  98. package/Chips/styles.js.map +1 -0
  99. package/CodeEditor/CodeEditor.d.ts +3 -8
  100. package/CodeEditor/CodeEditor.js +52 -35
  101. package/CodeEditor/CodeEditor.js.map +1 -0
  102. package/CodeEditor/CodeEditor.stories.js +30 -17
  103. package/CodeEditor/CodeEditor.stories.js.map +1 -0
  104. package/CodeEditor/index.js +18 -1
  105. package/CodeEditor/index.js.map +1 -0
  106. package/ColorPicker/ColorPicker.d.ts +9 -10
  107. package/ColorPicker/ColorPicker.js +63 -51
  108. package/ColorPicker/ColorPicker.js.map +1 -0
  109. package/ColorPicker/ColorPicker.stories.js +26 -15
  110. package/ColorPicker/ColorPicker.stories.js.map +1 -0
  111. package/ColorPicker/index.js +18 -1
  112. package/ColorPicker/index.js.map +1 -0
  113. package/ConfirmationDialog/ConfirmationDialog.d.ts +13 -13
  114. package/ConfirmationDialog/ConfirmationDialog.js +57 -45
  115. package/ConfirmationDialog/ConfirmationDialog.js.map +1 -0
  116. package/ConfirmationDialog/ConfirmationDialog.stories.js +22 -12
  117. package/ConfirmationDialog/ConfirmationDialog.stories.js.map +1 -0
  118. package/ConfirmationDialog/index.js +31 -2
  119. package/ConfirmationDialog/index.js.map +1 -0
  120. package/ConfirmationDialog/withConfirmation.d.ts +2 -2
  121. package/ConfirmationDialog/withConfirmation.js +19 -6
  122. package/ConfirmationDialog/withConfirmation.js.map +1 -0
  123. package/Dialog/Dialog.d.ts +22 -30
  124. package/Dialog/Dialog.js +75 -39
  125. package/Dialog/Dialog.js.map +1 -0
  126. package/Dialog/Dialog.stories.js +26 -16
  127. package/Dialog/Dialog.stories.js.map +1 -0
  128. package/Dialog/index.js +18 -1
  129. package/Dialog/index.js.map +1 -0
  130. package/Drawer/Drawer.d.ts +1 -1
  131. package/Drawer/Drawer.js +20 -6
  132. package/Drawer/Drawer.js.map +1 -0
  133. package/Drawer/Drawer.stories.js +26 -15
  134. package/Drawer/Drawer.stories.js.map +1 -0
  135. package/Drawer/index.js +18 -1
  136. package/Drawer/index.js.map +1 -0
  137. package/DynamicFieldset/Fieldset.d.ts +26 -16
  138. package/DynamicFieldset/Fieldset.js +82 -60
  139. package/DynamicFieldset/Fieldset.js.map +1 -0
  140. package/DynamicFieldset/index.js +15 -1
  141. package/DynamicFieldset/index.js.map +1 -0
  142. package/Elevation/Elevation.d.ts +1 -1
  143. package/Elevation/Elevation.js +17 -6
  144. package/Elevation/Elevation.js.map +1 -0
  145. package/Elevation/Elevation.stories.js +27 -16
  146. package/Elevation/Elevation.stories.js.map +1 -0
  147. package/Elevation/index.js +18 -1
  148. package/Elevation/index.js.map +1 -0
  149. package/FormElementMessage/FormElementMessage.d.ts +1 -1
  150. package/FormElementMessage/FormElementMessage.js +15 -5
  151. package/FormElementMessage/FormElementMessage.js.map +1 -0
  152. package/FormElementMessage/index.js +13 -1
  153. package/FormElementMessage/index.js.map +1 -0
  154. package/FullName/FullName.js +8 -1
  155. package/FullName/FullName.js.map +1 -0
  156. package/FullName/index.js +18 -1
  157. package/FullName/index.js.map +1 -0
  158. package/Grid/Grid.d.ts +1 -1
  159. package/Grid/Grid.js +26 -9
  160. package/Grid/Grid.js.map +1 -0
  161. package/Grid/Grid.stories.js +21 -12
  162. package/Grid/Grid.stories.js.map +1 -0
  163. package/Grid/index.js +18 -1
  164. package/Grid/index.js.map +1 -0
  165. package/Helpers/ClassNames.d.ts +4 -3
  166. package/Helpers/ClassNames.js +21 -10
  167. package/Helpers/ClassNames.js.map +1 -0
  168. package/Helpers/index.js +13 -2
  169. package/Helpers/index.js.map +1 -0
  170. package/Icon/Icon.d.ts +3 -6
  171. package/Icon/Icon.js +19 -10
  172. package/Icon/Icon.js.map +1 -0
  173. package/Icon/Icon.stories.js +33 -20
  174. package/Icon/Icon.stories.js.map +1 -0
  175. package/Icon/index.js +18 -1
  176. package/Icon/index.js.map +1 -0
  177. package/Image/Image.d.ts +5 -4
  178. package/Image/Image.js +19 -9
  179. package/Image/Image.js.map +1 -0
  180. package/Image/Image.stories.js +21 -11
  181. package/Image/Image.stories.js.map +1 -0
  182. package/Image/index.js +18 -1
  183. package/Image/index.js.map +1 -0
  184. package/ImageEditor/ImageEditor.d.ts +33 -34
  185. package/ImageEditor/ImageEditor.js +110 -83
  186. package/ImageEditor/ImageEditor.js.map +1 -0
  187. package/ImageEditor/index.js +18 -1
  188. package/ImageEditor/index.js.map +1 -0
  189. package/ImageEditor/toolbar/crop.js +34 -15
  190. package/ImageEditor/toolbar/crop.js.map +1 -0
  191. package/ImageEditor/toolbar/filter.js +76 -47
  192. package/ImageEditor/toolbar/filter.js.map +1 -0
  193. package/ImageEditor/toolbar/flip.js +35 -16
  194. package/ImageEditor/toolbar/flip.js.map +1 -0
  195. package/ImageEditor/toolbar/icons/index.js +69 -8
  196. package/ImageEditor/toolbar/icons/index.js.map +1 -0
  197. package/ImageEditor/toolbar/index.js +39 -4
  198. package/ImageEditor/toolbar/index.js.map +1 -0
  199. package/ImageEditor/toolbar/rotate.js +65 -36
  200. package/ImageEditor/toolbar/rotate.js.map +1 -0
  201. package/ImageEditor/toolbar/types.d.ts +23 -12
  202. package/ImageEditor/toolbar/types.js +5 -1
  203. package/ImageEditor/toolbar/types.js.map +1 -0
  204. package/ImageUpload/Image.d.ts +6 -6
  205. package/ImageUpload/Image.js +57 -35
  206. package/ImageUpload/Image.js.map +1 -0
  207. package/ImageUpload/ImageEditorDialog.d.ts +11 -6
  208. package/ImageUpload/ImageEditorDialog.js +54 -31
  209. package/ImageUpload/ImageEditorDialog.js.map +1 -0
  210. package/ImageUpload/MultiImageUpload.d.ts +10 -31
  211. package/ImageUpload/MultiImageUpload.js +117 -81
  212. package/ImageUpload/MultiImageUpload.js.map +1 -0
  213. package/ImageUpload/MultiImageUpload.stories.js +26 -15
  214. package/ImageUpload/MultiImageUpload.stories.js.map +1 -0
  215. package/ImageUpload/SingleImageUpload.d.ts +16 -37
  216. package/ImageUpload/SingleImageUpload.js +85 -54
  217. package/ImageUpload/SingleImageUpload.js.map +1 -0
  218. package/ImageUpload/SingleImageUpload.stories.js +27 -16
  219. package/ImageUpload/SingleImageUpload.stories.js.map +1 -0
  220. package/ImageUpload/index.js +39 -4
  221. package/ImageUpload/index.js.map +1 -0
  222. package/ImageUpload/styled.d.ts +20 -14
  223. package/ImageUpload/styled.js +29 -15
  224. package/ImageUpload/styled.js.map +1 -0
  225. package/Input/Input.d.ts +4 -8
  226. package/Input/Input.js +70 -41
  227. package/Input/Input.js.map +1 -0
  228. package/Input/Input.stories.js +62 -46
  229. package/Input/Input.stories.js.map +1 -0
  230. package/Input/__tests__/Input.test.js +65 -48
  231. package/Input/__tests__/Input.test.js.map +1 -0
  232. package/Input/index.js +18 -1
  233. package/Input/index.js.map +1 -0
  234. package/List/CollapsibleList/CollapsibleList.stories.js +27 -16
  235. package/List/CollapsibleList/CollapsibleList.stories.js.map +1 -0
  236. package/List/CollapsibleList/index.d.ts +2 -2
  237. package/List/CollapsibleList/index.js +21 -6
  238. package/List/CollapsibleList/index.js.map +1 -0
  239. package/List/DataList/DataList.d.ts +24 -43
  240. package/List/DataList/DataList.js +112 -68
  241. package/List/DataList/DataList.js.map +1 -0
  242. package/List/DataList/DataList.stories.js +37 -25
  243. package/List/DataList/DataList.stories.js.map +1 -0
  244. package/List/DataList/DataListModalOverlay/DataListModalOverlay.d.ts +8 -8
  245. package/List/DataList/DataListModalOverlay/DataListModalOverlay.js +29 -10
  246. package/List/DataList/DataListModalOverlay/DataListModalOverlay.js.map +1 -0
  247. package/List/DataList/DataListModalOverlay/DataListModalOverlayAction.d.ts +3 -3
  248. package/List/DataList/DataListModalOverlay/DataListModalOverlayAction.js +27 -9
  249. package/List/DataList/DataListModalOverlay/DataListModalOverlayAction.js.map +1 -0
  250. package/List/DataList/DataListModalOverlay/DataListModalOverlayContext.d.ts +9 -4
  251. package/List/DataList/DataListModalOverlay/DataListModalOverlayContext.js +29 -8
  252. package/List/DataList/DataListModalOverlay/DataListModalOverlayContext.js.map +1 -0
  253. package/List/DataList/DataListModalOverlay/index.js +35 -3
  254. package/List/DataList/DataListModalOverlay/index.js.map +1 -0
  255. package/List/DataList/DataListWithSections.d.ts +45 -0
  256. package/List/DataList/DataListWithSections.js +356 -0
  257. package/List/DataList/DataListWithSections.js.map +1 -0
  258. package/List/DataList/Loader.d.ts +2 -2
  259. package/List/DataList/Loader.js +29 -12
  260. package/List/DataList/Loader.js.map +1 -0
  261. package/List/DataList/NoData.d.ts +2 -2
  262. package/List/DataList/NoData.js +19 -6
  263. package/List/DataList/NoData.js.map +1 -0
  264. package/List/DataList/icons/index.d.ts +1 -1
  265. package/List/DataList/icons/index.js +83 -38
  266. package/List/DataList/icons/index.js.map +1 -0
  267. package/List/DataList/index.d.ts +1 -0
  268. package/List/DataList/index.js +64 -3
  269. package/List/DataList/index.js.map +1 -0
  270. package/List/DataList/types.d.ts +1 -1
  271. package/List/DataList/types.js +5 -1
  272. package/List/DataList/types.js.map +1 -0
  273. package/List/List.d.ts +3 -2
  274. package/List/List.js +92 -49
  275. package/List/List.js.map +1 -0
  276. package/List/List.stories.js +52 -37
  277. package/List/List.stories.js.map +1 -0
  278. package/List/icons/index.js +23 -3
  279. package/List/icons/index.js.map +1 -0
  280. package/List/index.d.ts +1 -1
  281. package/List/index.js +74 -3
  282. package/List/index.js.map +1 -0
  283. package/Menu/Menu.d.ts +14 -21
  284. package/Menu/Menu.js +57 -49
  285. package/Menu/Menu.js.map +1 -0
  286. package/Menu/Menu.stories.js +24 -14
  287. package/Menu/Menu.stories.js.map +1 -0
  288. package/Menu/index.js +18 -1
  289. package/Menu/index.js.map +1 -0
  290. package/Mosaic/Mosaic.d.ts +4 -14
  291. package/Mosaic/Mosaic.js +22 -5
  292. package/Mosaic/Mosaic.js.map +1 -0
  293. package/Mosaic/Mosaic.stories.js +37 -28
  294. package/Mosaic/Mosaic.stories.js.map +1 -0
  295. package/Mosaic/index.js +18 -1
  296. package/Mosaic/index.js.map +1 -0
  297. package/Progress/CircularProgress.d.ts +8 -16
  298. package/Progress/CircularProgress.js +38 -20
  299. package/Progress/CircularProgress.js.map +1 -0
  300. package/Progress/index.js +15 -1
  301. package/Progress/index.js.map +1 -0
  302. package/Radio/Radio.d.ts +2 -6
  303. package/Radio/Radio.js +42 -28
  304. package/Radio/Radio.js.map +1 -0
  305. package/Radio/Radio.styles.js +11 -4
  306. package/Radio/Radio.styles.js.map +1 -0
  307. package/Radio/RadioGroup.d.ts +1 -6
  308. package/Radio/RadioGroup.js +38 -26
  309. package/Radio/RadioGroup.js.map +1 -0
  310. package/Radio/RadioGroup.stories.js +29 -18
  311. package/Radio/RadioGroup.stories.js.map +1 -0
  312. package/Radio/index.js +23 -2
  313. package/Radio/index.js.map +1 -0
  314. package/RichTextEditor/RichTextEditor.d.ts +13 -9
  315. package/RichTextEditor/RichTextEditor.js +92 -57
  316. package/RichTextEditor/RichTextEditor.js.map +1 -0
  317. package/RichTextEditor/RichTextEditor.stories.js +22 -11
  318. package/RichTextEditor/RichTextEditor.stories.js.map +1 -0
  319. package/RichTextEditor/createPropsFromConfig.d.ts +11 -1
  320. package/RichTextEditor/createPropsFromConfig.js +20 -5
  321. package/RichTextEditor/createPropsFromConfig.js.map +1 -0
  322. package/RichTextEditor/index.d.ts +1 -0
  323. package/RichTextEditor/index.js +30 -2
  324. package/RichTextEditor/index.js.map +1 -0
  325. package/Ripple/Ripple.d.ts +4 -5
  326. package/Ripple/Ripple.js +16 -5
  327. package/Ripple/Ripple.js.map +1 -0
  328. package/Ripple/Ripple.stories.js +57 -42
  329. package/Ripple/Ripple.stories.js.map +1 -0
  330. package/Ripple/index.js +18 -1
  331. package/Ripple/index.js.map +1 -0
  332. package/Scrollbar/Scrollbar.d.ts +5 -5
  333. package/Scrollbar/Scrollbar.js +14 -4
  334. package/Scrollbar/Scrollbar.js.map +1 -0
  335. package/Scrollbar/Scrollbar.stories.js +18 -9
  336. package/Scrollbar/Scrollbar.stories.js.map +1 -0
  337. package/Scrollbar/index.js +18 -1
  338. package/Scrollbar/index.js.map +1 -0
  339. package/Section/Section.stories.js +22 -12
  340. package/Section/Section.stories.js.map +1 -0
  341. package/Section/index.d.ts +4 -5
  342. package/Section/index.js +30 -15
  343. package/Section/index.js.map +1 -0
  344. package/Select/Select.d.ts +7 -10
  345. package/Select/Select.js +101 -23
  346. package/Select/Select.js.map +1 -0
  347. package/Select/Select.stories.js +36 -25
  348. package/Select/Select.stories.js.map +1 -0
  349. package/Select/index.js +18 -1
  350. package/Select/index.js.map +1 -0
  351. package/Slider/Slider.d.ts +1 -6
  352. package/Slider/Slider.js +47 -33
  353. package/Slider/Slider.js.map +1 -0
  354. package/Slider/Slider.stories.js +27 -16
  355. package/Slider/Slider.stories.js.map +1 -0
  356. package/Slider/index.js +15 -1
  357. package/Slider/index.js.map +1 -0
  358. package/Snackbar/Snackbar.d.ts +5 -7
  359. package/Snackbar/Snackbar.js +38 -23
  360. package/Snackbar/Snackbar.js.map +1 -0
  361. package/Snackbar/Snackbar.stories.js +44 -30
  362. package/Snackbar/Snackbar.stories.js.map +1 -0
  363. package/Snackbar/index.js +19 -1
  364. package/Snackbar/index.js.map +1 -0
  365. package/Switch/Switch.d.ts +2 -6
  366. package/Switch/Switch.js +48 -33
  367. package/Switch/Switch.js.map +1 -0
  368. package/Switch/Switch.stories.js +27 -16
  369. package/Switch/Switch.stories.js.map +1 -0
  370. package/Switch/index.js +18 -1
  371. package/Switch/index.js.map +1 -0
  372. package/Tabs/Tab.d.ts +6 -2
  373. package/Tabs/Tab.js +37 -10
  374. package/Tabs/Tab.js.map +1 -0
  375. package/Tabs/Tabs.d.ts +43 -21
  376. package/Tabs/Tabs.js +131 -125
  377. package/Tabs/Tabs.js.map +1 -0
  378. package/Tabs/Tabs.stories.js +34 -22
  379. package/Tabs/Tabs.stories.js.map +1 -0
  380. package/Tabs/index.js +31 -2
  381. package/Tabs/index.js.map +1 -0
  382. package/Tags/Tags.d.ts +5 -10
  383. package/Tags/Tags.js +71 -47
  384. package/Tags/Tags.js.map +1 -0
  385. package/Tags/Tags.stories.js +27 -16
  386. package/Tags/Tags.stories.js.map +1 -0
  387. package/Tags/index.js +18 -1
  388. package/Tags/index.js.map +1 -0
  389. package/Tooltip/Tooltip.d.ts +9 -8
  390. package/Tooltip/Tooltip.js +44 -25
  391. package/Tooltip/Tooltip.js.map +1 -0
  392. package/Tooltip/Tooltip.stories.js +20 -11
  393. package/Tooltip/Tooltip.stories.js.map +1 -0
  394. package/Tooltip/index.js +18 -1
  395. package/Tooltip/index.js.map +1 -0
  396. package/TopAppBar/TopAppBar.d.ts +1 -1
  397. package/TopAppBar/TopAppBar.js +18 -7
  398. package/TopAppBar/TopAppBar.js.map +1 -0
  399. package/TopAppBar/TopAppBar.stories.js +39 -25
  400. package/TopAppBar/TopAppBar.stories.js.map +1 -0
  401. package/TopAppBar/TopAppBarActionItem.d.ts +1 -1
  402. package/TopAppBar/TopAppBarActionItem.js +14 -4
  403. package/TopAppBar/TopAppBarActionItem.js.map +1 -0
  404. package/TopAppBar/TopAppBarNavigationIcon.d.ts +1 -1
  405. package/TopAppBar/TopAppBarNavigationIcon.js +14 -4
  406. package/TopAppBar/TopAppBarNavigationIcon.js.map +1 -0
  407. package/TopAppBar/TopAppBarPrimary.js +18 -7
  408. package/TopAppBar/TopAppBarPrimary.js.map +1 -0
  409. package/TopAppBar/TopAppBarSecondary.js +18 -7
  410. package/TopAppBar/TopAppBarSecondary.js.map +1 -0
  411. package/TopAppBar/TopAppBarSection.d.ts +1 -1
  412. package/TopAppBar/TopAppBarSection.js +18 -7
  413. package/TopAppBar/TopAppBarSection.js.map +1 -0
  414. package/TopAppBar/TopAppBarTitle.d.ts +1 -1
  415. package/TopAppBar/TopAppBarTitle.js +18 -7
  416. package/TopAppBar/TopAppBarTitle.js.map +1 -0
  417. package/TopAppBar/index.js +96 -7
  418. package/TopAppBar/index.js.map +1 -0
  419. package/TopProgressBar/TopProgressBar.d.ts +7 -7
  420. package/TopProgressBar/TopProgressBar.js +20 -7
  421. package/TopProgressBar/TopProgressBar.js.map +1 -0
  422. package/TopProgressBar/TopProgressBar.stories.js +22 -12
  423. package/TopProgressBar/TopProgressBar.stories.js.map +1 -0
  424. package/TopProgressBar/hoc/index.js +15 -1
  425. package/TopProgressBar/hoc/index.js.map +1 -0
  426. package/TopProgressBar/hoc/withTopProgressBar.d.ts +1 -1
  427. package/TopProgressBar/hoc/withTopProgressBar.js +16 -5
  428. package/TopProgressBar/hoc/withTopProgressBar.js.map +1 -0
  429. package/TopProgressBar/index.js +18 -1
  430. package/TopProgressBar/index.js.map +1 -0
  431. package/Typography/Typography.d.ts +4 -4
  432. package/Typography/Typography.js +14 -4
  433. package/Typography/Typography.js.map +1 -0
  434. package/Typography/Typography.stories.js +43 -34
  435. package/Typography/Typography.stories.js.map +1 -0
  436. package/Typography/index.js +18 -1
  437. package/Typography/index.js.map +1 -0
  438. package/package.json +53 -61
  439. package/styles.scss +1 -1
  440. package/types.d.ts +2 -2
  441. package/types.js +5 -1
  442. package/types.js.map +1 -0
  443. package/Chips/ChipIcon.d.ts +0 -4
  444. package/Chips/ChipIcon.js +0 -8
  445. package/rmwc/textfield/code/index.d.ts +0 -135
  446. package/rmwc/textfield/code/index.js +0 -571
  447. package/rmwc/textfield/next/index.d.ts +0 -135
  448. package/rmwc/textfield/next/index.js +0 -560
  449. package/rmwc/textfield/package.json +0 -45
@@ -1,65 +1,107 @@
1
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
2
- import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
3
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
4
- import _createClass from "@babel/runtime/helpers/createClass";
5
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
6
- import _inherits from "@babel/runtime/helpers/inherits";
7
- import _createSuper from "@babel/runtime/helpers/createSuper";
8
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
- import _objectSpread from "@babel/runtime/helpers/objectSpread2";
10
- var _excluded = ["options", "allowFreeInput", "useSimpleValues", "unique", "value", "onChange", "valueProp", "textProp", "onInput", "validation", "useMultipleSelectionList", "description"],
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.MultiAutoComplete = void 0;
9
+
10
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
+
12
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
13
+
14
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
15
+
16
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
17
+
18
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
19
+
20
+ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
21
+
22
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
23
+
24
+ var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
25
+
26
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
27
+
28
+ var _react = _interopRequireDefault(require("react"));
29
+
30
+ var _downshift = _interopRequireDefault(require("downshift"));
31
+
32
+ var _reactSpinnerMaterial = _interopRequireDefault(require("react-spinner-material"));
33
+
34
+ var _Input = require("../Input");
35
+
36
+ var _Chips = require("../Chips");
37
+
38
+ var _utils = require("./utils");
39
+
40
+ var _List = require("../List");
41
+
42
+ var _Button = require("../Button");
43
+
44
+ var _classnames = _interopRequireDefault(require("classnames"));
45
+
46
+ var _Elevation = require("../Elevation");
47
+
48
+ var _Typography = require("../Typography");
49
+
50
+ var _styles = require("./styles");
51
+
52
+ var _FormElementMessage = require("../FormElementMessage");
53
+
54
+ var _baselineClose24px = require("./icons/baseline-close-24px.svg");
55
+
56
+ var _navigate_before24px = require("./icons/navigate_before-24px.svg");
57
+
58
+ var _navigate_next24px = require("./icons/navigate_next-24px.svg");
59
+
60
+ var _skip_previous24px = require("./icons/skip_previous-24px.svg");
61
+
62
+ var _skip_next24px = require("./icons/skip_next-24px.svg");
63
+
64
+ var _reorder_black_24dp = require("./icons/reorder_black_24dp.svg");
65
+
66
+ var _emotion = require("emotion");
67
+
68
+ var _excluded = ["unique", "value", "onChange", "onInput", "validation", "useMultipleSelectionList", "description"],
11
69
  _excluded2 = ["getInputProps", "openMenu"];
12
- import * as React from "react";
13
- import Downshift from "downshift";
14
- import MaterialSpinner from "react-spinner-material";
15
- import { Input } from "../Input";
16
- import { Chips, Chip } from "../Chips";
17
- import { getOptionValue, getOptionText, findInAliases } from "./utils";
18
- import { List, ListItem, ListItemMeta } from "../List";
19
- import { IconButton } from "../Button";
20
- import classNames from "classnames";
21
- import { Elevation } from "../Elevation";
22
- import { Typography } from "../Typography";
23
- import { autoCompleteStyle, suggestionList } from "./styles";
24
- import { FormElementMessage } from "../FormElementMessage";
25
- import { ReactComponent as BaselineCloseIcon } from "@svgr/webpack!./icons/baseline-close-24px.svg";
26
- import { ReactComponent as PrevIcon } from "@svgr/webpack!./icons/navigate_before-24px.svg";
27
- import { ReactComponent as NextIcon } from "@svgr/webpack!./icons/navigate_next-24px.svg";
28
- import { ReactComponent as PrevAllIcon } from "@svgr/webpack!./icons/skip_previous-24px.svg";
29
- import { ReactComponent as NextAllIcon } from "@svgr/webpack!./icons/skip_next-24px.svg";
30
- import { ReactComponent as DeleteIcon } from "@svgr/webpack!./icons/baseline-close-24px.svg";
31
- import { ReactComponent as ReorderIcon } from "@svgr/webpack!./icons/reorder_black_24dp.svg";
32
- import { css } from "emotion";
33
- import { ListItemGraphic } from "../List";
70
+ var listItemMetaClassName = /*#__PURE__*/(0, _emotion.css)({
71
+ display: "table"
72
+ }, "label:listItemMetaClassName;");
73
+ var iconButtonClassName = /*#__PURE__*/(0, _emotion.css)({
74
+ display: "table-cell !important"
75
+ }, "label:iconButtonClassName;");
34
76
  var style = {
35
77
  pagination: {
36
- bar: /*#__PURE__*/css({
78
+ bar: /*#__PURE__*/(0, _emotion.css)({
37
79
  display: "flex",
38
80
  justifyContent: "space-between",
39
81
  alignItems: "center",
40
82
  borderBottom: "2px solid #fa5723",
41
83
  padding: "6px 0"
42
84
  }, "label:bar;"),
43
- pages: /*#__PURE__*/css({
85
+ pages: /*#__PURE__*/(0, _emotion.css)({
44
86
  display: "flex",
45
87
  justifyContent: "space-between",
46
88
  alignItems: "center"
47
89
  }, "label:pages;"),
48
- searchInput: /*#__PURE__*/css({
90
+ searchInput: /*#__PURE__*/(0, _emotion.css)({
49
91
  height: "42px !important"
50
92
  }, "label:searchInput;"),
51
- list: /*#__PURE__*/css({
93
+ list: /*#__PURE__*/(0, _emotion.css)({
52
94
  padding: "0 0 5px 0 !important",
53
95
  ".mdc-list-item": {
54
96
  borderBottom: "1px solid var(--mdc-theme-on-background)"
55
97
  }
56
98
  }, "label:list;"),
57
- secondaryText: /*#__PURE__*/css({
99
+ secondaryText: /*#__PURE__*/(0, _emotion.css)({
58
100
  color: "var(--mdc-theme-text-secondary-on-background)"
59
101
  }, "label:secondaryText;")
60
102
  }
61
103
  };
62
- var listStyles = /*#__PURE__*/css({
104
+ var listStyles = /*#__PURE__*/(0, _emotion.css)({
63
105
  "&.multi-autocomplete__options-list": {
64
106
  listStyle: "none",
65
107
  paddingLeft: 0,
@@ -69,107 +111,66 @@ var listStyles = /*#__PURE__*/css({
69
111
  }
70
112
  }, "label:listStyles;");
71
113
 
72
- function Spinner() {
73
- return /*#__PURE__*/React.createElement(MaterialSpinner, {
114
+ var Spinner = function Spinner() {
115
+ return /*#__PURE__*/_react.default.createElement(_reactSpinnerMaterial.default, {
74
116
  size: 24,
75
117
  spinnerColor: "#fa5723",
76
118
  spinnerWidth: 2,
77
119
  visible: true
78
120
  });
79
- }
80
-
81
- var DEFAULT_PER_PAGE = 10;
82
-
83
- function paginateMultipleSelection(multipleSelection, limit, page, search) {
84
- // Assign a real index, so that later when we press delete, we know what is the actual index we're deleting.
85
- var data = Array.isArray(multipleSelection) ? multipleSelection.map(function (item, index) {
86
- return _objectSpread(_objectSpread({}, item), {}, {
87
- index: index
88
- });
89
- }) : [];
90
-
91
- if (typeof search === "string" && search) {
92
- data = data.filter(function (item) {
93
- return typeof item.name === "string" && item.name.toLowerCase().includes(search.toLowerCase());
94
- });
95
- }
121
+ };
96
122
 
97
- var lastPage = Math.ceil(data.length / limit);
98
- var totalCount = data.length;
99
- page = page || lastPage;
100
- data = data.slice((page - 1) * limit, page * limit);
101
- var from = 0;
102
- var to = 0;
123
+ var OptionsList = function OptionsList(_ref) {
124
+ var getMenuProps = _ref.getMenuProps,
125
+ children = _ref.children;
126
+ return /*#__PURE__*/_react.default.createElement(_Elevation.Elevation, {
127
+ z: 1
128
+ }, /*#__PURE__*/_react.default.createElement("ul", Object.assign({
129
+ className: (0, _classnames.default)("multi-autocomplete__options-list", listStyles)
130
+ }, getMenuProps()), children));
131
+ };
103
132
 
104
- if (data.length) {
105
- from = (page - 1) * limit + 1;
106
- to = from + (data.length - 1);
107
- }
133
+ var MultiAutoComplete = /*#__PURE__*/function (_React$Component) {
134
+ (0, _inherits2.default)(MultiAutoComplete, _React$Component);
108
135
 
109
- var meta = {
110
- hasData: data.length > 0,
111
- totalCount: totalCount,
112
- from: from,
113
- to: to,
114
- page: page,
115
- lastPage: lastPage,
116
- limit: limit,
117
- hasPrevious: page > 1,
118
- hasNext: page < lastPage
119
- };
120
- return {
121
- data: data,
122
- meta: meta
123
- };
124
- }
125
-
126
- export var MultiAutoComplete = /*#__PURE__*/function (_React$Component) {
127
- _inherits(MultiAutoComplete, _React$Component);
128
-
129
- var _super = _createSuper(MultiAutoComplete);
136
+ var _super = (0, _createSuper2.default)(MultiAutoComplete);
130
137
 
131
138
  function MultiAutoComplete() {
132
139
  var _this;
133
140
 
134
- _classCallCheck(this, MultiAutoComplete);
141
+ (0, _classCallCheck2.default)(this, MultiAutoComplete);
135
142
 
136
143
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
137
144
  args[_key] = arguments[_key];
138
145
  }
139
146
 
140
147
  _this = _super.call.apply(_super, [this].concat(args));
141
-
142
- _defineProperty(_assertThisInitialized(_this), "state", {
148
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
143
149
  inputValue: "",
144
150
  multipleSelectionPage: 0,
145
151
  multipleSelectionSearch: "",
146
152
  reorderFormVisible: "",
147
153
  reorderFormValue: ""
148
154
  });
149
-
150
- _defineProperty(_assertThisInitialized(_this), "downshift", /*#__PURE__*/React.createRef());
151
-
152
- _defineProperty(_assertThisInitialized(_this), "assignedValueAfterClearing", {
155
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "downshift", /*#__PURE__*/_react.default.createRef());
156
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "assignedValueAfterClearing", {
153
157
  set: false,
154
158
  selection: null
155
159
  });
156
-
157
- _defineProperty(_assertThisInitialized(_this), "setMultipleSelectionPage", function (multipleSelectionPage) {
160
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "setMultipleSelectionPage", function (multipleSelectionPage) {
158
161
  _this.setState({
159
162
  multipleSelectionPage: multipleSelectionPage
160
163
  });
161
164
  });
162
-
163
- _defineProperty(_assertThisInitialized(_this), "setMultipleSelectionSearch", function (multipleSelectionSearch) {
165
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "setMultipleSelectionSearch", function (multipleSelectionSearch) {
164
166
  _this.setState({
165
167
  multipleSelectionSearch: multipleSelectionSearch
166
168
  });
167
169
  });
168
-
169
170
  return _this;
170
171
  }
171
172
 
172
- _createClass(MultiAutoComplete, [{
173
+ (0, _createClass2.default)(MultiAutoComplete, [{
173
174
  key: "getOptions",
174
175
  value: function getOptions() {
175
176
  var _this2 = this;
@@ -180,15 +181,34 @@ export var MultiAutoComplete = /*#__PURE__*/function (_React$Component) {
180
181
  allowFreeInput = _this$props.allowFreeInput,
181
182
  useSimpleValues = _this$props.useSimpleValues,
182
183
  options = _this$props.options;
183
- var filtered = options.filter(function (item) {
184
+ var values = Array.isArray(value) ? (0, _toConsumableArray2.default)(value) : [];
185
+ var filtered = (0, _toConsumableArray2.default)(options); // If free input is allowed, prepend typed value to the list.
186
+
187
+ if (allowFreeInput && this.state.inputValue) {
188
+ if (useSimpleValues) {
189
+ var existingValue = filtered.includes(this.state.inputValue);
190
+
191
+ if (!existingValue) {
192
+ filtered.unshift(this.state.inputValue);
193
+ }
194
+ } else {
195
+ var _existingValue = filtered.find(function (item) {
196
+ return _this2.state.inputValue === (0, _utils.getOptionText)(item, _this2.props);
197
+ });
198
+
199
+ if (!_existingValue) {
200
+ filtered.unshift((0, _defineProperty2.default)({}, this.props.textProp, this.state.inputValue));
201
+ }
202
+ }
203
+ }
204
+
205
+ return filtered.filter(function (item) {
184
206
  // We need to filter received options.
185
207
  // 1) If "unique" prop was passed, we don't want to show already picked options again.
186
208
  if (unique) {
187
- var values = value;
188
-
189
209
  if (Array.isArray(values)) {
190
210
  if (values.find(function (value) {
191
- return getOptionValue(value, _this2.props) === getOptionValue(item, _this2.props);
211
+ return (0, _utils.getOptionValue)(value, _this2.props) === (0, _utils.getOptionValue)(item, _this2.props);
192
212
  })) {
193
213
  return false;
194
214
  }
@@ -201,99 +221,134 @@ export var MultiAutoComplete = /*#__PURE__*/function (_React$Component) {
201
221
  }
202
222
 
203
223
  if (item.aliases) {
204
- return findInAliases(item, _this2.state.inputValue);
205
- }
206
-
207
- return getOptionText(item, _this2.props).toLowerCase().includes(_this2.state.inputValue.toLowerCase());
208
- }); // If free input is allowed, prepend typed value to the list.
209
-
210
- if (allowFreeInput && this.state.inputValue) {
211
- if (useSimpleValues) {
212
- var existingValue = filtered.includes(this.state.inputValue);
213
-
214
- if (!existingValue) {
215
- filtered.unshift(this.state.inputValue);
216
- }
217
- } else {
218
- var _existingValue = filtered.find(function (item) {
219
- return _this2.state.inputValue === getOptionText(item, _this2.props);
220
- });
221
-
222
- if (!_existingValue) {
223
- filtered.unshift(_defineProperty({}, this.props.textProp, this.state.inputValue));
224
- }
224
+ return (0, _utils.findInAliases)(item, _this2.state.inputValue);
225
225
  }
226
- }
227
226
 
228
- return filtered;
227
+ return (0, _utils.getOptionText)(item, _this2.props).toLowerCase().includes(_this2.state.inputValue.toLowerCase());
228
+ });
229
229
  }
230
230
  /**
231
231
  * Renders options - based on user's input. It will try to match input text with available options.
232
- * @param options
233
- * @param isOpen
234
- * @param highlightedIndex
235
- * @param selectedItem
236
- * @param getMenuProps
237
- * @param getItemProps
238
- * @returns {*}
239
232
  */
240
233
 
241
234
  }, {
242
235
  key: "renderOptions",
243
- value: function renderOptions(_ref) {
236
+ value: function renderOptions(params) {
244
237
  var _this3 = this;
245
238
 
246
- var options = _ref.options,
247
- isOpen = _ref.isOpen,
248
- highlightedIndex = _ref.highlightedIndex,
249
- getMenuProps = _ref.getMenuProps,
250
- getItemProps = _ref.getItemProps;
239
+ var options = params.options,
240
+ isOpen = params.isOpen,
241
+ highlightedIndex = params.highlightedIndex,
242
+ getMenuProps = params.getMenuProps,
243
+ getItemProps = params.getItemProps;
251
244
 
252
245
  if (!isOpen) {
253
246
  return null;
254
247
  }
248
+ /**
249
+ * Suggest user to start typing when there are no options available to choose from.
250
+ */
251
+
252
+
253
+ if (!this.state.inputValue && !options.length) {
254
+ return /*#__PURE__*/_react.default.createElement(OptionsList, {
255
+ getMenuProps: getMenuProps
256
+ }, /*#__PURE__*/_react.default.createElement("li", null, /*#__PURE__*/_react.default.createElement(_Typography.Typography, {
257
+ use: "body2"
258
+ }, "Start typing to find entry")));
259
+ }
255
260
 
256
261
  if (!options.length) {
257
- return /*#__PURE__*/React.createElement(Elevation, {
262
+ return /*#__PURE__*/_react.default.createElement(_Elevation.Elevation, {
258
263
  z: 1
259
- }, /*#__PURE__*/React.createElement("ul", Object.assign({
260
- className: classNames("multi-autocomplete__options-list", listStyles)
261
- }, getMenuProps()), /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement(Typography, {
264
+ }, /*#__PURE__*/_react.default.createElement("ul", Object.assign({
265
+ className: (0, _classnames.default)("multi-autocomplete__options-list", listStyles)
266
+ }, getMenuProps()), /*#__PURE__*/_react.default.createElement("li", null, /*#__PURE__*/_react.default.createElement(_Typography.Typography, {
262
267
  use: "body2"
263
- }, "No results."))));
268
+ }, "No results."), this.props.noResultFound)));
264
269
  }
265
270
 
266
271
  var renderItem = this.props.renderItem;
267
- return /*#__PURE__*/React.createElement(Elevation, {
272
+ return /*#__PURE__*/_react.default.createElement(_Elevation.Elevation, {
268
273
  z: 1
269
- }, /*#__PURE__*/React.createElement("ul", Object.assign({
270
- className: classNames("multi-autocomplete__options-list", listStyles)
274
+ }, /*#__PURE__*/_react.default.createElement("ul", Object.assign({
275
+ className: (0, _classnames.default)("multi-autocomplete__options-list", listStyles)
271
276
  }, getMenuProps()), options.map(function (item, index) {
272
277
  var _itemClassNames;
273
278
 
274
- var itemValue = getOptionValue(item, _this3.props); // Base classes.
279
+ var itemValue = (0, _utils.getOptionValue)(item, _this3.props); // Base classes.
275
280
 
276
- var itemClassNames = (_itemClassNames = {}, _defineProperty(_itemClassNames, suggestionList, true), _defineProperty(_itemClassNames, "highlighted", highlightedIndex === index), _defineProperty(_itemClassNames, "selected", false), _itemClassNames); // Render the item.
281
+ var itemClassNames = (_itemClassNames = {}, (0, _defineProperty2.default)(_itemClassNames, _styles.suggestionList, true), (0, _defineProperty2.default)(_itemClassNames, "highlighted", highlightedIndex === index), (0, _defineProperty2.default)(_itemClassNames, "selected", false), _itemClassNames); // Render the item.
277
282
 
278
- return /*#__PURE__*/React.createElement("li", Object.assign({
283
+ return /*#__PURE__*/_react.default.createElement("li", Object.assign({
279
284
  key: itemValue + index
280
285
  }, getItemProps({
281
286
  index: index,
282
287
  item: item,
283
- className: classNames(itemClassNames)
288
+ className: (0, _classnames.default)(itemClassNames)
284
289
  })), renderItem.call(_this3, item, index));
285
290
  })));
286
291
  }
292
+ }, {
293
+ key: "paginateMultipleSelection",
294
+ value: function paginateMultipleSelection() {
295
+ var _this4 = this;
296
+
297
+ var value = this.props.value;
298
+ var limit = 10;
299
+ var page = this.state.multipleSelectionPage;
300
+ var search = this.state.multipleSelectionSearch; // Assign a real index, so that later when we press delete, we know what is the actual index we're deleting.
301
+
302
+ var data = Array.isArray(value) ? value.map(function (option, index) {
303
+ return {
304
+ option: option,
305
+ index: index
306
+ };
307
+ }) : [];
308
+
309
+ if (search) {
310
+ data = data.filter(function (item) {
311
+ return (0, _utils.getOptionText)(item.option, _this4.props).toLowerCase().includes(search.toLowerCase());
312
+ });
313
+ }
314
+
315
+ var lastPage = Math.ceil(data.length / limit);
316
+ var totalCount = data.length;
317
+ page = page || lastPage;
318
+ data = data.slice((page - 1) * limit, page * limit);
319
+ var from = 0;
320
+ var to = 0;
321
+
322
+ if (data.length) {
323
+ from = (page - 1) * limit + 1;
324
+ to = from + (data.length - 1);
325
+ }
326
+
327
+ var meta = {
328
+ hasData: data.length > 0,
329
+ totalCount: totalCount,
330
+ from: from,
331
+ to: to,
332
+ page: page,
333
+ lastPage: lastPage,
334
+ limit: limit,
335
+ hasPrevious: page > 1,
336
+ hasNext: page < lastPage
337
+ };
338
+ return {
339
+ data: data,
340
+ meta: meta
341
+ };
342
+ }
287
343
  /**
288
344
  * Once added, items can also be removed by clicking on the ✕ icon. This is the method that is responsible for
289
345
  * rendering selected items (we are using already existing "Chips" component).
290
- * @returns {*}
291
346
  */
292
347
 
293
348
  }, {
294
349
  key: "renderMultipleSelection",
295
350
  value: function renderMultipleSelection() {
296
- var _this4 = this;
351
+ var _this5 = this;
297
352
 
298
353
  var _this$props2 = this.props,
299
354
  value = _this$props2.value,
@@ -301,65 +356,68 @@ export var MultiAutoComplete = /*#__PURE__*/function (_React$Component) {
301
356
  disabled = _this$props2.disabled,
302
357
  useMultipleSelectionList = _this$props2.useMultipleSelectionList,
303
358
  description = _this$props2.description,
304
- renderListItemLabel = _this$props2.renderListItemLabel;
359
+ renderListItemLabel = _this$props2.renderListItemLabel,
360
+ renderListItemOptions = _this$props2.renderListItemOptions;
305
361
 
306
362
  if (useMultipleSelectionList) {
307
- var _paginateMultipleSele = paginateMultipleSelection(value, DEFAULT_PER_PAGE, this.state.multipleSelectionPage, this.state.multipleSelectionSearch),
308
- data = _paginateMultipleSele.data,
309
- meta = _paginateMultipleSele.meta;
363
+ var _this$paginateMultipl = this.paginateMultipleSelection(),
364
+ data = _this$paginateMultipl.data,
365
+ meta = _this$paginateMultipl.meta;
310
366
 
311
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
367
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
312
368
  className: style.pagination.bar
313
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Input, {
369
+ }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Input.Input, {
314
370
  className: style.pagination.searchInput,
315
371
  placeholder: "Search selected...",
316
372
  value: this.state.multipleSelectionSearch,
373
+ "data-testid": "pb.pagination.search",
317
374
  onChange: function onChange(value) {
318
- _this4.setMultipleSelectionSearch(value);
375
+ _this5.setMultipleSelectionSearch(value);
319
376
 
320
- _this4.setMultipleSelectionPage(value ? 1 : 0);
377
+ _this5.setMultipleSelectionPage(value ? 1 : 0);
321
378
  }
322
- })), /*#__PURE__*/React.createElement("div", {
379
+ })), /*#__PURE__*/_react.default.createElement("div", {
323
380
  className: style.pagination.pages
324
- }, /*#__PURE__*/React.createElement("div", {
381
+ }, /*#__PURE__*/_react.default.createElement("div", {
325
382
  className: meta.hasData ? "" : style.pagination.secondaryText
326
- }, meta.from, " - ", meta.to, " of ", meta.totalCount), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(IconButton, {
327
- icon: /*#__PURE__*/React.createElement(PrevAllIcon, null),
383
+ }, meta.from, " - ", meta.to, " of ", meta.totalCount), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Button.IconButton, {
384
+ icon: /*#__PURE__*/_react.default.createElement(_skip_previous24px.ReactComponent, null),
328
385
  disabled: !meta.hasData || meta.page === 1,
329
386
  onClick: function onClick() {
330
- return _this4.setMultipleSelectionPage(1);
387
+ return _this5.setMultipleSelectionPage(1);
331
388
  }
332
- }), /*#__PURE__*/React.createElement(IconButton, {
333
- icon: /*#__PURE__*/React.createElement(PrevIcon, null),
389
+ }), /*#__PURE__*/_react.default.createElement(_Button.IconButton, {
390
+ icon: /*#__PURE__*/_react.default.createElement(_navigate_before24px.ReactComponent, null),
334
391
  disabled: !meta.hasData || !meta.hasPrevious,
335
392
  onClick: function onClick() {
336
- return _this4.setMultipleSelectionPage(meta.page - 1);
393
+ return _this5.setMultipleSelectionPage(meta.page - 1);
337
394
  }
338
- }), /*#__PURE__*/React.createElement(IconButton, {
339
- icon: /*#__PURE__*/React.createElement(NextIcon, null),
395
+ }), /*#__PURE__*/_react.default.createElement(_Button.IconButton, {
396
+ icon: /*#__PURE__*/_react.default.createElement(_navigate_next24px.ReactComponent, null),
340
397
  disabled: !meta.hasData || !meta.hasNext,
341
398
  onClick: function onClick() {
342
- return _this4.setMultipleSelectionPage(meta.page + 1);
399
+ return _this5.setMultipleSelectionPage(meta.page + 1);
343
400
  }
344
- }), /*#__PURE__*/React.createElement(IconButton, {
345
- icon: /*#__PURE__*/React.createElement(NextAllIcon, null),
401
+ }), /*#__PURE__*/_react.default.createElement(_Button.IconButton, {
402
+ icon: /*#__PURE__*/_react.default.createElement(_skip_next24px.ReactComponent, null),
346
403
  disabled: !meta.hasData || meta.page === meta.lastPage,
347
404
  onClick: function onClick() {
348
- return _this4.setMultipleSelectionPage(meta.lastPage);
405
+ return _this5.setMultipleSelectionPage(meta.lastPage);
349
406
  }
350
- })))), /*#__PURE__*/React.createElement(List, {
407
+ })))), /*#__PURE__*/_react.default.createElement(_List.List, {
351
408
  className: style.pagination.list
352
409
  }, meta.hasData ? data.map(function (item, index) {
353
- var key = "".concat(getOptionValue(item, _this4.props), "-").concat(index);
410
+ var key = "".concat((0, _utils.getOptionValue)(item.option, _this5.props), "-").concat(index);
354
411
 
355
- if (_this4.state.reorderFormVisible === key) {
356
- return /*#__PURE__*/React.createElement(ListItem, {
412
+ if (_this5.state.reorderFormVisible === key) {
413
+ return /*#__PURE__*/_react.default.createElement(_List.ListItem, {
357
414
  key: key
358
- }, /*#__PURE__*/React.createElement(ListItemGraphic, null, /*#__PURE__*/React.createElement(IconButton, {
415
+ }, /*#__PURE__*/_react.default.createElement(_List.ListItemGraphic, null, /*#__PURE__*/_react.default.createElement(_Button.IconButton, {
359
416
  disabled: true,
360
- icon: /*#__PURE__*/React.createElement(ReorderIcon, null)
361
- })), /*#__PURE__*/React.createElement(Input, {
362
- value: _this4.state.reorderFormValue,
417
+ icon: /*#__PURE__*/_react.default.createElement(_reorder_black_24dp.ReactComponent, null)
418
+ })), /*#__PURE__*/_react.default.createElement(_Input.Input, {
419
+ value: _this5.state.reorderFormValue,
420
+ "data-testid": "pb.pagination.input",
363
421
  onKeyDown: function onKeyDown(e) {
364
422
  var key = e.key;
365
423
 
@@ -369,19 +427,21 @@ export var MultiAutoComplete = /*#__PURE__*/function (_React$Component) {
369
427
 
370
428
  if (key === "Enter") {
371
429
  // Reorder the item.
372
- var newValue = _toConsumableArray(value);
373
-
430
+ var newValue = (0, _toConsumableArray2.default)(value);
374
431
  newValue.splice(e.target.value - 1, 0, newValue.splice(item.index, 1)[0]);
375
- onChange(newValue);
432
+
433
+ if (onChange) {
434
+ onChange(newValue);
435
+ }
376
436
  }
377
437
 
378
- _this4.setState({
438
+ _this5.setState({
379
439
  reorderFormVisible: "",
380
440
  reorderFormValue: ""
381
441
  });
382
442
  },
383
443
  onChange: function onChange(value) {
384
- return _this4.setState({
444
+ return _this5.setState({
385
445
  reorderFormValue: value
386
446
  });
387
447
  },
@@ -389,38 +449,43 @@ export var MultiAutoComplete = /*#__PURE__*/function (_React$Component) {
389
449
  autoFocus: true,
390
450
  className: style.pagination.searchInput,
391
451
  placeholder: "Type a new order number and press Enter, or press Esc to cancel."
392
- }), /*#__PURE__*/React.createElement(ListItemMeta, null, /*#__PURE__*/React.createElement(IconButton, {
393
- icon: /*#__PURE__*/React.createElement(DeleteIcon, null),
452
+ }), /*#__PURE__*/_react.default.createElement(_List.ListItemMeta, null, /*#__PURE__*/_react.default.createElement(_Button.IconButton, {
453
+ icon: /*#__PURE__*/_react.default.createElement(_baselineClose24px.ReactComponent, null),
394
454
  disabled: true
395
455
  })));
396
456
  }
397
457
 
398
- return /*#__PURE__*/React.createElement(ListItem, {
458
+ return /*#__PURE__*/_react.default.createElement(_List.ListItem, {
399
459
  key: key
400
- }, /*#__PURE__*/React.createElement(ListItemGraphic, null, /*#__PURE__*/React.createElement(IconButton, {
401
- icon: /*#__PURE__*/React.createElement(ReorderIcon, null),
460
+ }, /*#__PURE__*/_react.default.createElement(_List.ListItemGraphic, null, /*#__PURE__*/_react.default.createElement(_Button.IconButton, {
461
+ icon: /*#__PURE__*/_react.default.createElement(_reorder_black_24dp.ReactComponent, null),
402
462
  onClick: function onClick() {
403
- _this4.setState({
463
+ _this5.setState({
404
464
  reorderFormVisible: key
405
465
  });
406
466
  }
407
- })), /*#__PURE__*/React.createElement("div", {
467
+ })), /*#__PURE__*/_react.default.createElement("div", {
408
468
  style: {
409
469
  color: "var(--mdc-theme-text-secondary-on-background)",
410
470
  marginRight: 8,
411
471
  minWidth: 32
412
472
  }
413
- }, item.index + 1, "."), " ", renderListItemLabel.call(_this4, item), /*#__PURE__*/React.createElement(ListItemMeta, null, /*#__PURE__*/React.createElement(IconButton, {
414
- icon: /*#__PURE__*/React.createElement(DeleteIcon, null),
473
+ }, item.index + 1, "."), " ", renderListItemLabel && renderListItemLabel.call(_this5, item.option), /*#__PURE__*/_react.default.createElement(_List.ListItemMeta, {
474
+ className: listItemMetaClassName
475
+ }, renderListItemOptions && renderListItemOptions.call(_this5, item.option), /*#__PURE__*/_react.default.createElement(_Button.IconButton, {
476
+ icon: /*#__PURE__*/_react.default.createElement(_baselineClose24px.ReactComponent, null),
477
+ className: iconButtonClassName,
415
478
  onClick: function onClick() {
416
- if (onChange) {
417
- onChange([].concat(_toConsumableArray(value.slice(0, item.index)), _toConsumableArray(value.slice(item.index + 1))));
479
+ if (!onChange) {
480
+ return;
418
481
  }
482
+
483
+ onChange([].concat((0, _toConsumableArray2.default)(value.slice(0, item.index)), (0, _toConsumableArray2.default)(value.slice(item.index + 1))));
419
484
  }
420
485
  })));
421
- }) : /*#__PURE__*/React.createElement(ListItem, null, /*#__PURE__*/React.createElement("span", {
486
+ }) : /*#__PURE__*/_react.default.createElement(_List.ListItem, null, /*#__PURE__*/_react.default.createElement("span", {
422
487
  className: style.pagination.secondaryText
423
- }, "Nothing to show."))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(FormElementMessage, null, description)));
488
+ }, "Nothing to show."))), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_FormElementMessage.FormElementMessage, null, description)));
424
489
  }
425
490
 
426
491
  var hasItems = Array.isArray(value) && value.length;
@@ -429,17 +494,19 @@ export var MultiAutoComplete = /*#__PURE__*/function (_React$Component) {
429
494
  return null;
430
495
  }
431
496
 
432
- return /*#__PURE__*/React.createElement(Chips, {
497
+ return /*#__PURE__*/_react.default.createElement(_Chips.Chips, {
433
498
  disabled: disabled
434
499
  }, value.map(function (item, index) {
435
- return /*#__PURE__*/React.createElement(Chip, {
436
- label: getOptionText(item, _this4.props),
437
- key: "".concat(getOptionValue(item, _this4.props), "-").concat(index),
438
- trailingIcon: /*#__PURE__*/React.createElement(BaselineCloseIcon, null),
500
+ return /*#__PURE__*/_react.default.createElement(_Chips.Chip, {
501
+ label: (0, _utils.getOptionText)(item, _this5.props),
502
+ key: "".concat((0, _utils.getOptionValue)(item, _this5.props), "-").concat(index),
503
+ trailingIcon: /*#__PURE__*/_react.default.createElement(_baselineClose24px.ReactComponent, null),
439
504
  onRemove: function onRemove() {
440
- if (onChange) {
441
- onChange([].concat(_toConsumableArray(value.slice(0, index)), _toConsumableArray(value.slice(index + 1))));
505
+ if (!onChange) {
506
+ return;
442
507
  }
508
+
509
+ onChange([].concat((0, _toConsumableArray2.default)(value.slice(0, index)), (0, _toConsumableArray2.default)(value.slice(index + 1))));
443
510
  }
444
511
  });
445
512
  }));
@@ -447,78 +514,72 @@ export var MultiAutoComplete = /*#__PURE__*/function (_React$Component) {
447
514
  }, {
448
515
  key: "render",
449
516
  value: function render() {
450
- var _this5 = this;
517
+ var _this6 = this;
451
518
 
452
519
  var props = this.props,
453
520
  _this$props3 = this.props,
454
- rawOptions = _this$props3.options,
455
- allowFreeInput = _this$props3.allowFreeInput,
456
- useSimpleValues = _this$props3.useSimpleValues,
457
521
  unique = _this$props3.unique,
458
522
  value = _this$props3.value,
459
523
  _onChange = _this$props3.onChange,
460
- valueProp = _this$props3.valueProp,
461
- textProp = _this$props3.textProp,
462
524
  onInput = _this$props3.onInput,
463
525
  _this$props3$validati = _this$props3.validation,
464
526
  validation = _this$props3$validati === void 0 ? {
465
- isValid: null
527
+ isValid: null,
528
+ message: null
466
529
  } : _this$props3$validati,
467
530
  useMultipleSelectionList = _this$props3.useMultipleSelectionList,
468
531
  description = _this$props3.description,
469
- otherInputProps = _objectWithoutProperties(_this$props3, _excluded);
470
-
532
+ otherInputProps = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
471
533
  var options = this.getOptions();
472
- return /*#__PURE__*/React.createElement("div", {
473
- className: classNames(autoCompleteStyle, props.className)
474
- }, /*#__PURE__*/React.createElement(Downshift, {
475
- defaultSelectedItem: null // @ts-ignore
534
+ return /*#__PURE__*/_react.default.createElement("div", {
535
+ className: (0, _classnames.default)(_styles.autoCompleteStyle, props.className)
536
+ }, /*#__PURE__*/_react.default.createElement(_downshift.default, {
537
+ defaultSelectedItem: null // @ts-ignore there is no className on Downshift
476
538
  ,
477
- className: autoCompleteStyle,
539
+ className: _styles.autoCompleteStyle,
478
540
  itemToString: function itemToString(item) {
479
- return item && getOptionText(item, props);
541
+ return item && (0, _utils.getOptionText)(item, props);
480
542
  },
481
543
  ref: this.downshift,
482
544
  onChange: function onChange(selection) {
483
- if (!_this5.assignedValueAfterClearing.set) {
484
- _this5.assignedValueAfterClearing = {
545
+ if (!_this6.assignedValueAfterClearing.set) {
546
+ _this6.assignedValueAfterClearing = {
485
547
  set: true,
486
548
  selection: selection
487
549
  };
488
550
 
489
- _this5.downshift.current.clearSelection();
551
+ _this6.downshift.current.clearSelection();
490
552
 
491
- _this5.setMultipleSelectionPage(0);
553
+ _this6.setMultipleSelectionPage(0);
492
554
 
493
555
  return;
494
556
  }
495
557
 
496
- if (_this5.assignedValueAfterClearing.set) {
497
- _this5.setState({
558
+ if (_this6.assignedValueAfterClearing.set) {
559
+ _this6.setState({
498
560
  inputValue: ""
499
561
  });
500
562
 
501
- _this5.assignedValueAfterClearing.set = false;
563
+ _this6.assignedValueAfterClearing.set = false;
502
564
 
503
565
  if (Array.isArray(value)) {
504
- _onChange && _onChange([].concat(_toConsumableArray(value), [_this5.assignedValueAfterClearing.selection]));
566
+ _onChange && _onChange([].concat((0, _toConsumableArray2.default)(value), [_this6.assignedValueAfterClearing.selection]));
505
567
  } else {
506
- _onChange && _onChange([_this5.assignedValueAfterClearing.selection]);
568
+ _onChange && _onChange([_this6.assignedValueAfterClearing.selection]);
507
569
  }
508
570
  }
509
571
  }
510
572
  }, function (_ref2) {
511
573
  var getInputProps = _ref2.getInputProps,
512
574
  openMenu = _ref2.openMenu,
513
- rest = _objectWithoutProperties(_ref2, _excluded2);
514
-
515
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Input, getInputProps(_objectSpread(_objectSpread({}, otherInputProps), {}, {
575
+ rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
576
+ return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Input.Input, getInputProps((0, _objectSpread2.default)((0, _objectSpread2.default)({}, otherInputProps), {}, {
516
577
  // @ts-ignore
517
578
  validation: validation,
518
579
  // Only pass description if not using "useMultipleSelectionList".
519
580
  description: useMultipleSelectionList ? null : description,
520
581
  rawOnChange: true,
521
- trailingIcon: _this5.props.loading && /*#__PURE__*/React.createElement(Spinner, null),
582
+ trailingIcon: _this6.props.loading && /*#__PURE__*/_react.default.createElement(Spinner, null),
522
583
  onChange: function onChange(e) {
523
584
  return e;
524
585
  },
@@ -528,8 +589,8 @@ export var MultiAutoComplete = /*#__PURE__*/function (_React$Component) {
528
589
  onKeyUp: function onKeyUp(e) {
529
590
  var inputValue = e.target.value || ""; // Set current input value into state and trigger onInput if different.
530
591
 
531
- if (inputValue !== _this5.state.inputValue) {
532
- _this5.setState({
592
+ if (inputValue !== _this6.state.inputValue) {
593
+ _this6.setState({
533
594
  inputValue: inputValue
534
595
  }, function () {
535
596
  onInput && onInput(inputValue);
@@ -540,30 +601,38 @@ export var MultiAutoComplete = /*#__PURE__*/function (_React$Component) {
540
601
  openMenu();
541
602
  otherInputProps.onFocus && otherInputProps.onFocus(e);
542
603
  }
543
- }))), _this5.renderOptions(_objectSpread(_objectSpread({}, rest), {}, {
604
+ }))), _this6.renderOptions((0, _objectSpread2.default)((0, _objectSpread2.default)({}, rest), {}, {
544
605
  unique: unique,
545
606
  options: options
546
- })), _this5.renderMultipleSelection());
607
+ })), _this6.renderMultipleSelection());
547
608
  }));
548
609
  }
549
610
  }]);
550
-
551
611
  return MultiAutoComplete;
552
- }(React.Component);
612
+ }(_react.default.Component);
553
613
 
554
- _defineProperty(MultiAutoComplete, "defaultProps", {
614
+ exports.MultiAutoComplete = MultiAutoComplete;
615
+ (0, _defineProperty2.default)(MultiAutoComplete, "defaultProps", {
555
616
  valueProp: "id",
556
617
  textProp: "name",
557
618
  unique: true,
558
619
  options: [],
559
620
  useSimpleValues: false,
560
621
  useMultipleSelectionList: false,
622
+
623
+ /**
624
+ * We cast this as MultiAutoComplete because renderItem() is executed via .call() where this is MultiAutoComplete instance.
625
+ */
561
626
  renderItem: function renderItem(item) {
562
- return /*#__PURE__*/React.createElement(Typography, {
627
+ return /*#__PURE__*/_react.default.createElement(_Typography.Typography, {
563
628
  use: "body2"
564
- }, getOptionText(item, this.props));
629
+ }, (0, _utils.getOptionText)(item, this.props));
565
630
  },
631
+
632
+ /**
633
+ * We cast this as MultiAutoComplete because renderListItemLabel() is executed via .call() where this is MultiAutoComplete instance.
634
+ */
566
635
  renderListItemLabel: function renderListItemLabel(item) {
567
- return getOptionText(item, this.props);
636
+ return (0, _utils.getOptionText)(item, this.props);
568
637
  }
569
638
  });