@finsemble/finsemble-ui 6.2.1 → 6.3.1-beta-1

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 (749) hide show
  1. package/package.json +27 -22
  2. package/react/actions/smartDesktopDesignerActions.d.ts +7 -8
  3. package/react/actions/smartDesktopDesignerActions.js.map +1 -1
  4. package/react/actions/toolbarActions.d.ts +2 -3
  5. package/react/actions/toolbarActions.js.map +1 -1
  6. package/react/assets/css/button.css +2 -1
  7. package/react/assets/css/notificationsCenter.css +4 -2
  8. package/react/assets/css/userPreferences.css +1 -0
  9. package/react/assets/css/windowTitleBar.css +33 -1
  10. package/react/componentTemplateGenerator.js.map +1 -1
  11. package/react/components/FinsembleProvider.js +1 -1
  12. package/react/components/FinsembleProvider.js.map +1 -1
  13. package/react/components/appCatalog/AppCatalogComponent.js +7 -13
  14. package/react/components/appCatalog/AppCatalogComponent.js.map +1 -1
  15. package/react/components/appCatalog/components/AppList.d.ts +7 -1
  16. package/react/components/appCatalog/components/AppList.js +1 -1
  17. package/react/components/appCatalog/components/AppList.js.map +1 -1
  18. package/react/components/appCatalog/components/AppResults.d.ts +10 -8
  19. package/react/components/appCatalog/components/AppResults.js +1 -1
  20. package/react/components/appCatalog/components/AppResults.js.map +1 -1
  21. package/react/components/appCatalog/components/Carousel.js +1 -1
  22. package/react/components/appCatalog/components/Carousel.js.map +1 -1
  23. package/react/components/appCatalog/components/EmptyResults.d.ts +2 -1
  24. package/react/components/appCatalog/components/EmptyResults.js +2 -4
  25. package/react/components/appCatalog/components/EmptyResults.js.map +1 -1
  26. package/react/components/appCatalog/components/Hero.d.ts +24 -4
  27. package/react/components/appCatalog/components/Hero.js +2 -1
  28. package/react/components/appCatalog/components/Hero.js.map +1 -1
  29. package/react/components/appCatalog/components/Home.d.ts +18 -4
  30. package/react/components/appCatalog/components/Home.js.map +1 -1
  31. package/react/components/appCatalog/components/SearchBar.d.ts +20 -7
  32. package/react/components/appCatalog/components/SearchBar.js +4 -7
  33. package/react/components/appCatalog/components/SearchBar.js.map +1 -1
  34. package/react/components/appCatalog/components/Showcase/AppDescription.d.ts +5 -3
  35. package/react/components/appCatalog/components/Showcase/AppDescription.js +4 -6
  36. package/react/components/appCatalog/components/Showcase/AppDescription.js.map +1 -1
  37. package/react/components/appCatalog/components/Showcase/AppDevNotes.d.ts +5 -4
  38. package/react/components/appCatalog/components/Showcase/AppDevNotes.js.map +1 -1
  39. package/react/components/appCatalog/components/Showcase/AppShowcase.js +1 -1
  40. package/react/components/appCatalog/components/Showcase/AppShowcase.js.map +1 -1
  41. package/react/components/appCatalog/components/Showcase/Header.d.ts +13 -5
  42. package/react/components/appCatalog/components/Showcase/Header.js +2 -2
  43. package/react/components/appCatalog/components/Showcase/Header.js.map +1 -1
  44. package/react/components/appCatalog/components/Showcase/Modal.d.ts +7 -4
  45. package/react/components/appCatalog/components/Showcase/Modal.js +6 -6
  46. package/react/components/appCatalog/components/Showcase/Modal.js.map +1 -1
  47. package/react/components/appCatalog/components/Showcase/defaults.d.ts +3 -3
  48. package/react/components/appCatalog/components/Showcase/defaults.js.map +1 -1
  49. package/react/components/appCatalog/components/Tag.d.ts +6 -4
  50. package/react/components/appCatalog/components/Tag.js.map +1 -1
  51. package/react/components/appCatalog/components/Toast.d.ts +5 -3
  52. package/react/components/appCatalog/components/Toast.js +5 -5
  53. package/react/components/appCatalog/components/Toast.js.map +1 -1
  54. package/react/components/appCatalog/components/helpers.js +2 -1
  55. package/react/components/appCatalog/components/helpers.js.map +1 -1
  56. package/react/components/appCatalog/modules/AppDirectory.d.ts +5 -1
  57. package/react/components/appCatalog/modules/AppDirectory.js.map +1 -1
  58. package/react/components/appCatalog/modules/FDC3.d.ts +12 -11
  59. package/react/components/appCatalog/modules/FDC3.js +39 -48
  60. package/react/components/appCatalog/modules/FDC3.js.map +1 -1
  61. package/react/components/appCatalog/stores/appStore.d.ts +9 -2
  62. package/react/components/appCatalog/stores/appStore.js +10 -4
  63. package/react/components/appCatalog/stores/appStore.js.map +1 -1
  64. package/react/components/appCatalog/stores/storeActions.js +96 -98
  65. package/react/components/appCatalog/stores/storeActions.js.map +1 -1
  66. package/react/components/common/Button.d.ts +4 -4
  67. package/react/components/common/Button.js +1 -1
  68. package/react/components/common/Button.js.map +1 -1
  69. package/react/components/common/ButtonIcon.js +1 -1
  70. package/react/components/common/ButtonIcon.js.map +1 -1
  71. package/react/components/common/ColorPicker.js +1 -1
  72. package/react/components/common/ColorPicker.js.map +1 -1
  73. package/react/components/common/DropZone.d.ts +0 -5
  74. package/react/components/common/DropZone.js.map +1 -1
  75. package/react/components/common/DropdownButton.js +1 -1
  76. package/react/components/common/DropdownButton.js.map +1 -1
  77. package/react/components/common/FileInput.d.ts +0 -5
  78. package/react/components/common/FileInput.js +7 -9
  79. package/react/components/common/FileInput.js.map +1 -1
  80. package/react/components/common/FinsembleIcon.d.ts +2 -2
  81. package/react/components/common/FinsembleIcon.js.map +1 -1
  82. package/react/components/common/FinsembleSelect.js +2 -5
  83. package/react/components/common/FinsembleSelect.js.map +1 -1
  84. package/react/components/common/FinsembleToggle.js +2 -2
  85. package/react/components/common/FinsembleToggle.js.map +1 -1
  86. package/react/components/common/FontSizeSelector.js +2 -2
  87. package/react/components/common/FontSizeSelector.js.map +1 -1
  88. package/react/components/common/ImagePreview.js +2 -2
  89. package/react/components/common/ImagePreview.js.map +1 -1
  90. package/react/components/common/Tab.js +2 -1
  91. package/react/components/common/Tab.js.map +1 -1
  92. package/react/components/common/file_helpers.js +3 -2
  93. package/react/components/common/file_helpers.js.map +1 -1
  94. package/react/components/common/helpers.js +12 -10
  95. package/react/components/common/helpers.js.map +1 -1
  96. package/react/components/common/stories/Button.stories.js +1 -1
  97. package/react/components/common/stories/Button.stories.js.map +1 -1
  98. package/react/components/common/stories/ButtonIcon.stories.js +1 -1
  99. package/react/components/common/stories/ButtonIcon.stories.js.map +1 -1
  100. package/react/components/common/stories/ButtonRow.stories.js +2 -2
  101. package/react/components/common/stories/ButtonRow.stories.js.map +1 -1
  102. package/react/components/common/stories/ButtonTile.stories.js +1 -1
  103. package/react/components/common/stories/ButtonTile.stories.js.map +1 -1
  104. package/react/components/common/stories/Checkbox.stories.js +1 -1
  105. package/react/components/common/stories/Checkbox.stories.js.map +1 -1
  106. package/react/components/common/stories/ColorPicker.stories.js +1 -1
  107. package/react/components/common/stories/ColorPicker.stories.js.map +1 -1
  108. package/react/components/common/stories/DropZone.stories.js +1 -1
  109. package/react/components/common/stories/DropZone.stories.js.map +1 -1
  110. package/react/components/common/stories/FinsembleIcon.stories.js.map +1 -1
  111. package/react/components/common/stories/FinsembleSelect.stories.js +1 -1
  112. package/react/components/common/stories/FinsembleSelect.stories.js.map +1 -1
  113. package/react/components/common/stories/FinsembleToggle.stories.js +3 -1
  114. package/react/components/common/stories/FinsembleToggle.stories.js.map +1 -1
  115. package/react/components/common/stories/FontSizeSelector.stories.js +1 -1
  116. package/react/components/common/stories/FontSizeSelector.stories.js.map +1 -1
  117. package/react/components/common/stories/Header.stories.js +1 -1
  118. package/react/components/common/stories/Header.stories.js.map +1 -1
  119. package/react/components/common/tests/Checkbox.spec.js +4 -4
  120. package/react/components/common/tests/Checkbox.spec.js.map +1 -1
  121. package/react/components/common/tests/ColorPicker.spec.js +6 -6
  122. package/react/components/common/tests/ColorPicker.spec.js.map +1 -1
  123. package/react/components/common/tests/DropZone.spec.js +4 -4
  124. package/react/components/common/tests/DropZone.spec.js.map +1 -1
  125. package/react/components/common/tests/FileInput.spec.js +5 -5
  126. package/react/components/common/tests/FileInput.spec.js.map +1 -1
  127. package/react/components/common/tests/FinsembleSelect.spec.js +12 -11
  128. package/react/components/common/tests/FinsembleSelect.spec.js.map +1 -1
  129. package/react/components/common/tests/FinsembleToggle.spec.js +8 -2
  130. package/react/components/common/tests/FinsembleToggle.spec.js.map +1 -1
  131. package/react/components/common/tests/Header.spec.js +3 -3
  132. package/react/components/common/tests/Header.spec.js.map +1 -1
  133. package/react/components/common/tests/ImagePreview.spec.js +8 -8
  134. package/react/components/common/tests/ImagePreview.spec.js.map +1 -1
  135. package/react/components/common/tests/Tab.spec.js +3 -3
  136. package/react/components/common/tests/Tab.spec.js.map +1 -1
  137. package/react/components/common/tests/Tooltip.spec.js +5 -5
  138. package/react/components/common/tests/Tooltip.spec.js.map +1 -1
  139. package/react/components/favorites/FavoriteMaker.d.ts +0 -5
  140. package/react/components/favorites/FavoriteMaker.js +1 -1
  141. package/react/components/favorites/FavoriteMaker.js.map +1 -1
  142. package/react/components/favorites/FavoritesShell.js +1 -1
  143. package/react/components/favorites/FavoritesShell.js.map +1 -1
  144. package/react/components/favorites/FavoritesShell.spec.js +7 -7
  145. package/react/components/favorites/FavoritesShell.spec.js.map +1 -1
  146. package/react/components/favorites/FavoritesShell.stories.js +5 -4
  147. package/react/components/favorites/FavoritesShell.stories.js.map +1 -1
  148. package/react/components/fdc3Resolver/ResolverContainer.js +2 -1
  149. package/react/components/fdc3Resolver/ResolverContainer.js.map +1 -1
  150. package/react/components/fdc3Resolver/ResolverDialog.js +13 -13
  151. package/react/components/fdc3Resolver/ResolverDialog.js.map +1 -1
  152. package/react/components/fdc3Resolver/ResolverDialog.spec.js +5 -5
  153. package/react/components/fdc3Resolver/ResolverDialog.spec.js.map +1 -1
  154. package/react/components/fdc3Resolver/ResolverDialog.stories.js +1 -1
  155. package/react/components/fdc3Resolver/ResolverDialog.stories.js.map +1 -1
  156. package/react/components/icon/Icon.js +5 -4
  157. package/react/components/icon/Icon.js.map +1 -1
  158. package/react/components/legacyControls/FinsembleDialog.js +0 -1
  159. package/react/components/legacyControls/FinsembleDialog.js.map +1 -1
  160. package/react/components/legacyControls/FinsembleDialogButton.d.ts +1 -1
  161. package/react/components/legacyControls/FinsembleDialogButton.js +4 -3
  162. package/react/components/legacyControls/FinsembleDialogButton.js.map +1 -1
  163. package/react/components/legacyControls/FinsembleDialogQuestion.js +2 -1
  164. package/react/components/legacyControls/FinsembleDialogQuestion.js.map +1 -1
  165. package/react/components/legacyControls/FinsembleDialogTextInput.d.ts +1 -1
  166. package/react/components/legacyControls/FinsembleDialogTextInput.js +8 -5
  167. package/react/components/legacyControls/FinsembleDialogTextInput.js.map +1 -1
  168. package/react/components/legacyControls/FinsembleDnDContext.js +34 -22
  169. package/react/components/legacyControls/FinsembleDnDContext.js.map +1 -1
  170. package/react/components/legacyControls/FinsembleDraggable.js +3 -3
  171. package/react/components/legacyControls/FinsembleDraggable.js.map +1 -1
  172. package/react/components/legacyControls/FinsembleHoverDetector.js +2 -1
  173. package/react/components/legacyControls/FinsembleHoverDetector.js.map +1 -1
  174. package/react/components/legacyControls/FinsembleMenuSection.js +9 -5
  175. package/react/components/legacyControls/FinsembleMenuSection.js.map +1 -1
  176. package/react/components/legacyControls/stories/FinsembleDialog.stories.js +1 -1
  177. package/react/components/legacyControls/stories/FinsembleDialog.stories.js.map +1 -1
  178. package/react/components/legacyControls/stories/FinsembleDialogButton.stories.js +1 -1
  179. package/react/components/legacyControls/stories/FinsembleDialogButton.stories.js.map +1 -1
  180. package/react/components/legacyControls/stories/FinsembleDialogQuestion.stories.js +1 -1
  181. package/react/components/legacyControls/stories/FinsembleDialogQuestion.stories.js.map +1 -1
  182. package/react/components/legacyControls/stories/FinsembleDialogTextInput.stories.js +1 -1
  183. package/react/components/legacyControls/stories/FinsembleDialogTextInput.stories.js.map +1 -1
  184. package/react/components/legacyControls/tests/FinsembleDialog.spec.js +1 -1
  185. package/react/components/legacyControls/tests/FinsembleDialog.spec.js.map +1 -1
  186. package/react/components/legacyControls/tests/FinsembleDialogButton.spec.js +8 -7
  187. package/react/components/legacyControls/tests/FinsembleDialogButton.spec.js.map +1 -1
  188. package/react/components/legacyControls/tests/FinsembleDialogQuestion.spec.js +7 -5
  189. package/react/components/legacyControls/tests/FinsembleDialogQuestion.spec.js.map +1 -1
  190. package/react/components/legacyControls/tests/FinsembleDialogTextInput.spec.js +13 -12
  191. package/react/components/legacyControls/tests/FinsembleDialogTextInput.spec.js.map +1 -1
  192. package/react/components/linker/LinkerMenu.js +4 -3
  193. package/react/components/linker/LinkerMenu.js.map +1 -1
  194. package/react/components/linker/LinkerMenuDeprecated.js +1 -1
  195. package/react/components/linker/LinkerMenuDeprecated.js.map +1 -1
  196. package/react/components/linker/remoteRedux.d.ts +10 -42
  197. package/react/components/linker/remoteRedux.js.map +1 -1
  198. package/react/components/menu/Menu.d.ts +1 -1
  199. package/react/components/menu/Menu.js +1 -1
  200. package/react/components/menu/Menu.js.map +1 -1
  201. package/react/components/menu/MenuAutoResizer.js.map +1 -1
  202. package/react/components/menu/MenuContent.js +1 -2
  203. package/react/components/menu/MenuContent.js.map +1 -1
  204. package/react/components/menu/MenuHotKey.js +1 -1
  205. package/react/components/menu/MenuHotKey.js.map +1 -1
  206. package/react/components/menu/MenuPortal.js +7 -6
  207. package/react/components/menu/MenuPortal.js.map +1 -1
  208. package/react/components/menu/keyboardNavigation.js +14 -15
  209. package/react/components/menu/keyboardNavigation.js.map +1 -1
  210. package/react/components/notifications/components/NoNotifications.js +2 -4
  211. package/react/components/notifications/components/NoNotifications.js.map +1 -1
  212. package/react/components/notifications/components/drawer/Drawer.js +2 -4
  213. package/react/components/notifications/components/drawer/Drawer.js.map +1 -1
  214. package/react/components/notifications/components/drawer/DrawerControls.js +3 -5
  215. package/react/components/notifications/components/drawer/DrawerControls.js.map +1 -1
  216. package/react/components/notifications/components/drawer/DrawerHeader.js +1 -4
  217. package/react/components/notifications/components/drawer/DrawerHeader.js.map +1 -1
  218. package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js +64 -79
  219. package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js.map +1 -1
  220. package/react/components/notifications/components/notificationsToasts/NotificationsToasts.js +15 -13
  221. package/react/components/notifications/components/notificationsToasts/NotificationsToasts.js.map +1 -1
  222. package/react/components/notifications/components/shared/CheckButton.d.ts +2 -2
  223. package/react/components/notifications/components/shared/CheckButton.js.map +1 -1
  224. package/react/components/notifications/components/shared/IconButton.js +3 -5
  225. package/react/components/notifications/components/shared/IconButton.js.map +1 -1
  226. package/react/components/notifications/components/shared/NotificationCardShell.d.ts +3 -2
  227. package/react/components/notifications/components/shared/NotificationCardShell.js.map +1 -1
  228. package/react/components/notifications/components/shared/OverflowMenu.d.ts +2 -1
  229. package/react/components/notifications/components/shared/OverflowMenu.js +6 -5
  230. package/react/components/notifications/components/shared/OverflowMenu.js.map +1 -1
  231. package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyActions.d.ts +3 -2
  232. package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyActions.js +2 -2
  233. package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyActions.js.map +1 -1
  234. package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.d.ts +3 -2
  235. package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.js.map +1 -1
  236. package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.d.ts +3 -2
  237. package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.js +2 -4
  238. package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.js.map +1 -1
  239. package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderShell.d.ts +3 -2
  240. package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderShell.js.map +1 -1
  241. package/react/components/notifications/components/views/CardView.js +15 -24
  242. package/react/components/notifications/components/views/CardView.js.map +1 -1
  243. package/react/components/notifications/components/views/ListView.d.ts +2 -2
  244. package/react/components/notifications/components/views/ListView.js +9 -9
  245. package/react/components/notifications/components/views/ListView.js.map +1 -1
  246. package/react/components/notifications/components/views/NotificationDetailsView.d.ts +2 -2
  247. package/react/components/notifications/components/views/NotificationDetailsView.js +2 -6
  248. package/react/components/notifications/components/views/NotificationDetailsView.js.map +1 -1
  249. package/react/components/notifications/constants.d.ts +0 -13
  250. package/react/components/notifications/constants.js.map +1 -1
  251. package/react/components/notifications/types.d.ts +7 -6
  252. package/react/components/notifications/types.js.map +1 -1
  253. package/react/components/notifications/utils.d.ts +6 -4
  254. package/react/components/notifications/utils.js +26 -32
  255. package/react/components/notifications/utils.js.map +1 -1
  256. package/react/components/processMonitor/ProcessMonitor.d.ts +3 -1
  257. package/react/components/processMonitor/ProcessMonitor.js +24 -14
  258. package/react/components/processMonitor/ProcessMonitor.js.map +1 -1
  259. package/react/components/processMonitor/ProcessMonitorTypes.d.ts +33 -0
  260. package/react/components/processMonitor/ProcessMonitorTypes.js +6 -0
  261. package/react/components/processMonitor/ProcessMonitorTypes.js.map +1 -0
  262. package/react/components/processMonitor/components/ChildWindow.d.ts +10 -3
  263. package/react/components/processMonitor/components/ChildWindow.js +29 -10
  264. package/react/components/processMonitor/components/ChildWindow.js.map +1 -1
  265. package/react/components/processMonitor/components/ListHeader.d.ts +18 -4
  266. package/react/components/processMonitor/components/ListHeader.js +11 -3
  267. package/react/components/processMonitor/components/ListHeader.js.map +1 -1
  268. package/react/components/processMonitor/components/ProcessStatistics.d.ts +11 -3
  269. package/react/components/processMonitor/components/ProcessStatistics.js +35 -18
  270. package/react/components/processMonitor/components/ProcessStatistics.js.map +1 -1
  271. package/react/components/processMonitor/constants.d.ts +11 -16
  272. package/react/components/processMonitor/constants.js +6 -1
  273. package/react/components/processMonitor/constants.js.map +1 -1
  274. package/react/components/processMonitor/helpers.d.ts +14 -6
  275. package/react/components/processMonitor/helpers.js +31 -23
  276. package/react/components/processMonitor/helpers.js.map +1 -1
  277. package/react/components/processMonitor/helpers.spec.d.ts +1 -0
  278. package/react/components/processMonitor/helpers.spec.js +44 -0
  279. package/react/components/processMonitor/helpers.spec.js.map +1 -0
  280. package/react/components/processMonitor/stores/ProcessMonitorStore.d.ts +31 -15
  281. package/react/components/processMonitor/stores/ProcessMonitorStore.js +104 -95
  282. package/react/components/processMonitor/stores/ProcessMonitorStore.js.map +1 -1
  283. package/react/components/quickComponentForm/QuickComponentForm.d.ts +4 -1
  284. package/react/components/quickComponentForm/QuickComponentForm.js +14 -15
  285. package/react/components/quickComponentForm/QuickComponentForm.js.map +1 -1
  286. package/react/components/search/Highlight.js +2 -2
  287. package/react/components/search/Highlight.js.map +1 -1
  288. package/react/components/search/Highlight.spec.js +3 -3
  289. package/react/components/search/Highlight.spec.js.map +1 -1
  290. package/react/components/search/Highlight.stories.js +1 -1
  291. package/react/components/search/Highlight.stories.js.map +1 -1
  292. package/react/components/search/Search.js +17 -8
  293. package/react/components/search/Search.js.map +1 -1
  294. package/react/components/search/SearchBestMatch.js +3 -5
  295. package/react/components/search/SearchBestMatch.js.map +1 -1
  296. package/react/components/search/SearchProviderResults.js +4 -5
  297. package/react/components/search/SearchProviderResults.js.map +1 -1
  298. package/react/components/search/SearchResult.js +3 -2
  299. package/react/components/search/SearchResult.js.map +1 -1
  300. package/react/components/search/SearchResults.js +1 -1
  301. package/react/components/search/SearchResults.js.map +1 -1
  302. package/react/components/shared/Button.js +2 -4
  303. package/react/components/shared/Button.js.map +1 -1
  304. package/react/components/shared/DefaultDropdownButton.js +58 -13
  305. package/react/components/shared/DefaultDropdownButton.js.map +1 -1
  306. package/react/components/shared/NavigationButton.js +9 -11
  307. package/react/components/shared/NavigationButton.js.map +1 -1
  308. package/react/components/shared/Tag.d.ts +11 -1
  309. package/react/components/shared/Tag.js.map +1 -1
  310. package/react/components/shared/TagsMenu.d.ts +26 -6
  311. package/react/components/shared/TagsMenu.js.map +1 -1
  312. package/react/components/shared/linkerUtil.d.ts +3 -1
  313. package/react/components/shared/linkerUtil.js.map +1 -1
  314. package/react/components/shared/tests/DefaultDropdownButton.spec.js.map +1 -1
  315. package/react/components/shared/tests/addProtocolToValidURL.spec.js.map +1 -1
  316. package/react/components/singleInputDialog/SingleInputDialog.js +0 -2
  317. package/react/components/singleInputDialog/SingleInputDialog.js.map +1 -1
  318. package/react/components/singleInputDialog/SingleInputDialog.spec.js +6 -6
  319. package/react/components/singleInputDialog/SingleInputDialog.spec.js.map +1 -1
  320. package/react/components/singleInputDialog/SingleInputDialog.stories.js +1 -1
  321. package/react/components/singleInputDialog/SingleInputDialog.stories.js.map +1 -1
  322. package/react/components/smartDesktopDesigner/AppEditAccess.d.ts +1 -1
  323. package/react/components/smartDesktopDesigner/AppEditAccess.js +17 -34
  324. package/react/components/smartDesktopDesigner/AppEditAccess.js.map +1 -1
  325. package/react/components/smartDesktopDesigner/AppEditPage.d.ts +4 -4
  326. package/react/components/smartDesktopDesigner/AppEditPage.js +2 -2
  327. package/react/components/smartDesktopDesigner/AppEditPage.js.map +1 -1
  328. package/react/components/smartDesktopDesigner/Appearance.js +3 -5
  329. package/react/components/smartDesktopDesigner/Appearance.js.map +1 -1
  330. package/react/components/smartDesktopDesigner/Application.d.ts +7 -5
  331. package/react/components/smartDesktopDesigner/Application.js +78 -92
  332. package/react/components/smartDesktopDesigner/Application.js.map +1 -1
  333. package/react/components/smartDesktopDesigner/ApplicationEdit.d.ts +4 -1
  334. package/react/components/smartDesktopDesigner/ApplicationEdit.js +68 -51
  335. package/react/components/smartDesktopDesigner/ApplicationEdit.js.map +1 -1
  336. package/react/components/smartDesktopDesigner/ApplicationList.d.ts +4 -2
  337. package/react/components/smartDesktopDesigner/ApplicationList.js +23 -20
  338. package/react/components/smartDesktopDesigner/ApplicationList.js.map +1 -1
  339. package/react/components/smartDesktopDesigner/ApplicationSetup.d.ts +4 -3
  340. package/react/components/smartDesktopDesigner/ApplicationSetup.js +8 -20
  341. package/react/components/smartDesktopDesigner/ApplicationSetup.js.map +1 -1
  342. package/react/components/smartDesktopDesigner/Applications.d.ts +3 -2
  343. package/react/components/smartDesktopDesigner/Applications.js +73 -62
  344. package/react/components/smartDesktopDesigner/Applications.js.map +1 -1
  345. package/react/components/smartDesktopDesigner/Authentication.js +2 -8
  346. package/react/components/smartDesktopDesigner/Authentication.js.map +1 -1
  347. package/react/components/smartDesktopDesigner/AuthenticationProviderConfig.js +1 -8
  348. package/react/components/smartDesktopDesigner/AuthenticationProviderConfig.js.map +1 -1
  349. package/react/components/smartDesktopDesigner/Content.js.map +1 -1
  350. package/react/components/smartDesktopDesigner/CurrentView.js +1 -1
  351. package/react/components/smartDesktopDesigner/CurrentView.js.map +1 -1
  352. package/react/components/smartDesktopDesigner/Export.js +3 -3
  353. package/react/components/smartDesktopDesigner/Export.js.map +1 -1
  354. package/react/components/smartDesktopDesigner/ExportCloud.js +1 -1
  355. package/react/components/smartDesktopDesigner/ExportCloud.js.map +1 -1
  356. package/react/components/smartDesktopDesigner/ExportDeployInfo.js +1 -1
  357. package/react/components/smartDesktopDesigner/ExportDeployInfo.js.map +1 -1
  358. package/react/components/smartDesktopDesigner/ExportZip.js +0 -1
  359. package/react/components/smartDesktopDesigner/ExportZip.js.map +1 -1
  360. package/react/components/smartDesktopDesigner/GettingStarted.d.ts +1 -1
  361. package/react/components/smartDesktopDesigner/GettingStarted.js +1 -1
  362. package/react/components/smartDesktopDesigner/GettingStarted.js.map +1 -1
  363. package/react/components/smartDesktopDesigner/ProjectHeader.d.ts +1 -1
  364. package/react/components/smartDesktopDesigner/ProjectHeader.js +1 -1
  365. package/react/components/smartDesktopDesigner/ProjectHeader.js.map +1 -1
  366. package/react/components/smartDesktopDesigner/Publish.js +1 -1
  367. package/react/components/smartDesktopDesigner/Publish.js.map +1 -1
  368. package/react/components/smartDesktopDesigner/SmartDesktopDesigner.d.ts +0 -11
  369. package/react/components/smartDesktopDesigner/SmartDesktopDesigner.js +18 -31
  370. package/react/components/smartDesktopDesigner/SmartDesktopDesigner.js.map +1 -1
  371. package/react/components/smartDesktopDesigner/Themes.js +2 -8
  372. package/react/components/smartDesktopDesigner/Themes.js.map +1 -1
  373. package/react/components/smartDesktopDesigner/View.js.map +1 -1
  374. package/react/components/smartDesktopDesigner/common/getCSSVars.d.ts +1 -2
  375. package/react/components/smartDesktopDesigner/common/getCSSVars.js +2 -2
  376. package/react/components/smartDesktopDesigner/common/getCSSVars.js.map +1 -1
  377. package/react/components/smartDesktopDesigner/common/views.d.ts +1 -1
  378. package/react/components/smartDesktopDesigner/common/views.js +8 -18
  379. package/react/components/smartDesktopDesigner/common/views.js.map +1 -1
  380. package/react/components/smartDesktopDesigner/fixtures/applicationEditProps.js +16 -24
  381. package/react/components/smartDesktopDesigner/fixtures/applicationEditProps.js.map +1 -1
  382. package/react/components/smartDesktopDesigner/fixtures/applicationSetupProps.js +8 -9
  383. package/react/components/smartDesktopDesigner/fixtures/applicationSetupProps.js.map +1 -1
  384. package/react/components/smartDesktopDesigner/fixtures/apps.d.ts +4 -70
  385. package/react/components/smartDesktopDesigner/fixtures/apps.js +20 -31
  386. package/react/components/smartDesktopDesigner/fixtures/apps.js.map +1 -1
  387. package/react/components/smartDesktopDesigner/fixtures/authenticationProps.js +6 -9
  388. package/react/components/smartDesktopDesigner/fixtures/authenticationProps.js.map +1 -1
  389. package/react/components/smartDesktopDesigner/fixtures/exportProps.js +5 -5
  390. package/react/components/smartDesktopDesigner/fixtures/exportProps.js.map +1 -1
  391. package/react/components/smartDesktopDesigner/fixtures/publishProgress.d.ts +2 -1
  392. package/react/components/smartDesktopDesigner/fixtures/publishProgress.js.map +1 -1
  393. package/react/components/smartDesktopDesigner/fixtures/themeProps.d.ts +5 -5
  394. package/react/components/smartDesktopDesigner/fixtures/themeProps.js +6 -7
  395. package/react/components/smartDesktopDesigner/fixtures/themeProps.js.map +1 -1
  396. package/react/components/smartDesktopDesigner/fixtures/views.js +4 -4
  397. package/react/components/smartDesktopDesigner/fixtures/views.js.map +1 -1
  398. package/react/components/smartDesktopDesigner/sdd_helpers.js +2 -1
  399. package/react/components/smartDesktopDesigner/sdd_helpers.js.map +1 -1
  400. package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.d.ts +3 -4
  401. package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.js +14 -20
  402. package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.js.map +1 -1
  403. package/react/components/smartDesktopDesigner/stories/Appearance.stories.js +7 -7
  404. package/react/components/smartDesktopDesigner/stories/Appearance.stories.js.map +1 -1
  405. package/react/components/smartDesktopDesigner/stories/ApplicationEdit.stories.js +3 -7
  406. package/react/components/smartDesktopDesigner/stories/ApplicationEdit.stories.js.map +1 -1
  407. package/react/components/smartDesktopDesigner/stories/ApplicationList.stories.js +9 -2
  408. package/react/components/smartDesktopDesigner/stories/ApplicationList.stories.js.map +1 -1
  409. package/react/components/smartDesktopDesigner/stories/ApplicationSetup.stories.js +3 -10
  410. package/react/components/smartDesktopDesigner/stories/ApplicationSetup.stories.js.map +1 -1
  411. package/react/components/smartDesktopDesigner/stories/Applications.stories.js +1 -1
  412. package/react/components/smartDesktopDesigner/stories/Applications.stories.js.map +1 -1
  413. package/react/components/smartDesktopDesigner/stories/Authentication.stories.js +18 -36
  414. package/react/components/smartDesktopDesigner/stories/Authentication.stories.js.map +1 -1
  415. package/react/components/smartDesktopDesigner/stories/Export.stories.js +2 -2
  416. package/react/components/smartDesktopDesigner/stories/Export.stories.js.map +1 -1
  417. package/react/components/smartDesktopDesigner/stories/ExportCloud.stories.js +2 -2
  418. package/react/components/smartDesktopDesigner/stories/ExportCloud.stories.js.map +1 -1
  419. package/react/components/smartDesktopDesigner/stories/ExportZip.stories.js +5 -11
  420. package/react/components/smartDesktopDesigner/stories/ExportZip.stories.js.map +1 -1
  421. package/react/components/smartDesktopDesigner/stories/GettingStarted.stories.d.ts +1 -1
  422. package/react/components/smartDesktopDesigner/stories/GettingStarted.stories.js +1 -1
  423. package/react/components/smartDesktopDesigner/stories/GettingStarted.stories.js.map +1 -1
  424. package/react/components/smartDesktopDesigner/stories/Navigation.stories.js +1 -1
  425. package/react/components/smartDesktopDesigner/stories/Navigation.stories.js.map +1 -1
  426. package/react/components/smartDesktopDesigner/stories/ProjectErrors.stories.js +2 -4
  427. package/react/components/smartDesktopDesigner/stories/ProjectErrors.stories.js.map +1 -1
  428. package/react/components/smartDesktopDesigner/stories/ProjectHeader.stories.d.ts +1 -1
  429. package/react/components/smartDesktopDesigner/stories/ProjectHeader.stories.js +1 -1
  430. package/react/components/smartDesktopDesigner/stories/ProjectHeader.stories.js.map +1 -1
  431. package/react/components/smartDesktopDesigner/stories/Publish.stories.js +13 -28
  432. package/react/components/smartDesktopDesigner/stories/Publish.stories.js.map +1 -1
  433. package/react/components/smartDesktopDesigner/stories/PublishProgress.stories.js +1 -1
  434. package/react/components/smartDesktopDesigner/stories/PublishProgress.stories.js.map +1 -1
  435. package/react/components/smartDesktopDesigner/stories/SmartDesktopDesigner.stories.js +3 -3
  436. package/react/components/smartDesktopDesigner/stories/SmartDesktopDesigner.stories.js.map +1 -1
  437. package/react/components/smartDesktopDesigner/stories/Themes.stories.js +1 -1
  438. package/react/components/smartDesktopDesigner/stories/Themes.stories.js.map +1 -1
  439. package/react/components/smartDesktopDesigner/tests/AppEditPage.spec.js +32 -32
  440. package/react/components/smartDesktopDesigner/tests/AppEditPage.spec.js.map +1 -1
  441. package/react/components/smartDesktopDesigner/tests/ApplicationEdit.spec.js +6 -5
  442. package/react/components/smartDesktopDesigner/tests/ApplicationEdit.spec.js.map +1 -1
  443. package/react/components/smartDesktopDesigner/tests/ApplicationList.spec.js +11 -11
  444. package/react/components/smartDesktopDesigner/tests/ApplicationList.spec.js.map +1 -1
  445. package/react/components/smartDesktopDesigner/tests/ApplicationSetup.spec.js +9 -7
  446. package/react/components/smartDesktopDesigner/tests/ApplicationSetup.spec.js.map +1 -1
  447. package/react/components/smartDesktopDesigner/tests/Applications.spec.js +35 -35
  448. package/react/components/smartDesktopDesigner/tests/Applications.spec.js.map +1 -1
  449. package/react/components/smartDesktopDesigner/tests/Authentication.spec.js +6 -18
  450. package/react/components/smartDesktopDesigner/tests/Authentication.spec.js.map +1 -1
  451. package/react/components/smartDesktopDesigner/tests/Export.spec.js +14 -22
  452. package/react/components/smartDesktopDesigner/tests/Export.spec.js.map +1 -1
  453. package/react/components/smartDesktopDesigner/tests/ExportZip.spec.js +2 -6
  454. package/react/components/smartDesktopDesigner/tests/ExportZip.spec.js.map +1 -1
  455. package/react/components/smartDesktopDesigner/tests/Navigation.spec.js +2 -2
  456. package/react/components/smartDesktopDesigner/tests/Navigation.spec.js.map +1 -1
  457. package/react/components/smartDesktopDesigner/tests/ProjectErrors.spec.js +2 -2
  458. package/react/components/smartDesktopDesigner/tests/ProjectErrors.spec.js.map +1 -1
  459. package/react/components/smartDesktopDesigner/tests/ProjectHeader.spec.js +2 -2
  460. package/react/components/smartDesktopDesigner/tests/ProjectHeader.spec.js.map +1 -1
  461. package/react/components/smartDesktopDesigner/tests/Publish.spec.js +3 -10
  462. package/react/components/smartDesktopDesigner/tests/Publish.spec.js.map +1 -1
  463. package/react/components/smartDesktopDesigner/tests/PublishProgess.spec.js +2 -6
  464. package/react/components/smartDesktopDesigner/tests/PublishProgess.spec.js.map +1 -1
  465. package/react/components/smartDesktopDesigner/tests/SmartDesktopDesigner.spec.js +3 -3
  466. package/react/components/smartDesktopDesigner/tests/SmartDesktopDesigner.spec.js.map +1 -1
  467. package/react/components/smartDesktopDesigner/tests/Themes.spec.js +7 -7
  468. package/react/components/smartDesktopDesigner/tests/Themes.spec.js.map +1 -1
  469. package/react/components/smartDesktopDesigner/tests/a11y_helper.js +4 -5
  470. package/react/components/smartDesktopDesigner/tests/a11y_helper.js.map +1 -1
  471. package/react/components/system/System.spec.js +1 -1
  472. package/react/components/system/System.spec.js.map +1 -1
  473. package/react/components/system/SystemTrayComponentShell.js +1 -1
  474. package/react/components/system/SystemTrayComponentShell.js.map +1 -1
  475. package/react/components/toolbar/MinimizeAll.spec.js +5 -5
  476. package/react/components/toolbar/MinimizeAll.spec.js.map +1 -1
  477. package/react/components/toolbar/NotificationControl.js +3 -2
  478. package/react/components/toolbar/NotificationControl.js.map +1 -1
  479. package/react/components/toolbar/RevealAll.spec.js +5 -5
  480. package/react/components/toolbar/RevealAll.spec.js.map +1 -1
  481. package/react/components/toolbar/ToolbarIcon.js +14 -2
  482. package/react/components/toolbar/ToolbarIcon.js.map +1 -1
  483. package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.d.ts +22 -5
  484. package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.js +11 -6
  485. package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.js.map +1 -1
  486. package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncherMenu.js +21 -9
  487. package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncherMenu.js.map +1 -1
  488. package/react/components/toolbar/advancedAppLauncher/components/AddNewAppForm.d.ts +33 -10
  489. package/react/components/toolbar/advancedAppLauncher/components/AddNewAppForm.js +41 -10
  490. package/react/components/toolbar/advancedAppLauncher/components/AddNewAppForm.js.map +1 -1
  491. package/react/components/toolbar/advancedAppLauncher/components/AddNewFolder.d.ts +3 -3
  492. package/react/components/toolbar/advancedAppLauncher/components/AddNewFolder.js +0 -3
  493. package/react/components/toolbar/advancedAppLauncher/components/AddNewFolder.js.map +1 -1
  494. package/react/components/toolbar/advancedAppLauncher/components/AppActionsMenu.d.ts +24 -8
  495. package/react/components/toolbar/advancedAppLauncher/components/AppActionsMenu.js +4 -2
  496. package/react/components/toolbar/advancedAppLauncher/components/AppActionsMenu.js.map +1 -1
  497. package/react/components/toolbar/advancedAppLauncher/components/AppDefinition.d.ts +18 -4
  498. package/react/components/toolbar/advancedAppLauncher/components/AppDefinition.js +7 -5
  499. package/react/components/toolbar/advancedAppLauncher/components/AppDefinition.js.map +1 -1
  500. package/react/components/toolbar/advancedAppLauncher/components/AppTagsList.d.ts +14 -6
  501. package/react/components/toolbar/advancedAppLauncher/components/AppTagsList.js +2 -3
  502. package/react/components/toolbar/advancedAppLauncher/components/AppTagsList.js.map +1 -1
  503. package/react/components/toolbar/advancedAppLauncher/components/Content.d.ts +30 -13
  504. package/react/components/toolbar/advancedAppLauncher/components/Content.js +35 -37
  505. package/react/components/toolbar/advancedAppLauncher/components/Content.js.map +1 -1
  506. package/react/components/toolbar/advancedAppLauncher/components/FilterSort.d.ts +15 -5
  507. package/react/components/toolbar/advancedAppLauncher/components/FilterSort.js +4 -3
  508. package/react/components/toolbar/advancedAppLauncher/components/FilterSort.js.map +1 -1
  509. package/react/components/toolbar/advancedAppLauncher/components/FoldersList.d.ts +38 -21
  510. package/react/components/toolbar/advancedAppLauncher/components/FoldersList.js +14 -9
  511. package/react/components/toolbar/advancedAppLauncher/components/FoldersList.js.map +1 -1
  512. package/react/components/toolbar/advancedAppLauncher/components/LeftNavBottomLinks.d.ts +18 -3
  513. package/react/components/toolbar/advancedAppLauncher/components/LeftNavBottomLinks.js +8 -4
  514. package/react/components/toolbar/advancedAppLauncher/components/LeftNavBottomLinks.js.map +1 -1
  515. package/react/components/toolbar/advancedAppLauncher/components/NoAppsFound.d.ts +10 -3
  516. package/react/components/toolbar/advancedAppLauncher/components/NoAppsFound.js +1 -3
  517. package/react/components/toolbar/advancedAppLauncher/components/NoAppsFound.js.map +1 -1
  518. package/react/components/toolbar/advancedAppLauncher/components/SearchBox.d.ts +15 -6
  519. package/react/components/toolbar/advancedAppLauncher/components/SearchBox.js +11 -6
  520. package/react/components/toolbar/advancedAppLauncher/components/SearchBox.js.map +1 -1
  521. package/react/components/toolbar/advancedAppLauncher/components/SortBy.d.ts +11 -4
  522. package/react/components/toolbar/advancedAppLauncher/components/SortBy.js +3 -2
  523. package/react/components/toolbar/advancedAppLauncher/components/SortBy.js.map +1 -1
  524. package/react/components/toolbar/advancedAppLauncher/components/TagsList.d.ts +18 -6
  525. package/react/components/toolbar/advancedAppLauncher/components/TagsList.js +2 -2
  526. package/react/components/toolbar/advancedAppLauncher/components/TagsList.js.map +1 -1
  527. package/react/components/toolbar/advancedAppLauncher/components/TagsMenu.d.ts +20 -4
  528. package/react/components/toolbar/advancedAppLauncher/components/TagsMenu.js +2 -4
  529. package/react/components/toolbar/advancedAppLauncher/components/TagsMenu.js.map +1 -1
  530. package/react/components/toolbar/advancedAppLauncher/modules/AppDirectory.js.map +1 -1
  531. package/react/components/toolbar/advancedAppLauncher/modules/FDC3.d.ts +15 -10
  532. package/react/components/toolbar/advancedAppLauncher/modules/FDC3.js +19 -30
  533. package/react/components/toolbar/advancedAppLauncher/modules/FDC3.js.map +1 -1
  534. package/react/components/toolbar/advancedAppLauncher/stores/LauncherStore.d.ts +5 -2
  535. package/react/components/toolbar/advancedAppLauncher/stores/LauncherStore.js +1 -1
  536. package/react/components/toolbar/advancedAppLauncher/stores/LauncherStore.js.map +1 -1
  537. package/react/components/toolbar/advancedAppLauncher/stores/StoreActions.d.ts +87 -59
  538. package/react/components/toolbar/advancedAppLauncher/stores/StoreActions.js +51 -54
  539. package/react/components/toolbar/advancedAppLauncher/stores/StoreActions.js.map +1 -1
  540. package/react/components/toolbar/advancedAppLauncher/utils/sort-functions.d.ts +7 -6
  541. package/react/components/toolbar/advancedAppLauncher/utils/sort-functions.js +11 -13
  542. package/react/components/toolbar/advancedAppLauncher/utils/sort-functions.js.map +1 -1
  543. package/react/components/toolbar/appLauncher/AppLauncherMenu.d.ts +3 -3
  544. package/react/components/toolbar/appLauncher/AppLauncherMenu.js +1 -1
  545. package/react/components/toolbar/appLauncher/AppLauncherMenu.js.map +1 -1
  546. package/react/components/toolbar/appLauncher/DynamicAppLauncher.js.map +1 -1
  547. package/react/components/toolbar/appLauncher/StaticAppLauncherMenu.d.ts +25 -3
  548. package/react/components/toolbar/appLauncher/StaticAppLauncherMenu.js +4 -11
  549. package/react/components/toolbar/appLauncher/StaticAppLauncherMenu.js.map +1 -1
  550. package/react/components/toolbar/appLauncher/components/componentList.d.ts +34 -6
  551. package/react/components/toolbar/appLauncher/components/componentList.js +25 -22
  552. package/react/components/toolbar/appLauncher/components/componentList.js.map +1 -1
  553. package/react/components/toolbar/appLauncher/stores/appLauncherStore.d.ts +32 -32
  554. package/react/components/toolbar/appLauncher/stores/appLauncherStore.js +43 -65
  555. package/react/components/toolbar/appLauncher/stores/appLauncherStore.js.map +1 -1
  556. package/react/components/toolbar/dashbar/Dashbar.js +143 -125
  557. package/react/components/toolbar/dashbar/Dashbar.js.map +1 -1
  558. package/react/components/toolbar/dashbar/DashbarItem.js +4 -5
  559. package/react/components/toolbar/dashbar/DashbarItem.js.map +1 -1
  560. package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.d.ts +28 -5
  561. package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.js +17 -23
  562. package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.js.map +1 -1
  563. package/react/components/toolbar/workspaceManagementMenu/components/Workspace.d.ts +25 -3
  564. package/react/components/toolbar/workspaceManagementMenu/components/Workspace.js.map +1 -1
  565. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceActions.d.ts +13 -8
  566. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceActions.js +2 -2
  567. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceActions.js.map +1 -1
  568. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.d.ts +16 -8
  569. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.js +0 -3
  570. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.js.map +1 -1
  571. package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.d.ts +66 -11
  572. package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js +103 -153
  573. package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js.map +1 -1
  574. package/react/components/toolbar/workspaceManagementMenu/workspaceManagementMenu.css +0 -4
  575. package/react/components/userPreferences/UserPreferenceTypes.d.ts +5 -0
  576. package/react/components/userPreferences/UserPreferenceTypes.js +2 -0
  577. package/react/components/userPreferences/UserPreferenceTypes.js.map +1 -0
  578. package/react/components/userPreferences/UserPreferencesBase.js +2 -2
  579. package/react/components/userPreferences/UserPreferencesBase.js.map +1 -1
  580. package/react/components/userPreferences/UserPreferencesWrapper.js +1 -1
  581. package/react/components/userPreferences/UserPreferencesWrapper.js.map +1 -1
  582. package/react/components/userPreferences/components/ContentSection.js +1 -1
  583. package/react/components/userPreferences/components/ContentSection.js.map +1 -1
  584. package/react/components/userPreferences/components/LeftNav.d.ts +1 -1
  585. package/react/components/userPreferences/components/LeftNav.js +1 -1
  586. package/react/components/userPreferences/components/LeftNav.js.map +1 -1
  587. package/react/components/userPreferences/components/content/DashbarEditor.js +4 -4
  588. package/react/components/userPreferences/components/content/DashbarEditor.js.map +1 -1
  589. package/react/components/userPreferences/components/content/Notifications.js +2 -0
  590. package/react/components/userPreferences/components/content/Notifications.js.map +1 -1
  591. package/react/components/userPreferences/components/content/Workspaces.d.ts +51 -14
  592. package/react/components/userPreferences/components/content/Workspaces.js +96 -90
  593. package/react/components/userPreferences/components/content/Workspaces.js.map +1 -1
  594. package/react/components/userPreferences/components/content/notificationViews/NotificationsPreferencesHome.js +48 -51
  595. package/react/components/userPreferences/components/content/notificationViews/NotificationsPreferencesHome.js.map +1 -1
  596. package/react/components/userPreferences/components/content/notificationViews/NotificationsSourceTypes.js +9 -9
  597. package/react/components/userPreferences/components/content/notificationViews/NotificationsSourceTypes.js.map +1 -1
  598. package/react/components/userPreferences/components/content/notificationViews/NotificationsSourcesPreferences.js +4 -6
  599. package/react/components/userPreferences/components/content/notificationViews/NotificationsSourcesPreferences.js.map +1 -1
  600. package/react/components/userPreferences/components/content/notificationViews/notificationViewsUtils.js +6 -6
  601. package/react/components/userPreferences/components/content/notificationViews/notificationViewsUtils.js.map +1 -1
  602. package/react/components/userPreferences/components/general/ScheduledRestart.js +0 -1
  603. package/react/components/userPreferences/components/general/ScheduledRestart.js.map +1 -1
  604. package/react/components/userPreferences/components/workspaces/WorkspaceButton.d.ts +3 -4
  605. package/react/components/userPreferences/components/workspaces/WorkspaceButton.js +5 -1
  606. package/react/components/userPreferences/components/workspaces/WorkspaceButton.js.map +1 -1
  607. package/react/components/userPreferences/components/workspaces/WorkspaceComponents.js +8 -5
  608. package/react/components/userPreferences/components/workspaces/WorkspaceComponents.js.map +1 -1
  609. package/react/components/userPreferences/components/workspaces/WorkspaceItem.d.ts +1 -1
  610. package/react/components/userPreferences/components/workspaces/WorkspaceItem.js +24 -9
  611. package/react/components/userPreferences/components/workspaces/WorkspaceItem.js.map +1 -1
  612. package/react/components/userPreferences/components/workspaces/WorkspaceItemList.js +16 -2
  613. package/react/components/userPreferences/components/workspaces/WorkspaceItemList.js.map +1 -1
  614. package/react/components/userPreferences/stores/UserPreferencesStore.d.ts +12 -12
  615. package/react/components/userPreferences/stores/UserPreferencesStore.js +10 -17
  616. package/react/components/userPreferences/stores/UserPreferencesStore.js.map +1 -1
  617. package/react/components/userPreferences/stories/DashbarEditor.stories.js +1 -1
  618. package/react/components/userPreferences/stories/DashbarEditor.stories.js.map +1 -1
  619. package/react/components/userPreferences/stories/DashbarEditorItem.stories.js +1 -1
  620. package/react/components/userPreferences/stories/DashbarEditorItem.stories.js.map +1 -1
  621. package/react/components/userPreferences/stories/General.stories.js.map +1 -1
  622. package/react/components/userPreferences/stories/NotificationsSourceTypes.stories.js +1 -1
  623. package/react/components/userPreferences/stories/NotificationsSourceTypes.stories.js.map +1 -1
  624. package/react/components/userPreferences/stories/NotificationsSources.stories.js +1 -1
  625. package/react/components/userPreferences/stories/NotificationsSources.stories.js.map +1 -1
  626. package/react/components/userPreferences/stories/UserPreferences.stories.d.ts +1 -1
  627. package/react/components/userPreferences/stories/UserPreferences.stories.js +1 -1
  628. package/react/components/userPreferences/stories/UserPreferences.stories.js.map +1 -1
  629. package/react/components/userPreferences/stories/WorkspaceButton.stories.d.ts +5 -9
  630. package/react/components/userPreferences/stories/WorkspaceButton.stories.js +10 -3
  631. package/react/components/userPreferences/stories/WorkspaceButton.stories.js.map +1 -1
  632. package/react/components/userPreferences/stories/WorkspaceItem.stories.js +2 -2
  633. package/react/components/userPreferences/stories/WorkspaceItem.stories.js.map +1 -1
  634. package/react/components/userPreferences/stories/WorkspaceItemList.stories.js.map +1 -1
  635. package/react/components/userPreferences/stories/Workspaces.stories.js +2 -2
  636. package/react/components/userPreferences/stories/Workspaces.stories.js.map +1 -1
  637. package/react/components/userPreferences/tests/ContentSection.spec.js.map +1 -1
  638. package/react/components/userPreferences/tests/DashbarEditor.spec.js.map +1 -1
  639. package/react/components/userPreferences/tests/DashbarEditorItem.spec.js.map +1 -1
  640. package/react/components/userPreferences/tests/General.spec.js.map +1 -1
  641. package/react/components/userPreferences/tests/LeftNav.spec.js.map +1 -1
  642. package/react/components/userPreferences/tests/NotificationSourceTypes.spec.js.map +1 -1
  643. package/react/components/userPreferences/tests/Notifications.spec.js.map +1 -1
  644. package/react/components/userPreferences/tests/NotificationsPreferencesHome.spec.js.map +1 -1
  645. package/react/components/userPreferences/tests/NotificationsSourcesPreferences.spec.js.map +1 -1
  646. package/react/components/userPreferences/tests/ScheduledRestart.spec.js.map +1 -1
  647. package/react/components/userPreferences/tests/WorkspaceButton.spec.js +17 -3
  648. package/react/components/userPreferences/tests/WorkspaceButton.spec.js.map +1 -1
  649. package/react/components/userPreferences/tests/WorkspaceComponents.spec.js +1 -1
  650. package/react/components/userPreferences/tests/WorkspaceComponents.spec.js.map +1 -1
  651. package/react/components/userPreferences/tests/WorkspaceItem.spec.js.map +1 -1
  652. package/react/components/userPreferences/tests/WorkspaceItemList.spec.js.map +1 -1
  653. package/react/components/utils.js +1 -1
  654. package/react/components/utils.js.map +1 -1
  655. package/react/components/windowTitleBar/WindowTitleBarShell.d.ts +58 -31
  656. package/react/components/windowTitleBar/WindowTitleBarShell.js +47 -50
  657. package/react/components/windowTitleBar/WindowTitleBarShell.js.map +1 -1
  658. package/react/components/windowTitleBar/components/center/Tab.d.ts +28 -7
  659. package/react/components/windowTitleBar/components/center/Tab.js +11 -4
  660. package/react/components/windowTitleBar/components/center/Tab.js.map +1 -1
  661. package/react/components/windowTitleBar/components/center/TabList.d.ts +43 -30
  662. package/react/components/windowTitleBar/components/center/TabList.js +179 -66
  663. package/react/components/windowTitleBar/components/center/TabList.js.map +1 -1
  664. package/react/components/windowTitleBar/components/left/LinkerButton.js +5 -4
  665. package/react/components/windowTitleBar/components/left/LinkerButton.js.map +1 -1
  666. package/react/components/windowTitleBar/components/left/LinkerButtonDeprecated.d.ts +1 -21
  667. package/react/components/windowTitleBar/components/left/LinkerGroups.js +6 -8
  668. package/react/components/windowTitleBar/components/left/LinkerGroups.js.map +1 -1
  669. package/react/components/windowTitleBar/components/left/LinkerGroupsDeprecated.js +2 -1
  670. package/react/components/windowTitleBar/components/left/LinkerGroupsDeprecated.js.map +1 -1
  671. package/react/components/windowTitleBar/components/left/ShareButton.d.ts +1 -21
  672. package/react/components/windowTitleBar/components/right/CloseButton.d.ts +12 -25
  673. package/react/components/windowTitleBar/components/right/CloseButton.js.map +1 -1
  674. package/react/components/windowTitleBar/components/right/GroupingButton.d.ts +17 -26
  675. package/react/components/windowTitleBar/components/right/GroupingButton.js +2 -2
  676. package/react/components/windowTitleBar/components/right/GroupingButton.js.map +1 -1
  677. package/react/components/windowTitleBar/components/right/MaximizeButton.d.ts +16 -26
  678. package/react/components/windowTitleBar/components/right/MaximizeButton.js +7 -9
  679. package/react/components/windowTitleBar/components/right/MaximizeButton.js.map +1 -1
  680. package/react/components/windowTitleBar/components/right/MinimizeButton.d.ts +12 -25
  681. package/react/components/windowTitleBar/components/right/MinimizeButton.js.map +1 -1
  682. package/react/components/windowTitleBar/components/windowTitle.d.ts +2 -1
  683. package/react/components/windowTitleBar/components/windowTitle.js +22 -10
  684. package/react/components/windowTitleBar/components/windowTitle.js.map +1 -1
  685. package/react/components/windowTitleBar/stores/windowTitleBarStore.d.ts +56 -44
  686. package/react/components/windowTitleBar/stores/windowTitleBarStore.js +96 -64
  687. package/react/components/windowTitleBar/stores/windowTitleBarStore.js.map +1 -1
  688. package/react/components/windowTitleBar/stores/windowTitleBarStoreDefaults.d.ts +42 -44
  689. package/react/components/windowTitleBar/stores/windowTitleBarStoreDefaults.js.map +1 -1
  690. package/react/components/windowTitleBar/windowTitleBarContext.d.ts +9 -9
  691. package/react/components/windowTitleBar/windowTitleBarContext.js +2 -4
  692. package/react/components/windowTitleBar/windowTitleBarContext.js.map +1 -1
  693. package/react/components/yesNoDialog/Timer.spec.js +2 -2
  694. package/react/components/yesNoDialog/Timer.spec.js.map +1 -1
  695. package/react/components/yesNoDialog/Timer.stories.js +1 -1
  696. package/react/components/yesNoDialog/Timer.stories.js.map +1 -1
  697. package/react/components/yesNoDialog/YesNoDialog.spec.js +5 -5
  698. package/react/components/yesNoDialog/YesNoDialog.spec.js.map +1 -1
  699. package/react/components/yesNoDialog/YesNoDialog.stories.js +1 -1
  700. package/react/components/yesNoDialog/YesNoDialog.stories.js.map +1 -1
  701. package/react/hooks/useFavoritesShell.js +1 -3
  702. package/react/hooks/useFavoritesShell.js.map +1 -1
  703. package/react/hooks/useLinker.js +4 -4
  704. package/react/hooks/useLinker.js.map +1 -1
  705. package/react/hooks/useMenu.js +2 -2
  706. package/react/hooks/useMenu.js.map +1 -1
  707. package/react/hooks/useNotifications.d.ts +8 -8
  708. package/react/hooks/useNotifications.js +30 -30
  709. package/react/hooks/useNotifications.js.map +1 -1
  710. package/react/hooks/usePubSub.js +3 -5
  711. package/react/hooks/usePubSub.js.map +1 -1
  712. package/react/hooks/useSearch.js +1 -1
  713. package/react/hooks/useSearch.js.map +1 -1
  714. package/react/hooks/useToolbar.js +16 -35
  715. package/react/hooks/useToolbar.js.map +1 -1
  716. package/react/hooks/useWorkspace.js +1 -1
  717. package/react/hooks/useWorkspace.js.map +1 -1
  718. package/react/reducers/favoriteReducer.js +1 -1
  719. package/react/reducers/favoriteReducer.js.map +1 -1
  720. package/react/reducers/linkerReducer.js.map +1 -1
  721. package/react/reducers/rootReducer.d.ts +3 -4
  722. package/react/reducers/toolbarReducer.js +1 -1
  723. package/react/reducers/toolbarReducer.js.map +1 -1
  724. package/react/store.d.ts +6 -7
  725. package/react/store.js.map +1 -1
  726. package/react/types/advancedAppLauncherTypes.d.ts +28 -1
  727. package/react/types/advancedAppLauncherTypes.js.map +1 -1
  728. package/react/types/favoriteTypes.d.ts +1 -1
  729. package/react/types/favoriteTypes.js.map +1 -1
  730. package/react/types/fdc3.d.ts +22 -0
  731. package/react/types/fdc3.js.map +1 -1
  732. package/react/types/searchTypes.d.ts +3 -0
  733. package/react/types/searchTypes.js.map +1 -1
  734. package/react/types/smartDesktopDesignerTypes.d.ts +11 -9
  735. package/react/types/smartDesktopDesignerTypes.js.map +1 -1
  736. package/react/types/windowTitleBar.d.ts +47 -0
  737. package/react/types/windowTitleBar.js +2 -0
  738. package/react/types/windowTitleBar.js.map +1 -0
  739. package/react/types/workspaceTypes.d.ts +19 -0
  740. package/react/types/workspaceTypes.js.map +1 -1
  741. package/react/components/processMonitor/components/ChildWindows.d.ts +0 -4
  742. package/react/components/processMonitor/components/ChildWindows.js +0 -11
  743. package/react/components/processMonitor/components/ChildWindows.js.map +0 -1
  744. package/react/components/smartDesktopDesigner/fixtures/applicationsProps.d.ts +0 -2
  745. package/react/components/smartDesktopDesigner/fixtures/applicationsProps.js +0 -88
  746. package/react/components/smartDesktopDesigner/fixtures/applicationsProps.js.map +0 -1
  747. package/react/components/toolbar/advancedAppLauncher/components/LeftNav.d.ts +0 -4
  748. package/react/components/toolbar/advancedAppLauncher/components/LeftNav.js +0 -14
  749. package/react/components/toolbar/advancedAppLauncher/components/LeftNav.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"storeActions.js","sourceRoot":"","sources":["../../../../src/components/appCatalog/stores/storeActions.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAMnC,OAAO,YAAY,MAAM,yBAAyB,CAAC;AACnD,OAAO,IAAI,MAAM,iBAAiB,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,CAClE,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;AAEnE,eAAe;IACd,UAAU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,EAAE,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;AAC3D,CAAC;AAKD,SAAS,aAAa;IACrB,OAAO,IAAI,CAAC,UAAU,CAAC;AACxB,CAAC;AAMD,SAAS,MAAM,CAAC,GAAG;IAClB,aAAa,CAAC,GAAG,CAAC,CAAC;AACpB,CAAC;AAMD,SAAS,SAAS,CAAC,GAAG;IACrB,gBAAgB,CAAC,GAAG,CAAC,CAAC;AACvB,CAAC;AAKD,SAAS,gBAAgB;IACxB,UAAU,EAAE,CAAC;AACd,CAAC;AAKD,SAAS,SAAS;IACjB,gBAAgB,EAAE,CAAC;AACpB,CAAC;AAMD,SAAS,UAAU,CAAC,KAAK,EAAE,EAAE,GAAG,QAAQ,CAAC,SAAS;IACjD,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IACxB,cAAc,CAAC,IAAI,CAAC,CAAC;IACrB,QAAQ,EAAE,CAAC,QAAQ,CAClB;QACC,KAAK,EAAE,YAAY;QACnB,KAAK,EAAE,KAAK;KACZ,EACD,GAAG,EAAE;QACJ,UAAU,EAAE,CAAC;QACb,EAAE,EAAE,CAAC;IACN,CAAC,CACD,CAAC;AACH,CAAC","sourcesContent":["import { findIndex } from \"lodash\";\r\n\r\n/*!\r\n * Copyright 2017 - 2020 by ChartIQ, Inc.\r\n * All rights reserved.\r\n */\r\nimport AppDirectory from \"../modules/AppDirectory\";\r\nimport FDC3 from \"../modules/FDC3\";\r\nimport { getStore } from \"./appStore\";\r\nimport { findIndex } from \"lodash\";\r\nimport * as path from \"path\";\r\n\r\nexport const findAppIndexInFolder = (appID, folderName, folders) =>\r\n\tfindIndex(folders[folderName].apps, (app) => app.appID === appID);\r\n\r\nexport default {\r\n\tinitialize,\r\n\tgetApps,\r\n\tgetFilteredApps,\r\n\tclearFilteredApps,\r\n\tsearchApps,\r\n\tgetActiveTags,\r\n\tgetTags,\r\n\taddTag,\r\n\tremoveTag,\r\n\trefreshTagSearch,\r\n\tclearTags,\r\n\tclearSearchText,\r\n\taddApp,\r\n\tremoveApp,\r\n\topenApp,\r\n\tclearApp,\r\n\tgetInstalledApps,\r\n\tgetActiveApp,\r\n\tsetActiveApp,\r\n\tfilterApps,\r\n\tsetSearchValue,\r\n\tsetForceSearch,\r\n\tgetSearchValue,\r\n\tgetForceSearch,\r\n\tgoHome,\r\n};\r\n\r\nconst data = {};\r\nlet FDC3Client;\r\nlet appd;\r\n\r\nfunction initialize(done = Function.prototype) {\r\n\tFSBL.Clients.ConfigClient.getValue({ field: \"finsemble.appDirectoryEndpoint\" }, (err, appDirectoryEndpoint) => {\r\n\t\tFDC3Client = new FDC3({ url: appDirectoryEndpoint });\r\n\t\tappd = new AppDirectory(FDC3Client);\r\n\r\n\t\tconst store = getStore();\r\n\t\tdata.apps = store.values.apps;\r\n\t\tstore.getValue({ field: \"appFolders.folders\" }, (err, folders) => {\r\n\t\t\tdata.folders = folders;\r\n\t\t\tstore.addListener({ field: \"appFolders.folders\" }, (err, dt) => (data.folders = dt.value));\r\n\t\t});\r\n\t\tstore.getValue({ field: \"activeFolder\" }, (err, active) => {\r\n\t\t\tdata.activeFolder = active;\r\n\t\t\tstore.addListener({ field: \"activeFolder\" }, (err, dt) => (data.activeFolder = dt.value));\r\n\t\t});\r\n\t\tstore.getValue({ field: \"defaultFolder\" }, (err, folder) => {\r\n\t\t\tdata.defaultFolder = folder;\r\n\t\t});\r\n\r\n\t\tdata.installed = store.values.appDefinitions;\r\n\t\tdata.tags = store.values.tags;\r\n\t\tdata.filteredApps = store.values.filteredApps;\r\n\t\tdata.activeTags = store.values.activeTags;\r\n\t\tdata.activeApp = store.values.activeApp;\r\n\t\tdata.searchText = store.values.searchText;\r\n\t\tdata.forceSearch = store.values.forceSearch;\r\n\t\tdata.ADVANCED_APP_LAUNCHER = store.values.defaultFolder;\r\n\r\n\t\tstore.addListener({ field: \"apps\" }, (err, dt) => (data.apps = dt.value));\r\n\t\tstore.addListener({ field: \"appDefinitions\" }, (err, dt) => (data.installed = dt.value));\r\n\t\tstore.addListener({ field: \"tags\" }, (err, dt) => (data.tags = dt.value));\r\n\t\tstore.addListener({ field: \"activeApp\" }, (err, dt) => (data.activeApp = dt.value));\r\n\t\tstore.addListener({ field: \"activeTags\" }, (err, dt) => (data.activeTags = dt.value));\r\n\t\tstore.addListener({ field: \"filteredApps\" }, (err, dt) => (data.filteredApps = dt.value));\r\n\t\tstore.addListener({ field: \"searchText\" }, (err, dt) => (data.searchText = dt.value));\r\n\t\tstore.addListener({ field: \"forceSearch\" }, (err, dt) => (data.forceSearch = dt.value));\r\n\t\tdone();\r\n\t});\r\n}\r\n\r\n/**\r\n * Return to the App Catalog home page\r\n */\r\nfunction goHome() {\r\n\tsetForceSearch(false);\r\n\tclearFilteredApps();\r\n\tclearApp();\r\n\tclearTags();\r\n\tclearSearchText();\r\n}\r\n\r\n/**\r\n * Send the search text and tags to the appd server and get a list of apps\r\n */\r\nfunction filterApps() {\r\n\tlet { activeTags, searchText } = data;\r\n\r\n\tif (activeTags.length === 0 && searchText === \"\") {\r\n\t\tgoHome();\r\n\t} else {\r\n\t\tappd.search({ text: searchText, tags: activeTags }, (err, data) => {\r\n\t\t\tif (err) {\r\n\t\t\t\tFSBL.Logger.system.error(`FDC3 App search failed!: ${err}`);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tgetStore().setValue({ field: \"activeApp\", value: null });\r\n\t\t\tgetStore().setValue({ field: \"activeTags\", value: activeTags });\r\n\t\t\tgetStore().setValue({ field: \"filteredApps\", value: data });\r\n\t\t});\r\n\t}\r\n}\r\n\r\n/**\r\n * Private function to add an active tag. This will filter apps based on tags\r\n * @param {string} tag The name of the tag\r\n */\r\nfunction _addActiveTag(tag) {\r\n\tlet { activeTags } = data;\r\n\tif (!activeTags.includes(tag)) {\r\n\t\tactiveTags.push(tag);\r\n\t}\r\n\r\n\tgetStore().setValue({ field: \"activeTags\", value: activeTags }, filterApps());\r\n}\r\n\r\nfunction _findAppIndexInFolder(appID, folderName) {\r\n\treturn findIndex(data.folders[folderName].apps, (app) => app.appID === appID);\r\n}\r\n\r\n/**\r\n * Private function to remove an active tag. This will filter apps based on tags\r\n * @param {string} tag The name of the tag\r\n */\r\nfunction _removeActiveTag(tag) {\r\n\tdata.activeTags = data.activeTags.filter((currentTag) => currentTag !== tag);\r\n\r\n\tgetStore().setValue({ field: \"activeTags\", value: data.activeTags });\r\n\tfilterApps();\r\n}\r\n\r\n/**\r\n * Clears all active tags\r\n */\r\nfunction _clearActiveTags() {\r\n\tgetStore().setValue({ field: \"activeTags\", value: [] });\r\n}\r\n\r\n/**\r\n * Async function to fetch apps from the FDC3 api (appD)\r\n */\r\nasync function getApps() {\r\n\tlet apps = await appd.getAll((err, apps) => {\r\n\t\tif (!err) {\r\n\t\t\tgetStore().setValue({\r\n\t\t\t\tfield: \"apps\",\r\n\t\t\t\tvalue: apps,\r\n\t\t\t});\r\n\t\t}\r\n\t});\r\n\treturn apps;\r\n}\r\n\r\n/**\r\n * Call to appD to get the list of all tags\r\n */\r\nasync function getTags() {\r\n\tlet tags = await appd.getTags((err, tags) => {\r\n\t\tgetStore().setValue({\r\n\t\t\tfield: \"tags\",\r\n\t\t\tvalue: tags,\r\n\t\t});\r\n\t});\r\n\treturn tags;\r\n}\r\n\r\n/**\r\n * Function to write errors to the log\r\n * @param {string} message The log message\r\n * @param {string} [protocol] Provide the logging protocol (default is error)\r\n */\r\nfunction writeToLog(message, protocol = \"error\") {\r\n\tFSBL.Clients.Logger[protocol](message);\r\n}\r\n\r\n/**\r\n * Function to \"install\" an app. Adds the id to a list of installed apps\r\n * @param {string} name The name of the app\r\n */\r\nasync function addApp(id, cb = Function.prototype) {\r\n\tconst { activeApp, installed, apps } = data;\r\n\tconst appID = id;\r\n\tconst app = apps.find((app) => app.appId === appID);\r\n\r\n\tif (!app) {\r\n\t\tFSBL.Clients.Logger.system.error(\r\n\t\t\t`Attempted to install app with id: ${id}, but could not find it in the local store.`\r\n\t\t);\r\n\t\treturn cb();\r\n\t}\r\n\r\n\tconst name = app.title || app.name;\r\n\tconst folder = data.activeFolder;\r\n\r\n\tif (app === undefined) {\r\n\t\tconsole.warn(\"App not found.\");\r\n\t\treturn cb();\r\n\t}\r\n\r\n\tlet manifest, appConfig;\r\n\t// Manifest from FDC3 is a string property which can either be a stringified JSON, or a uri which delivers valid JSON.\r\n\t// The catalog will attempt to parse the string as JSON, then fetch from a URL if that fails.\r\n\t// If both paths fail, notify the user that this app can't be added\r\n\tif (app.manifestType.toLowerCase() === \"finsemble\") {\r\n\t\ttry {\r\n\t\t\tmanifest = JSON.parse(app.manifest);\r\n\t\t} catch (e) {\r\n\t\t\ttry {\r\n\t\t\t\tconst urlRes = await fetch(app.manifest, { method: \"GET\" });\r\n\t\t\t\tmanifest = await urlRes.json();\r\n\t\t\t} catch (e) {\r\n\t\t\t\twriteToLog(\r\n\t\t\t\t\t`${name} is missing a valid manifest or URI that delivers a valid JSON manifest. Unable to add app.`,\r\n\t\t\t\t\t\"error\"\r\n\t\t\t\t);\r\n\t\t\t\treturn cb();\r\n\t\t\t}\r\n\t\t} finally {\r\n\t\t\tappConfig = installed[appID] = {\r\n\t\t\t\tappID,\r\n\t\t\t\ttags: app.tags,\r\n\t\t\t\tname: name.trim(),\r\n\t\t\t\ttype: \"component\",\r\n\t\t\t\tmanifest,\r\n\t\t\t\tcanDelete: true,\r\n\t\t\t\tsource: \"FDC3\",\r\n\t\t\t};\r\n\t\t}\r\n\t} else {\r\n\t\twriteToLog(`${name} does not appear to be a Finsemble manifest. This app cannot be added to Finsemble.`, \"error\");\r\n\t\treturn cb();\r\n\t}\r\n\r\n\tconst ADVANCED_APP_LAUNCHER = data.defaultFolder;\r\n\tconst { folders } = data;\r\n\r\n\tfolders[ADVANCED_APP_LAUNCHER].apps.push(appConfig);\r\n\tif (folder !== ADVANCED_APP_LAUNCHER) folders[folder].apps.push(appConfig);\r\n\r\n\tFSBL.Clients.LauncherClient.registerComponent(\r\n\t\t{\r\n\t\t\tcomponentType: appConfig.name,\r\n\t\t\tmanifest: appConfig.manifest,\r\n\t\t},\r\n\t\t(err, response) => {\r\n\t\t\tgetStore().setValues(\r\n\t\t\t\t[\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfield: \"activeApp\",\r\n\t\t\t\t\t\tvalue: activeApp,\r\n\t\t\t\t\t},\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfield: \"appDefinitions\",\r\n\t\t\t\t\t\tvalue: installed,\r\n\t\t\t\t\t},\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfield: \"appFolders.folders\",\r\n\t\t\t\t\t\tvalue: folders,\r\n\t\t\t\t\t},\r\n\t\t\t\t],\r\n\t\t\t\tcb\r\n\t\t\t);\r\n\t\t}\r\n\t);\r\n}\r\n\r\n/**\r\n * Function to \"uninstall\" an app. Removes the id from a list of installed apps\r\n * @param {string} name The name of the app\r\n */\r\nfunction removeApp(id, cb = Function.prototype) {\r\n\tlet { installed, folders } = data;\r\n\tFSBL.Clients.LauncherClient.unRegisterComponent({ componentType: installed[id].name }, (err, res) => {\r\n\t\tif (err) {\r\n\t\t\tconsole.warn(\"Failed to deregister a component\");\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tfor (const key in data.folders) {\r\n\t\t\tconst appIndex = findAppIndexInFolder(id, key, data.folders);\r\n\t\t\tif (appIndex > -1) {\r\n\t\t\t\tfolders[key].apps.splice(appIndex, 1);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Delete the app from the list\r\n\t\tdelete installed[id];\r\n\r\n\t\tgetStore().setValues(\r\n\t\t\t[\r\n\t\t\t\t{\r\n\t\t\t\t\tfield: \"appDefinitions\",\r\n\t\t\t\t\tvalue: installed,\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tfield: \"appFolders.folders\",\r\n\t\t\t\t\tvalue: folders,\r\n\t\t\t\t},\r\n\t\t\t],\r\n\t\t\tcb\r\n\t\t);\r\n\t});\r\n}\r\n\r\n/**\r\n * Function to set the 'active app' for the catalog.\r\n * @param {string} id The app id to show as the actively showcasing app\r\n */\r\nfunction openApp(id) {\r\n\tlet { apps } = data;\r\n\r\n\tlet index = apps.findIndex((app) => app.appId === id);\r\n\r\n\tif (index > -1) {\r\n\t\tgetStore().setValue({\r\n\t\t\tfield: \"activeApp\",\r\n\t\t\tvalue: id,\r\n\t\t});\r\n\t}\r\n}\r\n\r\n/**\r\n * Clear the activeApp in store\r\n */\r\nfunction clearApp() {\r\n\tgetStore().setValue({\r\n\t\tfield: \"activeApp\",\r\n\t\tvalue: null,\r\n\t});\r\n}\r\n\r\n/**\r\n * Return activeApp from store\r\n *\r\n * @returns {string} activeApp\r\n */\r\nfunction getActiveApp() {\r\n\treturn data.activeApp;\r\n}\r\n\r\n/**\r\n * Set the activeApp param in store\r\n *\r\n * @param {*} app\r\n */\r\nfunction setActiveApp(app) {\r\n\tgetStore().setValue({\r\n\t\tfield: \"activeApp\",\r\n\t\tvalue: app,\r\n\t});\r\n}\r\n\r\n/**\r\n * Retrieves a list of installed apps by id\r\n */\r\nfunction getInstalledApps() {\r\n\treturn data.installed;\r\n}\r\n\r\n/**\r\n * Gets the list of filtered apps (when searching/filtering by tags)\r\n */\r\nfunction getFilteredApps() {\r\n\treturn data.filteredApps;\r\n}\r\n\r\n/**\r\n * Clears the list of filtered apps\r\n */\r\nfunction clearFilteredApps() {\r\n\tgetStore().setValue({\r\n\t\tfield: \"filteredApps\",\r\n\t\tvalue: [],\r\n\t});\r\n}\r\n\r\n/**\r\n * Set the value of the search text in store\r\n *\r\n * @param {set} val Search string\r\n */\r\nfunction setSearchValue(val) {\r\n\tgetStore().setValue({ field: \"searchText\", value: val });\r\n}\r\n\r\n/**\r\n * Get the current value of the text in the store\r\n *\r\n * @returns {string} Search string\r\n */\r\nfunction getSearchValue() {\r\n\treturn data.searchText;\r\n}\r\n\r\n/**\r\n * Clears the search text in store\r\n *\r\n */\r\nfunction clearSearchText() {\r\n\tgetStore().setValue({ field: \"searchText\", value: \"\" });\r\n}\r\n\r\n/**\r\n * Get forceSearch store value\r\n *\r\n * @returns {boolean} forceSearch\r\n */\r\nfunction getForceSearch() {\r\n\treturn data.forceSearch;\r\n}\r\n\r\n/**\r\n * Set the forceSearch value\r\n *\r\n * @param {string} val Boolean value for forceSearch\r\n */\r\nfunction setForceSearch(val) {\r\n\tgetStore().setValue({ field: \"forceSearch\", value: val });\r\n}\r\n\r\n/**\r\n * Gets the list of active tags (these are tags that are actively filtering the content list)\r\n */\r\nfunction getActiveTags() {\r\n\treturn data.activeTags;\r\n}\r\n\r\n/**\r\n * Adds an 'active tag' to the list of filtered tags\r\n * @param {string} tag The tag name\r\n */\r\nfunction addTag(tag) {\r\n\t_addActiveTag(tag);\r\n}\r\n\r\n/**\r\n * Removes an 'active tag' from the list of filtered tags\r\n * @param {string} tag The tag name\r\n */\r\nfunction removeTag(tag) {\r\n\t_removeActiveTag(tag);\r\n}\r\n\r\n/**\r\n * Refreshes the active tags search\r\n */\r\nfunction refreshTagSearch() {\r\n\tfilterApps();\r\n}\r\n\r\n/**\r\n * Removes all tags from the active tags list\r\n */\r\nfunction clearTags() {\r\n\t_clearActiveTags();\r\n}\r\n\r\n/**\r\n * Calls appD to search the directory of apps based on search text and tag names\r\n * @param {string} terms The search terms provided by the user\r\n */\r\nfunction searchApps(terms, cb = Function.prototype) {\r\n\tdata.searchText = terms;\r\n\tsetForceSearch(true);\r\n\tgetStore().setValue(\r\n\t\t{\r\n\t\t\tfield: \"searchText\",\r\n\t\t\tvalue: terms,\r\n\t\t},\r\n\t\t() => {\r\n\t\t\tfilterApps();\r\n\t\t\tcb();\r\n\t\t}\r\n\t);\r\n}\r\n"]}
