@webiny/ui 0.0.0-mt-3 → 0.0.0-unstable.085ff6572f

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