@mailstep/design-system 0.4.21 → 0.5.0-beta.10

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 (285) hide show
  1. package/package.json +33 -2
  2. package/ui/Blocks/CommonGrid/CommonGrid.d.ts +3 -0
  3. package/ui/Blocks/CommonGrid/CommonGrid.js +106 -0
  4. package/ui/Blocks/CommonGrid/CommonGridContainer.d.ts +3 -0
  5. package/ui/Blocks/CommonGrid/CommonGridContainer.js +67 -0
  6. package/ui/Blocks/CommonGrid/CommonGridContext.d.ts +9 -0
  7. package/ui/Blocks/CommonGrid/CommonGridContext.js +32 -0
  8. package/ui/Blocks/CommonGrid/HoC/withReduxActions.d.ts +2 -0
  9. package/ui/Blocks/CommonGrid/HoC/withReduxActions.js +36 -0
  10. package/ui/Blocks/CommonGrid/StandardButtons.d.ts +6 -0
  11. package/ui/Blocks/CommonGrid/StandardButtons.js +50 -0
  12. package/ui/Blocks/CommonGrid/components/ActionHead/ActionHead.d.ts +11 -0
  13. package/ui/Blocks/CommonGrid/components/ActionHead/ActionHead.js +53 -0
  14. package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownMenu.d.ts +11 -0
  15. package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownMenu.js +18 -0
  16. package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownSelect.d.ts +12 -0
  17. package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownSelect.js +45 -0
  18. package/ui/Blocks/CommonGrid/components/ActionHead/index.d.ts +2 -0
  19. package/ui/Blocks/CommonGrid/components/ActionHead/index.js +2 -0
  20. package/ui/Blocks/CommonGrid/components/BooleanSelect/BooleanSelect.d.ts +6 -0
  21. package/ui/Blocks/CommonGrid/components/BooleanSelect/BooleanSelect.js +35 -0
  22. package/ui/Blocks/CommonGrid/components/BooleanSelect/index.d.ts +2 -0
  23. package/ui/Blocks/CommonGrid/components/BooleanSelect/index.js +2 -0
  24. package/ui/Blocks/CommonGrid/components/ButtonMore/ButtonMore.d.ts +13 -0
  25. package/ui/Blocks/CommonGrid/components/ButtonMore/ButtonMore.js +32 -0
  26. package/ui/Blocks/CommonGrid/components/ButtonMore/index.d.ts +2 -0
  27. package/ui/Blocks/CommonGrid/components/ButtonMore/index.js +2 -0
  28. package/ui/Blocks/CommonGrid/components/ColumnFilterCell.d.ts +11 -0
  29. package/ui/Blocks/CommonGrid/components/ColumnFilterCell.js +41 -0
  30. package/ui/Blocks/CommonGrid/components/ColumnTitle/ColumnTitle.d.ts +5 -0
  31. package/ui/Blocks/CommonGrid/components/ColumnTitle/ColumnTitle.js +58 -0
  32. package/ui/Blocks/CommonGrid/components/ColumnTitle/index.d.ts +2 -0
  33. package/ui/Blocks/CommonGrid/components/ColumnTitle/index.js +2 -0
  34. package/ui/Blocks/CommonGrid/components/ColumnTitle.d.ts +9 -0
  35. package/ui/Blocks/CommonGrid/components/ColumnTitle.js +20 -0
  36. package/ui/Blocks/CommonGrid/components/ControlButtons/ControlButtons.d.ts +11 -0
  37. package/ui/Blocks/CommonGrid/components/ControlButtons/ControlButtons.js +20 -0
  38. package/ui/Blocks/CommonGrid/components/ControlButtons/index.d.ts +2 -0
  39. package/ui/Blocks/CommonGrid/components/ControlButtons/index.js +2 -0
  40. package/ui/Blocks/CommonGrid/components/DataCell.d.ts +11 -0
  41. package/ui/Blocks/CommonGrid/components/DataCell.js +52 -0
  42. package/ui/Blocks/CommonGrid/components/DataRow.d.ts +21 -0
  43. package/ui/Blocks/CommonGrid/components/DataRow.js +110 -0
  44. package/ui/Blocks/CommonGrid/components/DatePickerRange/DatePickerRange.d.ts +12 -0
  45. package/ui/Blocks/CommonGrid/components/DatePickerRange/DatePickerRange.js +113 -0
  46. package/ui/Blocks/CommonGrid/components/DatePickerRange/index.d.ts +2 -0
  47. package/ui/Blocks/CommonGrid/components/DatePickerRange/index.js +2 -0
  48. package/ui/Blocks/CommonGrid/components/DatePickerRange/utils/sameDate.d.ts +1 -0
  49. package/ui/Blocks/CommonGrid/components/DatePickerRange/utils/sameDate.js +3 -0
  50. package/ui/Blocks/CommonGrid/components/DropdownSelect/DropdownSelect.d.ts +21 -0
  51. package/ui/Blocks/CommonGrid/components/DropdownSelect/DropdownSelect.js +47 -0
  52. package/ui/Blocks/CommonGrid/components/DropdownSelect/index.d.ts +4 -0
  53. package/ui/Blocks/CommonGrid/components/DropdownSelect/index.js +3 -0
  54. package/ui/Blocks/CommonGrid/components/ExtraControlButtons/ExtraControlButtons.d.ts +8 -0
  55. package/ui/Blocks/CommonGrid/components/ExtraControlButtons/ExtraControlButtons.js +43 -0
  56. package/ui/Blocks/CommonGrid/components/ExtraControlButtons/index.d.ts +2 -0
  57. package/ui/Blocks/CommonGrid/components/ExtraControlButtons/index.js +2 -0
  58. package/ui/Blocks/CommonGrid/components/FilterDropdown.d.ts +3 -0
  59. package/ui/Blocks/CommonGrid/components/FilterDropdown.js +36 -0
  60. package/ui/Blocks/CommonGrid/components/FilterRow.d.ts +15 -0
  61. package/ui/Blocks/CommonGrid/components/FilterRow.js +34 -0
  62. package/ui/Blocks/CommonGrid/components/FloatingButton/FloatingButton.d.ts +7 -0
  63. package/ui/Blocks/CommonGrid/components/FloatingButton/FloatingButton.js +45 -0
  64. package/ui/Blocks/CommonGrid/components/FloatingButton/index.d.ts +2 -0
  65. package/ui/Blocks/CommonGrid/components/FloatingButton/index.js +2 -0
  66. package/ui/Blocks/CommonGrid/components/GridSelect/GridSelect.d.ts +10 -0
  67. package/ui/Blocks/CommonGrid/components/GridSelect/GridSelect.js +19 -0
  68. package/ui/Blocks/CommonGrid/components/GridSelect/index.d.ts +2 -0
  69. package/ui/Blocks/CommonGrid/components/GridSelect/index.js +2 -0
  70. package/ui/Blocks/CommonGrid/components/GroupRow.d.ts +9 -0
  71. package/ui/Blocks/CommonGrid/components/GroupRow.js +27 -0
  72. package/ui/Blocks/CommonGrid/components/HeadCell.d.ts +27 -0
  73. package/ui/Blocks/CommonGrid/components/HeadCell.js +40 -0
  74. package/ui/Blocks/CommonGrid/components/HeadRow.d.ts +15 -0
  75. package/ui/Blocks/CommonGrid/components/HeadRow.js +69 -0
  76. package/ui/Blocks/CommonGrid/components/HidePrint/HidePrint.d.ts +6 -0
  77. package/ui/Blocks/CommonGrid/components/HidePrint/HidePrint.js +13 -0
  78. package/ui/Blocks/CommonGrid/components/IconList/IconList.d.ts +18 -0
  79. package/ui/Blocks/CommonGrid/components/IconList/IconList.js +29 -0
  80. package/ui/Blocks/CommonGrid/components/IconList/index.d.ts +2 -0
  81. package/ui/Blocks/CommonGrid/components/IconList/index.js +2 -0
  82. package/ui/Blocks/CommonGrid/components/ManageColumnForm/ManageColumnForm.d.ts +11 -0
  83. package/ui/Blocks/CommonGrid/components/ManageColumnForm/ManageColumnForm.js +20 -0
  84. package/ui/Blocks/CommonGrid/components/ManageColumnForm/components/ActionRow.d.ts +12 -0
  85. package/ui/Blocks/CommonGrid/components/ManageColumnForm/components/ActionRow.js +47 -0
  86. package/ui/Blocks/CommonGrid/components/ManageColumnForm/index.d.ts +2 -0
  87. package/ui/Blocks/CommonGrid/components/ManageColumnForm/index.js +2 -0
  88. package/ui/Blocks/CommonGrid/components/NumberRange/NumberRange.d.ts +3 -0
  89. package/ui/Blocks/CommonGrid/components/NumberRange/NumberRange.js +76 -0
  90. package/ui/Blocks/CommonGrid/components/NumberRange/index.d.ts +2 -0
  91. package/ui/Blocks/CommonGrid/components/NumberRange/index.js +2 -0
  92. package/ui/Blocks/CommonGrid/components/NumberRange/types.d.ts +17 -0
  93. package/ui/Blocks/CommonGrid/components/NumberRange/types.js +1 -0
  94. package/ui/Blocks/CommonGrid/components/OversizedScroll.d.ts +11 -0
  95. package/ui/Blocks/CommonGrid/components/OversizedScroll.js +21 -0
  96. package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/ReadEditButtonCell.d.ts +6 -0
  97. package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/ReadEditButtonCell.js +26 -0
  98. package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/index.d.ts +2 -0
  99. package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/index.js +2 -0
  100. package/ui/Blocks/CommonGrid/components/Resize.d.ts +7 -0
  101. package/ui/Blocks/CommonGrid/components/Resize.js +33 -0
  102. package/ui/Blocks/CommonGrid/components/Table.d.ts +10 -0
  103. package/ui/Blocks/CommonGrid/components/Table.js +25 -0
  104. package/ui/Blocks/CommonGrid/components/TablePagination/TablePagination.d.ts +7 -0
  105. package/ui/Blocks/CommonGrid/components/TablePagination/TablePagination.js +31 -0
  106. package/ui/Blocks/CommonGrid/components/TablePagination/index.d.ts +2 -0
  107. package/ui/Blocks/CommonGrid/components/TablePagination/index.js +2 -0
  108. package/ui/Blocks/CommonGrid/components/TextRange/TextRange.d.ts +4 -0
  109. package/ui/Blocks/CommonGrid/components/TextRange/TextRange.js +89 -0
  110. package/ui/Blocks/CommonGrid/components/TextRange/index.d.ts +2 -0
  111. package/ui/Blocks/CommonGrid/components/TextRange/index.js +2 -0
  112. package/ui/Blocks/CommonGrid/components/TextRange/types.d.ts +21 -0
  113. package/ui/Blocks/CommonGrid/components/TextRange/types.js +1 -0
  114. package/ui/Blocks/CommonGrid/components/gridCells/BoolIcon.d.ts +5 -0
  115. package/ui/Blocks/CommonGrid/components/gridCells/BoolIcon.js +22 -0
  116. package/ui/Blocks/CommonGrid/components/gridCells/ButtonInCell.d.ts +4 -0
  117. package/ui/Blocks/CommonGrid/components/gridCells/ButtonInCell.js +16 -0
  118. package/ui/Blocks/CommonGrid/components/gridCells/Date.d.ts +4 -0
  119. package/ui/Blocks/CommonGrid/components/gridCells/Date.js +8 -0
  120. package/ui/Blocks/CommonGrid/components/gridCells/DateTime.d.ts +4 -0
  121. package/ui/Blocks/CommonGrid/components/gridCells/DateTime.js +13 -0
  122. package/ui/Blocks/CommonGrid/components/gridCells/EnumInCell.d.ts +9 -0
  123. package/ui/Blocks/CommonGrid/components/gridCells/EnumInCell.js +33 -0
  124. package/ui/Blocks/CommonGrid/components/gridCells/HoverBubble.d.ts +5 -0
  125. package/ui/Blocks/CommonGrid/components/gridCells/HoverBubble.js +19 -0
  126. package/ui/Blocks/CommonGrid/components/gridCells/IconButtonInCell.d.ts +9 -0
  127. package/ui/Blocks/CommonGrid/components/gridCells/IconButtonInCell.js +15 -0
  128. package/ui/Blocks/CommonGrid/components/gridCells/ImageCell.d.ts +6 -0
  129. package/ui/Blocks/CommonGrid/components/gridCells/ImageCell.js +23 -0
  130. package/ui/Blocks/CommonGrid/components/gridCells/LinkInCell.d.ts +1 -0
  131. package/ui/Blocks/CommonGrid/components/gridCells/LinkInCell.js +8 -0
  132. package/ui/Blocks/CommonGrid/components/gridCells/RemoveItem.d.ts +5 -0
  133. package/ui/Blocks/CommonGrid/components/gridCells/RemoveItem.js +24 -0
  134. package/ui/Blocks/CommonGrid/components/gridCells/RowActionsCell.d.ts +7 -0
  135. package/ui/Blocks/CommonGrid/components/gridCells/RowActionsCell.js +30 -0
  136. package/ui/Blocks/CommonGrid/components/gridCells/StringJoin.d.ts +4 -0
  137. package/ui/Blocks/CommonGrid/components/gridCells/StringJoin.js +7 -0
  138. package/ui/Blocks/CommonGrid/components/gridCells/SwitchInCell.d.ts +2 -0
  139. package/ui/Blocks/CommonGrid/components/gridCells/SwitchInCell.js +16 -0
  140. package/ui/Blocks/CommonGrid/components/gridCells/index.d.ts +12 -0
  141. package/ui/Blocks/CommonGrid/components/gridCells/index.js +12 -0
  142. package/ui/Blocks/CommonGrid/components/icons/ArrowSimple.d.ts +2 -0
  143. package/ui/Blocks/CommonGrid/components/icons/ArrowSimple.js +14 -0
  144. package/ui/Blocks/CommonGrid/components/icons/Edit.d.ts +2 -0
  145. package/ui/Blocks/CommonGrid/components/icons/Edit.js +14 -0
  146. package/ui/Blocks/CommonGrid/components/icons/EyeOpen.d.ts +2 -0
  147. package/ui/Blocks/CommonGrid/components/icons/EyeOpen.js +14 -0
  148. package/ui/Blocks/CommonGrid/components/icons/Sorting.d.ts +2 -0
  149. package/ui/Blocks/CommonGrid/components/icons/Sorting.js +14 -0
  150. package/ui/Blocks/CommonGrid/components/utils.d.ts +8 -0
  151. package/ui/Blocks/CommonGrid/components/utils.js +22 -0
  152. package/ui/Blocks/CommonGrid/hooks/useColumnSizes.d.ts +12 -0
  153. package/ui/Blocks/CommonGrid/hooks/useColumnSizes.js +83 -0
  154. package/ui/Blocks/CommonGrid/hooks/useEditReadAsColumn.d.ts +15 -0
  155. package/ui/Blocks/CommonGrid/hooks/useEditReadAsColumn.js +70 -0
  156. package/ui/Blocks/CommonGrid/hooks/useGetGridHeight.d.ts +7 -0
  157. package/ui/Blocks/CommonGrid/hooks/useGetGridHeight.js +33 -0
  158. package/ui/Blocks/CommonGrid/hooks/useManageColumn.d.ts +19 -0
  159. package/ui/Blocks/CommonGrid/hooks/useManageColumn.js +34 -0
  160. package/ui/Blocks/CommonGrid/hooks/useRowsKeyControls.d.ts +4 -0
  161. package/ui/Blocks/CommonGrid/hooks/useRowsKeyControls.js +21 -0
  162. package/ui/Blocks/CommonGrid/hooks/useUxReset.d.ts +3 -0
  163. package/ui/Blocks/CommonGrid/hooks/useUxReset.js +15 -0
  164. package/ui/Blocks/CommonGrid/index.d.ts +7 -0
  165. package/ui/Blocks/CommonGrid/index.js +7 -0
  166. package/ui/Blocks/CommonGrid/store/index.d.ts +58 -0
  167. package/ui/Blocks/CommonGrid/store/index.js +230 -0
  168. package/ui/Blocks/CommonGrid/store/migrateState.d.ts +3 -0
  169. package/ui/Blocks/CommonGrid/store/migrateState.js +14 -0
  170. package/ui/Blocks/CommonGrid/storybook/stories/complexWithPaginationAndRedux.stories.d.ts +11 -0
  171. package/ui/Blocks/CommonGrid/storybook/stories/complexWithPaginationAndRedux.stories.js +31 -0
  172. package/ui/Blocks/CommonGrid/storybook/stories/customControllButtons.stories.d.ts +13 -0
  173. package/ui/Blocks/CommonGrid/storybook/stories/customControllButtons.stories.js +49 -0
  174. package/ui/Blocks/CommonGrid/storybook/stories/default.stories.d.ts +6 -0
  175. package/ui/Blocks/CommonGrid/storybook/stories/default.stories.js +14 -0
  176. package/ui/Blocks/CommonGrid/storybook/stories/loading.stories.d.ts +10 -0
  177. package/ui/Blocks/CommonGrid/storybook/stories/loading.stories.js +11 -0
  178. package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNoScrollLayout.stories.d.ts +10 -0
  179. package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNoScrollLayout.stories.js +12 -0
  180. package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNormalLayout.stories.d.ts +10 -0
  181. package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNormalLayout.stories.js +12 -0
  182. package/ui/Blocks/CommonGrid/storybook/stories/styledCommonGrid.stories.d.ts +6 -0
  183. package/ui/Blocks/CommonGrid/storybook/stories/styledCommonGrid.stories.js +15 -0
  184. package/ui/Blocks/CommonGrid/storybook/stories/withCustomGridActions.stories.d.ts +10 -0
  185. package/ui/Blocks/CommonGrid/storybook/stories/withCustomGridActions.stories.js +15 -0
  186. package/ui/Blocks/CommonGrid/storybook/stories/withForcedCheckboxes.stories.d.ts +14 -0
  187. package/ui/Blocks/CommonGrid/storybook/stories/withForcedCheckboxes.stories.js +24 -0
  188. package/ui/Blocks/CommonGrid/storybook/utils/actions.d.ts +4 -0
  189. package/ui/Blocks/CommonGrid/storybook/utils/actions.js +6 -0
  190. package/ui/Blocks/CommonGrid/storybook/utils/columnDefinition.d.ts +10 -0
  191. package/ui/Blocks/CommonGrid/storybook/utils/columnDefinition.js +97 -0
  192. package/ui/Blocks/CommonGrid/storybook/utils/filters.d.ts +2 -0
  193. package/ui/Blocks/CommonGrid/storybook/utils/filters.js +23 -0
  194. package/ui/Blocks/CommonGrid/storybook/utils/utils.d.ts +17 -0
  195. package/ui/Blocks/CommonGrid/storybook/utils/utils.js +66 -0
  196. package/ui/Blocks/CommonGrid/storybook/utils/withRedux.d.ts +2 -0
  197. package/ui/Blocks/CommonGrid/storybook/utils/withRedux.js +12 -0
  198. package/ui/Blocks/CommonGrid/storybook/utils/withRouter.d.ts +2 -0
  199. package/ui/Blocks/CommonGrid/storybook/utils/withRouter.js +4 -0
  200. package/ui/Blocks/CommonGrid/storybook/utils/withTheme.d.ts +2 -0
  201. package/ui/Blocks/CommonGrid/storybook/utils/withTheme.js +18 -0
  202. package/ui/Blocks/CommonGrid/styles.d.ts +12 -0
  203. package/ui/Blocks/CommonGrid/styles.js +33 -0
  204. package/ui/Blocks/CommonGrid/translations.d.ts +1 -0
  205. package/ui/Blocks/CommonGrid/translations.js +6 -0
  206. package/ui/Blocks/CommonGrid/types.d.ts +313 -0
  207. package/ui/Blocks/CommonGrid/types.js +8 -0
  208. package/ui/Blocks/CommonGrid/utils/index.d.ts +19 -0
  209. package/ui/Blocks/CommonGrid/utils/index.js +78 -0
  210. package/ui/Blocks/CommonGrid/utils/public.d.ts +16 -0
  211. package/ui/Blocks/CommonGrid/utils/public.js +52 -0
  212. package/ui/Blocks/Popover/index.d.ts +10 -0
  213. package/ui/Blocks/Popover/index.js +19 -0
  214. package/ui/Elements/DatePicker/DatePicker.d.ts +20 -0
  215. package/ui/Elements/DatePicker/DatePicker.js +65 -0
  216. package/ui/Elements/DatePicker/Datetime/DateTime.d.ts +95 -0
  217. package/ui/Elements/DatePicker/Datetime/DateTime.js +516 -0
  218. package/ui/Elements/DatePicker/Datetime/components/Timepicker.d.ts +8 -0
  219. package/ui/Elements/DatePicker/Datetime/components/Timepicker.js +57 -0
  220. package/ui/Elements/DatePicker/Datetime/components/ViewNavigation.d.ts +9 -0
  221. package/ui/Elements/DatePicker/Datetime/components/ViewNavigation.js +16 -0
  222. package/ui/Elements/DatePicker/Datetime/types.d.ts +61 -0
  223. package/ui/Elements/DatePicker/Datetime/types.js +7 -0
  224. package/ui/Elements/DatePicker/Datetime/views/DaysView.d.ts +14 -0
  225. package/ui/Elements/DatePicker/Datetime/views/DaysView.js +145 -0
  226. package/ui/Elements/DatePicker/Datetime/views/MonthsView.d.ts +10 -0
  227. package/ui/Elements/DatePicker/Datetime/views/MonthsView.js +111 -0
  228. package/ui/Elements/DatePicker/Datetime/views/YearsView.d.ts +15 -0
  229. package/ui/Elements/DatePicker/Datetime/views/YearsView.js +117 -0
  230. package/ui/Elements/DatePicker/index.d.ts +2 -0
  231. package/ui/Elements/DatePicker/index.js +2 -0
  232. package/ui/Elements/DatePicker/styles.d.ts +2 -0
  233. package/ui/Elements/DatePicker/styles.js +8 -0
  234. package/ui/Elements/DatePicker/utils/getLanguage.d.ts +1 -0
  235. package/ui/Elements/DatePicker/utils/getLanguage.js +10 -0
  236. package/ui/Elements/DropdownMenu/DropdownMenu.d.ts +2 -0
  237. package/ui/Elements/DropdownMenu/DropdownMenu.js +36 -0
  238. package/ui/Elements/DropdownMenu/components/DefaultItem.d.ts +3 -0
  239. package/ui/Elements/DropdownMenu/components/DefaultItem.js +16 -0
  240. package/ui/Elements/DropdownMenu/components/MenuItem.d.ts +3 -0
  241. package/ui/Elements/DropdownMenu/components/MenuItem.js +51 -0
  242. package/ui/Elements/DropdownMenu/components/MenuList.d.ts +3 -0
  243. package/ui/Elements/DropdownMenu/components/MenuList.js +10 -0
  244. package/ui/Elements/DropdownMenu/index.d.ts +1 -0
  245. package/ui/Elements/DropdownMenu/index.js +1 -0
  246. package/ui/Elements/DropdownMenu/types.d.ts +41 -0
  247. package/ui/Elements/DropdownMenu/types.js +1 -0
  248. package/ui/Elements/HighlightBox/HighlightBox.d.ts +50 -0
  249. package/ui/Elements/HighlightBox/HighlightBox.js +65 -0
  250. package/ui/Elements/HighlightBox/index.d.ts +2 -0
  251. package/ui/Elements/HighlightBox/index.js +2 -0
  252. package/ui/Elements/MultiSelect/MultiSelect.d.ts +6 -0
  253. package/ui/Elements/MultiSelect/MultiSelect.js +29 -0
  254. package/ui/Elements/MultiSelect/index.d.ts +2 -0
  255. package/ui/Elements/MultiSelect/index.js +2 -0
  256. package/ui/Elements/Pagination/Pagination.d.ts +1 -1
  257. package/ui/Elements/Pagination/Pagination.js +6 -2
  258. package/ui/Elements/Pagination/styled.js +6 -6
  259. package/ui/Elements/Select/Select.d.ts +3 -0
  260. package/ui/Elements/Select/Select.js +69 -0
  261. package/ui/Elements/Select/index.d.ts +2 -0
  262. package/ui/Elements/Select/index.js +2 -0
  263. package/ui/Elements/Select/styles.d.ts +5 -0
  264. package/ui/Elements/Select/styles.js +12 -0
  265. package/ui/Elements/Select/themes/CustomComponents.d.ts +9 -0
  266. package/ui/Elements/Select/themes/CustomComponents.js +131 -0
  267. package/ui/Elements/Select/themes/baseStyles.d.ts +28 -0
  268. package/ui/Elements/Select/themes/baseStyles.js +70 -0
  269. package/ui/Elements/Select/themes/formStyles.d.ts +23 -0
  270. package/ui/Elements/Select/themes/formStyles.js +104 -0
  271. package/ui/Elements/Select/themes/headingStyles.d.ts +17 -0
  272. package/ui/Elements/Select/themes/headingStyles.js +99 -0
  273. package/ui/Elements/Select/themes/index.d.ts +3 -0
  274. package/ui/Elements/Select/themes/index.js +61 -0
  275. package/ui/Elements/Select/themes/leftMenuStyles.d.ts +18 -0
  276. package/ui/Elements/Select/themes/leftMenuStyles.js +57 -0
  277. package/ui/Elements/Select/types.d.ts +54 -0
  278. package/ui/Elements/Select/types.js +1 -0
  279. package/ui/Elements/SingleSelect/SingleSelect.d.ts +20 -0
  280. package/ui/Elements/SingleSelect/SingleSelect.js +197 -0
  281. package/ui/Elements/SingleSelect/index.d.ts +2 -0
  282. package/ui/Elements/SingleSelect/index.js +2 -0
  283. package/ui/Forms/Input/types.d.ts +2 -2
  284. package/ui/index.es.js +868 -1104
  285. package/ui/index.umd.js +8 -5