1
+ {"version":3,"file":"storeActions.js","sourceRoot":"","sources":["../../../../src/components/appCatalog/stores/storeActions.js"],"names":[],"mappings":"AAIA,OAAO,YAAY,MAAM,yBAAyB,CAAC;AACnD,OAAO,IAAI,MAAM,iBAAiB,CA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EAAE,CAAC;AACd,CAAC;AAMD,SAAS,SAAS,CAAC,GAAG;IACrB,gBAAgB,CAAC,GAAG,CAAC,CAAC;AACvB,CAAC;AAMD,SAAS,aAAa,CAAC,GAAG;IACzB,IAAI,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;IAC1B,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QAC9B,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACrB;IAED,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,GAAG,EAAE;QACpE,UAAU,EAAE,CAAC;IACd,CAAC,CAAC,CAAC;AACJ,CAAC;AAMD,SAAS,MAAM,CAAC,GAAG;IAClB,aAAa,CAAC,GAAG,CAAC,CAAC;AACpB,CAAC;AAED,eAAe;IACd,UAAU;IACV,OAAO;IACP,eAAe;IACf,iBAAiB;IACjB,UAAU;IACV,aAAa;IACb,OAAO;IACP,MAAM;IACN,SAAS;IACT,gBAAgB;IAChB,SAAS;IACT,eAAe;IACf,MAAM;IACN,SAAS;IACT,OAAO;IACP,QAAQ;IACR,gBAAgB;IAChB,YAAY;IACZ,YAAY;IACZ,UAAU;IACV,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,MAAM;CACN,CAAC","sourcesContent":["/*!\r\n * Copyright 2017 - 2020 by ChartIQ, Inc.\r\n * All rights reserved.\r\n */\r\nimport AppDirectory from \"../modules/AppDirectory\";\r\nimport FDC3 from \"../modules/FDC3\";\r\nimport { getStore } from \"./appStore\";\r\nimport { findIndex } from \"lodash\";\r\n\r\nexport const findAppIndexInFolder = (appID, folderName, folders) =>\r\n\tfindIndex(folders[folderName].apps, (app) => app.appID === appID);\r\n\r\nconst data = {};\r\nlet FDC3Client;\r\nlet appd;\r\n\r\nfunction initialize(done = Function.prototype) {\r\n\tFSBL.Clients.ConfigClient.getValue({ field: \"finsemble.appDirectoryEndpoint\" }, (err, appDirectoryEndpoint) => {\r\n\t\tFDC3Client = new FDC3({ url: appDirectoryEndpoint });\r\n\t\tappd = new AppDirectory(FDC3Client);\r\n\r\n\t\tconst store = getStore();\r\n\t\tdata.apps = store.values.apps;\r\n\t\tstore.getValue({ field: \"appFolders.folders\" }, (_err, folders) => {\r\n\t\t\tdata.folders = folders;\r\n\t\t\tstore.addListener({ field: \"appFolders.folders\" }, (__err, dt) => (data.folders = dt.value));\r\n\t\t});\r\n\t\tstore.getValue({ field: \"activeFolder\" }, (_err, active) => {\r\n\t\t\tdata.activeFolder = active;\r\n\t\t\tstore.addListener({ field: \"activeFolder\" }, (__err, dt) => (data.activeFolder = dt.value));\r\n\t\t});\r\n\t\tstore.getValue({ field: \"defaultFolder\" }, (_err, folder) => {\r\n\t\t\tdata.defaultFolder = folder;\r\n\t\t});\r\n\r\n\t\tdata.installed = store.values.appDefinitions;\r\n\t\tdata.tags = store.values.tags;\r\n\t\tdata.filteredApps = store.values.filteredApps;\r\n\t\tdata.activeTags = store.values.activeTags;\r\n\t\tdata.activeApp = store.values.activeApp;\r\n\t\tdata.searchText = store.values.searchText;\r\n\t\tdata.forceSearch = store.values.forceSearch;\r\n\t\tdata.ADVANCED_APP_LAUNCHER = store.values.defaultFolder;\r\n\r\n\t\tstore.addListener({ field: \"apps\" }, (_err, dt) => (data.apps = dt.value));\r\n\t\tstore.addListener({ field: \"appDefinitions\" }, (_err, dt) => (data.installed = dt.value));\r\n\t\tstore.addListener({ field: \"tags\" }, (_err, dt) => (data.tags = dt.value));\r\n\t\tstore.addListener({ field: \"activeApp\" }, (_err, dt) => (data.activeApp = dt.value));\r\n\t\tstore.addListener({ field: \"activeTags\" }, (_err, dt) => (data.activeTags = dt.value));\r\n\t\tstore.addListener({ field: \"filteredApps\" }, (_err, dt) => (data.filteredApps = dt.value));\r\n\t\tstore.addListener({ field: \"searchText\" }, (_err, dt) => (data.searchText = dt.value));\r\n\t\tstore.addListener({ field: \"forceSearch\" }, (_err, dt) => (data.forceSearch = dt.value));\r\n\t\tdone();\r\n\t});\r\n}\r\n\r\n/**\r\n * Clears all active tags\r\n */\r\nfunction _clearActiveTags() {\r\n\tgetStore().setValue({ field: \"activeTags\", value: [] });\r\n}\r\n\r\n/**\r\n * Async function to fetch apps from the FDC3 api (appD)\r\n */\r\nasync function getApps() {\r\n\treturn await appd.getAll((err, retrievedApps) => {\r\n\t\tif (!err) {\r\n\t\t\tgetStore().setValue({\r\n\t\t\t\tfield: \"apps\",\r\n\t\t\t\tvalue: retrievedApps,\r\n\t\t\t});\r\n\t\t}\r\n\t});\r\n}\r\n\r\n/**\r\n * Call to appD to get the list of all tags\r\n */\r\nasync function getTags() {\r\n\treturn await appd.getTags((err, retrievedTags) => {\r\n\t\tgetStore().setValue({\r\n\t\t\tfield: \"tags\",\r\n\t\t\tvalue: retrievedTags,\r\n\t\t});\r\n\t});\r\n}\r\n\r\n/**\r\n * Function to write errors to the log\r\n * @param {string} message The log message\r\n * @param {string} [protocol] Provide the logging protocol (default is error)\r\n */\r\nfunction writeToLog(message, protocol = \"error\") {\r\n\tFSBL.Clients.Logger[protocol](message);\r\n}\r\n\r\n/**\r\n * Function to \"install\" an app. Adds the id to a list of installed apps\r\n * @param {string} name The name of the app\r\n */\r\nasync function addApp(id, cb = Function.prototype) {\r\n\tconst { activeApp, installed, apps } = data;\r\n\tconst appID = id;\r\n\tconst app = apps.find((checkedApp) => checkedApp.appId === appID);\r\n\r\n\tif (!app) {\r\n\t\tFSBL.Clients.Logger.system.error(\r\n\t\t\t`Attempted to install app with id: ${id}, but could not find it in the local store.`\r\n\t\t);\r\n\t\treturn cb();\r\n\t}\r\n\r\n\tconst name = app.title || app.name;\r\n\tconst folder = data.activeFolder;\r\n\r\n\tif (app === undefined) {\r\n\t\tconsole.warn(\"App not found.\");\r\n\t\treturn cb();\r\n\t}\r\n\r\n\tlet manifest;\r\n\tlet appConfig;\r\n\t// Manifest from FDC3 is a string property which can either be a stringified JSON, or a uri which delivers valid JSON.\r\n\t// The catalog will attempt to parse the string as JSON, then fetch from a URL if that fails.\r\n\t// If both paths fail, notify the user that this app can't be added\r\n\tif (app.manifestType.toLowerCase() === \"finsemble\") {\r\n\t\ttry {\r\n\t\t\tmanifest = JSON.parse(app.manifest);\r\n\t\t} catch (e) {\r\n\t\t\ttry {\r\n\t\t\t\tconst urlRes = await fetch(app.manifest, { method: \"GET\" });\r\n\t\t\t\tmanifest = await urlRes.json();\r\n\t\t\t} catch (err) {\r\n\t\t\t\twriteToLog(\r\n\t\t\t\t\t`${name} is missing a valid manifest or URI that delivers a valid JSON manifest. Unable to add app.`,\r\n\t\t\t\t\t\"error\"\r\n\t\t\t\t);\r\n\t\t\t\treturn cb();\r\n\t\t\t}\r\n\t\t} finally {\r\n\t\t\tappConfig = installed[appID] = {\r\n\t\t\t\tappID,\r\n\t\t\t\ttags: app.tags,\r\n\t\t\t\tname: name.trim(),\r\n\t\t\t\ttype: \"component\",\r\n\t\t\t\tmanifest,\r\n\t\t\t\tcanDelete: true,\r\n\t\t\t\tsource: \"FDC3\",\r\n\t\t\t};\r\n\t\t}\r\n\t} else {\r\n\t\twriteToLog(`${name} does not appear to be a Finsemble manifest. This app cannot be added to Finsemble.`, \"error\");\r\n\t\treturn cb();\r\n\t}\r\n\r\n\tconst ADVANCED_APP_LAUNCHER = data.defaultFolder;\r\n\tconst { folders } = data;\r\n\r\n\tfolders[ADVANCED_APP_LAUNCHER].apps.push(appConfig);\r\n\tif (folder !== ADVANCED_APP_LAUNCHER) folders[folder].apps.push(appConfig);\r\n\r\n\tFSBL.Clients.LauncherClient.registerComponent(\r\n\t\t{\r\n\t\t\tcomponentType: appConfig.name,\r\n\t\t\tmanifest: appConfig.manifest,\r\n\t\t},\r\n\t\t() => {\r\n\t\t\tgetStore().setValues(\r\n\t\t\t\t[\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfield: \"activeApp\",\r\n\t\t\t\t\t\tvalue: activeApp,\r\n\t\t\t\t\t},\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfield: \"appDefinitions\",\r\n\t\t\t\t\t\tvalue: installed,\r\n\t\t\t\t\t},\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfield: \"appFolders.folders\",\r\n\t\t\t\t\t\tvalue: folders,\r\n\t\t\t\t\t},\r\n\t\t\t\t],\r\n\t\t\t\tcb\r\n\t\t\t);\r\n\t\t}\r\n\t);\r\n}\r\n\r\n/**\r\n * Function to \"uninstall\" an app. Removes the id from a list of installed apps\r\n * @param {string} name The name of the app\r\n */\r\nfunction removeApp(id, cb = Function.prototype) {\r\n\tlet { installed, folders } = data;\r\n\tFSBL.Clients.LauncherClient.unRegisterComponent({ componentType: installed[id].name }, (err) => {\r\n\t\tif (err) {\r\n\t\t\tconsole.warn(\"Failed to deregister a component\");\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tfor (const key in data.folders) {\r\n\t\t\tconst appIndex = findAppIndexInFolder(id, key, data.folders);\r\n\t\t\tif (appIndex > -1) {\r\n\t\t\t\tfolders[key].apps.splice(appIndex, 1);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Delete the app from the list\r\n\t\tdelete installed[id];\r\n\r\n\t\tgetStore().setValues(\r\n\t\t\t[\r\n\t\t\t\t{\r\n\t\t\t\t\tfield: \"appDefinitions\",\r\n\t\t\t\t\tvalue: installed,\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tfield: \"appFolders.folders\",\r\n\t\t\t\t\tvalue: folders,\r\n\t\t\t\t},\r\n\t\t\t],\r\n\t\t\tcb\r\n\t\t);\r\n\t});\r\n}\r\n\r\n/**\r\n * Function to set the 'active app' for the catalog.\r\n * @param {string} id The app id to show as the actively showcasing app\r\n */\r\nfunction openApp(id) {\r\n\tlet { apps } = data;\r\n\r\n\tlet index = apps.findIndex((app) => app.appId === id);\r\n\r\n\tif (index > -1) {\r\n\t\tgetStore().setValue({\r\n\t\t\tfield: \"activeApp\",\r\n\t\t\tvalue: id,\r\n\t\t});\r\n\t}\r\n}\r\n\r\n/**\r\n * Clear the activeApp in store\r\n */\r\nfunction clearApp() {\r\n\tgetStore().setValue({\r\n\t\tfield: \"activeApp\",\r\n\t\tvalue: null,\r\n\t});\r\n}\r\n\r\n/**\r\n * Return activeApp from store\r\n *\r\n * @returns {string} activeApp\r\n */\r\nfunction getActiveApp() {\r\n\treturn data.activeApp;\r\n}\r\n\r\n/**\r\n * Set the activeApp param in store\r\n *\r\n * @param {*} app\r\n */\r\nfunction setActiveApp(app) {\r\n\tgetStore().setValue({\r\n\t\tfield: \"activeApp\",\r\n\t\tvalue: app,\r\n\t});\r\n}\r\n\r\n/**\r\n * Retrieves a list of installed apps by id\r\n */\r\nfunction getInstalledApps() {\r\n\treturn data.installed;\r\n}\r\n\r\n/**\r\n * Gets the list of filtered apps (when searching/filtering by tags)\r\n */\r\nfunction getFilteredApps() {\r\n\treturn data.filteredApps;\r\n}\r\n\r\n/**\r\n * Clears the list of filtered apps\r\n */\r\nfunction clearFilteredApps() {\r\n\tgetStore().setValue({\r\n\t\tfield: \"filteredApps\",\r\n\t\tvalue: [],\r\n\t});\r\n}\r\n\r\n/**\r\n * Set the value of the search text in store\r\n *\r\n * @param {set} val Search string\r\n */\r\nfunction setSearchValue(val) {\r\n\tgetStore().setValue({ field: \"searchText\", value: val });\r\n}\r\n\r\n/**\r\n * Get the current value of the text in the store\r\n *\r\n * @returns {string} Search string\r\n */\r\nfunction getSearchValue() {\r\n\treturn data.searchText;\r\n}\r\n\r\n/**\r\n * Clears the search text in store\r\n *\r\n */\r\nfunction clearSearchText() {\r\n\tgetStore().setValue({ field: \"searchText\", value: \"\" });\r\n}\r\n\r\n/**\r\n * Get forceSearch store value\r\n *\r\n * @returns {boolean} forceSearch\r\n */\r\nfunction getForceSearch() {\r\n\treturn data.forceSearch;\r\n}\r\n\r\n/**\r\n * Set the forceSearch value\r\n *\r\n * @param {string} val Boolean value for forceSearch\r\n */\r\nfunction setForceSearch(val) {\r\n\tgetStore().setValue({ field: \"forceSearch\", value: val });\r\n}\r\n\r\n/**\r\n * Gets the list of active tags (these are tags that are actively filtering the content list)\r\n */\r\nfunction getActiveTags() {\r\n\treturn data.activeTags; // type: string[]\r\n}\r\n\r\n/**\r\n * Removes all tags from the active tags list\r\n */\r\nfunction clearTags() {\r\n\t_clearActiveTags();\r\n}\r\n\r\n/**\r\n * Return to the App Catalog home page\r\n */\r\nfunction goHome() {\r\n\tsetForceSearch(false);\r\n\tclearFilteredApps();\r\n\tclearApp();\r\n\tclearTags();\r\n\tclearSearchText();\r\n}\r\n\r\n/**\r\n * Send the search text and tags to the appd server and get a list of apps\r\n */\r\nfunction filterApps() {\r\n\tlet { activeTags, searchText } = data;\r\n\r\n\tif (activeTags.length === 0 && searchText === \"\") {\r\n\t\tgoHome();\r\n\t} else {\r\n\t\tappd.search({ text: searchText, tags: activeTags }, (err, retrievedData) => {\r\n\t\t\tif (err) {\r\n\t\t\t\tFSBL.Logger.system.error(`FDC3 App search failed!: ${err}`);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tgetStore().setValue({ field: \"activeApp\", value: null });\r\n\t\t\tgetStore().setValue({ field: \"activeTags\", value: activeTags });\r\n\t\t\tgetStore().setValue({ field: \"filteredApps\", value: retrievedData });\r\n\t\t});\r\n\t}\r\n}\r\n\r\n/**\r\n * Refreshes the active tags search\r\n */\r\nfunction refreshTagSearch() {\r\n\tfilterApps();\r\n}\r\n\r\n/**\r\n * Calls appD to search the directory of apps based on search text and tag names\r\n * @param {string} terms The search terms provided by the user\r\n */\r\nfunction searchApps(terms, cb = Function.prototype) {\r\n\tdata.searchText = terms;\r\n\tsetForceSearch(true);\r\n\tgetStore().setValue(\r\n\t\t{\r\n\t\t\tfield: \"searchText\",\r\n\t\t\tvalue: terms,\r\n\t\t},\r\n\t\t() => {\r\n\t\t\tfilterApps();\r\n\t\t\tcb();\r\n\t\t}\r\n\t);\r\n}\r\n\r\n/**\r\n * Private function to remove an active tag. This will filter apps based on tags\r\n * @param {string} tag The name of the tag\r\n */\r\nfunction _removeActiveTag(tag) {\r\n\tdata.activeTags = data.activeTags.filter((currentTag) => currentTag !== tag);\r\n\r\n\tgetStore().setValue({ field: \"activeTags\", value: data.activeTags });\r\n\tfilterApps();\r\n}\r\n\r\n/**\r\n * Removes an 'active tag' from the list of filtered tags\r\n * @param {string} tag The tag name\r\n */\r\nfunction removeTag(tag) {\r\n\t_removeActiveTag(tag);\r\n}\r\n\r\n/**\r\n * Private function to add an active tag. This will filter apps based on tags\r\n * @param {string} tag The name of the tag\r\n */\r\nfunction _addActiveTag(tag) {\r\n\tlet { activeTags } = data;\r\n\tif (!activeTags.includes(tag)) {\r\n\t\tactiveTags.push(tag);\r\n\t}\r\n\r\n\tgetStore().setValue({ field: \"activeTags\", value: activeTags }, () => {\r\n\t\tfilterApps();\r\n\t});\r\n}\r\n\r\n/**\r\n * Adds an 'active tag' to the list of filtered tags\r\n * @param {string} tag The tag name\r\n */\r\nfunction addTag(tag) {\r\n\t_addActiveTag(tag);\r\n}\r\n\r\nexport default {\r\n\tinitialize,\r\n\tgetApps,\r\n\tgetFilteredApps,\r\n\tclearFilteredApps,\r\n\tsearchApps,\r\n\tgetActiveTags,\r\n\tgetTags,\r\n\taddTag,\r\n\tremoveTag,\r\n\trefreshTagSearch,\r\n\tclearTags,\r\n\tclearSearchText,\r\n\taddApp,\r\n\tremoveApp,\r\n\topenApp,\r\n\tclearApp,\r\n\tgetInstalledApps,\r\n\tgetActiveApp,\r\n\tsetActiveApp,\r\n\tfilterApps,\r\n\tsetSearchValue,\r\n\tsetForceSearch,\r\n\tgetSearchValue,\r\n\tgetForceSearch,\r\n\tgoHome,\r\n};\r\n"]}
@@ -1,8 +1,8 @@
1
1
  import React from "react";
