studiokit-scaffolding-js 7.0.11-alpha.7 → 7.0.12-next.1.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 (335) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +137 -137
  3. package/lib/components/ActionList.d.ts +2 -2
  4. package/lib/components/ActionList.js +46 -64
  5. package/lib/components/AlertDialog.d.ts +3 -3
  6. package/lib/components/AlertDialog.js +7 -14
  7. package/lib/components/AlertWithIcon.js +16 -29
  8. package/lib/components/ConnectedModal.d.ts +1 -2
  9. package/lib/components/ConnectedModal.js +8 -19
  10. package/lib/components/Dropdowns/GroupsDropdown.d.ts +4 -4
  11. package/lib/components/Dropdowns/GroupsDropdown.js +31 -69
  12. package/lib/components/Dropdowns/ManagedNavDropdown.d.ts +2 -2
  13. package/lib/components/Dropdowns/ManagedNavDropdown.js +32 -77
  14. package/lib/components/Dropdowns/UserDropdown.js +20 -56
  15. package/lib/components/EntityOwnerList.d.ts +3 -3
  16. package/lib/components/EntityOwnerList.js +16 -58
  17. package/lib/components/Error.js +10 -25
  18. package/lib/components/ErrorBoundary.js +46 -60
  19. package/lib/components/ErrorMessage.d.ts +2 -2
  20. package/lib/components/ErrorMessage.js +4 -7
  21. package/lib/components/Forms/DateField.d.ts +2 -2
  22. package/lib/components/Forms/DateField.js +33 -82
  23. package/lib/components/Forms/TimeField.d.ts +2 -2
  24. package/lib/components/Forms/TimeField.js +35 -96
  25. package/lib/components/Forms/index.js +5 -1
  26. package/lib/components/Groups/CreateEditCopySaveButtons.js +9 -10
  27. package/lib/components/Groups/ExternalGroups/Attach.d.ts +6 -7
  28. package/lib/components/Groups/ExternalGroups/Attach.js +98 -135
  29. package/lib/components/Groups/ExternalGroups/Table.js +29 -45
  30. package/lib/components/Groups/RosterSyncInfo.js +18 -46
  31. package/lib/components/HOC/AccessibleAppComponent.d.ts +2 -2
  32. package/lib/components/HOC/AccessibleAppComponent.js +56 -72
  33. package/lib/components/HOC/ActivityRequiredComponent.d.ts +14 -14
  34. package/lib/components/HOC/ActivityRequiredComponent.js +20 -67
  35. package/lib/components/HOC/AsyncComponent.d.ts +9 -9
  36. package/lib/components/HOC/AsyncComponent.js +30 -113
  37. package/lib/components/HOC/AuthenticatedComponent.d.ts +4 -4
  38. package/lib/components/HOC/AuthenticatedComponent.js +27 -74
  39. package/lib/components/HOC/CollectionComponent.d.ts +12 -12
  40. package/lib/components/HOC/CollectionComponent.js +72 -119
  41. package/lib/components/HOC/CollectionFirstItemComponent.d.ts +13 -13
  42. package/lib/components/HOC/CollectionFirstItemComponent.js +23 -76
  43. package/lib/components/HOC/CollectionItemComponent.d.ts +9 -9
  44. package/lib/components/HOC/CollectionItemComponent.js +69 -117
  45. package/lib/components/HOC/ConnectedModalComponent.d.ts +9 -9
  46. package/lib/components/HOC/ConnectedModalComponent.js +44 -93
  47. package/lib/components/HOC/DataDependentComponent.d.ts +3 -55
  48. package/lib/components/HOC/DataDependentComponent.js +17 -64
  49. package/lib/components/HOC/EntityComponent.d.ts +13 -13
  50. package/lib/components/HOC/EntityComponent.js +29 -79
  51. package/lib/components/HOC/FullscreenModalComponent.d.ts +9 -9
  52. package/lib/components/HOC/FullscreenModalComponent.js +40 -87
  53. package/lib/components/HOC/GroupActivityRequiredComponent.d.ts +2 -2
  54. package/lib/components/HOC/GroupActivityRequiredComponent.js +11 -24
  55. package/lib/components/HOC/GuidComponent.d.ts +1 -1
  56. package/lib/components/HOC/GuidComponent.js +13 -59
  57. package/lib/components/HOC/ModelContextDependencyVerifyComponent.d.ts +28 -29
  58. package/lib/components/HOC/ModelContextDependencyVerifyComponent.js +19 -52
  59. package/lib/components/HOC/ModelErrorRedirectComponent.d.ts +10 -10
  60. package/lib/components/HOC/ModelErrorRedirectComponent.js +18 -65
  61. package/lib/components/HOC/SearchPersistorComponent.d.ts +4 -4
  62. package/lib/components/HOC/SearchPersistorComponent.js +87 -134
  63. package/lib/components/HOC/UnauthenticatedComponent.d.ts +12 -12
  64. package/lib/components/HOC/UnauthenticatedComponent.js +16 -63
  65. package/lib/components/HOC/UserComponent.d.ts +1 -1
  66. package/lib/components/HOC/UserComponent.js +4 -6
  67. package/lib/components/Icons/IconAlphaList.js +4 -16
  68. package/lib/components/Icons/IconExternalUser.js +4 -16
  69. package/lib/components/Icons/IconImpersonation.js +4 -16
  70. package/lib/components/Icons/IconStopImpersonating.js +4 -16
  71. package/lib/components/Icons/IconTable.js +3 -15
  72. package/lib/components/Icons/IconTableDeleteCol.js +4 -16
  73. package/lib/components/Icons/IconTableDeleteRow.js +4 -16
  74. package/lib/components/Icons/IconTableInsertCol.js +4 -16
  75. package/lib/components/Icons/IconTableInsertRow.js +4 -16
  76. package/lib/components/Impersonation/Button.d.ts +2 -2
  77. package/lib/components/Impersonation/Button.js +11 -42
  78. package/lib/components/Impersonation/Link.d.ts +2 -2
  79. package/lib/components/Impersonation/Link.js +11 -42
  80. package/lib/components/Impersonation/UserDetail.css +22 -22
  81. package/lib/components/Impersonation/UserDetail.d.ts +2 -2
  82. package/lib/components/Impersonation/UserDetail.js +6 -14
  83. package/lib/components/Loading.js +4 -20
  84. package/lib/components/LockDownBrowser/Check.js +28 -84
  85. package/lib/components/LockDownBrowser/ExitButton.js +8 -10
  86. package/lib/components/LockDownBrowser/Launch.js +45 -36
  87. package/lib/components/Lti/Confirm.js +9 -29
  88. package/lib/components/Lti/CreateNonLtiGroupAlertDialog.d.ts +4 -2
  89. package/lib/components/Lti/CreateNonLtiGroupAlertDialog.js +24 -59
  90. package/lib/components/Lti/Launch.js +19 -44
  91. package/lib/components/Lti/LaunchGroup.js +12 -38
  92. package/lib/components/ManageTable.d.ts +1 -2
  93. package/lib/components/ManageTable.js +38 -53
  94. package/lib/components/ManageTableNoDataComponent.js +3 -21
  95. package/lib/components/NewVersionAlert.d.ts +2 -2
  96. package/lib/components/NewVersionAlert.js +29 -72
  97. package/lib/components/NotFound.js +9 -26
  98. package/lib/components/Notifications.d.ts +4 -4
  99. package/lib/components/Notifications.js +59 -98
  100. package/lib/components/PaginationNextButton.js +4 -17
  101. package/lib/components/PaginationPreviousButton.js +4 -17
  102. package/lib/components/Quill/CustomToolbar.d.ts +2 -2
  103. package/lib/components/Quill/CustomToolbar.js +83 -87
  104. package/lib/components/Quill/Formats/Image.d.ts +10 -25
  105. package/lib/components/Quill/Formats/Image.js +36 -52
  106. package/lib/components/Quill/Formats/List.d.ts +6 -3
  107. package/lib/components/Quill/Formats/List.js +26 -48
  108. package/lib/components/Quill/Formats/Video.d.ts +2 -1
  109. package/lib/components/Quill/Formats/Video.js +12 -30
  110. package/lib/components/Quill/ImageDropModule.d.ts +1 -1
  111. package/lib/components/Quill/ImageDropModule.js +33 -36
  112. package/lib/components/Quill/ImageWarning.d.ts +2 -2
  113. package/lib/components/Quill/ImageWarning.js +7 -30
  114. package/lib/components/Quill/ImageWithAltTextModal.js +36 -91
  115. package/lib/components/Quill/Specs/CustomImageSpec.d.ts +1 -1
  116. package/lib/components/Quill/Specs/CustomImageSpec.js +16 -32
  117. package/lib/components/Quill/Specs/CustomVideoSpec.d.ts +1 -1
  118. package/lib/components/Quill/Specs/CustomVideoSpec.js +14 -29
  119. package/lib/components/Quill/TableModule/Blots/BaseTableBlot.d.ts +2 -1
  120. package/lib/components/Quill/TableModule/Blots/BaseTableBlot.js +44 -60
  121. package/lib/components/Quill/TableModule/Blots/TableBlot.js +34 -52
  122. package/lib/components/Quill/TableModule/Blots/TableBodyBlot.js +35 -53
  123. package/lib/components/Quill/TableModule/Blots/TableCellBlot.d.ts +1 -1
  124. package/lib/components/Quill/TableModule/Blots/TableCellBlot.js +110 -129
  125. package/lib/components/Quill/TableModule/Blots/TableContainer.js +45 -59
  126. package/lib/components/Quill/TableModule/Blots/TableRowBlot.js +48 -64
  127. package/lib/components/Quill/TableModule/constants.js +5 -5
  128. package/lib/components/Quill/TableModule/index.css +171 -171
  129. package/lib/components/Quill/TableModule/index.d.ts +14 -5
  130. package/lib/components/Quill/TableModule/index.js +128 -129
  131. package/lib/components/Quill/TableModule/utils.js +28 -32
  132. package/lib/components/Quill/accessibilityFix.d.ts +0 -1
  133. package/lib/components/Quill/accessibilityFix.js +46 -64
  134. package/lib/components/Quill/index.js +12 -12
  135. package/lib/components/RefreshIndicator/Bordered.js +5 -20
  136. package/lib/components/RefreshIndicator/Inline.js +6 -17
  137. package/lib/components/RefreshIndicator/index.d.ts +2 -2
  138. package/lib/components/RefreshIndicator/index.js +60 -79
  139. package/lib/components/SearchControls.js +9 -27
  140. package/lib/components/SentryRoute.js +25 -11
  141. package/lib/components/Tables/RoleFilter.d.ts +3 -4
  142. package/lib/components/Tables/RoleFilter.js +16 -28
  143. package/lib/components/Tables/TextFilter.d.ts +2 -3
  144. package/lib/components/Tables/TextFilter.js +7 -12
  145. package/lib/components/UserRoles/Add.d.ts +3 -3
  146. package/lib/components/UserRoles/Add.js +61 -124
  147. package/lib/components/UserRoles/Context.js +1 -1
  148. package/lib/components/UserRoles/RoleCell.js +64 -91
  149. package/lib/components/UserRoles/Select.js +16 -37
  150. package/lib/components/UserRoles/Table.js +56 -43
  151. package/lib/components/UserRoles/index.d.ts +6 -6
  152. package/lib/components/UserRoles/index.js +192 -271
  153. package/lib/config/eslint/index.d.ts +2 -0
  154. package/lib/config/eslint/index.js +35 -0
  155. package/lib/config/eslint/lib/order.d.ts +3 -0
  156. package/lib/config/eslint/lib/order.js +31 -0
  157. package/lib/config/eslint/lib/prettier.d.ts +3 -0
  158. package/lib/config/eslint/lib/prettier.js +21 -0
  159. package/lib/config/eslint/lib/typescript.d.ts +2 -0
  160. package/lib/config/eslint/lib/typescript.js +120 -0
  161. package/lib/config/eslint/react.d.ts +2 -0
  162. package/lib/config/eslint/react.js +22 -0
  163. package/lib/constants/baseActivity.js +1 -1
  164. package/lib/constants/baseRole.js +1 -1
  165. package/lib/constants/configuration.d.ts +1 -1
  166. package/lib/constants/configuration.js +15 -15
  167. package/lib/constants/externalProviderType.js +1 -1
  168. package/lib/constants/fetchErrorData.js +1 -1
  169. package/lib/constants/index.js +5 -1
  170. package/lib/constants/lockDownBrowser.js +2 -2
  171. package/lib/constants/mockData.d.ts +4 -6
  172. package/lib/constants/mockData.js +35 -61
  173. package/lib/constants/modelStatus.js +1 -1
  174. package/lib/constants/notificationType.js +1 -1
  175. package/lib/constants/operatingSystem.js +1 -1
  176. package/lib/constants/shard.js +1 -1
  177. package/lib/constants/table.js +2 -2
  178. package/lib/constants/tier.js +1 -1
  179. package/lib/constants/userRole.d.ts +1 -2
  180. package/lib/constants/userRole.js +4 -16
  181. package/lib/css/base/_base.css +98 -98
  182. package/lib/css/base/_typography.css +130 -130
  183. package/lib/css/components/_alert.css +86 -86
  184. package/lib/css/components/_bootstrap-grid.css +28 -28
  185. package/lib/css/components/_buttons.css +397 -397
  186. package/lib/css/components/_forms.css +101 -101
  187. package/lib/css/components/_menu.css +56 -56
  188. package/lib/css/components/_modals.css +46 -46
  189. package/lib/css/components/_quill.css +315 -315
  190. package/lib/css/components/_tables.css +497 -497
  191. package/lib/css/components/_tags.css +12 -12
  192. package/lib/css/index-with-variables.css +15 -15
  193. package/lib/css/index.css +14 -14
  194. package/lib/css/utils/_border.css +463 -463
  195. package/lib/css/utils/_color.css +317 -317
  196. package/lib/css/utils/_display.css +305 -312
  197. package/lib/css/utils/_general.css +48 -48
  198. package/lib/css/utils/_icon.css +16 -16
  199. package/lib/css/utils/_text.css +25 -24
  200. package/lib/css/utils/_width.css +60 -60
  201. package/lib/css/variables.css +84 -84
  202. package/lib/endpointMappings.js +10 -22
  203. package/lib/hooks/useCollection.js +28 -30
  204. package/lib/hooks/useCollectionConfiguration.d.ts +0 -1
  205. package/lib/hooks/useCollectionConfiguration.js +61 -64
  206. package/lib/hooks/useCollectionItem.js +25 -28
  207. package/lib/hooks/useGuid.js +4 -5
  208. package/lib/hooks/usePrevious.js +4 -5
  209. package/lib/index.js +5 -1
  210. package/lib/redux/actionCreator.d.ts +6 -6
  211. package/lib/redux/actionCreator.js +21 -32
  212. package/lib/redux/actions/AuthAction.js +6 -6
  213. package/lib/redux/actions/ModalAction.d.ts +1 -1
  214. package/lib/redux/actions/ModalAction.js +1 -1
  215. package/lib/redux/actions/ModelAction.d.ts +2 -3
  216. package/lib/redux/actions/ModelAction.js +13 -23
  217. package/lib/redux/actions/NotificationAction.js +1 -1
  218. package/lib/redux/actions/SearchAction.js +1 -1
  219. package/lib/redux/actions/index.js +5 -1
  220. package/lib/redux/configureReducers.d.ts +2 -5
  221. package/lib/redux/configureReducers.js +19 -39
  222. package/lib/redux/configureStore.d.ts +2 -2
  223. package/lib/redux/configureStore.js +62 -55
  224. package/lib/redux/helpers.js +2 -1
  225. package/lib/redux/reducers/authReducer.js +4 -5
  226. package/lib/redux/reducers/index.js +5 -5
  227. package/lib/redux/reducers/modalsReducer.js +11 -22
  228. package/lib/redux/reducers/modelsReducer.d.ts +2 -2
  229. package/lib/redux/reducers/modelsReducer.js +47 -49
  230. package/lib/redux/reducers/notificationsReducer.js +9 -10
  231. package/lib/redux/reducers/searchReducer.js +6 -6
  232. package/lib/redux/sagas/appInsightsSaga.js +19 -61
  233. package/lib/redux/sagas/authSaga.js +246 -408
  234. package/lib/redux/sagas/caliperSaga.js +106 -216
  235. package/lib/redux/sagas/clockOffsetSaga.js +23 -65
  236. package/lib/redux/sagas/configurationSaga.js +8 -45
  237. package/lib/redux/sagas/downtimeApiErrorSaga.d.ts +0 -1
  238. package/lib/redux/sagas/downtimeApiErrorSaga.js +19 -63
  239. package/lib/redux/sagas/errorSaga.d.ts +0 -1
  240. package/lib/redux/sagas/errorSaga.js +21 -59
  241. package/lib/redux/sagas/googleAnalyticsSaga.js +24 -66
  242. package/lib/redux/sagas/identityProviderSaga.js +19 -68
  243. package/lib/redux/sagas/initialDataLoadSaga.js +12 -12
  244. package/lib/redux/sagas/lockDownBrowserErrorSaga.d.ts +0 -1
  245. package/lib/redux/sagas/lockDownBrowserErrorSaga.js +22 -80
  246. package/lib/redux/sagas/modelFetchSaga.js +246 -357
  247. package/lib/redux/sagas/noStoreSaga.d.ts +1 -1
  248. package/lib/redux/sagas/noStoreSaga.js +42 -88
  249. package/lib/redux/sagas/postLoginDataSaga.js +28 -71
  250. package/lib/redux/sagas/postLoginRedirectSaga.js +25 -66
  251. package/lib/redux/sagas/rootSaga.js +71 -113
  252. package/lib/redux/sagas/sentrySaga.js +47 -75
  253. package/lib/redux/sagas/userIdSaga.js +13 -53
  254. package/lib/services/codeProviderService.js +13 -13
  255. package/lib/services/dateService.js +4 -5
  256. package/lib/services/documentService.js +3 -3
  257. package/lib/services/fetchService.js +79 -130
  258. package/lib/services/persistenceService.d.ts +4 -4
  259. package/lib/services/persistenceService.js +19 -19
  260. package/lib/services/ticketProviderService.js +16 -16
  261. package/lib/services/tokenPersistenceService.js +3 -3
  262. package/lib/services/windowService.js +9 -9
  263. package/lib/startup.d.ts +1 -1
  264. package/lib/startup.js +52 -38
  265. package/lib/types/Artifact.js +1 -1
  266. package/lib/types/Collection.d.ts +3 -3
  267. package/lib/types/Notification.d.ts +2 -2
  268. package/lib/types/OptionalRecord.d.ts +1 -1
  269. package/lib/types/OwnerSchedule.d.ts +3 -1
  270. package/lib/types/PropertyOfType.d.ts +3 -3
  271. package/lib/types/RoleDescription.d.ts +0 -1
  272. package/lib/types/auth/index.js +5 -1
  273. package/lib/types/index.js +5 -1
  274. package/lib/types/net/ErrorHandler.d.ts +1 -1
  275. package/lib/types/net/FetchConfig.d.ts +1 -1
  276. package/lib/types/net/FetchErrorData.js +1 -1
  277. package/lib/types/net/FetchResult.d.ts +2 -2
  278. package/lib/types/net/HTTPMethod.d.ts +1 -1
  279. package/lib/types/net/HTTPStatusCode.js +1 -1
  280. package/lib/types/net/OAuthTokenOrNull.d.ts +1 -1
  281. package/lib/types/net/TokenAccessFunction.d.ts +1 -1
  282. package/lib/types/net/index.js +5 -1
  283. package/lib/utils/baseActivity.d.ts +2 -2
  284. package/lib/utils/baseActivity.js +14 -22
  285. package/lib/utils/baseRole.js +5 -5
  286. package/lib/utils/collection.js +144 -150
  287. package/lib/utils/cookies.js +32 -18
  288. package/lib/utils/date.js +96 -118
  289. package/lib/utils/dom.js +51 -50
  290. package/lib/utils/domainIdentifier.js +3 -7
  291. package/lib/utils/entityUserRole.js +1 -1
  292. package/lib/utils/error.d.ts +1 -1
  293. package/lib/utils/error.js +5 -5
  294. package/lib/utils/events.js +7 -7
  295. package/lib/utils/externalGroup.js +10 -10
  296. package/lib/utils/externalProviders.js +3 -3
  297. package/lib/utils/externalTerms.js +2 -6
  298. package/lib/utils/fetch.d.ts +1 -1
  299. package/lib/utils/fetch.js +92 -95
  300. package/lib/utils/group.js +6 -9
  301. package/lib/utils/groupDates.d.ts +1 -1
  302. package/lib/utils/groupDates.js +15 -15
  303. package/lib/utils/groupRoles.js +17 -19
  304. package/lib/utils/lockDownBrowser.js +4 -4
  305. package/lib/utils/logger.js +9 -8
  306. package/lib/utils/lti.js +2 -2
  307. package/lib/utils/model.d.ts +2 -2
  308. package/lib/utils/model.js +25 -29
  309. package/lib/utils/number.js +6 -12
  310. package/lib/utils/promise.d.ts +6 -1
  311. package/lib/utils/promise.js +20 -8
  312. package/lib/utils/quill.js +24 -36
  313. package/lib/utils/route.d.ts +2 -2
  314. package/lib/utils/route.js +31 -31
  315. package/lib/utils/search.d.ts +1 -1
  316. package/lib/utils/search.js +38 -41
  317. package/lib/utils/shard.js +14 -15
  318. package/lib/utils/sort.d.ts +3 -3
  319. package/lib/utils/sort.js +30 -34
  320. package/lib/utils/string.js +5 -6
  321. package/lib/utils/table.d.ts +3 -3
  322. package/lib/utils/table.js +10 -12
  323. package/lib/utils/timezone.js +29 -15
  324. package/lib/utils/url.d.ts +2 -1
  325. package/lib/utils/url.js +63 -109
  326. package/lib/utils/user.js +35 -40
  327. package/lib/utils/userAgent.js +5 -5
  328. package/lib/utils/userRole.d.ts +3 -3
  329. package/lib/utils/userRole.js +16 -22
  330. package/package.json +215 -207
  331. package/lib/config/eslint/index.cjs +0 -21
  332. package/lib/config/eslint/lib/order.cjs +0 -22
  333. package/lib/config/eslint/lib/prettier.cjs +0 -18
  334. package/lib/config/eslint/lib/typescript.cjs +0 -86
  335. package/lib/config/eslint/react.cjs +0 -9
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2019 Purdue Informatics / StudioKit
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2019 Purdue Informatics / StudioKit
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,137 +1,137 @@
1
- # studiokit-scaffolding-js
2
-
3
- **studiokit-scaffolding-js** provides a common scaffolding for react apps.
4
-
5
- 1. [Installation](#installation)
6
- 1. [Usage](#usage)
7
- 1. [Development](#development)
8
-
9
- # Installation
10
-
11
- ## Install this library and call startup methods
12
- 1. `yarn add studiokit-scaffolding-js`
13
- 1. (Optional) Call configurable extensions in your main entry file
14
- * `redux/sagas/rootSaga`
15
- * `setOtherDependentSagas` to add more sagas
16
- * `redux/sagas/postLoginDataSaga`
17
- * `setOnPostLogin` to load more data after login
18
- * `redux/configureReducers`
19
- * `updatePersistBlacklist` and `setOtherReducers` to add more reducers
20
- 1. In your main entry file call `startup`
21
- ```js
22
- import { startup, endpointMappings } from 'studiokit-scaffolding-js'
23
-
24
- const appConfig = {/* AppConfiguration */}
25
- const endpointMappings = {...endpointMappings, .../* App EndpointMappings */}
26
- const { history, store, persistor } = startup(appConfig, endpointMappings)
27
-
28
- // render using history, store, persistor
29
- ReactDOM.render(
30
- ...
31
- )
32
- ```
33
- ## Styles
34
-
35
- ### Basic Setup
36
-
37
- In your project’s startup `index.tsx` file, import the scaffolding styles as follows
38
-
39
- ```ts
40
- ...third party css...
41
-
42
- import 'studiokit-scaffolding-js/lib/css/index-with-variables.css'
43
-
44
- ...project specific css...
45
- ```
46
-
47
- In `config-overrides.js` when setting up `react-app-require-postcss`, in order for css variables to work, the `importFrom` array should look like the following:
48
-
49
- ```js
50
- importFrom: [
51
- 'node_modules/studiokit-scaffolding-js/lib/css/variables.css'
52
- ]
53
- ```
54
- ### Variable Override Setup
55
-
56
- In order to override certain color variables from `variables.css`, they must be overridden _before_ scaffolding’s `index.css` file is imported.
57
-
58
- In your project’s startup `index.tsx` file, import the scaffolding styles as follows
59
-
60
- ```ts
61
- ...third party css...
62
-
63
- import 'studiokit-scaffolding-js/lib/css/variables.css'
64
- import './css/variables.css'
65
- import 'studiokit-scaffolding-js/lib/css/index.css'
66
- import './css/index.css'
67
- ```
68
-
69
- In `config-overrides.js` when setting up `react-app-require-postcss`, in order for css variables to work, the `importFrom` array should look like the following:
70
-
71
- ```js
72
- importFrom: [
73
- 'node_modules/studiokit-scaffolding-js/lib/css/variables.css',
74
- 'src/css/variables.css'
75
- ]
76
- ```
77
-
78
- # Usage
79
-
80
- ## Components and Utils
81
-
82
- Components and utils can be imported from `studiokit-scaffolding-js/lib/...`
83
-
84
- # Development
85
-
86
- ## Branches
87
-
88
- 1. Create a new branch
89
- * **Feature/Issue**: In GitLab from an issue, create a branch off of `develop`
90
- * **Hotfix**: Create a `hotfix` branch off of `master` (manually or in GitLab by making an MR)
91
- 1. Update the version number
92
- * **Feature/Issue**
93
- * append `-next.1.1`
94
- * e.g. If the current version is `1.0.0`, the new branch should be `1.0.0-next.1.1`
95
- * **Hotfix**
96
- * increase the version number and append `-alpha.1`
97
- * e.g. If the current version is `1.0.0`, the new branch should be `1.0.1-alpha.1` for hotfix
98
- * **NOTE:** if **more than one** branch is being developed on at the same time, simply increment the **first** number after "next"
99
- * e.g. `1.0.0-next.2.1` for the second issue branch (this won't apply for hotfixes)
100
- 1. Development Loop
101
- 1. Add/update new components, utils, or styles
102
- 1. Add/update unit tests for those components or utils to confirm basic functionality
103
- 1. Increment the **last** number in the version
104
- * e.g. `1.0.0-next.2.1` => `1.0.0-next.2.2` for a feature/issue branch
105
- * e.g. `1.0.1-alpha.1` => `1.0.1-alpha.2` for a hotfix branch
106
- 1. Push to gitlab. Azure DevOps will run a pipeline and publish this version to npmjs.org
107
- 1. Install the new version in the project(s) you are working on by updating its `package.json` and running `yarn`
108
- * As an alternative to the two steps above, if you don't need to make changes available to other devs yet you can:
109
- 1. In the studiokit directory, run `yarn build` then `yarn pack`. You'll still need to have incremented the version number to avoid having it cached.
110
- 1. Over in the Circuit/Variate/etc. directory, run `yarn add ../studiokit-scaffolding-js/package.tgz`.
111
- 1. Repeat as needed
112
- 1. Merging
113
- * After the Merge Request is approved, **remove** the "next" or "alpha" suffix from the version **before** merging to develop or master
114
- * For **hotfix** branches, the version number should be the new patch number, e.g. `1.0.1`
115
- 1. Release
116
- * **Feature/Issue**: After merging, create a new "release" branch from `develop` and follow the "git flow" release steps as normal
117
- * **Hotfix**: Finish the "git flow" hotfix steps as normal from the hotfix branch
118
- * Azure DevOps will run a pipeline to publish the version merged to `master` to npmjs.org
119
-
120
- ## Styles
121
-
122
- Styles are organized into the following folders and files inside of `src/css`
123
-
124
- 1. `variables.css`
125
- * Global constant variables
126
- * Common app-specific variables
127
- 1. `utils`
128
- * Assorted utility styles, similar to tachyons
129
- * Break out similar styles into separate files once a few similar ones exist
130
- * e.g. `_display.css` contains all `display: ...;` related modifier styles
131
- 1. `base`
132
- * `_base.css`: Generic tags, .skip-main link, and .main-content
133
- * `_typography.css`: Default fonts, font scale, and text colors
134
- 1. `components`
135
- * Global component specific styles (e.g. not functional like tachyons)
136
-
137
- Your project’s css folders and files should follow this same pattern.
1
+ # studiokit-scaffolding-js
2
+
3
+ **studiokit-scaffolding-js** provides a common scaffolding for react apps.
4
+
5
+ 1. [Installation](#installation)
6
+ 1. [Usage](#usage)
7
+ 1. [Development](#development)
8
+
9
+ # Installation
10
+
11
+ ## Install this library and call startup methods
12
+ 1. `yarn add studiokit-scaffolding-js`
13
+ 1. (Optional) Call configurable extensions in your main entry file
14
+ * `redux/sagas/rootSaga`
15
+ * `setOtherDependentSagas` to add more sagas
16
+ * `redux/sagas/postLoginDataSaga`
17
+ * `setOnPostLogin` to load more data after login
18
+ * `redux/configureReducers`
19
+ * `updatePersistBlacklist` and `setOtherReducers` to add more reducers
20
+ 1. In your main entry file call `startup`
21
+ ```js
22
+ import { startup, endpointMappings } from 'studiokit-scaffolding-js'
23
+
24
+ const appConfig = {/* AppConfiguration */}
25
+ const endpointMappings = {...endpointMappings, .../* App EndpointMappings */}
26
+ const { history, store, persistor } = startup(appConfig, endpointMappings)
27
+
28
+ // render using history, store, persistor
29
+ ReactDOM.render(
30
+ ...
31
+ )
32
+ ```
33
+ ## Styles
34
+
35
+ ### Basic Setup
36
+
37
+ In your project’s startup `index.tsx` file, import the scaffolding styles as follows
38
+
39
+ ```ts
40
+ ...third party css...
41
+
42
+ import 'studiokit-scaffolding-js/lib/css/index-with-variables.css'
43
+
44
+ ...project specific css...
45
+ ```
46
+
47
+ In `config-overrides.js` when setting up `react-app-require-postcss`, in order for css variables to work, the `importFrom` array should look like the following:
48
+
49
+ ```js
50
+ importFrom: [
51
+ 'node_modules/studiokit-scaffolding-js/lib/css/variables.css'
52
+ ]
53
+ ```
54
+ ### Variable Override Setup
55
+
56
+ In order to override certain color variables from `variables.css`, they must be overridden _before_ scaffolding’s `index.css` file is imported.
57
+
58
+ In your project’s startup `index.tsx` file, import the scaffolding styles as follows
59
+
60
+ ```ts
61
+ ...third party css...
62
+
63
+ import 'studiokit-scaffolding-js/lib/css/variables.css'
64
+ import './css/variables.css'
65
+ import 'studiokit-scaffolding-js/lib/css/index.css'
66
+ import './css/index.css'
67
+ ```
68
+
69
+ In `config-overrides.js` when setting up `react-app-require-postcss`, in order for css variables to work, the `importFrom` array should look like the following:
70
+
71
+ ```js
72
+ importFrom: [
73
+ 'node_modules/studiokit-scaffolding-js/lib/css/variables.css',
74
+ 'src/css/variables.css'
75
+ ]
76
+ ```
77
+
78
+ # Usage
79
+
80
+ ## Components and Utils
81
+
82
+ Components and utils can be imported from `studiokit-scaffolding-js/lib/...`
83
+
84
+ # Development
85
+
86
+ ## Branches
87
+
88
+ 1. Create a new branch
89
+ * **Feature/Issue**: In GitLab from an issue, create a branch off of `develop`
90
+ * **Hotfix**: Create a `hotfix` branch off of `master` (manually or in GitLab by making an MR)
91
+ 1. Update the version number
92
+ * **Feature/Issue**
93
+ * append `-next.1.1`
94
+ * e.g. If the current version is `1.0.0`, the new branch should be `1.0.0-next.1.1`
95
+ * **Hotfix**
96
+ * increase the version number and append `-alpha.1`
97
+ * e.g. If the current version is `1.0.0`, the new branch should be `1.0.1-alpha.1` for hotfix
98
+ * **NOTE:** if **more than one** branch is being developed on at the same time, simply increment the **first** number after "next"
99
+ * e.g. `1.0.0-next.2.1` for the second issue branch (this won't apply for hotfixes)
100
+ 1. Development Loop
101
+ 1. Add/update new components, utils, or styles
102
+ 1. Add/update unit tests for those components or utils to confirm basic functionality
103
+ 1. Increment the **last** number in the version
104
+ * e.g. `1.0.0-next.2.1` => `1.0.0-next.2.2` for a feature/issue branch
105
+ * e.g. `1.0.1-alpha.1` => `1.0.1-alpha.2` for a hotfix branch
106
+ 1. Push to gitlab. Azure DevOps will run a pipeline and publish this version to npmjs.org
107
+ 1. Install the new version in the project(s) you are working on by updating its `package.json` and running `yarn`
108
+ * As an alternative to the two steps above, if you don't need to make changes available to other devs yet you can:
109
+ 1. In the studiokit directory, run `yarn build` then `yarn pack`. You'll still need to have incremented the version number to avoid having it cached.
110
+ 1. Over in the Circuit/Variate/etc. directory, run `yarn add ../studiokit-scaffolding-js/package.tgz`.
111
+ 1. Repeat as needed
112
+ 1. Merging
113
+ * After the Merge Request is approved, **remove** the "next" or "alpha" suffix from the version **before** merging to develop or master
114
+ * For **hotfix** branches, the version number should be the new patch number, e.g. `1.0.1`
115
+ 1. Release
116
+ * **Feature/Issue**: After merging, create a new "release" branch from `develop` and follow the "git flow" release steps as normal
117
+ * **Hotfix**: Finish the "git flow" hotfix steps as normal from the hotfix branch
118
+ * Azure DevOps will run a pipeline to publish the version merged to `master` to npmjs.org
119
+
120
+ ## Styles
121
+
122
+ Styles are organized into the following folders and files inside of `src/css`
123
+
124
+ 1. `variables.css`
125
+ * Global constant variables
126
+ * Common app-specific variables
127
+ 1. `utils`
128
+ * Assorted utility styles, similar to tachyons
129
+ * Break out similar styles into separate files once a few similar ones exist
130
+ * e.g. `_display.css` contains all `display: ...;` related modifier styles
131
+ 1. `base`
132
+ * `_base.css`: Generic tags, .skip-main link, and .main-content
133
+ * `_typography.css`: Default fonts, font scale, and text colors
134
+ 1. `components`
135
+ * Global component specific styles (e.g. not functional like tachyons)
136
+
137
+ Your project’s css folders and files should follow this same pattern.
@@ -1,4 +1,4 @@
1
- import { FunctionComponent } from 'react';
1
+ import React, { FunctionComponent } from 'react';
2
2
  import { Model } from '../types';
3
3
  export interface ActionListProps {
4
4
  actions?: ListAction[];
@@ -11,7 +11,7 @@ export interface ListAction {
11
11
  predicate: boolean;
12
12
  action: () => void;
13
13
  name: string;
14
- icon: JSX.Element;
14
+ icon: React.JSX.Element;
15
15
  className: string;
16
16
  id: string;
17
17
  isDefault?: boolean;
@@ -1,18 +1,11 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
3
  if (k2 === undefined) k2 = k;
15
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
16
9
  }) : (function(o, m, k, k2) {
17
10
  if (k2 === undefined) k2 = k;
18
11
  o[k2] = m[k];
@@ -22,37 +15,40 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
22
15
  }) : function(o, v) {
23
16
  o["default"] = v;
24
17
  });
25
- var __importStar = (this && this.__importStar) || function (mod) {
26
- if (mod && mod.__esModule) return mod;
27
- var result = {};
28
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
29
- __setModuleDefault(result, mod);
30
- return result;
31
- };
32
- var __spreadArrays = (this && this.__spreadArrays) || function () {
33
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
34
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
35
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
36
- r[k] = a[j];
37
- return r;
38
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
39
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
40
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
41
37
  };
42
38
  Object.defineProperty(exports, "__esModule", { value: true });
43
39
  exports.ActionList = void 0;
44
- var core_1 = require("@material-ui/core");
45
- var MoreVert_1 = __importDefault(require("@material-ui/icons/MoreVert"));
46
- var react_1 = __importStar(require("react"));
47
- var ActionList = function (_a) {
48
- var _b = _a.actions, actions = _b === void 0 ? [] : _b, _c = _a.model, model = _c === void 0 ? null : _c, className = _a.className, alwaysShowKebab = _a.alwaysShowKebab;
49
- var anchorRef = react_1.default.useRef(null);
50
- var _d = react_1.useState(undefined), infoMenuAnchorElement = _d[0], setInfoMenuAnchorElement = _d[1];
51
- var onActionItemClick = function (action) { return function () {
40
+ const jsx_runtime_1 = require("react/jsx-runtime");
41
+ const core_1 = require("@material-ui/core");
42
+ const MoreVert_1 = __importDefault(require("@material-ui/icons/MoreVert"));
43
+ const react_1 = __importStar(require("react"));
44
+ const ActionList = ({ actions = [], model = null, className, alwaysShowKebab }) => {
45
+ const anchorRef = react_1.default.useRef(null);
46
+ const [infoMenuAnchorElement, setInfoMenuAnchorElement] = (0, react_1.useState)(undefined);
47
+ const onActionItemClick = (action) => () => {
52
48
  setInfoMenuAnchorElement(undefined);
53
49
  action === null || action === void 0 ? void 0 : action();
54
- }; };
55
- var handleListKeyDown = function (event) {
50
+ };
51
+ const handleListKeyDown = (event) => {
56
52
  var _a;
57
53
  if (event.key === 'Tab' || event.key === 'Escape' || event.key === 'Esc') {
58
54
  event.preventDefault();
@@ -60,35 +56,21 @@ var ActionList = function (_a) {
60
56
  (_a = anchorRef.current) === null || _a === void 0 ? void 0 : _a.focus();
61
57
  }
62
58
  };
63
- var allowedActions = actions.filter(function (a) { return a.predicate; });
64
- var actionCount = allowedActions.length;
65
- var defaultAction = actionCount === 1 && !alwaysShowKebab ? allowedActions[0] : allowedActions.find(function (a) { return !!a.isDefault; });
59
+ let allowedActions = actions.filter((a) => a.predicate);
60
+ const actionCount = allowedActions.length;
61
+ const defaultAction = actionCount === 1 && !alwaysShowKebab ? allowedActions[0] : allowedActions.find(a => !!a.isDefault);
66
62
  if (defaultAction) {
67
- allowedActions = allowedActions.filter(function (a) { return a !== defaultAction; });
63
+ allowedActions = allowedActions.filter(a => a !== defaultAction);
68
64
  }
69
- return (react_1.default.createElement("div", { className: !!defaultAction && !!model && (actionCount > 1 || alwaysShowKebab) ? 'inline-flex' : 'di' },
70
- !!defaultAction && (react_1.default.createElement(core_1.Button, { color: "primary", onClick: defaultAction.action, id: defaultAction.id, className: defaultAction.className || '', disabled: defaultAction.disabled },
71
- defaultAction.icon,
72
- defaultAction.name)),
73
- !!model && (actionCount > 1 || alwaysShowKebab) && (react_1.default.createElement(react_1.default.Fragment, null,
74
- react_1.default.createElement(core_1.Button, { ref: anchorRef, onClick: function (event) { return setInfoMenuAnchorElement(event.currentTarget); }, "aria-label": "Actions", "aria-haspopup": "true", "aria-controls": infoMenuAnchorElement ? "info-menu-" + model.id : undefined, className: "action-list-text-button" + (defaultAction ? ' with-default-action' : ''), color: "primary" },
75
- "Actions",
76
- react_1.default.createElement(MoreVert_1.default, { color: "primary" })),
77
- react_1.default.createElement(core_1.IconButton, { ref: anchorRef, onClick: function (event) { return setInfoMenuAnchorElement(event.currentTarget); }, "aria-label": "Actions", "aria-haspopup": "true", "aria-controls": infoMenuAnchorElement ? "info-menu-" + model.id : undefined, className: "action-list-icon-button" + (defaultAction ? ' with-default-action' : '') },
78
- react_1.default.createElement(MoreVert_1.default, { color: "primary" })),
79
- react_1.default.createElement(core_1.Popper, { open: !!infoMenuAnchorElement, anchorEl: infoMenuAnchorElement, placement: "bottom-end", className: "z-1" + (className ? " " + className : ''), transition: true }, function (_a) {
80
- var TransitionProps = _a.TransitionProps, placement = _a.placement;
81
- return (react_1.default.createElement(core_1.Grow, __assign({}, TransitionProps, { style: { transformOrigin: placement === 'bottom-end' ? 'top right' : 'bottom right' } }),
82
- react_1.default.createElement(core_1.Paper, null,
83
- react_1.default.createElement(core_1.ClickAwayListener, { onClickAway: onActionItemClick() },
84
- react_1.default.createElement(core_1.MenuList, { id: "info-menu-" + model.id, autoFocusItem: !!infoMenuAnchorElement, onKeyDown: handleListKeyDown, className: "action-list shadow-large" }, allowedActions.map(function (a, index) {
85
- return a.predicate
86
- ? __spreadArrays((index > 0 ? [react_1.default.createElement(core_1.Divider, null)] : []), [
87
- react_1.default.createElement(core_1.MenuItem, { key: a.id, className: "action-list-menu mv1 pv2 " + a.className, onClick: onActionItemClick(a.action), color: "primary", disabled: a.disabled },
88
- a.icon,
89
- a.name)
90
- ]) : undefined;
91
- }))))));
92
- })))));
65
+ return ((0, jsx_runtime_1.jsxs)("div", { className: !!defaultAction && !!model && (actionCount > 1 || alwaysShowKebab) ? 'inline-flex' : 'di', children: [!!defaultAction && ((0, jsx_runtime_1.jsxs)(core_1.Button, { color: "primary", onClick: defaultAction.action, id: defaultAction.id, className: defaultAction.className || '', disabled: defaultAction.disabled, children: [defaultAction.icon, defaultAction.name] })), !!model && (actionCount > 1 || alwaysShowKebab) && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(core_1.Button, { ref: anchorRef, onClick: event => {
66
+ setInfoMenuAnchorElement(event.currentTarget);
67
+ }, "aria-label": "Actions", "aria-haspopup": "true", "aria-controls": infoMenuAnchorElement ? `info-menu-${model.id}` : undefined, className: `action-list-text-button${defaultAction ? ' with-default-action' : ''}`, color: "primary", children: ["Actions", (0, jsx_runtime_1.jsx)(MoreVert_1.default, { color: "primary" })] }), (0, jsx_runtime_1.jsx)(core_1.IconButton, { ref: anchorRef, onClick: event => {
68
+ setInfoMenuAnchorElement(event.currentTarget);
69
+ }, "aria-label": "Actions", "aria-haspopup": "true", "aria-controls": infoMenuAnchorElement ? `info-menu-${model.id}` : undefined, className: `action-list-icon-button${defaultAction ? ' with-default-action' : ''}`, children: (0, jsx_runtime_1.jsx)(MoreVert_1.default, { color: "primary" }) }), (0, jsx_runtime_1.jsx)(core_1.Popper, { open: !!infoMenuAnchorElement, anchorEl: infoMenuAnchorElement, placement: "bottom-end", className: `z-1${className ? ` ${className}` : ''}`, transition: true, children: ({ TransitionProps, placement }) => ((0, jsx_runtime_1.jsx)(core_1.Grow, Object.assign({}, TransitionProps, { style: { transformOrigin: placement === 'bottom-end' ? 'top right' : 'bottom right' }, children: (0, jsx_runtime_1.jsx)(core_1.Paper, { children: (0, jsx_runtime_1.jsx)(core_1.ClickAwayListener, { onClickAway: onActionItemClick(), children: (0, jsx_runtime_1.jsx)(core_1.MenuList, { id: `info-menu-${model.id}`, autoFocusItem: !!infoMenuAnchorElement, onKeyDown: handleListKeyDown, className: "action-list shadow-large", children: allowedActions.map((a, index) => a.predicate
70
+ ? [
71
+ ...(index > 0 ? [(0, jsx_runtime_1.jsx)(core_1.Divider, {})] : []),
72
+ (0, jsx_runtime_1.jsxs)(core_1.MenuItem, { className: `action-list-menu mv1 pv2 ${a.className}`, onClick: onActionItemClick(a.action), color: "primary", disabled: a.disabled, children: [a.icon, a.name] }, a.id)
73
+ ]
74
+ : undefined) }) }) }) }))) })] }))] }));
93
75
  };
94
76
  exports.ActionList = ActionList;
@@ -1,9 +1,9 @@
1
- import { FunctionComponent, MouseEventHandler } from 'react';
1
+ import React, { FunctionComponent, MouseEventHandler } from 'react';
2
2
  export interface AlertDialogProps {
3
3
  id?: string;
4
4
  isOpen: boolean;
5
- title: string | JSX.Element;
6
- description?: string | JSX.Element | void;
5
+ title: string | React.JSX.Element;
6
+ description?: string | React.JSX.Element;
7
7
  onProceed?: MouseEventHandler<HTMLElement>;
8
8
  proceedText?: string;
9
9
  /** onCancel is needed for closing using the X button, clicking the backdrop, or clicking the cancel button*/
@@ -4,19 +4,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.AlertDialog = void 0;
7
- var Button_1 = __importDefault(require("@material-ui/core/Button"));
8
- var react_1 = __importDefault(require("react"));
9
- var react_bootstrap_1 = require("react-bootstrap");
10
- var ConnectedModal_1 = __importDefault(require("./ConnectedModal"));
11
- var AlertDialog = function (props) {
12
- var isOpen = props.isOpen, title = props.title, description = props.description, onProceed = props.onProceed, proceedText = props.proceedText, onCancel = props.onCancel, cancelText = props.cancelText, hideCancel = props.hideCancel, onDestroy = props.onDestroy, destroyText = props.destroyText, manualBackground = props.manualBackground;
13
- return (react_1.default.createElement(ConnectedModal_1.default, { show: isOpen, onHide: onCancel, className: "z-9999" + (manualBackground ? ' bg-black-50' : '') },
14
- react_1.default.createElement(react_bootstrap_1.Modal.Header, { closeButton: true },
15
- react_1.default.createElement(react_bootstrap_1.Modal.Title, null, title)),
16
- !!description && react_1.default.createElement(react_bootstrap_1.Modal.Body, null, description),
17
- react_1.default.createElement(react_bootstrap_1.Modal.Footer, null,
18
- !!onProceed && (react_1.default.createElement(Button_1.default, { id: "alert-dialog-proceed-btn", "aria-label": proceedText || 'Confirm', className: "btn-primary ttc fr mb1", color: "primary", onClick: onProceed }, proceedText || 'Confirm')),
19
- !hideCancel && (react_1.default.createElement(Button_1.default, { id: "alert-dialog-cancel-btn", color: "primary", "aria-label": cancelText || 'Cancel', className: "btn-text ttc" + (onDestroy ? ' fr' : ' fl') + " " + (onProceed ? ' mr1' : ''), onClick: onCancel }, cancelText || 'Cancel')),
20
- !!onDestroy && (react_1.default.createElement(Button_1.default, { id: "alert-dialog-destroy-btn", "aria-label": destroyText || 'Destroy', color: "secondary", className: "btn-text color-red ttc fl", onClick: onDestroy }, destroyText || 'Destroy')))));
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const Button_1 = __importDefault(require("@material-ui/core/Button"));
9
+ const react_bootstrap_1 = require("react-bootstrap");
10
+ const ConnectedModal_1 = __importDefault(require("./ConnectedModal"));
11
+ const AlertDialog = (props) => {
12
+ const { isOpen, title, description, onProceed, proceedText, onCancel, cancelText, hideCancel, onDestroy, destroyText, manualBackground } = props;
13
+ return ((0, jsx_runtime_1.jsxs)(ConnectedModal_1.default, { show: isOpen, onHide: onCancel, className: `z-9999${manualBackground ? ' bg-black-50' : ''}`, children: [(0, jsx_runtime_1.jsx)(react_bootstrap_1.Modal.Header, { closeButton: true, children: (0, jsx_runtime_1.jsx)(react_bootstrap_1.Modal.Title, { children: title }) }), !!description && (0, jsx_runtime_1.jsx)(react_bootstrap_1.Modal.Body, { children: description }), (0, jsx_runtime_1.jsxs)(react_bootstrap_1.Modal.Footer, { children: [!!onProceed && ((0, jsx_runtime_1.jsx)(Button_1.default, { id: "alert-dialog-proceed-btn", "aria-label": proceedText || 'Confirm', className: "btn-primary ttc fr mb1", color: "primary", onClick: onProceed, children: proceedText || 'Confirm' })), !hideCancel && ((0, jsx_runtime_1.jsx)(Button_1.default, { id: "alert-dialog-cancel-btn", color: "primary", "aria-label": cancelText || 'Cancel', className: `btn-text ttc${onDestroy ? ' fr' : ' fl'} ${onProceed ? ' mr1' : ''}`, onClick: onCancel, children: cancelText || 'Cancel' })), !!onDestroy && ((0, jsx_runtime_1.jsx)(Button_1.default, { id: "alert-dialog-destroy-btn", "aria-label": destroyText || 'Destroy', color: "secondary", className: "btn-text color-red ttc fl", onClick: onDestroy, children: destroyText || 'Destroy' }))] })] }));
21
14
  };
22
15
  exports.AlertDialog = AlertDialog;
@@ -1,15 +1,4 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
2
  var __rest = (this && this.__rest) || function (s, e) {
14
3
  var t = {};
15
4
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -26,33 +15,31 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
15
  };
27
16
  Object.defineProperty(exports, "__esModule", { value: true });
28
17
  exports.AlertWithIcon = void 0;
29
- var CheckCircle_1 = __importDefault(require("@material-ui/icons/CheckCircle"));
30
- var Error_1 = __importDefault(require("@material-ui/icons/Error"));
31
- var Info_1 = __importDefault(require("@material-ui/icons/Info"));
32
- var Warning_1 = __importDefault(require("@material-ui/icons/Warning"));
33
- var react_1 = __importDefault(require("react"));
34
- var react_bootstrap_1 = require("react-bootstrap");
18
+ const jsx_runtime_1 = require("react/jsx-runtime");
19
+ const CheckCircle_1 = __importDefault(require("@material-ui/icons/CheckCircle"));
20
+ const Error_1 = __importDefault(require("@material-ui/icons/Error"));
21
+ const Info_1 = __importDefault(require("@material-ui/icons/Info"));
22
+ const Warning_1 = __importDefault(require("@material-ui/icons/Warning"));
23
+ const react_bootstrap_1 = require("react-bootstrap");
35
24
  function getIconForVariant(variant, iconClassName) {
36
- var combinedIconClassName = "self-start mr2 " + (iconClassName ? " " + iconClassName : '');
25
+ const combinedIconClassName = `self-start mr2 ${iconClassName ? ` ${iconClassName}` : ''}`;
37
26
  switch (variant) {
38
27
  case 'success':
39
- return react_1.default.createElement(CheckCircle_1.default, { className: combinedIconClassName });
28
+ return (0, jsx_runtime_1.jsx)(CheckCircle_1.default, { className: combinedIconClassName });
40
29
  case 'info':
41
- return react_1.default.createElement(Info_1.default, { className: combinedIconClassName });
30
+ return (0, jsx_runtime_1.jsx)(Info_1.default, { className: combinedIconClassName });
42
31
  case 'warning':
43
- return react_1.default.createElement(Warning_1.default, { className: combinedIconClassName });
32
+ return (0, jsx_runtime_1.jsx)(Warning_1.default, { className: combinedIconClassName });
44
33
  case 'danger':
45
- return react_1.default.createElement(Error_1.default, { className: combinedIconClassName });
34
+ return (0, jsx_runtime_1.jsx)(Error_1.default, { className: combinedIconClassName });
46
35
  default:
47
36
  return null;
48
37
  }
49
38
  }
50
- var AlertWithIcon = function (props) {
51
- var iconClassName = props.iconClassName, className = props.className, children = props.children, variant = props.variant, otherProps = __rest(props, ["iconClassName", "className", "children", "variant"]);
52
- var combinedClassName = "alert-with-icon" + (className ? " " + className : '');
53
- var Icon = getIconForVariant(variant, iconClassName);
54
- return (react_1.default.createElement(react_bootstrap_1.Alert, __assign({ className: combinedClassName, variant: variant }, otherProps),
55
- Icon,
56
- props.children));
39
+ const AlertWithIcon = props => {
40
+ const { iconClassName, className, children, variant } = props, otherProps = __rest(props, ["iconClassName", "className", "children", "variant"]);
41
+ const combinedClassName = `alert-with-icon${className ? ` ${className}` : ''}`;
42
+ const Icon = getIconForVariant(variant, iconClassName);
43
+ return ((0, jsx_runtime_1.jsxs)(react_bootstrap_1.Alert, Object.assign({ className: combinedClassName, variant: variant }, otherProps, { children: [Icon, props.children] })));
57
44
  };
58
45
  exports.AlertWithIcon = AlertWithIcon;
@@ -1,7 +1,6 @@
1
- import React from 'react';
2
1
  import { ModalProps } from 'react-bootstrap';
3
- declare const _default: React.ComponentClass<ModalProps, any>;
4
2
  /**
5
3
  * Wrapped version of "react-bootstrap"'s `Modal` component. Uses `ConnectedModalComponent` to coordinate modal state in redux.
6
4
  */
5
+ declare const _default: import("react").ComponentClass<ModalProps, any>;
7
6
  export default _default;