@@ -0,0 +1,54 @@
1
+ import { RefObject } from 'react';
2
+ import { SpaceAround } from '../SpaceAround/types';
3
+ import { Theme } from 'react-select';
4
+ export type Option<Value = string | number> = {
5
+ value: Value;
6
+ label: string | number;
7
+ isDisabled?: boolean;
8
+ isFixed?: boolean;
9
+ color?: string;
10
+ index?: number;
11
+ inputValue?: string;
12
+ };
13
+ export type ValueType = Option | Option[] | null;
14
+ export type SelectProps = {
15
+ label?: string;
16
+ name?: string;
17
+ value?: number | string | string[] | Option | Option[];
18
+ placeholder?: string;
19
+ loadingMessage?: (inputValue: string) => string | JSX.Element;
20
+ noOptionsMessage?: (inputValue: string) => string | JSX.Element;
21
+ filterOption?: (option: Option) => boolean;
22
+ options?: Option[];
23
+ loadOptions?: (text: string) => Promise<Option[]>;
24
+ defaultOptions?: Option[];
25
+ onChange: (value: ValueType) => void;
26
+ onBlur?: Function;
27
+ error?: string;
28
+ index?: [];
29
+ isInvalid?: boolean;
30
+ isLoading?: boolean;
31
+ spaceAround?: SpaceAround;
32
+ disabled?: boolean;
33
+ onInputChange?: Function;
34
+ useSimplifiedOptions?: boolean;
35
+ showSelectAllButton?: boolean;
36
+ showResetGridButton?: boolean;
37
+ isClearable?: boolean;
38
+ isSearchable?: boolean;
39
+ isMulti?: boolean;
40
+ menuIsOpen?: boolean;
41
+ defaultMenuIsOpen?: boolean;
42
+ isDarkPlaceholderText?: boolean;
43
+ style?: 'form' | 'leftMenu' | 'heading' | 'gridFilter';
44
+ optionVariant?: 'default' | 'checkbox' | 'toggle';
45
+ multiLabelVariant?: 'default' | 'count';
46
+ containerVariant?: 'default' | 'search';
47
+ placeholderIcon?: string;
48
+ innerRef?: RefObject<HTMLElement>;
49
+ className?: string;
50
+ maxMenuHeight?: number;
51
+ resetGrid?: Function;
52
+ getOptionValue?: Function;
53
+ systemTheme?: Theme;
54
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,20 @@
1
+ import { SelectProps, Option } from '../Select/types';
2
+ type FieldValueType = string | number | (string | number)[] | null;
3
+ export type Props = Omit<SelectProps, 'onChange' | 'loadOptions'> & {
4
+ onChange: (event: {
5
+ target: {
6
+ [key: string]: FieldValueType;
7
+ };
8
+ }) => void;
9
+ onValueChange?: Function;
10
+ asyncLoadMinChars?: number;
11
+ preload?: boolean;
12
+ isLocked?: boolean;
13
+ lockedText?: string;
14
+ onCreateOption?: (label: string) => Promise<Option<string>>;
15
+ initialOptions?: Option[];
16
+ loadOptions?: (fulltext: string, byId: boolean) => Promise<Option[]>;
17
+ form?: any;
18
+ };
19
+ declare const SingleSelect: (props: Props) => JSX.Element;
20
+ export default SingleSelect;
@@ -0,0 +1,197 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
+ return new (P || (P = Promise))(function (resolve, reject) {
15
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
19
+ });
20
+ };
21
+ var __generator = (this && this.__generator) || function (thisArg, body) {
22
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
+ function verb(n) { return function (v) { return step([n, v]); }; }
25
+ function step(op) {
26
+ if (f) throw new TypeError("Generator is already executing.");
27
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
28
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
+ if (y = 0, t) op = [op[0] & 2, t.value];
30
+ switch (op[0]) {
31
+ case 0: case 1: t = op; break;
32
+ case 4: _.label++; return { value: op[1], done: false };
33
+ case 5: _.label++; y = op[1]; op = [0]; continue;
34
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
+ default:
36
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
+ if (t[2]) _.ops.pop();
41
+ _.trys.pop(); continue;
42
+ }
43
+ op = body.call(thisArg, _);
44
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
+ }
47
+ };
48
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
49
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
50
+ if (ar || !(i in from)) {
51
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
52
+ ar[i] = from[i];
53
+ }
54
+ }
55
+ return to.concat(ar || Array.prototype.slice.call(from));
56
+ };
57
+ import { jsx as _jsx } from "react/jsx-runtime";
58
+ import { useCallback, useEffect, useMemo, useState } from 'react';
59
+ import { createFilter } from 'react-select';
60
+ import Select from '../Select';
61
+ import omit from 'lodash/fp/omit';
62
+ import { t } from '@lingui/macro';
63
+ import { nanoid } from 'nanoid';
64
+ var CREATE = "_create_".concat(nanoid(), "_");
65
+ var defaultFilterOption = createFilter();
66
+ var creatableFilterOption = function (option, rawInput) {
67
+ if ((option === null || option === void 0 ? void 0 : option.value) == CREATE)
68
+ return true;
69
+ return defaultFilterOption(option, rawInput);
70
+ };
71
+ var getOptionValue = function (selectedOption) {
72
+ if (selectedOption === null) {
73
+ return null;
74
+ }
75
+ else if (Array.isArray(selectedOption)) {
76
+ return selectedOption.map(function (option) { return option.value; });
77
+ }
78
+ else {
79
+ return selectedOption.value;
80
+ }
81
+ };
82
+ var SingleSelect = function (props) {
83
+ var name = props.name, onChange = props.onChange, onBlur = props.onBlur, onValueChange = props.onValueChange, loadOptions = props.loadOptions, _a = props.asyncLoadMinChars, asyncLoadMinChars = _a === void 0 ? 0 : _a, isLocked = props.isLocked, _b = props.lockedText, lockedText = _b === void 0 ? t({ id: 'components.dropdown.notReact', message: 'Select related values first...' }) : _b, disabled = props.disabled, _c = props.placeholder, placeholder = _c === void 0 ? t({ id: 'components.dropdown.placeholder', message: 'Select...' }) : _c, preload = props.preload, initialOptions = props.initialOptions, onCreateOption = props.onCreateOption, options = props.options, filterOption = props.filterOption;
84
+ var _d = useState(false), isCreating = _d[0], setIsCreating = _d[1];
85
+ var asAsync = !!loadOptions || !!onCreateOption;
86
+ var loadingMessage = useCallback(function () { return t({ id: 'components.dropdown.loading', message: 'Loading...' }); }, []);
87
+ var noOptionsMessage = useCallback(function (inputValue) {
88
+ return loadOptions && inputValue.length < asyncLoadMinChars
89
+ ? t({
90
+ id: 'components.dropdown.writeMoreChars',
91
+ message: 'Write at least ${asyncLoadMinChars} characters.',
92
+ })
93
+ : t({ id: 'components.dropdown.noOptions', message: 'No options' });
94
+ }, [loadOptions, asyncLoadMinChars]);
95
+ var handleLoadOptions = useCallback(function (inputValue) {
96
+ if (onCreateOption) {
97
+ if (!inputValue.trim())
98
+ return Promise.resolve(options || []);
99
+ return Promise.resolve(__spreadArray(__spreadArray([], (options || []), true), [
100
+ {
101
+ value: CREATE,
102
+ label: "".concat(inputValue, " (").concat(t({ id: 'components.dropdown.newOption', message: 'new value' }), ")"),
103
+ inputValue: inputValue,
104
+ },
105
+ ], false));
106
+ }
107
+ else if (!loadOptions || inputValue.length < asyncLoadMinChars) {
108
+ return Promise.resolve([]);
109
+ }
110
+ else {
111
+ return loadOptions(inputValue, false);
112
+ }
113
+ }, [onCreateOption, loadOptions, asyncLoadMinChars, options]);
114
+ var _e = useState(options || []), loadedDefaultOptions = _e[0], setLoadedDefaultOptions = _e[1];
115
+ useEffect(function () {
116
+ if (loadOptions && preload && !props.value)
117
+ loadOptions('', false).then(setLoadedDefaultOptions);
118
+ // eslint-disable-next-line react-hooks/exhaustive-deps
119
+ }, [loadOptions]); // this is intentional
120
+ var _f = useState(null), storedSelectedOption = _f[0], setStoredSelectedOption = _f[1];
121
+ useEffect(function () {
122
+ if (initialOptions && initialOptions.length) {
123
+ var selectedOption = initialOptions.find(function (option) { return option.value == props.value; }) || null;
124
+ setStoredSelectedOption(selectedOption);
125
+ }
126
+ if (loadOptions && !initialOptions && props.value) {
127
+ loadOptions(String(props.value), true).then(function (selectedOptions) { return setStoredSelectedOption((selectedOptions === null || selectedOptions === void 0 ? void 0 : selectedOptions[0]) || null); });
128
+ }
129
+ // ignored because of props.value, this only finds option for initial value
130
+ // eslint-disable-next-line react-hooks/exhaustive-deps
131
+ }, [initialOptions, setStoredSelectedOption]);
132
+ var handleChange = useCallback(function (option) { return __awaiter(void 0, void 0, void 0, function () {
133
+ var value, newOption;
134
+ var _a, _b, _c, _d;
135
+ return __generator(this, function (_e) {
136
+ switch (_e.label) {
137
+ case 0:
138
+ if (!(onCreateOption && (option === null || option === void 0 ? void 0 : option.value) == CREATE)) return [3 /*break*/, 4];
139
+ if (!((option === null || option === void 0 ? void 0 : option.inputValue) && ((_b = (_a = option === null || option === void 0 ? void 0 : option.inputValue) === null || _a === void 0 ? void 0 : _a.trim()) === null || _b === void 0 ? void 0 : _b.length) < 2)) return [3 /*break*/, 1];
140
+ props === null || props === void 0 ? void 0 : props.form.setFieldTouched(name, true, true);
141
+ props === null || props === void 0 ? void 0 : props.form.setFieldError(name, t({ id: 'form.general.min2Chars', message: 'Minimal length is 2 characters.' }));
142
+ return [2 /*return*/];
143
+ case 1:
144
+ setIsCreating(true);
145
+ return [4 /*yield*/, onCreateOption((_d = (_c = option === null || option === void 0 ? void 0 : option.inputValue) === null || _c === void 0 ? void 0 : _c.trim()) !== null && _d !== void 0 ? _d : '')];
146
+ case 2:
147
+ newOption = _e.sent();
148
+ value = getOptionValue(newOption);
149
+ setIsCreating(false);
150
+ _e.label = 3;
151
+ case 3: return [3 /*break*/, 5];
152
+ case 4:
153
+ value = getOptionValue(option);
154
+ loadOptions && setStoredSelectedOption(option);
155
+ _e.label = 5;
156
+ case 5:
157
+ if (onChange) {
158
+ onChange({
159
+ target: {
160
+ name: name !== null && name !== void 0 ? name : '',
161
+ type: 'change',
162
+ value: value,
163
+ },
164
+ });
165
+ }
166
+ if (onValueChange) {
167
+ onValueChange(value);
168
+ }
169
+ return [2 /*return*/];
170
+ }
171
+ });
172
+ }); }, [onCreateOption, loadOptions, onChange, onValueChange, props === null || props === void 0 ? void 0 : props.form, name]);
173
+ var handleBlur = useCallback(function (option) {
174
+ if (onBlur) {
175
+ onBlur({
176
+ target: {
177
+ name: name,
178
+ type: 'blur',
179
+ value: getOptionValue(option),
180
+ },
181
+ });
182
+ }
183
+ }, [name, onBlur]);
184
+ var omitted = ['onValueChange', 'placeholder', 'options', 'loadOptions', 'asyncLoadMinChars'];
185
+ var displayLockedText = isLocked && !disabled;
186
+ var placeholderValue = displayLockedText ? lockedText : placeholder;
187
+ var defaultOptions = useMemo(function () {
188
+ if (!asAsync)
189
+ return undefined; // relates only to asAsync true
190
+ var staticOptions = onCreateOption ? options : loadedDefaultOptions;
191
+ if (!storedSelectedOption)
192
+ return staticOptions || undefined;
193
+ return staticOptions ? __spreadArray(__spreadArray([], staticOptions, true), [storedSelectedOption], false) : [storedSelectedOption];
194
+ }, [asAsync, loadedDefaultOptions, onCreateOption, options, storedSelectedOption]);
195
+ return (_jsx(Select, __assign({}, omit(omitted, props), { filterOption: (filterOption || creatableFilterOption), disabled: disabled || isLocked, onChange: handleChange, onBlur: handleBlur, placeholder: placeholderValue, loadingMessage: loadingMessage, noOptionsMessage: noOptionsMessage, loadOptions: asAsync ? handleLoadOptions : undefined, containerVariant: asAsync ? 'search' : undefined, defaultOptions: defaultOptions, options: !asAsync ? options : undefined, isLoading: isCreating || props.isLoading })));
196
+ };
197
+ export default SingleSelect;
@@ -0,0 +1,2 @@
1
+ import SingleSelect from './SingleSelect';
2
+ export default SingleSelect;
@@ -0,0 +1,2 @@
1
+ import SingleSelect from './SingleSelect';
2
+ export default SingleSelect;
@@ -1,4 +1,4 @@
1
- import { ChangeEvent, Dispatch, FocusEvent, InputHTMLAttributes, MouseEvent, ReactNode, RefObject, SetStateAction } from 'react';
1
+ import { ChangeEvent, Dispatch, FocusEvent, InputHTMLAttributes, MouseEvent, ReactElement, ReactNode, RefObject, SetStateAction } from 'react';
2
2
  export type SpaceAround = boolean | SpaceAroundProps;
3
3
  export type SpaceAroundProps = {
4
4
  marginTop?: number;
@@ -27,7 +27,7 @@ export type InputProps = InputHTMLAttributes<HTMLInputElement> & {
27
27
  onEnter?: () => void;
28
28
  onClear?: () => void;
29
29
  alwaysShowClear?: boolean;
30
- error?: string;
30
+ error?: string | ReactElement;
31
31
  isInvalid?: boolean;
32
32
  spaceAround?: SpaceAround;
33
33
  isLoading?: boolean;