2
2
  import "./css/button.css";
3
- import { FinsembleIcon } from "./FinsembleIcon";
3
+ import { FinsembleIconType } from "./FinsembleIcon";
4
4
  export interface AdvancedButtonProps {
5
- icon: FinsembleIcon;
5
+ icon: FinsembleIconType;
6
6
  text: string;
7
7
  disabled?: boolean;
8
8
  onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
@@ -13,8 +13,8 @@ export interface AdvancedButtonProps {
13
13
  export interface ButtonProps {
14
14
  fashion: "secondary" | "primary" | "danger" | "ghost" | "danger ghost";
15
15
  text: string;
16
- iconBefore?: FinsembleIcon;
17
- iconAfter?: FinsembleIcon;
16
+ iconBefore?: FinsembleIconType;
17
+ iconAfter?: FinsembleIconType;
18
18
  disabled?: boolean;
19
19
  onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
20
20
  className?: string;
@@ -13,7 +13,7 @@ export const fashion_class_lookup = {
13
13
  export const Button = ({ fashion = "secondary", text = "", iconBefore, iconAfter, disabled = false, onClick = () => { }, className = "", buttonAttributes = {}, fixedSize, }) => {
14
14
  const containerClassName = [fashion_class_lookup[fashion], className].join(" ");
15
15
  return (React.createElement("div", { className: `${containerClassName}` },
16
- React.createElement("button", { ...buttonAttributes, onClick: onClick, disabled: disabled, style: { width: fixedSize } },
16
+ React.createElement("button", Object.assign({}, buttonAttributes, { onClick: onClick, disabled: disabled, style: { width: fixedSize } }),
17
17
  iconBefore && React.createElement(FinsembleIcon, { className: "button-icon-before", icon: iconBefore }),
18
18
  text,
19
19
  iconAfter && React.createElement(FinsembleIcon, { className: "button-icon-after", icon: iconAfter }))));
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/components/common/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAwBhD,MAAM,CAAC,MAAM,oBAAoB,GAAG;IACnC,SAAS,EAAE,4BAA4B;IACvC,IAAI,EAAE,uBAAuB;IAC7B,OAAO,EAAE,0BAA0B;IACnC,IAAI,EAAE,uBAAuB;IAC7B,MAAM,EAAE,yBAAyB;IACjC,KAAK,EAAE,wBAAwB;IAC/B,cAAc,EAAE,+BAA+B;CAC/C,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAA0B,CAAC,EAC7C,OAAO,GAAG,WAAW,EACrB,IAAI,GAAG,EAAE,EACT,UAAU,EACV,SAAS,EACT,QAAQ,GAAG,KAAK,EAChB,OAAO,GAAG,GAAG,EAAE,GAAE,CAAC,EAClB,SAAS,GAAG,EAAE,EACd,gBAAgB,GAAG,EAAE,EACrB,SAAS,GACT,EAAE,EAAE;IACJ,MAAM,kBAAkB,GAAG,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAEhF,OAAO,CACN,6BAAK,SAAS,EAAE,GAAG,kBAAkB,EAAE;QACtC,mCAAY,gBAAgB,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE;YAC7F,UAAU,IAAI,oBAAC,aAAa,IAAC,SAAS,EAAC,oBAAoB,EAAC,IAAI,EAAE,UAAU,GAAkB;YAC9F,IAAI;YACJ,SAAS,IAAI,oBAAC,aAAa,IAAC,SAAS,EAAC,mBAAmB,EAAC,IAAI,EAAE,SAAS,GAAkB,CACpF,CACJ,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React from \"react\";\r\nimport \"./css/button.css\";\r\nimport { FinsembleIcon } from \"./FinsembleIcon\";\r\n\r\nexport interface AdvancedButtonProps {\r\n\ticon: FinsembleIcon;\r\n\ttext: string;\r\n\tdisabled?: boolean;\r\n\tonClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;\r\n\ttabIndex?: number;\r\n\tclassName?: string;\r\n\tbuttonAttributes?: object;\r\n}\r\n\r\nexport interface ButtonProps {\r\n\tfashion: \"secondary\" | \"primary\" | \"danger\" | \"ghost\" | \"danger ghost\";\r\n\ttext: string;\r\n\ticonBefore?: FinsembleIcon;\r\n\ticonAfter?: FinsembleIcon;\r\n\tdisabled?: boolean;\r\n\tonClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;\r\n\tclassName?: string;\r\n\tbuttonAttributes?: object;\r\n\tfixedSize?: number;\r\n}\r\n\r\nexport const fashion_class_lookup = {\r\n\tsecondary: \"button-container-secondary\",\r\n\ttile: \"button-container-tile\",\r\n\tprimary: \"button-container-primary\",\r\n\ticon: \"button-container-icon\",\r\n\tdanger: \"button-container-danger\",\r\n\tghost: \"button-container-ghost\",\r\n\t\"danger ghost\": \"button-container-danger-ghost\",\r\n};\r\n\r\nexport const Button: React.FC<ButtonProps> = ({\r\n\tfashion = \"secondary\",\r\n\ttext = \"\",\r\n\ticonBefore,\r\n\ticonAfter,\r\n\tdisabled = false,\r\n\tonClick = () => {},\r\n\tclassName = \"\",\r\n\tbuttonAttributes = {},\r\n\tfixedSize,\r\n}) => {\r\n\tconst containerClassName = [fashion_class_lookup[fashion], className].join(\" \");\r\n\r\n\treturn (\r\n\t\t<div className={`${containerClassName}`}>\r\n\t\t\t<button {...buttonAttributes} onClick={onClick} disabled={disabled} style={{ width: fixedSize }}>\r\n\t\t\t\t{iconBefore && <FinsembleIcon className=\"button-icon-before\" icon={iconBefore}></FinsembleIcon>}\r\n\t\t\t\t{text}\r\n\t\t\t\t{iconAfter && <FinsembleIcon className=\"button-icon-after\" icon={iconAfter}></FinsembleIcon>}\r\n\t\t\t</button>\r\n\t\t</div>\r\n\t);\r\n};\r\n"]}
1
+ {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/components/common/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAqB,MAAM,iBAAiB,CAAC;AAwBnE,MAAM,CAAC,MAAM,oBAAoB,GAAG;IACnC,SAAS,EAAE,4BAA4B;IACvC,IAAI,EAAE,uBAAuB;IAC7B,OAAO,EAAE,0BAA0B;IACnC,IAAI,EAAE,uBAAuB;IAC7B,MAAM,EAAE,yBAAyB;IACjC,KAAK,EAAE,wBAAwB;IAC/B,cAAc,EAAE,+BAA+B;CAC/C,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAA0B,CAAC,EAC7C,OAAO,GAAG,WAAW,EACrB,IAAI,GAAG,EAAE,EACT,UAAU,EACV,SAAS,EACT,QAAQ,GAAG,KAAK,EAChB,OAAO,GAAG,GAAG,EAAE,GAAE,CAAC,EAClB,SAAS,GAAG,EAAE,EACd,gBAAgB,GAAG,EAAE,EACrB,SAAS,GACT,EAAE,EAAE;IACJ,MAAM,kBAAkB,GAAG,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAEhF,OAAO,CACN,6BAAK,SAAS,EAAE,GAAG,kBAAkB,EAAE;QACtC,gDAAY,gBAAgB,IAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE;YAC7F,UAAU,IAAI,oBAAC,aAAa,IAAC,SAAS,EAAC,oBAAoB,EAAC,IAAI,EAAE,UAAU,GAAkB;YAC9F,IAAI;YACJ,SAAS,IAAI,oBAAC,aAAa,IAAC,SAAS,EAAC,mBAAmB,EAAC,IAAI,EAAE,SAAS,GAAkB,CACpF,CACJ,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React from \"react\";\r\nimport \"./css/button.css\";\r\nimport { FinsembleIcon, FinsembleIconType } from \"./FinsembleIcon\";\r\n\r\nexport interface AdvancedButtonProps {\r\n\ticon: FinsembleIconType;\r\n\ttext: string;\r\n\tdisabled?: boolean;\r\n\tonClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;\r\n\ttabIndex?: number;\r\n\tclassName?: string;\r\n\tbuttonAttributes?: object;\r\n}\r\n\r\nexport interface ButtonProps {\r\n\tfashion: \"secondary\" | \"primary\" | \"danger\" | \"ghost\" | \"danger ghost\";\r\n\ttext: string;\r\n\ticonBefore?: FinsembleIconType;\r\n\ticonAfter?: FinsembleIconType;\r\n\tdisabled?: boolean;\r\n\tonClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;\r\n\tclassName?: string;\r\n\tbuttonAttributes?: object;\r\n\tfixedSize?: number;\r\n}\r\n\r\nexport const fashion_class_lookup = {\r\n\tsecondary: \"button-container-secondary\",\r\n\ttile: \"button-container-tile\",\r\n\tprimary: \"button-container-primary\",\r\n\ticon: \"button-container-icon\",\r\n\tdanger: \"button-container-danger\",\r\n\tghost: \"button-container-ghost\",\r\n\t\"danger ghost\": \"button-container-danger-ghost\",\r\n};\r\n\r\nexport const Button: React.FC<ButtonProps> = ({\r\n\tfashion = \"secondary\",\r\n\ttext = \"\",\r\n\ticonBefore,\r\n\ticonAfter,\r\n\tdisabled = false,\r\n\tonClick = () => {},\r\n\tclassName = \"\",\r\n\tbuttonAttributes = {},\r\n\tfixedSize,\r\n}) => {\r\n\tconst containerClassName = [fashion_class_lookup[fashion], className].join(\" \");\r\n\r\n\treturn (\r\n\t\t<div className={`${containerClassName}`}>\r\n\t\t\t<button {...buttonAttributes} onClick={onClick} disabled={disabled} style={{ width: fixedSize }}>\r\n\t\t\t\t{iconBefore && <FinsembleIcon className=\"button-icon-before\" icon={iconBefore}></FinsembleIcon>}\r\n\t\t\t\t{text}\r\n\t\t\t\t{iconAfter && <FinsembleIcon className=\"button-icon-after\" icon={iconAfter}></FinsembleIcon>}\r\n\t\t\t</button>\r\n\t\t</div>\r\n\t);\r\n};\r\n"]}
@@ -5,7 +5,7 @@ import { FinsembleIcon } from "./FinsembleIcon";
5
5
  export const ButtonIcon = ({ icon, text = "", disabled = false, tabIndex = 0, onClick = () => { }, className = "", buttonAttributes = {}, }) => {
6
6
  const containerClassName = fashion_class_lookup.icon;
7
7
  return (React.createElement("div", { className: `${containerClassName} ${className}` },
8
- React.createElement("button", { ...buttonAttributes, onClick: onClick, disabled: disabled, title: text, tabIndex: tabIndex },
8
+ React.createElement("button", Object.assign({}, buttonAttributes, { onClick: onClick, disabled: disabled, title: text, tabIndex: tabIndex }),
9
9
  React.createElement(FinsembleIcon, { icon: icon }))));
10
10
  };
11
11
  //# sourceMappingURL=ButtonIcon.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonIcon.js","sourceRoot":"","sources":["../../../src/components/common/ButtonIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAuB,oBAAoB,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,CAAC,MAAM,UAAU,GAAkC,CAAC,EACzD,IAAI,EACJ,IAAI,GAAG,EAAE,EACT,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,CAAC,EACZ,OAAO,GAAG,GAAG,EAAE,GAAE,CAAC,EAClB,SAAS,GAAG,EAAE,EACd,gBAAgB,GAAG,EAAE,GACrB,EAAE,EAAE;IACJ,MAAM,kBAAkB,GAAG,oBAAoB,CAAC,IAAI,CAAC;IAErD,OAAO,CACN,6BAAK,SAAS,EAAE,GAAG,kBAAkB,IAAI,SAAS,EAAE;QACnD,mCAAY,gBAAgB,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ;YAClG,oBAAC,aAAa,IAAC,IAAI,EAAE,IAAI,GAAkB,CACnC,CACJ,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React from \"react\";\r\nimport { AdvancedButtonProps, fashion_class_lookup } from \"./Button\";\r\nimport \"./css/button.css\";\r\nimport { FinsembleIcon } from \"./FinsembleIcon\";\r\n\r\nexport const ButtonIcon: React.FC<AdvancedButtonProps> = ({\r\n\ticon,\r\n\ttext = \"\",\r\n\tdisabled = false,\r\n\ttabIndex = 0,\r\n\tonClick = () => {},\r\n\tclassName = \"\",\r\n\tbuttonAttributes = {},\r\n}) => {\r\n\tconst containerClassName = fashion_class_lookup.icon;\r\n\r\n\treturn (\r\n\t\t<div className={`${containerClassName} ${className}`}>\r\n\t\t\t<button {...buttonAttributes} onClick={onClick} disabled={disabled} title={text} tabIndex={tabIndex}>\r\n\t\t\t\t<FinsembleIcon icon={icon}></FinsembleIcon>\r\n\t\t\t</button>\r\n\t\t</div>\r\n\t);\r\n};\r\n"]}
1
+ {"version":3,"file":"ButtonIcon.js","sourceRoot":"","sources":["../../../src/components/common/ButtonIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAuB,oBAAoB,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,CAAC,MAAM,UAAU,GAAkC,CAAC,EACzD,IAAI,EACJ,IAAI,GAAG,EAAE,EACT,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,CAAC,EACZ,OAAO,GAAG,GAAG,EAAE,GAAE,CAAC,EAClB,SAAS,GAAG,EAAE,EACd,gBAAgB,GAAG,EAAE,GACrB,EAAE,EAAE;IACJ,MAAM,kBAAkB,GAAG,oBAAoB,CAAC,IAAI,CAAC;IAErD,OAAO,CACN,6BAAK,SAAS,EAAE,GAAG,kBAAkB,IAAI,SAAS,EAAE;QACnD,gDAAY,gBAAgB,IAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ;YAClG,oBAAC,aAAa,IAAC,IAAI,EAAE,IAAI,GAAkB,CACnC,CACJ,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React from \"react\";\r\nimport { AdvancedButtonProps, fashion_class_lookup } from \"./Button\";\r\nimport \"./css/button.css\";\r\nimport { FinsembleIcon } from \"./FinsembleIcon\";\r\n\r\nexport const ButtonIcon: React.FC<AdvancedButtonProps> = ({\r\n\ticon,\r\n\ttext = \"\",\r\n\tdisabled = false,\r\n\ttabIndex = 0,\r\n\tonClick = () => {},\r\n\tclassName = \"\",\r\n\tbuttonAttributes = {},\r\n}) => {\r\n\tconst containerClassName = fashion_class_lookup.icon;\r\n\r\n\treturn (\r\n\t\t<div className={`${containerClassName} ${className}`}>\r\n\t\t\t<button {...buttonAttributes} onClick={onClick} disabled={disabled} title={text} tabIndex={tabIndex}>\r\n\t\t\t\t<FinsembleIcon icon={icon}></FinsembleIcon>\r\n\t\t\t</button>\r\n\t\t</div>\r\n\t);\r\n};\r\n"]}
@@ -46,6 +46,6 @@ export const ColorPicker = ({ id, startColor, updateColor }) => {
46
46
  };
47
47
  return (React.createElement("div", { className: "color-picker" },
48
48
  React.createElement("input", { className: "theme-color-picker", type: "color", value: color, onChange: onColorChanged, "aria-hidden": "true" }),
49
- React.createElement("input", { className: "theme-color-picker-text", type: "text", "aria-invalid": !isValid, value: color, onChange: onColorChanged, ...{ id } })));
49
+ React.createElement("input", Object.assign({ className: "theme-color-picker-text", type: "text", "aria-invalid": !isValid, value: color, onChange: onColorChanged }, { id }))));
50
50
  };
51
51
  //# sourceMappingURL=ColorPicker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ColorPicker.js","sourceRoot":"","sources":["../../../src/components/common/ColorPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,wBAAwB,CAAC;AAEhC,MAAM,YAAY,GAAG,iBAAiB,CAAC;AAEvC,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACvB,6CAAO,CAAA;IACP,iDAAS,CAAA;IACT,+CAAQ,CAAA;IACR,iDAAS,CAAA;AACV,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB;AAGD,MAAM,UAAU,WA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,CAAC,CAAC;IAC3D,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;IAEnD,SAAS,CAAC,GAAG,EAAE;QACd,IAAI,OAAO,EAAE;YACZ,WAAW,CAAC,KAAK,CAAC,CAAC;SACnB;IACF,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,SAAS,CAAC,GAAG,EAAE;QACd,IAAI,UAAU,EAAE;YACf,QAAQ,CAAC,UAAU,CAAC,CAAC;SACrB;IACF,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjB,MAAM,cAAc,GAAG,CAAC,EAAE,MAAM,EAAgC,EAAE,EAAE;QACnE,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC,CAAC;IAEF,OAAO,CACN,6BAAK,SAAS,EAAC,cAAc;QAC5B,+BACC,SAAS,EAAC,oBAAoB,EAC9B,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,cAAc,iBACZ,MAAM,GACV;QACT,+BACC,SAAS,EAAC,yBAAyB,EACnC,IAAI,EAAC,MAAM,kBACG,CAAC,OAAO,EACtB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,cAAc,KACpB,EAAE,EAAE,EAAE,GACF,CACJ,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { useState, useEffect } from \"react\";\r\nimport \"./css/color-picker.css\";\r\n\r\nconst RE_HEX_COLOR = /^#[0-9a-f]{6}$/i;\r\n\r\nexport enum RGBA_CHANNEL {\r\n\tRED = 0,\r\n\tGREEN = 1,\r\n\tBLUE = 2,\r\n\tALPHA = 3,\r\n}\r\n\r\n// From https://stackoverflow.com/a/24390910\r\nexport function colorToRGBA(color: string) {\r\n\t// Returns the color as an array of [r, g, b, a] -- all range from 0 - 255\r\n\t// color must be a valid canvas fillStyle. This will cover most anything\r\n\t// you'd want to use.\r\n\t// Examples:\r\n\t// colorToRGBA('red') # [255, 0, 0, 255]\r\n\t// colorToRGBA('#f00') # [255, 0, 0, 255]\r\n\tconst cvs = document.createElement(\"canvas\");\r\n\tcvs.height = 1;\r\n\tcvs.width = 1;\r\n\r\n\tconst ctx = cvs.getContext(\"2d\")!;\r\n\tctx.fillStyle = color;\r\n\tctx.fillRect(0, 0, 1, 1);\r\n\treturn ctx.getImageData(0, 0, 1, 1).data;\r\n}\r\n\r\nfunction byteToHex(num: number) {\r\n\t// Turns a number (0-255) into a 2-character hex number (00-ff)\r\n\treturn `0${num.toString(16)}`.slice(-2);\r\n}\r\n\r\nfunction colorToHex(color: string) {\r\n\t// Convert any CSS color to a hex representation\r\n\t// Examples:\r\n\t// colorToHex('red') # '#ff0000'\r\n\t// colorToHex('rgb(255, 0, 0)') # '#ff0000'\r\n\t// colorToHex('#ff0000') # '#ff0000'\r\n\tif (color.match(RE_HEX_COLOR) !== null) {\r\n\t\treturn color;\r\n\t}\r\n\tconst rgba = colorToRGBA(color);\r\n\tconst hex = [0, 1, 2].map((idx) => byteToHex(rgba[idx])).join(\"\");\r\n\treturn `#${hex}`;\r\n}\r\n\r\nexport interface ColorPickerProps {\r\n\tstartColor: string;\r\n\tupdateColor: (newColor: string) => void;\r\n\tid?: string;\r\n}\r\n\r\n/**\r\n * ColorPicker component to update theme variables. Displays a browser color input alongside a text version for hex color values.\r\n *\r\n * @param {{ [id]: string, startColor: string; updateColor: function }} { id, startColor, callback }\r\n */\r\nexport const ColorPicker = ({ id, startColor, updateColor }: ColorPickerProps) => {\r\n\tconst [color, setColor] = useState(colorToHex(startColor));\r\n\tconst isValid = color.match(RE_HEX_COLOR) !== null;\r\n\r\n\tuseEffect(() => {\r\n\t\tif (isValid) {\r\n\t\t\tupdateColor(color);\r\n\t\t}\r\n\t}, [color]);\r\n\r\n\tuseEffect(() => {\r\n\t\tif (startColor) {\r\n\t\t\tsetColor(startColor);\r\n\t\t}\r\n\t}, [startColor]);\r\n\r\n\tconst onColorChanged = ({ target }: { target: HTMLInputElement }) => {\r\n\t\tsetColor(target.value);\r\n\t};\r\n\r\n\treturn (\r\n\t\t<div className=\"color-picker\">\r\n\t\t\t<input\r\n\t\t\t\tclassName=\"theme-color-picker\"\r\n\t\t\t\ttype=\"color\"\r\n\t\t\t\tvalue={color}\r\n\t\t\t\tonChange={onColorChanged}\r\n\t\t\t\taria-hidden=\"true\"\r\n\t\t\t></input>\r\n\t\t\t<input\r\n\t\t\t\tclassName=\"theme-color-picker-text\"\r\n\t\t\t\ttype=\"text\"\r\n\t\t\t\taria-invalid={!isValid}\r\n\t\t\t\tvalue={color}\r\n\t\t\t\tonChange={onColorChanged}\r\n\t\t\t\t{...{ id }}\r\n\t\t\t></input>\r\n\t\t</div>\r\n\t);\r\n};\r\n"]}
1
+ {"version":3,"file":"ColorPicker.js","sourceRoot":"","sources":["../../../src/components/common/ColorPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,wBAAwB,CAAC;AAEhC,MAAM,YAAY,GAAG,iBAAiB,CAAC;AAEvC,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACvB,6CAAO,CAAA;IACP,iDAAS,CAAA;IACT,+CAAQ,CAAA;IACR,iDAAS,CAAA;AACV,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB;AAGD,MAAM,UAAU,WAAW,CAAC,KAAa;IAOxC,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC7C,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC;IACf,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;IAEd,MAAM,GAAG,GAAG,GAAG,CAAC,UAAU,CAAC,IAAI,CAAE,CAAC;IAClC,GAAG,CAAC,SAAS,GAAG,KAAK,CAAC;IACtB,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EA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,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjB,MAAM,cAAc,GAAG,CAAC,EAAE,MAAM,EAAgC,EAAE,EAAE;QACnE,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC,CAAC;IAEF,OAAO,CACN,6BAAK,SAAS,EAAC,cAAc;QAC5B,+BACC,SAAS,EAAC,oBAAoB,EAC9B,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,cAAc,iBACZ,MAAM,GACV;QACT,6CACC,SAAS,EAAC,yBAAyB,EACnC,IAAI,EAAC,MAAM,kBACG,CAAC,OAAO,EACtB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,cAAc,IACpB,EAAE,EAAE,EAAE,EACF,CACJ,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { useState, useEffect } from \"react\";\r\nimport \"./css/color-picker.css\";\r\n\r\nconst RE_HEX_COLOR = /^#[0-9a-f]{6}$/i;\r\n\r\nexport enum RGBA_CHANNEL {\r\n\tRED = 0,\r\n\tGREEN = 1,\r\n\tBLUE = 2,\r\n\tALPHA = 3,\r\n}\r\n\r\n// From https://stackoverflow.com/a/24390910\r\nexport function colorToRGBA(color: string) {\r\n\t// Returns the color as an array of [r, g, b, a] -- all range from 0 - 255\r\n\t// color must be a valid canvas fillStyle. This will cover most anything\r\n\t// you'd want to use.\r\n\t// Examples:\r\n\t// colorToRGBA('red') # [255, 0, 0, 255]\r\n\t// colorToRGBA('#f00') # [255, 0, 0, 255]\r\n\tconst cvs = document.createElement(\"canvas\");\r\n\tcvs.height = 1;\r\n\tcvs.width = 1;\r\n\r\n\tconst ctx = cvs.getContext(\"2d\")!;\r\n\tctx.fillStyle = color;\r\n\tctx.fillRect(0, 0, 1, 1);\r\n\treturn ctx.getImageData(0, 0, 1, 1).data;\r\n}\r\n\r\nfunction byteToHex(num: number) {\r\n\t// Turns a number (0-255) into a 2-character hex number (00-ff)\r\n\treturn `0${num.toString(16)}`.slice(-2);\r\n}\r\n\r\nfunction colorToHex(color: string) {\r\n\t// Convert any CSS color to a hex representation\r\n\t// Examples:\r\n\t// colorToHex('red') # '#ff0000'\r\n\t// colorToHex('rgb(255, 0, 0)') # '#ff0000'\r\n\t// colorToHex('#ff0000') # '#ff0000'\r\n\tif (color.match(RE_HEX_COLOR) !== null) {\r\n\t\treturn color;\r\n\t}\r\n\tconst rgba = colorToRGBA(color);\r\n\tconst hex = [0, 1, 2].map((idx) => byteToHex(rgba[idx])).join(\"\");\r\n\treturn `#${hex}`;\r\n}\r\n\r\nexport interface ColorPickerProps {\r\n\tstartColor: string;\r\n\tupdateColor: (newColor: string) => void;\r\n\tid?: string;\r\n}\r\n\r\n/**\r\n * ColorPicker component to update theme variables. Displays a browser color input alongside a text version for hex color values.\r\n *\r\n * @param {{ [id]: string, startColor: string; updateColor: function }} { id, startColor, callback }\r\n */\r\nexport const ColorPicker = ({ id, startColor, updateColor }: ColorPickerProps) => {\r\n\tconst [color, setColor] = useState(colorToHex(startColor));\r\n\tconst isValid = color.match(RE_HEX_COLOR) !== null;\r\n\r\n\tuseEffect(() => {\r\n\t\tif (isValid) {\r\n\t\t\tupdateColor(color);\r\n\t\t}\r\n\t}, [color]);\r\n\r\n\tuseEffect(() => {\r\n\t\tif (startColor) {\r\n\t\t\tsetColor(startColor);\r\n\t\t}\r\n\t}, [startColor]);\r\n\r\n\tconst onColorChanged = ({ target }: { target: HTMLInputElement }) => {\r\n\t\tsetColor(target.value);\r\n\t};\r\n\r\n\treturn (\r\n\t\t<div className=\"color-picker\">\r\n\t\t\t<input\r\n\t\t\t\tclassName=\"theme-color-picker\"\r\n\t\t\t\ttype=\"color\"\r\n\t\t\t\tvalue={color}\r\n\t\t\t\tonChange={onColorChanged}\r\n\t\t\t\taria-hidden=\"true\"\r\n\t\t\t></input>\r\n\t\t\t<input\r\n\t\t\t\tclassName=\"theme-color-picker-text\"\r\n\t\t\t\ttype=\"text\"\r\n\t\t\t\taria-invalid={!isValid}\r\n\t\t\t\tvalue={color}\r\n\t\t\t\tonChange={onColorChanged}\r\n\t\t\t\t{...{ id }}\r\n\t\t\t></input>\r\n\t\t</div>\r\n\t);\r\n};\r\n"]}
@@ -1,10 +1,5 @@
1
1
  import React from "react";
2
2
  import "./css/drop-zone.css";
3
- declare global {
4
- interface Window {
5
- File: object;
6
- }
7
- }
8
3
  export declare type FileWithPath = File & {
9
4
  path?: string;
10
5
  };
@@ -1 +1 @@
1
- {"version":3,"file":"DropZone.js","sourceRoot":"","sources":["../../../src/components/common/DropZone.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAa,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,qBAAqB,CAAC;AA4B7B,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,GAAG,KAAK,EAAiB,EAAE,EAAE;IACtF,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAEjD,MAAM,eAAe,GAAG,CAAC,CAA0D,EAAE,EAAE;QACtF,CAAC,CAAC,cAAc,EAAE,CAAC;QACnB,CAAC,CAAC,eAAe,EAAE,CAAC;IACrB,CAAC,CAAC;IAIF,IAAI,SAAS,EAAE;QAId,IAAI,OAAO,GAA0B,IAAI,CAAC;QAC1C,QAAQ,CAAC,gBAAgB,CAAC,UAAU,EAAE,CAAC,CAAC,EAAE,EAAE;YAC3C,eAAe,CAAC,CAAC,CAAC,CAAC;YACnB,YAAY,CAAC,IAAI,CAAC,CAAC;YAGnB,IAAI,OAAO,KAAK,IAAI,EAAE;gBACrB,YAAY,CAAC,OAAO,CAAC,CAAC;aACtB;YAGD,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;gBAEzB,YAAY,CAAC,KAAK,CAAC,CAAC;YACrB,CAAC,EAAE,GAAG,CAAC,CAAC;QAET,CAAC,CAAC,CAAC;QACH,YAAY,CAAC,KAAK,CAAC,CAAC;KACpB;IAED,OAAO,QAAQ,CAAC,CAAC,CAAC,CACjB,0CAAG,QAAQ,CAAI,CACf,CAAC,CAAC,CAAC,CACH,6BACC,SAAS,EAAE,YAAY,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,EAAE,EACnF,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE;YAClB,eAAe,CAAC,CAAC,CAAC,CAAC;YACnB,aAAa,CAAC,IAAI,CAAC,CAAC;QACrB,CAAC,EACD,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE;YAClB,eAAe,CAAC,CAAC,CAAC,CAAC;YACnB,aAAa,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC,EACD,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE;YACb,aAAa,CAAC,KAAK,CAAC,CAAC;YAErB,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,YAAY,CAAC;YACjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACtC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;oBACtB,SAAS;iBACT;gBACD,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;aACzB;YAED,eAAe,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC,IAEA,QAAQ,CACJ,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { useEffect, useState } from \"react\";\r\nimport \"./css/drop-zone.css\";\r\n\r\ndeclare global {\r\n\tinterface Window {\r\n\t\tFile: object;\r\n\t}\r\n}\r\n\r\n// Electron adds File.path\r\nexport type FileWithPath = File & { path?: string };\r\n\r\nexport type DropZoneProps = {\r\n\tchildren: React.ReactNode;\r\n\tprocessFile: (fileObj: FileWithPath, index: number) => void;\r\n\tsuppress?: boolean;\r\n};\r\n\r\n/***\r\n * Component that serves as a drop zone. It also keeps track of visual concerns and event handlers for\r\n * drag-and-drop.\r\n *\r\n * The DropZone component is intended to be a container element for other elements, such as text, lists,\r\n * images, input elements, etc.\r\n *\r\n * @callback processFile - This function will be called for each file that is dropped in the dropzone.\r\n * @param {ReactNode} children - React will fill this in.\r\n * @param {boolean} suppress=false - If the dropzone-ness should be suppressed, which would turn this container into just a div\r\n */\r\nexport const DropZone = ({ processFile, children, suppress = false }: DropZoneProps) => {\r\n\tconst [isDragging, setIsDragging] = useState(false);\r\n\tconst [potential, setPotential] = useState(false);\r\n\tconst [singleton, setSingleton] = useState(true);\r\n\r\n\tconst preventDefaults = (e: { preventDefault: Function; stopPropagation: Function }) => {\r\n\t\te.preventDefault();\r\n\t\te.stopPropagation();\r\n\t};\r\n\r\n\t// Check if something is being dragged somewhere on the page\r\n\t// If dragging is happening on the page, there will be a visual indication for potential drop zone\r\n\tif (singleton) {\r\n\t\t// \"dragenter\" and \"dragleave\" events are fired off of every single child element, and counting them isn't reliable\r\n\t\t// so, when \"dragover\" events are fired, we know dragging is happening.\r\n\t\t// we will wait 100ms after the last \"dragover\" event is fired, and then turn off the potential zone.\r\n\t\tlet timeout: NodeJS.Timeout | null = null;\r\n\t\tdocument.addEventListener(\"dragover\", (e) => {\r\n\t\t\tpreventDefaults(e);\r\n\t\t\tsetPotential(true);\r\n\r\n\t\t\t// If timeout was previously set, clear it\r\n\t\t\tif (timeout !== null) {\r\n\t\t\t\tclearTimeout(timeout);\r\n\t\t\t}\r\n\r\n\t\t\t// Set a new timeout, now that we've gotten a new dragover event\r\n\t\t\ttimeout = setTimeout(() => {\r\n\t\t\t\t// If it's been 100ms and no dragover event has been fired, assume the user isn't dragging anymore.\r\n\t\t\t\tsetPotential(false);\r\n\t\t\t}, 100); // 100ms was chosen by trial and error.\r\n\t\t\t// 10ms was too little time, and caused flicker. 100ms doesn't have a flicker, and turns off potential without a noticeable delay\r\n\t\t});\r\n\t\tsetSingleton(false);\r\n\t}\r\n\r\n\treturn suppress ? (\r\n\t\t<>{children}</>\r\n\t) : (\r\n\t\t<div\r\n\t\t\tclassName={`dropZone ${isDragging ? \"isDragging\" : potential ? \"isPotential\" : \"\"}`}\r\n\t\t\tonDragEnter={(e) => {\r\n\t\t\t\tpreventDefaults(e);\r\n\t\t\t\tsetIsDragging(true);\r\n\t\t\t}}\r\n\t\t\tonDragLeave={(e) => {\r\n\t\t\t\tpreventDefaults(e);\r\n\t\t\t\tsetIsDragging(false);\r\n\t\t\t}}\r\n\t\t\tonDrop={(e) => {\r\n\t\t\t\tsetIsDragging(false);\r\n\r\n\t\t\t\tconst { files } = e.dataTransfer;\r\n\t\t\t\tfor (let i = 0; i < files.length; i++) {\r\n\t\t\t\t\tif (files[i] === null) {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tprocessFile(files[i], i);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tpreventDefaults(e);\r\n\t\t\t}}\r\n\t\t>\r\n\t\t\t{children}\r\n\t\t</div>\r\n\t);\r\n};\r\n"]}
1
+ {"version":3,"file":"DropZone.js","sourceRoot":"","sources":["../../../src/components/common/DropZone.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,qBAAqB,CAAC;AAsB7B,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,GAAG,KAAK,EAAiB,EAAE,EAAE;IACtF,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpD,MAAM,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MAAM,EAAE,CAAC,CAAC,EAAE,EAAE;YACb,aAAa,CAAC,KAAK,CAAC,CAAC;YAErB,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,YAAY,CAAC;YACjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACtC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;oBACtB,SAAS;iBACT;gBACD,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;aACzB;YAED,eAAe,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC,IAEA,QAAQ,CACJ,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { useState } from \"react\";\r\nimport \"./css/drop-zone.css\";\r\n\r\n// Electron adds File.path\r\nexport type FileWithPath = File & { path?: string };\r\n\r\nexport type DropZoneProps = {\r\n\tchildren: React.ReactNode;\r\n\tprocessFile: (fileObj: FileWithPath, index: number) => void;\r\n\tsuppress?: boolean;\r\n};\r\n\r\n/***\r\n * Component that serves as a drop zone. It also keeps track of visual concerns and event handlers for\r\n * drag-and-drop.\r\n *\r\n * The DropZone component is intended to be a container element for other elements, such as text, lists,\r\n * images, input elements, etc.\r\n *\r\n * @callback processFile - This function will be called for each file that is dropped in the dropzone.\r\n * @param {ReactNode} children - React will fill this in.\r\n * @param {boolean} suppress=false - If the dropzone-ness should be suppressed, which would turn this container into just a div\r\n */\r\nexport const DropZone = ({ processFile, children, suppress = false }: DropZoneProps) => {\r\n\tconst [isDragging, setIsDragging] = useState(false);\r\n\tconst [potential, setPotential] = useState(false);\r\n\tconst [singleton, setSingleton] = useState(true);\r\n\r\n\tconst preventDefaults = (e: { preventDefault: Function; stopPropagation: Function }) => {\r\n\t\te.preventDefault();\r\n\t\te.stopPropagation();\r\n\t};\r\n\r\n\t// Check if something is being dragged somewhere on the page\r\n\t// If dragging is happening on the page, there will be a visual indication for potential drop zone\r\n\tif (singleton) {\r\n\t\t// \"dragenter\" and \"dragleave\" events are fired off of every single child element, and counting them isn't reliable\r\n\t\t// so, when \"dragover\" events are fired, we know dragging is happening.\r\n\t\t// we will wait 100ms after the last \"dragover\" event is fired, and then turn off the potential zone.\r\n\t\tlet timeout: NodeJS.Timeout | null = null;\r\n\t\tdocument.addEventListener(\"dragover\", (e) => {\r\n\t\t\tpreventDefaults(e);\r\n\t\t\tsetPotential(true);\r\n\r\n\t\t\t// If timeout was previously set, clear it\r\n\t\t\tif (timeout !== null) {\r\n\t\t\t\tclearTimeout(timeout);\r\n\t\t\t}\r\n\r\n\t\t\t// Set a new timeout, now that we've gotten a new dragover event\r\n\t\t\ttimeout = setTimeout(() => {\r\n\t\t\t\t// If it's been 100ms and no dragover event has been fired, assume the user isn't dragging anymore.\r\n\t\t\t\tsetPotential(false);\r\n\t\t\t}, 100); // 100ms was chosen by trial and error.\r\n\t\t\t// 10ms was too little time, and caused flicker. 100ms doesn't have a flicker, and turns off potential without a noticeable delay\r\n\t\t});\r\n\t\tsetSingleton(false);\r\n\t}\r\n\r\n\treturn suppress ? (\r\n\t\t<>{children}</>\r\n\t) : (\r\n\t\t<div\r\n\t\t\tclassName={`dropZone ${isDragging ? \"isDragging\" : potential ? \"isPotential\" : \"\"}`}\r\n\t\t\tonDragEnter={(e) => {\r\n\t\t\t\tpreventDefaults(e);\r\n\t\t\t\tsetIsDragging(true);\r\n\t\t\t}}\r\n\t\t\tonDragLeave={(e) => {\r\n\t\t\t\tpreventDefaults(e);\r\n\t\t\t\tsetIsDragging(false);\r\n\t\t\t}}\r\n\t\t\tonDrop={(e) => {\r\n\t\t\t\tsetIsDragging(false);\r\n\r\n\t\t\t\tconst { files } = e.dataTransfer;\r\n\t\t\t\tfor (let i = 0; i < files.length; i++) {\r\n\t\t\t\t\tif (files[i] === null) {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tprocessFile(files[i], i);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tpreventDefaults(e);\r\n\t\t\t}}\r\n\t\t>\r\n\t\t\t{children}\r\n\t\t</div>\r\n\t);\r\n};\r\n"]}
@@ -25,7 +25,7 @@ const DropdownButton = ({ buttonLabel = "Label", buttonOptions = [], mainAction,
25
25
  React.createElement("div", { className: "finsemble-dropdown-action__btn" },
26
26
  React.createElement("span", { className: "btn-label", onClick: buttonAction }, buttonLabel),
27
27
  React.createElement("span", { className: "separator" }),
28
- React.createElement("div", { className: "expand-options", onClick: (event) => setExpanded(!expanded) },
28
+ React.createElement("div", { className: "expand-options", onClick: () => setExpanded(!expanded) },
29
29
  React.createElement("span", { className: "caret" }))),
30
30
  expanded ? React.createElement("div", { className: "finsemble-dropdown-action__btn-options" }, options) : null));
31
31
  };
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownButton.js","sourceRoot":"","sources":["../../../src/components/common/DropdownButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,6BAA6B,CAAC;AACrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAS9E,MAAM,cAAc,GAAiE,CAAC,EACrF,WAAW,GAAG,OAAO,EACrB,aAAa,GAAG,EAAE,EAClB,UAAU,GAC2B,EAAE,EAAE;IACzC,MAAM,UAAU,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAChD,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEhD,uBAAuB,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;IAE9D,MAAM,OAAO,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CACpD,6BACC,GAAG,EAAE,KAAK,EACV,SAAS,EAAC,uCAAuC,EACjD,OAAO,EAAE,GAAG,EAAE;YACb,MAAM,CAAC,YAAY,EAAE,CAAC;YACtB,WAAW,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC,IAEA,MAAM,CAAC,WAAW,CACd,CACN,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,GAAG,EAAE;QACzB,IAAI,QAAQ,EAAE;YACb,WAAW,CAAC,KAAK,CAAC,CAAC;YACnB,OAAO;SACP;QAED,IAAI,UAAU,EAAE;YACf,UAAU,EAAE,CAAC;SACb;aAAM;YACN,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC,CAAC;SAC7B;IACF,CAAC,CAAC;IAEF,OAAO,CACN,6BAAK,GAAG,EAAE,UAAU,EAAE,SAAS,EAAC,0CAA0C;QACzE,6BAAK,SAAS,EAAC,gCAAgC;YAC9C,8BAAM,SAAS,EAAC,WAAW,EAAC,OAAO,EAAE,YAAY,IAC/C,WAAW,CACN;YACP,8BAAM,SAAS,EAAC,WAAW,GAAQ;YACnC,6BAAK,SAAS,EAAC,gBAAgB,EAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC;gBACzE,8BAAM,SAAS,EAAC,OAAO,GAAQ,CAC1B,CACD;QACL,QAAQ,CAAC,CAAC,CAAC,6BAAK,SAAS,EAAC,wCAAwC,IAAE,OAAO,CAAO,CAAC,CAAC,CAAC,IAAI,CACrF,CACN,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import React, { useState, useRef } from \"react\";\r\nimport \"../../assets/css/button.css\";\r\nimport { useOutsideClickDetector } from \"../../hooks/useOutsideClickDetector\";\r\nimport { IFinsembleButtonProps } from \"../shared/Button\";\r\n\r\nexport interface IFinsembleDropdownActionButtonProps {\r\n\tbuttonLabel: string;\r\n\tbuttonOptions: Array<IFinsembleButtonProps>;\r\n\tmainAction: Function;\r\n}\r\n\r\nconst DropdownButton: React.FunctionComponent<IFinsembleDropdownActionButtonProps> = ({\r\n\tbuttonLabel = \"Label\",\r\n\tbuttonOptions = [],\r\n\tmainAction,\r\n}: IFinsembleDropdownActionButtonProps) => {\r\n\tconst wrapperRef = useRef<HTMLDivElement>(null);\r\n\tconst [expanded, setExpanded] = useState(false);\r\n\r\n\tuseOutsideClickDetector(wrapperRef, () => setExpanded(false));\r\n\r\n\tconst options = buttonOptions.map((option, index) => (\r\n\t\t<div\r\n\t\t\tkey={index}\r\n\t\t\tclassName=\"finsemble-dropdown-action__btn-option\"\r\n\t\t\tonClick={() => {\r\n\t\t\t\toption.clickHandler();\r\n\t\t\t\tsetExpanded(false);\r\n\t\t\t}}\r\n\t\t>\r\n\t\t\t{option.buttonLabel}\r\n\t\t</div>\r\n\t));\r\n\r\n\tconst buttonAction = () => {\r\n\t\tif (expanded) {\r\n\t\t\tsetExpanded(false);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (mainAction) {\r\n\t\t\tmainAction();\r\n\t\t} else {\r\n\t\t\t() => setExpanded(!expanded);\r\n\t\t}\r\n\t};\r\n\r\n\treturn (\r\n\t\t<div ref={wrapperRef} className=\"finsemble-dropdown-action__btn-container\">\r\n\t\t\t<div className=\"finsemble-dropdown-action__btn\">\r\n\t\t\t\t<span className=\"btn-label\" onClick={buttonAction}>\r\n\t\t\t\t\t{buttonLabel}\r\n\t\t\t\t</span>\r\n\t\t\t\t<span className=\"separator\"></span>\r\n\t\t\t\t<div className=\"expand-options\" onClick={(event) => setExpanded(!expanded)}>\r\n\t\t\t\t\t<span className=\"caret\"></span>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\t{expanded ? <div className=\"finsemble-dropdown-action__btn-options\">{options}</div> : null}\r\n\t\t</div>\r\n\t);\r\n};\r\n\r\nexport default DropdownButton;\r\n"]}
1
+ {"version":3,"file":"DropdownButton.js","sourceRoot":"","sources":["../../../src/components/common/DropdownButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA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;YACnC,6BAAK,SAAS,EAAC,gBAAgB,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC;gBACpE,8BAAM,SAAS,EAAC,OAAO,GAAQ,CAC1B,CACD;QACL,QAAQ,CAAC,CAAC,CAAC,6BAAK,SAAS,EAAC,wCAAwC,IAAE,OAAO,CAAO,CAAC,CAAC,CAAC,IAAI,CACrF,CACN,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import React, { useState, useRef } from \"react\";\r\nimport \"../../assets/css/button.css\";\r\nimport { useOutsideClickDetector } from \"../../hooks/useOutsideClickDetector\";\r\nimport { IFinsembleButtonProps } from \"../shared/Button\";\r\n\r\nexport interface IFinsembleDropdownActionButtonProps {\r\n\tbuttonLabel: string;\r\n\tbuttonOptions: Array<IFinsembleButtonProps>;\r\n\tmainAction: Function;\r\n}\r\n\r\nconst DropdownButton: React.FunctionComponent<IFinsembleDropdownActionButtonProps> = ({\r\n\tbuttonLabel = \"Label\",\r\n\tbuttonOptions = [],\r\n\tmainAction,\r\n}: IFinsembleDropdownActionButtonProps) => {\r\n\tconst wrapperRef = useRef<HTMLDivElement>(null);\r\n\tconst [expanded, setExpanded] = useState(false);\r\n\r\n\tuseOutsideClickDetector(wrapperRef, () => setExpanded(false));\r\n\r\n\tconst options = buttonOptions.map((option, index) => (\r\n\t\t<div\r\n\t\t\tkey={index}\r\n\t\t\tclassName=\"finsemble-dropdown-action__btn-option\"\r\n\t\t\tonClick={() => {\r\n\t\t\t\toption.clickHandler();\r\n\t\t\t\tsetExpanded(false);\r\n\t\t\t}}\r\n\t\t>\r\n\t\t\t{option.buttonLabel}\r\n\t\t</div>\r\n\t));\r\n\r\n\tconst buttonAction = () => {\r\n\t\tif (expanded) {\r\n\t\t\tsetExpanded(false);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (mainAction) {\r\n\t\t\tmainAction();\r\n\t\t} else {\r\n\t\t\t() => setExpanded(!expanded);\r\n\t\t}\r\n\t};\r\n\r\n\treturn (\r\n\t\t<div ref={wrapperRef} className=\"finsemble-dropdown-action__btn-container\">\r\n\t\t\t<div className=\"finsemble-dropdown-action__btn\">\r\n\t\t\t\t<span className=\"btn-label\" onClick={buttonAction}>\r\n\t\t\t\t\t{buttonLabel}\r\n\t\t\t\t</span>\r\n\t\t\t\t<span className=\"separator\"></span>\r\n\t\t\t\t<div className=\"expand-options\" onClick={() => setExpanded(!expanded)}>\r\n\t\t\t\t\t<span className=\"caret\"></span>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\t{expanded ? <div className=\"finsemble-dropdown-action__btn-options\">{options}</div> : null}\r\n\t\t</div>\r\n\t);\r\n};\r\n\r\nexport default DropdownButton;\r\n"]}
@@ -4,11 +4,6 @@
4
4
  */
5
5
  /// <reference types="react" />
6
6
  import "./css/file-input.css";
7
- declare global {
8
- interface Window {
9
- File: object;
10
- }
11
- }
12
7
  export declare type FileInputUploadCb = (fileObject: File, cb?: (progress: number) => void) => Promise<{
13
8
  err: string | null;
14
9
  path: string;
@@ -36,7 +36,7 @@ export const FileInput = ({ acceptTypes, value, onSetValue, id, shouldUpload = t
36
36
  dispatch(SmartDesktopDesignerActions.delete_project_error(INVALID_FILE_TYPE_ERROR));
37
37
  setErrorMessage(null);
38
38
  setPath(successPath);
39
- onSetValue?.(successPath);
39
+ onSetValue === null || onSetValue === void 0 ? void 0 : onSetValue(successPath);
40
40
  fileInput.value = "";
41
41
  }
42
42
  };
@@ -48,12 +48,9 @@ export const FileInput = ({ acceptTypes, value, onSetValue, id, shouldUpload = t
48
48
  return;
49
49
  }
50
50
  setIsUploading(true);
51
- uploadFunction?.(fileObj, (progress) => {
51
+ uploadFunction === null || uploadFunction === void 0 ? void 0 : uploadFunction(fileObj, (progress) => {
52
52
  setUploadProgress(progress);
53
- })
54
- .then(uploadSuccess)
55
- .catch(uploadError)
56
- .finally(() => {
53
+ }).then(uploadSuccess).catch(uploadError).finally(() => {
57
54
  setIsUploading(false);
58
55
  setUploadProgress(0);
59
56
  });
@@ -62,7 +59,7 @@ export const FileInput = ({ acceptTypes, value, onSetValue, id, shouldUpload = t
62
59
  if (shouldUpload) {
63
60
  uploadFile(fileObj);
64
61
  }
65
- else if (fileObj?.path) {
62
+ else if (fileObj === null || fileObj === void 0 ? void 0 : fileObj.path) {
66
63
  uploadSuccess({
67
64
  err: null,
68
65
  path: fileObj.path,
@@ -76,7 +73,8 @@ export const FileInput = ({ acceptTypes, value, onSetValue, id, shouldUpload = t
76
73
  setPath(value || "");
77
74
  }, [value]);
78
75
  const onFileChange = (e) => {
79
- const fileObj = e.target.files?.[0];
76
+ var _a;
77
+ const fileObj = (_a = e.target.files) === null || _a === void 0 ? void 0 : _a[0];
80
78
  if (fileObj !== undefined) {
81
79
  processFile(fileObj);
82
80
  }
@@ -96,7 +94,7 @@ export const FileInput = ({ acceptTypes, value, onSetValue, id, shouldUpload = t
96
94
  fileInputElement.current.click();
97
95
  } })),
98
96
  React.createElement("div", { className: "file-input-value" },
99
- React.createElement("input", { className: "file-input-value-input", type: "text", disabled: true, value: path, "aria-invalid": isInvalid, ...{ id } }),
97
+ React.createElement("input", Object.assign({ className: "file-input-value-input", type: "text", disabled: true, value: path, "aria-invalid": isInvalid }, { id })),
100
98
  errorMessage && React.createElement("div", { className: "file-input-error" }, errorMessage)),
101
99
  React.createElement("div", { className: "file-input-status" }, isUploading ? (React.createElement("div", { className: "file-input-progress-container" },
102
100
  uploadProgress,
@@ -1 +1 @@
1
- {"version":3,"file":"FileInput.js","sourceRoot":"","sources":["../../../src/components/common/FileInput.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AA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,OAAO,EAAC,SAAS,EACjB,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE;wBACb,gBAAgB,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;oBAClC,CAAC,GACA,CACG;YACN,6BAAK,SAAS,EAAC,kBAAkB;gBAChC,+BACC,SAAS,EAAC,wBAAwB,EAClC,IAAI,EAAC,MAAM,EACX,QAAQ,QACR,KAAK,EAAE,IAAI,kBACG,SAAS,KACnB,EAAE,EAAE,EAAE,GACF;gBACR,YAAY,IAAI,6BAAK,SAAS,EAAC,kBAAkB,IAAE,YAAY,CAAO,CAClE;YACN,6BAAK,SAAS,EAAC,mBAAmB,IAChC,WAAW,CAAC,CAAC,CAAC,CACd,6BAAK,SAAS,EAAC,+BAA+B;gBAAE,cAAc;6BAAiB,CAC/E,CAAC,CAAC,CAAC,CACH,CAAC,YAAY,IAAI,yCAAK,CACtB,CACI,CACD,CACI,CACX,CAAC;AACH,CAAC,CAAC","sourcesContent":["/*!\r\n * Copyright 2017 - 2020 by ChartIQ, Inc.\r\n * All rights reserved.\r\n */\r\n\r\nimport React, { useState, useRef, useEffect } from \"react\";\r\nimport { SmartDesktopDesignerActions } from \"../../actions/smartDesktopDesignerActions\";\r\nimport { useDispatch } from \"../../store\";\r\nimport { ProjectError } from \"../../types/smartDesktopDesignerTypes\";\r\n\r\nimport { Button } from \"./Button\";\r\nimport \"./css/file-input.css\";\r\n\r\nimport { DropZone, FileWithPath } from \"./DropZone\";\r\nimport { validateFilename } from \"./file_helpers\";\r\n\r\ndeclare global {\r\n\tinterface Window {\r\n\t\tFile: object;\r\n\t}\r\n}\r\n\r\nexport type FileInputUploadCb = (\r\n\tfileObject: File,\r\n\tcb?: (progress: number) => void\r\n) => Promise<{ err: string | null; path: string }>;\r\n\r\nexport type FileInputProps = {\r\n\tacceptTypes: string[];\r\n\tvalue: string;\r\n\tid?: string;\r\n\tshouldUpload?: boolean;\r\n\tonSetValue?: (value: string) => void;\r\n\tuploadFunction?: FileInputUploadCb;\r\n\tpresetFile?: null | File;\r\n\tsuppressDropzone?: boolean;\r\n};\r\n\r\nconst INVALID_FILE_TYPE_ERROR: ProjectError = {\r\n\tviewId: \"themes\",\r\n\tmessage: \"Your uploaded file is not in the correct format\",\r\n};\r\n\r\nconst defaultUploadFunction = async () => {\r\n\treturn { err: null, path: \"\" };\r\n};\r\n\r\n/**\r\n * A Browse button with a hidden file input to allow for a file select dialog and extraction of a path\r\n *\r\n * @param {FileInputProps} { acceptTypes, value, onSetValue, shouldUpload=true, uploadFunction = defaultUploadFunction}\r\n * @return {*}\r\n */\r\nexport const FileInput = ({\r\n\tacceptTypes,\r\n\tvalue,\r\n\tonSetValue,\r\n\tid,\r\n\tshouldUpload = true,\r\n\tuploadFunction = defaultUploadFunction,\r\n\tpresetFile = null,\r\n\tsuppressDropzone = false,\r\n}: FileInputProps) => {\r\n\tconst dispatch = useDispatch();\r\n\tconst fileInputElement = useRef({} as HTMLInputElement);\r\n\tconst [isUploading, setIsUploading] = useState(false);\r\n\tconst [uploadProgress, setUploadProgress] = useState(0);\r\n\tconst [fileInput, setFileInput] = useState({} as HTMLInputElement); // cast to correct type so typescript doesn't complain\r\n\tconst [path, setPath] = useState(value || \"\");\r\n\tconst [errorMessage, setErrorMessage] = useState(null as string | null);\r\n\tconst [handedFile, setHandedFile] = useState<FileWithPath | null>(presetFile);\r\n\r\n\tconst isInvalid = validateFilename(acceptTypes, path);\r\n\r\n\tconst uploadSuccess = ({ err, path: successPath }: { err: string | null; path: string }) => {\r\n\t\tif (err) {\r\n\t\t\tdispatch(SmartDesktopDesignerActions.set_project_error(INVALID_FILE_TYPE_ERROR));\r\n\r\n\t\t\tsetErrorMessage(err);\r\n\t\t\tsetPath(\"\");\r\n\t\t} else {\r\n\t\t\tdispatch(SmartDesktopDesignerActions.delete_project_error(INVALID_FILE_TYPE_ERROR));\r\n\t\t\tsetErrorMessage(null);\r\n\t\t\tsetPath(successPath);\r\n\r\n\t\t\tonSetValue?.(successPath);\r\n\r\n\t\t\tfileInput.value = \"\";\r\n\t\t}\r\n\t};\r\n\r\n\tconst uploadError = (err: string) => {\r\n\t\tsetErrorMessage(err);\r\n\t};\r\n\r\n\tconst uploadFile = (fileObj: FileWithPath | undefined) => {\r\n\t\t// If it's not a file, we can't do anything with it\r\n\t\tif (!(fileObj instanceof File)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tsetIsUploading(true);\r\n\t\tuploadFunction?.(fileObj, (progress: number) => {\r\n\t\t\tsetUploadProgress(progress);\r\n\t\t})\r\n\t\t\t.then(uploadSuccess)\r\n\t\t\t.catch(uploadError)\r\n\t\t\t.finally(() => {\r\n\t\t\t\tsetIsUploading(false);\r\n\t\t\t\tsetUploadProgress(0);\r\n\t\t\t});\r\n\t};\r\n\r\n\tconst processFile = (fileObj: FileWithPath) => {\r\n\t\tif (shouldUpload) {\r\n\t\t\tuploadFile(fileObj);\r\n\t\t} else if (fileObj?.path) {\r\n\t\t\t// If the consumer doesn't want the file actually uploaded, just return the file name\r\n\t\t\tuploadSuccess({\r\n\t\t\t\terr: null,\r\n\t\t\t\tpath: fileObj.path,\r\n\t\t\t});\r\n\t\t}\r\n\t\tsetIsUploading(false);\r\n\t\tsetUploadProgress(0);\r\n\t\tsetErrorMessage(null);\r\n\t};\r\n\r\n\tuseEffect(() => {\r\n\t\tsetPath(value || \"\");\r\n\t}, [value]);\r\n\r\n\tconst onFileChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n\t\tconst fileObj = e.target.files?.[0] as FileWithPath | undefined;\r\n\r\n\t\tif (fileObj !== undefined) {\r\n\t\t\tprocessFile(fileObj);\r\n\t\t}\r\n\r\n\t\tsetFileInput(e.target);\r\n\t};\r\n\r\n\t// Check if props updated\r\n\tif (handedFile !== presetFile) {\r\n\t\tsetHandedFile(presetFile);\r\n\t\tif (presetFile !== null) {\r\n\t\t\tuploadFile(presetFile);\r\n\t\t}\r\n\t}\r\n\r\n\treturn (\r\n\t\t<DropZone processFile={processFile} suppress={suppressDropzone}>\r\n\t\t\t<div className=\"file-input-container\">\r\n\t\t\t\t<div className=\"file-input-actions\">\r\n\t\t\t\t\t<input\r\n\t\t\t\t\t\tref={fileInputElement}\r\n\t\t\t\t\t\ttype=\"file\"\r\n\t\t\t\t\t\tonChange={onFileChange}\r\n\t\t\t\t\t\taccept={acceptTypes.join(\", \")}\r\n\t\t\t\t\t\ttabIndex={-1}\r\n\t\t\t\t\t\taria-hidden=\"true\"\r\n\t\t\t\t\t/>\r\n\t\t\t\t\t<Button\r\n\t\t\t\t\t\tfashion=\"primary\"\r\n\t\t\t\t\t\ttext=\"Browse\"\r\n\t\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\t\tfileInputElement.current.click();\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t/>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div className=\"file-input-value\">\r\n\t\t\t\t\t<input\r\n\t\t\t\t\t\tclassName=\"file-input-value-input\"\r\n\t\t\t\t\t\ttype=\"text\"\r\n\t\t\t\t\t\tdisabled\r\n\t\t\t\t\t\tvalue={path}\r\n\t\t\t\t\t\taria-invalid={isInvalid}\r\n\t\t\t\t\t\t{...{ id }}\r\n\t\t\t\t\t></input>\r\n\t\t\t\t\t{errorMessage && <div className=\"file-input-error\">{errorMessage}</div>}\r\n\t\t\t\t</div>\r\n\t\t\t\t<div className=\"file-input-status\">\r\n\t\t\t\t\t{isUploading ? (\r\n\t\t\t\t\t\t<div className=\"file-input-progress-container\">{uploadProgress}% uploaded</div>\r\n\t\t\t\t\t) : (\r\n\t\t\t\t\t\t!errorMessage && <></>\r\n\t\t\t\t\t)}\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t</DropZone>\r\n\t);\r\n};\r\n"]}
1
+ {"version":3,"file":"FileInput.js","sourceRoot":"","sources":["../../../src/components/common/FileInput.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,EAAE,QAAQ,EAA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,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAC,MAAM,EACX,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAC9B,QAAQ,EAAE,CAAC,CAAC,iBACA,MAAM,GACjB;gBACF,oBAAC,MAAM,IACN,OAAO,EAAC,SAAS,EACjB,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE;wBACb,gBAAgB,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;oBAClC,CAAC,GACA,CACG;YACN,6BAAK,SAAS,EAAC,kBAAkB;gBAChC,6CACC,SAAS,EAAC,wBAAwB,EAClC,IAAI,EAAC,MAAM,EACX,QAAQ,QACR,KAAK,EAAE,IAAI,kBACG,SAAS,IACnB,EAAE,EAAE,EAAE,EACF;gBACR,YAAY,IAAI,6BAAK,SAAS,EAAC,kBAAkB,IAAE,YAAY,CAAO,CAClE;YACN,6BAAK,SAAS,EAAC,mBAAmB,IAChC,WAAW,CAAC,CAAC,CAAC,CACd,6BAAK,SAAS,EAAC,+BAA+B;gBAAE,cAAc;6BAAiB,CAC/E,CAAC,CAAC,CAAC,CACH,CAAC,YAAY,IAAI,yCAAK,CACtB,CACI,CACD,CACI,CACX,CAAC;AACH,CAAC,CAAC","sourcesContent":["/*!\r\n * Copyright 2017 - 2020 by ChartIQ, Inc.\r\n * All rights reserved.\r\n */\r\n\r\nimport React, { useState, useRef, useEffect } from \"react\";\r\nimport { SmartDesktopDesignerActions } from \"../../actions/smartDesktopDesignerActions\";\r\nimport { useDispatch } from \"../../store\";\r\nimport { ProjectError } from \"../../types/smartDesktopDesignerTypes\";\r\n\r\nimport { Button } from \"./Button\";\r\nimport \"./css/file-input.css\";\r\n\r\nimport { DropZone, FileWithPath } from \"./DropZone\";\r\nimport { validateFilename } from \"./file_helpers\";\r\n\r\nexport type FileInputUploadCb = (\r\n\tfileObject: File,\r\n\tcb?: (progress: number) => void\r\n) => Promise<{ err: string | null; path: string }>;\r\n\r\nexport type FileInputProps = {\r\n\tacceptTypes: string[];\r\n\tvalue: string;\r\n\tid?: string;\r\n\tshouldUpload?: boolean;\r\n\tonSetValue?: (value: string) => void;\r\n\tuploadFunction?: FileInputUploadCb;\r\n\tpresetFile?: null | File;\r\n\tsuppressDropzone?: boolean;\r\n};\r\n\r\nconst INVALID_FILE_TYPE_ERROR: ProjectError = {\r\n\tviewId: \"themes\",\r\n\tmessage: \"Your uploaded file is not in the correct format\",\r\n};\r\n\r\nconst defaultUploadFunction = async () => {\r\n\treturn { err: null, path: \"\" };\r\n};\r\n\r\n/**\r\n * A Browse button with a hidden file input to allow for a file select dialog and extraction of a path\r\n *\r\n * @param {FileInputProps} { acceptTypes, value, onSetValue, shouldUpload=true, uploadFunction = defaultUploadFunction}\r\n * @return {*}\r\n */\r\nexport const FileInput = ({\r\n\tacceptTypes,\r\n\tvalue,\r\n\tonSetValue,\r\n\tid,\r\n\tshouldUpload = true,\r\n\tuploadFunction = defaultUploadFunction,\r\n\tpresetFile = null,\r\n\tsuppressDropzone = false,\r\n}: FileInputProps) => {\r\n\tconst dispatch = useDispatch();\r\n\tconst fileInputElement = useRef({} as HTMLInputElement);\r\n\tconst [isUploading, setIsUploading] = useState(false);\r\n\tconst [uploadProgress, setUploadProgress] = useState(0);\r\n\tconst [fileInput, setFileInput] = useState({} as HTMLInputElement); // cast to correct type so typescript doesn't complain\r\n\tconst [path, setPath] = useState(value || \"\");\r\n\tconst [errorMessage, setErrorMessage] = useState(null as string | null);\r\n\tconst [handedFile, setHandedFile] = useState<FileWithPath | null>(presetFile);\r\n\r\n\tconst isInvalid = validateFilename(acceptTypes, path);\r\n\r\n\tconst uploadSuccess = ({ err, path: successPath }: { err: string | null; path: string }) => {\r\n\t\tif (err) {\r\n\t\t\tdispatch(SmartDesktopDesignerActions.set_project_error(INVALID_FILE_TYPE_ERROR));\r\n\r\n\t\t\tsetErrorMessage(err);\r\n\t\t\tsetPath(\"\");\r\n\t\t} else {\r\n\t\t\tdispatch(SmartDesktopDesignerActions.delete_project_error(INVALID_FILE_TYPE_ERROR));\r\n\t\t\tsetErrorMessage(null);\r\n\t\t\tsetPath(successPath);\r\n\r\n\t\t\tonSetValue?.(successPath);\r\n\r\n\t\t\tfileInput.value = \"\";\r\n\t\t}\r\n\t};\r\n\r\n\tconst uploadError = (err: string) => {\r\n\t\tsetErrorMessage(err);\r\n\t};\r\n\r\n\tconst uploadFile = (fileObj: FileWithPath | undefined) => {\r\n\t\t// If it's not a file, we can't do anything with it\r\n\t\tif (!(fileObj instanceof File)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tsetIsUploading(true);\r\n\t\tuploadFunction?.(fileObj, (progress: number) => {\r\n\t\t\tsetUploadProgress(progress);\r\n\t\t})\r\n\t\t\t.then(uploadSuccess)\r\n\t\t\t.catch(uploadError)\r\n\t\t\t.finally(() => {\r\n\t\t\t\tsetIsUploading(false);\r\n\t\t\t\tsetUploadProgress(0);\r\n\t\t\t});\r\n\t};\r\n\r\n\tconst processFile = (fileObj: FileWithPath) => {\r\n\t\tif (shouldUpload) {\r\n\t\t\tuploadFile(fileObj);\r\n\t\t} else if (fileObj?.path) {\r\n\t\t\t// If the consumer doesn't want the file actually uploaded, just return the file name\r\n\t\t\tuploadSuccess({\r\n\t\t\t\terr: null,\r\n\t\t\t\tpath: fileObj.path,\r\n\t\t\t});\r\n\t\t}\r\n\t\tsetIsUploading(false);\r\n\t\tsetUploadProgress(0);\r\n\t\tsetErrorMessage(null);\r\n\t};\r\n\r\n\tuseEffect(() => {\r\n\t\tsetPath(value || \"\");\r\n\t}, [value]);\r\n\r\n\tconst onFileChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n\t\tconst fileObj = e.target.files?.[0] as FileWithPath | undefined;\r\n\r\n\t\tif (fileObj !== undefined) {\r\n\t\t\tprocessFile(fileObj);\r\n\t\t}\r\n\r\n\t\tsetFileInput(e.target);\r\n\t};\r\n\r\n\t// Check if props updated\r\n\tif (handedFile !== presetFile) {\r\n\t\tsetHandedFile(presetFile);\r\n\t\tif (presetFile !== null) {\r\n\t\t\tuploadFile(presetFile);\r\n\t\t}\r\n\t}\r\n\r\n\treturn (\r\n\t\t<DropZone processFile={processFile} suppress={suppressDropzone}>\r\n\t\t\t<div className=\"file-input-container\">\r\n\t\t\t\t<div className=\"file-input-actions\">\r\n\t\t\t\t\t<input\r\n\t\t\t\t\t\tref={fileInputElement}\r\n\t\t\t\t\t\ttype=\"file\"\r\n\t\t\t\t\t\tonChange={onFileChange}\r\n\t\t\t\t\t\taccept={acceptTypes.join(\", \")}\r\n\t\t\t\t\t\ttabIndex={-1}\r\n\t\t\t\t\t\taria-hidden=\"true\"\r\n\t\t\t\t\t/>\r\n\t\t\t\t\t<Button\r\n\t\t\t\t\t\tfashion=\"primary\"\r\n\t\t\t\t\t\ttext=\"Browse\"\r\n\t\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\t\tfileInputElement.current.click();\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t/>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div className=\"file-input-value\">\r\n\t\t\t\t\t<input\r\n\t\t\t\t\t\tclassName=\"file-input-value-input\"\r\n\t\t\t\t\t\ttype=\"text\"\r\n\t\t\t\t\t\tdisabled\r\n\t\t\t\t\t\tvalue={path}\r\n\t\t\t\t\t\taria-invalid={isInvalid}\r\n\t\t\t\t\t\t{...{ id }}\r\n\t\t\t\t\t></input>\r\n\t\t\t\t\t{errorMessage && <div className=\"file-input-error\">{errorMessage}</div>}\r\n\t\t\t\t</div>\r\n\t\t\t\t<div className=\"file-input-status\">\r\n\t\t\t\t\t{isUploading ? (\r\n\t\t\t\t\t\t<div className=\"file-input-progress-container\">{uploadProgress}% uploaded</div>\r\n\t\t\t\t\t) : (\r\n\t\t\t\t\t\t!errorMessage && <></>\r\n\t\t\t\t\t)}\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t</DropZone>\r\n\t);\r\n};\r\n"]}
@@ -1,8 +1,8 @@
1
1
  import React from "react";
2
2
  import "./css/icon.css";
3
- export declare type FinsembleIcon = "check" | "check-square" | "chevron-left" | "chevron-right" | "copy" | "exclamation-circle" | "external-link" | "flag" | "font" | "folder" | "globe" | "hdd" | "key" | "life-ring" | "lock" | "magic" | "moon" | "paint-roller" | "pencil" | "plus" | "question-circle" | "search" | "sun" | "times" | "toggle-off" | "toggle-on" | "tools" | "trash" | "upload" | "window";
3
+ export declare type FinsembleIconType = "check" | "check-square" | "chevron-left" | "chevron-right" | "copy" | "exclamation-circle" | "external-link" | "flag" | "font" | "folder" | "globe" | "hdd" | "key" | "life-ring" | "lock" | "magic" | "moon" | "paint-roller" | "pencil" | "plus" | "question-circle" | "search" | "sun" | "times" | "toggle-off" | "toggle-on" | "tools" | "trash" | "upload" | "window";
4
4
  export declare type FinsembleIconProps = {
5
- icon: FinsembleIcon;
5
+ icon: FinsembleIconType;
6
6
  className?: string;
7
7
  onClick?: (e: React.MouseEvent) => void;
8
8
  };
@@ -1 +1 @@
1
- {"version":3,"file":"FinsembleIcon.js","sourceRoot":"","sources":["../../../src/components/common/FinsembleIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,gBAAgB,CAAC;AACxB,OAAO,EAAE,cAAc,IAAI,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAE,cAAc,IAAI,WAAW,EAAE,MAAM,qCAAqC,CAAC;AACpF,OAAO,EAAE,cAAc,IAAI,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACxF,OAAO,EAAE,cAAc,IAAI,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAC1F,OAAO,EAAE,cAAc,IAAI,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,cAAc,IAAI,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACrG,OAAO,EAAE,cAAc,IAAI,gBAAgB,EAAE,MAAM,sCAAs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EAAE,EAAE,KAAK,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAC9F,IAAI,EAAC,KAAK,gBACE,GAAG,KAAK,CAAC,IAAI,OAAO,EAChC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAEhD,IAAI,IAAI,oBAAC,IAAI,OAAQ,CAChB,CACP,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React from \"react\";\r\nimport \"./css/icon.css\";\r\nimport { ReactComponent as CheckIcon } from \"../../assets/icons/check.svg\";\r\nimport { ReactComponent as CheckSquare } from \"../../assets/icons/check-square.svg\";\r\nimport { ReactComponent as ChevronLeftIcon } from \"../../assets/icons/chevron-left.svg\";\r\nimport { ReactComponent as ChevronRightIcon } from \"../../assets/icons/chevron-right.svg\";\r\nimport { ReactComponent as CopyIcon } from \"../../assets/icons/copy.svg\";\r\nimport { ReactComponent as ExclaimationCircleIcon } from \"../../assets/icons/exclamation-circle.svg\";\r\nimport { ReactComponent as ExternalLinkIcon } from \"../../assets/icons/external-link.svg\";\r\nimport { ReactComponent as FlagIcon } from \"../../assets/icons/flag.svg\";\r\nimport { ReactComponent as FolderIcon } from \"../../assets/icons/folder.svg\";\r\nimport { ReactComponent as FontIcon } from \"../../assets/icons/font.svg\";\r\nimport { ReactComponent as GlobeIcon } from \"../../assets/icons/globe.svg\";\r\nimport { ReactComponent as HDDIcon } from \"../../assets/icons/hdd.svg\";\r\nimport { ReactComponent as KeyIcon } from \"../../assets/icons/key.svg\";\r\nimport { ReactComponent as LifeRingIcon } from \"../../assets/icons/life-ring.svg\";\r\nimport { ReactComponent as LockIcon } from \"../../assets/icons/lock.svg\";\r\nimport { ReactComponent as MagicIcon } from \"../../assets/icons/magic.svg\";\r\nimport { ReactComponent as MoonIcon } from \"../../assets/icons/moon.svg\";\r\nimport { ReactComponent as PaintRollerIcon } from \"../../assets/icons/paint-roller.svg\";\r\nimport { ReactComponent as PencilIcon } from \"../../assets/icons/pencil.svg\";\r\nimport { ReactComponent as PlusIcon } from \"../../assets/icons/plus.svg\";\r\nimport { ReactComponent as QuestionCircleIcon } from \"../../assets/icons/question-circle.svg\";\r\nimport { ReactComponent as SearchIcon } from \"../../assets/icons/search.svg\";\r\nimport { ReactComponent as SunIcon } from \"../../assets/icons/sun.svg\";\r\nimport { ReactComponent as TimesIcon } from \"../../assets/icons/times.svg\";\r\nimport { ReactComponent as ToggleOffIcon } from \"../../assets/icons/toggle-off.svg\";\r\nimport { ReactComponent as ToggleOnIcon } from \"../../assets/icons/toggle-on.svg\";\r\nimport { ReactComponent as ToolsIcon } from \"../../assets/icons/tools.svg\";\r\nimport { ReactComponent as TrashIcon } from \"../../assets/icons/trash.svg\";\r\nimport { ReactComponent as UploadIcon } from \"../../assets/icons/upload.svg\";\r\nimport { ReactComponent as WindowIcon } from \"../../assets/icons/window.svg\";\r\n\r\nexport type FinsembleIcon =\r\n\t| \"check\"\r\n\t| \"check-square\"\r\n\t| \"chevron-left\"\r\n\t| \"chevron-right\"\r\n\t| \"copy\"\r\n\t| \"exclamation-circle\"\r\n\t| \"external-link\"\r\n\t| \"flag\"\r\n\t| \"font\"\r\n\t| \"folder\"\r\n\t| \"globe\"\r\n\t| \"hdd\"\r\n\t| \"key\"\r\n\t| \"life-ring\"\r\n\t| \"lock\"\r\n\t| \"magic\"\r\n\t| \"moon\"\r\n\t| \"paint-roller\"\r\n\t| \"pencil\"\r\n\t| \"plus\"\r\n\t| \"question-circle\"\r\n\t| \"search\"\r\n\t| \"sun\"\r\n\t| \"times\"\r\n\t| \"toggle-off\"\r\n\t| \"toggle-on\"\r\n\t| \"tools\"\r\n\t| \"trash\"\r\n\t| \"upload\"\r\n\t| \"window\";\r\n\r\ntype IconComponents = {\r\n\t[key in FinsembleIcon]: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;\r\n};\r\n\r\nconst icons: IconComponents = {\r\n\tcheck: CheckIcon,\r\n\t\"check-square\": CheckSquare,\r\n\t\"chevron-left\": ChevronLeftIcon,\r\n\t\"chevron-right\": ChevronRightIcon,\r\n\tcopy: CopyIcon,\r\n\t\"exclamation-circle\": ExclaimationCircleIcon,\r\n\t\"external-link\": ExternalLinkIcon,\r\n\tflag: FlagIcon,\r\n\tfolder: FolderIcon,\r\n\tfont: FontIcon,\r\n\tglobe: GlobeIcon,\r\n\thdd: HDDIcon,\r\n\tkey: KeyIcon,\r\n\t\"life-ring\": LifeRingIcon,\r\n\tlock: LockIcon,\r\n\tmagic: MagicIcon,\r\n\tmoon: MoonIcon,\r\n\t\"paint-roller\": PaintRollerIcon,\r\n\tpencil: PencilIcon,\r\n\tplus: PlusIcon,\r\n\t\"question-circle\": QuestionCircleIcon,\r\n\tsearch: SearchIcon,\r\n\tsun: SunIcon,\r\n\ttimes: TimesIcon,\r\n\t\"toggle-off\": ToggleOffIcon,\r\n\t\"toggle-on\": ToggleOnIcon,\r\n\ttools: ToolsIcon,\r\n\ttrash: TrashIcon,\r\n\tupload: UploadIcon,\r\n\twindow: WindowIcon,\r\n};\r\n\r\nexport type FinsembleIconProps = {\r\n\ticon: FinsembleIcon;\r\n\tclassName?: string;\r\n\tonClick?: (e: React.MouseEvent) => void;\r\n};\r\n\r\nexport const FinsembleIcon = (props: FinsembleIconProps) => {\r\n\tconst Icon = icons[props.icon];\r\n\r\n\treturn (\r\n\t\t<span\r\n\t\t\tclassName={[\"finsemble-icon\", `finsemble-icon-${props.icon}`, props.className || \"\"].join(\" \")}\r\n\t\t\trole=\"img\"\r\n\t\t\taria-label={`${props.icon} icon`}\r\n\t\t\tonClick={(e) => props.onClick && props.onClick(e)}\r\n\t\t>\r\n\t\t\t{Icon && <Icon></Icon>}\r\n\t\t</span>\r\n\t);\r\n};\r\n"]}
1
+ {"version":3,"file":"FinsembleIcon.js","sourceRoot":"","sources":["../../../src/components/common/FinsembleIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KA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,IAAI,EAAE,QAAQ;IACd,iBAAiB,EAAE,kBAAkB;IACrC,MAAM,EAAE,UAAU;IAClB,GAAG,EAAE,OAAO;IACZ,KAAK,EAAE,SAAS;IAChB,YAAY,EAAE,aAAa;IAC3B,WAAW,EAAE,YAAY;IACzB,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,UAAU;IAClB,MAAM,EAAE,UAAU;CAClB,CAAC;AAQF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAyB,EAAE,EAAE;IAC1D,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAE/B,OAAO,CACN,8BACC,SAAS,EAAE,CAAC,gBAAgB,EAAE,kBAAkB,KAAK,CAAC,IAAI,EAAE,EAAE,KAAK,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAC9F,IAAI,EAAC,KAAK,gBACE,GAAG,KAAK,CAAC,IAAI,OAAO,EAChC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAEhD,IAAI,IAAI,oBAAC,IAAI,OAAQ,CAChB,CACP,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React from \"react\";\r\nimport \"./css/icon.css\";\r\nimport { ReactComponent as CheckIcon } from \"../../assets/icons/check.svg\";\r\nimport { ReactComponent as CheckSquare } from \"../../assets/icons/check-square.svg\";\r\nimport { ReactComponent as ChevronLeftIcon } from \"../../assets/icons/chevron-left.svg\";\r\nimport { ReactComponent as ChevronRightIcon } from \"../../assets/icons/chevron-right.svg\";\r\nimport { ReactComponent as CopyIcon } from \"../../assets/icons/copy.svg\";\r\nimport { ReactComponent as ExclaimationCircleIcon } from \"../../assets/icons/exclamation-circle.svg\";\r\nimport { ReactComponent as ExternalLinkIcon } from \"../../assets/icons/external-link.svg\";\r\nimport { ReactComponent as FlagIcon } from \"../../assets/icons/flag.svg\";\r\nimport { ReactComponent as FolderIcon } from \"../../assets/icons/folder.svg\";\r\nimport { ReactComponent as FontIcon } from \"../../assets/icons/font.svg\";\r\nimport { ReactComponent as GlobeIcon } from \"../../assets/icons/globe.svg\";\r\nimport { ReactComponent as HDDIcon } from \"../../assets/icons/hdd.svg\";\r\nimport { ReactComponent as KeyIcon } from \"../../assets/icons/key.svg\";\r\nimport { ReactComponent as LifeRingIcon } from \"../../assets/icons/life-ring.svg\";\r\nimport { ReactComponent as LockIcon } from \"../../assets/icons/lock.svg\";\r\nimport { ReactComponent as MagicIcon } from \"../../assets/icons/magic.svg\";\r\nimport { ReactComponent as MoonIcon } from \"../../assets/icons/moon.svg\";\r\nimport { ReactComponent as PaintRollerIcon } from \"../../assets/icons/paint-roller.svg\";\r\nimport { ReactComponent as PencilIcon } from \"../../assets/icons/pencil.svg\";\r\nimport { ReactComponent as PlusIcon } from \"../../assets/icons/plus.svg\";\r\nimport { ReactComponent as QuestionCircleIcon } from \"../../assets/icons/question-circle.svg\";\r\nimport { ReactComponent as SearchIcon } from \"../../assets/icons/search.svg\";\r\nimport { ReactComponent as SunIcon } from \"../../assets/icons/sun.svg\";\r\nimport { ReactComponent as TimesIcon } from \"../../assets/icons/times.svg\";\r\nimport { ReactComponent as ToggleOffIcon } from \"../../assets/icons/toggle-off.svg\";\r\nimport { ReactComponent as ToggleOnIcon } from \"../../assets/icons/toggle-on.svg\";\r\nimport { ReactComponent as ToolsIcon } from \"../../assets/icons/tools.svg\";\r\nimport { ReactComponent as TrashIcon } from \"../../assets/icons/trash.svg\";\r\nimport { ReactComponent as UploadIcon } from \"../../assets/icons/upload.svg\";\r\nimport { ReactComponent as WindowIcon } from \"../../assets/icons/window.svg\";\r\n\r\nexport type FinsembleIconType =\r\n\t| \"check\"\r\n\t| \"check-square\"\r\n\t| \"chevron-left\"\r\n\t| \"chevron-right\"\r\n\t| \"copy\"\r\n\t| \"exclamation-circle\"\r\n\t| \"external-link\"\r\n\t| \"flag\"\r\n\t| \"font\"\r\n\t| \"folder\"\r\n\t| \"globe\"\r\n\t| \"hdd\"\r\n\t| \"key\"\r\n\t| \"life-ring\"\r\n\t| \"lock\"\r\n\t| \"magic\"\r\n\t| \"moon\"\r\n\t| \"paint-roller\"\r\n\t| \"pencil\"\r\n\t| \"plus\"\r\n\t| \"question-circle\"\r\n\t| \"search\"\r\n\t| \"sun\"\r\n\t| \"times\"\r\n\t| \"toggle-off\"\r\n\t| \"toggle-on\"\r\n\t| \"tools\"\r\n\t| \"trash\"\r\n\t| \"upload\"\r\n\t| \"window\";\r\n\r\ntype IconComponents = {\r\n\t[key in FinsembleIconType]: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;\r\n};\r\n\r\nconst icons: IconComponents = {\r\n\tcheck: CheckIcon,\r\n\t\"check-square\": CheckSquare,\r\n\t\"chevron-left\": ChevronLeftIcon,\r\n\t\"chevron-right\": ChevronRightIcon,\r\n\tcopy: CopyIcon,\r\n\t\"exclamation-circle\": ExclaimationCircleIcon,\r\n\t\"external-link\": ExternalLinkIcon,\r\n\tflag: FlagIcon,\r\n\tfolder: FolderIcon,\r\n\tfont: FontIcon,\r\n\tglobe: GlobeIcon,\r\n\thdd: HDDIcon,\r\n\tkey: KeyIcon,\r\n\t\"life-ring\": LifeRingIcon,\r\n\tlock: LockIcon,\r\n\tmagic: MagicIcon,\r\n\tmoon: MoonIcon,\r\n\t\"paint-roller\": PaintRollerIcon,\r\n\tpencil: PencilIcon,\r\n\tplus: PlusIcon,\r\n\t\"question-circle\": QuestionCircleIcon,\r\n\tsearch: SearchIcon,\r\n\tsun: SunIcon,\r\n\ttimes: TimesIcon,\r\n\t\"toggle-off\": ToggleOffIcon,\r\n\t\"toggle-on\": ToggleOnIcon,\r\n\ttools: ToolsIcon,\r\n\ttrash: TrashIcon,\r\n\tupload: UploadIcon,\r\n\twindow: WindowIcon,\r\n};\r\n\r\nexport type FinsembleIconProps = {\r\n\ticon: FinsembleIconType;\r\n\tclassName?: string;\r\n\tonClick?: (e: React.MouseEvent) => void;\r\n};\r\n\r\nexport const FinsembleIcon = (props: FinsembleIconProps) => {\r\n\tconst Icon = icons[props.icon];\r\n\r\n\treturn (\r\n\t\t<span\r\n\t\t\tclassName={[\"finsemble-icon\", `finsemble-icon-${props.icon}`, props.className || \"\"].join(\" \")}\r\n\t\t\trole=\"img\"\r\n\t\t\taria-label={`${props.icon} icon`}\r\n\t\t\tonClick={(e) => props.onClick && props.onClick(e)}\r\n\t\t>\r\n\t\t\t{Icon && <Icon></Icon>}\r\n\t\t</span>\r\n\t);\r\n};\r\n"]}
@@ -34,10 +34,7 @@ export const FinsembleSelect = ({ options, optionComponents, updateCallback, sel
34
34
  setDisplayOptions(mappedOptions
35
35
  .filter((optionMap) => optionMap.option.toUpperCase().includes(searchString.toUpperCase()))
36
36
  .map((combination) => {
37
- return {
38
- ...combination,
39
- option: combination.option.replace(new RegExp(`(${searchString})`, "i"), `<span class="highlight">$1</span>`),
40
- };
37
+ return Object.assign(Object.assign({}, combination), { option: combination.option.replace(new RegExp(`(${searchString})`, "i"), `<span class="highlight">$1</span>`) });
41
38
  }));
42
39
  };
43
40
  return (React.createElement(React.Fragment, null,
@@ -56,6 +53,6 @@ export const FinsembleSelect = ({ options, optionComponents, updateCallback, sel
56
53
  doSetSelectedOptions(selectedOptions.concat([value]));
57
54
  }
58
55
  } }),
59
- optionComponents?.[index] ? (optionComponents?.[index]) : (React.createElement("span", { dangerouslySetInnerHTML: { __html: option } }))))))))));
56
+ (optionComponents === null || optionComponents === void 0 ? void 0 : optionComponents[index]) ? (optionComponents === null || optionComponents === void 0 ? void 0 : optionComponents[index]) : (React.createElement("span", { dangerouslySetInnerHTML: { __html: option } }))))))))));
60
57
  };
61
58
  //# sourceMappingURL=FinsembleSelect.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FinsembleSelect.js","sourceRoot":"","sources":["../../../src/components/common/FinsembleSelect.tsx"],"names":[],"mappings":"AAAA,O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AAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAC5B,gBAAgB,EAAE,CAAC,KAAK,CAAC,CACzB,CAAC,CAAC,CAAC,CACH,8BAAM,uBAAuB,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,GAAS,CAC1D,CACM,CACH,CACN,CAAC,CACG,CACD,CACJ,CACH,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { useEffect, useState, ReactNode } from \"react\";\r\nimport \"./css/selector.css\";\r\nimport { FinsembleIcon } from \"./FinsembleIcon\";\r\nimport { FinsembleToggle } from \"./FinsembleToggle\";\r\n\r\nconst heightMultiplier = 40; // It works in storybook, but we will probably want a better way of detecting this soon.\r\n\r\nconst removeItem = (startingArray: string[], removableItem: string) => {\r\n\tconst removableIndex = startingArray.indexOf(removableItem);\r\n\tif (removableIndex < 0) {\r\n\t\treturn startingArray;\r\n\t}\r\n\treturn startingArray.slice(0, removableIndex).concat(startingArray.slice(removableIndex + 1));\r\n};\r\n\r\nexport interface FinsembleSelectProps {\r\n\toptions: string[];\r\n\toptionComponents?: ReactNode[];\r\n\tvalues?: string[];\r\n\tselected?: string[];\r\n\tsize?: number;\r\n\tupdateCallback: (selectedValues: string[]) => void;\r\n\tshowSearch?: boolean;\r\n\tlimit?: number;\r\n}\r\n\r\nexport const FinsembleSelect = ({\r\n\toptions,\r\n\toptionComponents,\r\n\tupdateCallback,\r\n\tselected = [],\r\n\tsize,\r\n\tvalues = options,\r\n\tshowSearch = false,\r\n\tlimit = Infinity,\r\n}: FinsembleSelectProps) => {\r\n\tconst mappedOptions = options.map((option, index) => {\r\n\t\treturn { option, value: values[index] };\r\n\t});\r\n\tconst [selectedOptions, setSelectedOptions] = useState<string[]>(selected);\r\n\tconst [displayOptions, setDisplayOptions] = useState(mappedOptions);\r\n\r\n\t// Magic numbers\r\n\tconst height = size ? heightMultiplier * size : \"\";\r\n\r\n\t// Updating consumer\r\n\tconst doSetSelectedOptions = (opts: string[]) => {\r\n\t\tif (opts.length > limit) {\r\n\t\t\topts = opts.slice(limit * -1);\r\n\t\t}\r\n\r\n\t\tif (JSON.stringify(opts) !== JSON.stringify(selectedOptions)) {\r\n\t\t\tupdateCallback(opts);\r\n\t\t}\r\n\t\tsetSelectedOptions(opts);\r\n\t};\r\n\r\n\t// Event handlers\r\n\tconst changeHandler = (e: any) => {\r\n\t\tdoSetSelectedOptions(Array.from(e.target.selectedOptions).map((option: any) => option.value));\r\n\t};\r\n\r\n\tconst updateSearch = (e: React.KeyboardEvent<HTMLInputElement>) => {\r\n\t\t// @ts-ignore: \"value\" is on e.target, I don't know what your problem is\r\n\t\t// TS doesn't complain if I use .currentTarget, but then I can't use Enzyme to test it, so here we are\r\n\t\tconst searchString = e.target.value;\r\n\t\tsetDisplayOptions(\r\n\t\t\tmappedOptions\r\n\t\t\t\t.filter((optionMap) => optionMap.option.toUpperCase().includes(searchString.toUpperCase()))\r\n\t\t\t\t.map((combination) => {\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\t...combination,\r\n\t\t\t\t\t\toption: combination.option.replace(\r\n\t\t\t\t\t\t\tnew RegExp(`(${searchString})`, \"i\"),\r\n\t\t\t\t\t\t\t`<span class=\"highlight\">$1</span>`\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t};\r\n\t\t\t\t})\r\n\t\t);\r\n\t};\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t<div className=\"emperorSelectContainer\">\r\n\t\t\t\t{showSearch && (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t<FinsembleIcon className=\"searchIcon\" icon=\"search\"></FinsembleIcon>\r\n\t\t\t\t\t\t<input type=\"text\" placeholder=\"Search\" aria-label=\"search\" className=\"search\" onInput={updateSearch} />\r\n\t\t\t\t\t</>\r\n\t\t\t\t)}\r\n\t\t\t\t<select className=\"shogunSelect\" multiple onChange={changeHandler}>\r\n\t\t\t\t\t{displayOptions.map(({ option, value }, index: number) => (\r\n\t\t\t\t\t\t<option key={`shogun-option-${index}`} value={value}>\r\n\t\t\t\t\t\t\t{option}\r\n\t\t\t\t\t\t</option>\r\n\t\t\t\t\t))}\r\n\t\t\t\t</select>\r\n\t\t\t\t<div className=\"emperorSelect\" style={height === \"\" ? {} : { height }}>\r\n\t\t\t\t\t{displayOptions.map(({ option, value }, index: number) => (\r\n\t\t\t\t\t\t<div className=\"emperorOption\" key={`emperor-option-${index}`}>\r\n\t\t\t\t\t\t\t<label>\r\n\t\t\t\t\t\t\t\t<FinsembleToggle\r\n\t\t\t\t\t\t\t\t\tchecked={selectedOptions.includes(value) || selected.includes(value)}\r\n\t\t\t\t\t\t\t\t\tonChange={() => {\r\n\t\t\t\t\t\t\t\t\t\tif (selectedOptions.includes(value) || selected.includes(value)) {\r\n\t\t\t\t\t\t\t\t\t\t\tdoSetSelectedOptions(removeItem(selectedOptions, value));\r\n\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\tdoSetSelectedOptions(selectedOptions.concat([value]));\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t></FinsembleToggle>\r\n\t\t\t\t\t\t\t\t{optionComponents?.[index] ? (\r\n\t\t\t\t\t\t\t\t\toptionComponents?.[index]\r\n\t\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\t<span dangerouslySetInnerHTML={{ __html: option }}></span>\r\n\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t</label>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t))}\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t</>\r\n\t);\r\n};\r\n"]}
1
+ {"version":3,"file":"FinsembleSelect.js","sourceRoot":"","sources":["../../../src/components/common/FinsembleSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAa,MAAM,OAAO,CAAC;AACnD,OAAO,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,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AG,KAAK,CAAC,CACzB,CAAC,CAAC,CAAC,CACH,8BAAM,uBAAuB,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,GAAS,CAC1D,CACM,CACH,CACN,CAAC,CACG,CACD,CACJ,CACH,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { useState, ReactNode } from \"react\";\r\nimport \"./css/selector.css\";\r\nimport { FinsembleIcon } from \"./FinsembleIcon\";\r\nimport { FinsembleToggle } from \"./FinsembleToggle\";\r\n\r\nconst heightMultiplier = 40; // It works in storybook, but we will probably want a better way of detecting this soon.\r\n\r\nconst removeItem = (startingArray: string[], removableItem: string) => {\r\n\tconst removableIndex = startingArray.indexOf(removableItem);\r\n\tif (removableIndex < 0) {\r\n\t\treturn startingArray;\r\n\t}\r\n\treturn startingArray.slice(0, removableIndex).concat(startingArray.slice(removableIndex + 1));\r\n};\r\n\r\nexport interface FinsembleSelectProps {\r\n\toptions: string[];\r\n\toptionComponents?: ReactNode[];\r\n\tvalues?: string[];\r\n\tselected?: string[];\r\n\tsize?: number;\r\n\tupdateCallback: (selectedValues: string[]) => void;\r\n\tshowSearch?: boolean;\r\n\tlimit?: number;\r\n}\r\n\r\nexport const FinsembleSelect = ({\r\n\toptions,\r\n\toptionComponents,\r\n\tupdateCallback,\r\n\tselected = [],\r\n\tsize,\r\n\tvalues = options,\r\n\tshowSearch = false,\r\n\tlimit = Infinity,\r\n}: FinsembleSelectProps) => {\r\n\tconst mappedOptions = options.map((option, index) => {\r\n\t\treturn { option, value: values[index] };\r\n\t});\r\n\tconst [selectedOptions, setSelectedOptions] = useState<string[]>(selected);\r\n\tconst [displayOptions, setDisplayOptions] = useState(mappedOptions);\r\n\r\n\t// Magic numbers\r\n\tconst height = size ? heightMultiplier * size : \"\";\r\n\r\n\t// Updating consumer\r\n\tconst doSetSelectedOptions = (opts: string[]) => {\r\n\t\tif (opts.length > limit) {\r\n\t\t\topts = opts.slice(limit * -1);\r\n\t\t}\r\n\r\n\t\tif (JSON.stringify(opts) !== JSON.stringify(selectedOptions)) {\r\n\t\t\tupdateCallback(opts);\r\n\t\t}\r\n\t\tsetSelectedOptions(opts);\r\n\t};\r\n\r\n\t// Event handlers\r\n\tconst changeHandler = (e: any) => {\r\n\t\tdoSetSelectedOptions(Array.from(e.target.selectedOptions).map((option: any) => option.value));\r\n\t};\r\n\r\n\tconst updateSearch = (e: React.KeyboardEvent<HTMLInputElement>) => {\r\n\t\t// TS doesn't complain if I use .currentTarget, but then I can't use Enzyme to test it, so here we are\r\n\t\tconst searchString = (e.target as HTMLInputElement).value;\r\n\t\tsetDisplayOptions(\r\n\t\t\tmappedOptions\r\n\t\t\t\t.filter((optionMap) => optionMap.option.toUpperCase().includes(searchString.toUpperCase()))\r\n\t\t\t\t.map((combination) => {\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\t...combination,\r\n\t\t\t\t\t\toption: combination.option.replace(\r\n\t\t\t\t\t\t\tnew RegExp(`(${searchString})`, \"i\"),\r\n\t\t\t\t\t\t\t`<span class=\"highlight\">$1</span>`\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t};\r\n\t\t\t\t})\r\n\t\t);\r\n\t};\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t<div className=\"emperorSelectContainer\">\r\n\t\t\t\t{showSearch && (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t<FinsembleIcon className=\"searchIcon\" icon=\"search\"></FinsembleIcon>\r\n\t\t\t\t\t\t<input type=\"text\" placeholder=\"Search\" aria-label=\"search\" className=\"search\" onInput={updateSearch} />\r\n\t\t\t\t\t</>\r\n\t\t\t\t)}\r\n\t\t\t\t<select className=\"shogunSelect\" multiple onChange={changeHandler}>\r\n\t\t\t\t\t{displayOptions.map(({ option, value }, index: number) => (\r\n\t\t\t\t\t\t<option key={`shogun-option-${index}`} value={value}>\r\n\t\t\t\t\t\t\t{option}\r\n\t\t\t\t\t\t</option>\r\n\t\t\t\t\t))}\r\n\t\t\t\t</select>\r\n\t\t\t\t<div className=\"emperorSelect\" style={height === \"\" ? {} : { height }}>\r\n\t\t\t\t\t{displayOptions.map(({ option, value }, index: number) => (\r\n\t\t\t\t\t\t<div className=\"emperorOption\" key={`emperor-option-${index}`}>\r\n\t\t\t\t\t\t\t<label>\r\n\t\t\t\t\t\t\t\t<FinsembleToggle\r\n\t\t\t\t\t\t\t\t\tchecked={selectedOptions.includes(value) || selected.includes(value)}\r\n\t\t\t\t\t\t\t\t\tonChange={() => {\r\n\t\t\t\t\t\t\t\t\t\tif (selectedOptions.includes(value) || selected.includes(value)) {\r\n\t\t\t\t\t\t\t\t\t\t\tdoSetSelectedOptions(removeItem(selectedOptions, value));\r\n\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\tdoSetSelectedOptions(selectedOptions.concat([value]));\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t></FinsembleToggle>\r\n\t\t\t\t\t\t\t\t{optionComponents?.[index] ? (\r\n\t\t\t\t\t\t\t\t\toptionComponents?.[index]\r\n\t\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\t<span dangerouslySetInnerHTML={{ __html: option }}></span>\r\n\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t</label>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t))}\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t</>\r\n\t);\r\n};\r\n"]}
@@ -12,8 +12,8 @@ export const FinsembleToggle = ({ checked, onChange, label }) => {
12
12
  }, [checked]);
13
13
  return (React.createElement("span", { className: ["finsembleToggle", selected ? "finsembleToggle-on" : "finsembleToggle-off"].join(" ") },
14
14
  React.createElement(FinsembleIcon, { className: "finsembleToggle-icon", icon: selected ? "toggle-on" : "toggle-off" }),
15
- React.createElement("input", { type: "checkbox", tabIndex: -1, onChange: (e) => {
15
+ React.createElement("input", Object.assign({ type: "checkbox", onChange: (e) => {
16
16
  doSetSelected(e.target.checked);
17
- }, checked: selected, ...(label ? { "aria-label": label } : "") })));
17
+ }, checked: selected }, (label ? { "aria-label": label } : "")))));
18
18
  };
19
19
  //# sourceMappingURL=FinsembleToggle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FinsembleToggle.js","sourceRoot":"","sources":["../../../src/components/common/FinsembleToggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAQhD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAwB,EAAE,EAAE;IACrF,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;IAElD,SAAS,aAAa,CAAC,QAAiB;QACvC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACnB,WAAW,CAAC,QAAQ,CAAC,CAAC;IACvB,CAAC;IAED,SAAS,CAAC,GAAG,EAAE;QACd,WAAW,CAAC,OAAO,CAAC,CAAC;IACtB,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,OAAO,CACN,8BAAM,SAAS,EAAE,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QACtG,oBAAC,aAAa,IAAC,SAAS,EAAC,sBAAsB,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,GAAkB;QAC7G,+BACC,IAAI,EAAC,UAAU,EACf,QAAQ,EAAE,CAAC,CAAC,EACZ,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;gBACf,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YACjC,CAAC,EACD,OAAO,EAAE,QAAQ,KACb,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GACzC,CACI,CACP,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { useEffect, useState } from \"react\";\r\nimport \"./css/toggle.css\";\r\nimport { FinsembleIcon } from \"./FinsembleIcon\";\r\n\r\nexport interface FinsembleToggleProps {\r\n\tlabel?: string;\r\n\tchecked: boolean;\r\n\tonChange: (selected: boolean) => void;\r\n}\r\n\r\nexport const FinsembleToggle = ({ checked, onChange, label }: FinsembleToggleProps) => {\r\n\tconst [selected, setSelected] = useState(checked);\r\n\r\n\tfunction doSetSelected(newValue: boolean) {\r\n\t\tonChange(newValue);\r\n\t\tsetSelected(newValue);\r\n\t}\r\n\r\n\tuseEffect(() => {\r\n\t\tsetSelected(checked);\r\n\t}, [checked]);\r\n\r\n\treturn (\r\n\t\t<span className={[\"finsembleToggle\", selected ? \"finsembleToggle-on\" : \"finsembleToggle-off\"].join(\" \")}>\r\n\t\t\t<FinsembleIcon className=\"finsembleToggle-icon\" icon={selected ? \"toggle-on\" : \"toggle-off\"}></FinsembleIcon>\r\n\t\t\t<input\r\n\t\t\t\ttype=\"checkbox\"\r\n\t\t\t\ttabIndex={-1}\r\n\t\t\t\tonChange={(e) => {\r\n\t\t\t\t\tdoSetSelected(e.target.checked);\r\n\t\t\t\t}}\r\n\t\t\t\tchecked={selected}\r\n\t\t\t\t{...(label ? { \"aria-label\": label } : \"\")}\r\n\t\t\t/>\r\n\t\t</span>\r\n\t);\r\n};\r\n"]}
1
+ {"version":3,"file":"FinsembleToggle.js","sourceRoot":"","sources":["../../../src/components/common/FinsembleToggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAQhD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAwB,EAAE,EAAE;IACrF,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;IAElD,SAAS,aAAa,CAAC,QAAiB;QACvC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACnB,WAAW,CAAC,QAAQ,CAAC,CAAC;IACvB,CAAC;IAED,SAAS,CAAC,GAAG,EAAE;QACd,WAAW,CAAC,OAAO,CAAC,CAAC;IACtB,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,OAAO,CACN,8BAAM,SAAS,EAAE,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QACtG,oBAAC,aAAa,IAAC,SAAS,EAAC,sBAAsB,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,GAAkB;QAC7G,6CACC,IAAI,EAAC,UAAU,EACf,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;gBACf,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YACjC,CAAC,EACD,OAAO,EAAE,QAAQ,IACb,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EACzC,CACI,CACP,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { useEffect, useState } from \"react\";\r\nimport \"./css/toggle.css\";\r\nimport { FinsembleIcon } from \"./FinsembleIcon\";\r\n\r\nexport interface FinsembleToggleProps {\r\n\tlabel?: string;\r\n\tchecked: boolean;\r\n\tonChange: (selected: boolean) => void;\r\n}\r\n\r\nexport const FinsembleToggle = ({ checked, onChange, label }: FinsembleToggleProps) => {\r\n\tconst [selected, setSelected] = useState(checked);\r\n\r\n\tfunction doSetSelected(newValue: boolean) {\r\n\t\tonChange(newValue);\r\n\t\tsetSelected(newValue);\r\n\t}\r\n\r\n\tuseEffect(() => {\r\n\t\tsetSelected(checked);\r\n\t}, [checked]);\r\n\r\n\treturn (\r\n\t\t<span className={[\"finsembleToggle\", selected ? \"finsembleToggle-on\" : \"finsembleToggle-off\"].join(\" \")}>\r\n\t\t\t<FinsembleIcon className=\"finsembleToggle-icon\" icon={selected ? \"toggle-on\" : \"toggle-off\"}></FinsembleIcon>\r\n\t\t\t<input\r\n\t\t\t\ttype=\"checkbox\"\r\n\t\t\t\tonChange={(e) => {\r\n\t\t\t\t\tdoSetSelected(e.target.checked);\r\n\t\t\t\t}}\r\n\t\t\t\tchecked={selected}\r\n\t\t\t\t{...(label ? { \"aria-label\": label } : \"\")}\r\n\t\t\t/>\r\n\t\t</span>\r\n\t);\r\n};\r\n"]}
@@ -34,9 +34,9 @@ const FONT_SIZE_LIST = [
34
34
  export const FontSize = ({ id, startSize, updateSize }) => {
35
35
  const [size, setSize] = useState(startSize);
36
36
  return (React.createElement("div", { className: "font-size-picker" },
37
- React.createElement("select", { ...{ id }, value: size, onChange: (e) => {
37
+ React.createElement("select", Object.assign({}, { id }, { value: size, onChange: (e) => {
38
38
  setSize(e.target.value);
39
39
  updateSize(e.target.value);
40
- } }, FONT_SIZE_LIST.map((font_size) => (React.createElement("option", { key: font_size }, font_size))))));
40
+ } }), FONT_SIZE_LIST.map((font_size) => (React.createElement("option", { key: font_size }, font_size))))));
41
41
  };
42
42
  //# sourceMappingURL=FontSizeSelector.js.map