studiokit-scaffolding-js 7.0.11-alpha.7 → 7.0.12-next.1.3

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 (318) hide show
  1. package/lib/components/ActionList.d.ts +2 -2
  2. package/lib/components/ActionList.js +25 -78
  3. package/lib/components/AlertDialog.d.ts +3 -3
  4. package/lib/components/AlertDialog.js +8 -17
  5. package/lib/components/AlertWithIcon.js +17 -43
  6. package/lib/components/ConnectedModal.d.ts +1 -2
  7. package/lib/components/ConnectedModal.js +9 -33
  8. package/lib/components/Dropdowns/GroupsDropdown.d.ts +4 -4
  9. package/lib/components/Dropdowns/GroupsDropdown.js +31 -69
  10. package/lib/components/Dropdowns/ManagedNavDropdown.d.ts +2 -2
  11. package/lib/components/Dropdowns/ManagedNavDropdown.js +32 -77
  12. package/lib/components/Dropdowns/UserDropdown.js +21 -70
  13. package/lib/components/Dropdowns/index.js +2 -4
  14. package/lib/components/EntityOwnerList.d.ts +3 -3
  15. package/lib/components/EntityOwnerList.js +16 -58
  16. package/lib/components/Error.js +10 -25
  17. package/lib/components/ErrorBoundary.js +25 -85
  18. package/lib/components/ErrorMessage.d.ts +2 -2
  19. package/lib/components/ErrorMessage.js +5 -10
  20. package/lib/components/Forms/DateField.d.ts +2 -2
  21. package/lib/components/Forms/DateField.js +34 -85
  22. package/lib/components/Forms/TimeField.d.ts +2 -2
  23. package/lib/components/Forms/TimeField.js +36 -99
  24. package/lib/components/Forms/index.js +3 -12
  25. package/lib/components/Groups/CreateEditCopySaveButtons.js +10 -13
  26. package/lib/components/Groups/ExternalGroups/Attach.d.ts +6 -7
  27. package/lib/components/Groups/ExternalGroups/Attach.js +98 -135
  28. package/lib/components/Groups/ExternalGroups/Table.js +30 -59
  29. package/lib/components/Groups/RosterSyncInfo.js +19 -49
  30. package/lib/components/HOC/AccessibleAppComponent.d.ts +2 -2
  31. package/lib/components/HOC/AccessibleAppComponent.js +35 -83
  32. package/lib/components/HOC/ActivityRequiredComponent.d.ts +14 -14
  33. package/lib/components/HOC/ActivityRequiredComponent.js +21 -78
  34. package/lib/components/HOC/AsyncComponent.d.ts +9 -9
  35. package/lib/components/HOC/AsyncComponent.js +31 -122
  36. package/lib/components/HOC/AuthenticatedComponent.d.ts +4 -4
  37. package/lib/components/HOC/AuthenticatedComponent.js +28 -85
  38. package/lib/components/HOC/CollectionComponent.d.ts +12 -12
  39. package/lib/components/HOC/CollectionComponent.js +73 -133
  40. package/lib/components/HOC/CollectionFirstItemComponent.d.ts +13 -13
  41. package/lib/components/HOC/CollectionFirstItemComponent.js +24 -79
  42. package/lib/components/HOC/CollectionItemComponent.d.ts +9 -9
  43. package/lib/components/HOC/CollectionItemComponent.js +70 -131
  44. package/lib/components/HOC/ConnectedModalComponent.d.ts +9 -9
  45. package/lib/components/HOC/ConnectedModalComponent.js +45 -104
  46. package/lib/components/HOC/DataDependentComponent.d.ts +3 -55
  47. package/lib/components/HOC/DataDependentComponent.js +18 -75
  48. package/lib/components/HOC/EntityComponent.d.ts +13 -13
  49. package/lib/components/HOC/EntityComponent.js +30 -82
  50. package/lib/components/HOC/FullscreenModalComponent.d.ts +9 -9
  51. package/lib/components/HOC/FullscreenModalComponent.js +41 -101
  52. package/lib/components/HOC/GroupActivityRequiredComponent.d.ts +2 -2
  53. package/lib/components/HOC/GroupActivityRequiredComponent.js +11 -24
  54. package/lib/components/HOC/GuidComponent.d.ts +1 -1
  55. package/lib/components/HOC/GuidComponent.js +13 -59
  56. package/lib/components/HOC/ModelContextDependencyVerifyComponent.d.ts +28 -29
  57. package/lib/components/HOC/ModelContextDependencyVerifyComponent.js +19 -52
  58. package/lib/components/HOC/ModelErrorRedirectComponent.d.ts +10 -10
  59. package/lib/components/HOC/ModelErrorRedirectComponent.js +18 -65
  60. package/lib/components/HOC/SearchPersistorComponent.d.ts +4 -4
  61. package/lib/components/HOC/SearchPersistorComponent.js +87 -134
  62. package/lib/components/HOC/UnauthenticatedComponent.d.ts +12 -12
  63. package/lib/components/HOC/UnauthenticatedComponent.js +17 -74
  64. package/lib/components/HOC/UserComponent.d.ts +1 -1
  65. package/lib/components/HOC/UserComponent.js +5 -9
  66. package/lib/components/Icons/IconAlphaList.js +5 -19
  67. package/lib/components/Icons/IconExternalUser.js +5 -19
  68. package/lib/components/Icons/IconImpersonation.js +5 -19
  69. package/lib/components/Icons/IconStopImpersonating.js +5 -19
  70. package/lib/components/Icons/IconTable.js +4 -18
  71. package/lib/components/Icons/IconTableDeleteCol.js +5 -19
  72. package/lib/components/Icons/IconTableDeleteRow.js +5 -19
  73. package/lib/components/Icons/IconTableInsertCol.js +5 -19
  74. package/lib/components/Icons/IconTableInsertRow.js +5 -19
  75. package/lib/components/Impersonation/Button.d.ts +2 -2
  76. package/lib/components/Impersonation/Button.js +12 -56
  77. package/lib/components/Impersonation/Link.d.ts +2 -2
  78. package/lib/components/Impersonation/Link.js +12 -53
  79. package/lib/components/Impersonation/UserDetail.d.ts +2 -2
  80. package/lib/components/Impersonation/UserDetail.js +6 -14
  81. package/lib/components/Loading.js +4 -20
  82. package/lib/components/LockDownBrowser/Check.js +29 -87
  83. package/lib/components/LockDownBrowser/ExitButton.js +9 -13
  84. package/lib/components/LockDownBrowser/Launch.js +24 -47
  85. package/lib/components/Lti/Confirm.js +10 -32
  86. package/lib/components/Lti/CreateNonLtiGroupAlertDialog.d.ts +4 -2
  87. package/lib/components/Lti/CreateNonLtiGroupAlertDialog.js +25 -70
  88. package/lib/components/Lti/Launch.js +19 -44
  89. package/lib/components/Lti/LaunchGroup.js +12 -38
  90. package/lib/components/ManageTable.d.ts +1 -2
  91. package/lib/components/ManageTable.js +39 -56
  92. package/lib/components/ManageTableNoDataComponent.js +3 -21
  93. package/lib/components/NewVersionAlert.d.ts +2 -2
  94. package/lib/components/NewVersionAlert.js +30 -75
  95. package/lib/components/NotFound.js +9 -26
  96. package/lib/components/Notifications.d.ts +4 -4
  97. package/lib/components/Notifications.js +60 -101
  98. package/lib/components/PaginationNextButton.js +5 -20
  99. package/lib/components/PaginationPreviousButton.js +5 -20
  100. package/lib/components/Quill/CustomToolbar.d.ts +2 -2
  101. package/lib/components/Quill/CustomToolbar.js +62 -101
  102. package/lib/components/Quill/Formats/Image.d.ts +10 -25
  103. package/lib/components/Quill/Formats/Image.js +36 -52
  104. package/lib/components/Quill/Formats/List.d.ts +6 -3
  105. package/lib/components/Quill/Formats/List.js +26 -48
  106. package/lib/components/Quill/Formats/Video.d.ts +2 -1
  107. package/lib/components/Quill/Formats/Video.js +12 -30
  108. package/lib/components/Quill/ImageDropModule.d.ts +1 -1
  109. package/lib/components/Quill/ImageDropModule.js +33 -36
  110. package/lib/components/Quill/ImageWarning.d.ts +2 -2
  111. package/lib/components/Quill/ImageWarning.js +8 -33
  112. package/lib/components/Quill/ImageWithAltTextModal.d.ts +0 -1
  113. package/lib/components/Quill/ImageWithAltTextModal.js +42 -97
  114. package/lib/components/Quill/Specs/CustomImageSpec.d.ts +1 -1
  115. package/lib/components/Quill/Specs/CustomImageSpec.js +16 -32
  116. package/lib/components/Quill/Specs/CustomVideoSpec.d.ts +1 -1
  117. package/lib/components/Quill/Specs/CustomVideoSpec.js +14 -29
  118. package/lib/components/Quill/TableModule/Blots/BaseTableBlot.d.ts +2 -1
  119. package/lib/components/Quill/TableModule/Blots/BaseTableBlot.js +44 -60
  120. package/lib/components/Quill/TableModule/Blots/TableBlot.js +34 -52
  121. package/lib/components/Quill/TableModule/Blots/TableBodyBlot.js +35 -53
  122. package/lib/components/Quill/TableModule/Blots/TableCellBlot.d.ts +1 -1
  123. package/lib/components/Quill/TableModule/Blots/TableCellBlot.js +110 -129
  124. package/lib/components/Quill/TableModule/Blots/TableContainer.js +45 -59
  125. package/lib/components/Quill/TableModule/Blots/TableRowBlot.js +48 -64
  126. package/lib/components/Quill/TableModule/constants.js +5 -5
  127. package/lib/components/Quill/TableModule/index.css +25 -25
  128. package/lib/components/Quill/TableModule/index.d.ts +14 -5
  129. package/lib/components/Quill/TableModule/index.js +128 -129
  130. package/lib/components/Quill/TableModule/utils.js +28 -32
  131. package/lib/components/Quill/accessibilityFix.d.ts +0 -1
  132. package/lib/components/Quill/accessibilityFix.js +46 -64
  133. package/lib/components/Quill/index.js +13 -15
  134. package/lib/components/RefreshIndicator/Bordered.js +6 -31
  135. package/lib/components/RefreshIndicator/Inline.js +7 -31
  136. package/lib/components/RefreshIndicator/index.d.ts +2 -2
  137. package/lib/components/RefreshIndicator/index.js +39 -93
  138. package/lib/components/SearchControls.js +10 -30
  139. package/lib/components/SentryRoute.js +4 -22
  140. package/lib/components/Tables/RoleFilter.d.ts +3 -4
  141. package/lib/components/Tables/RoleFilter.js +16 -28
  142. package/lib/components/Tables/TextFilter.d.ts +2 -3
  143. package/lib/components/Tables/TextFilter.js +8 -15
  144. package/lib/components/UserRoles/Add.d.ts +3 -3
  145. package/lib/components/UserRoles/Add.js +62 -127
  146. package/lib/components/UserRoles/Context.js +2 -4
  147. package/lib/components/UserRoles/RoleCell.js +65 -94
  148. package/lib/components/UserRoles/Select.js +17 -51
  149. package/lib/components/UserRoles/Table.js +35 -57
  150. package/lib/components/UserRoles/index.d.ts +6 -6
  151. package/lib/components/UserRoles/index.js +192 -271
  152. package/lib/config/eslint/index.d.ts +2 -0
  153. package/lib/config/eslint/index.js +33 -0
  154. package/lib/config/eslint/lib/order.d.ts +3 -0
  155. package/lib/config/eslint/lib/order.js +31 -0
  156. package/lib/config/eslint/lib/prettier.d.ts +3 -0
  157. package/lib/config/eslint/lib/prettier.js +21 -0
  158. package/lib/config/eslint/lib/typescript.d.ts +2 -0
  159. package/lib/config/eslint/lib/typescript.js +118 -0
  160. package/lib/config/eslint/react.d.ts +2 -0
  161. package/lib/config/eslint/react.js +18 -0
  162. package/lib/constants/baseActivity.js +1 -1
  163. package/lib/constants/baseRole.js +1 -1
  164. package/lib/constants/configuration.d.ts +1 -1
  165. package/lib/constants/configuration.js +15 -15
  166. package/lib/constants/externalProviderType.js +1 -1
  167. package/lib/constants/fetchErrorData.js +1 -1
  168. package/lib/constants/index.js +13 -22
  169. package/lib/constants/lockDownBrowser.js +2 -2
  170. package/lib/constants/mockData.d.ts +4 -6
  171. package/lib/constants/mockData.js +35 -61
  172. package/lib/constants/modelStatus.js +1 -1
  173. package/lib/constants/notificationType.js +1 -1
  174. package/lib/constants/operatingSystem.js +1 -1
  175. package/lib/constants/shard.js +1 -1
  176. package/lib/constants/table.js +2 -2
  177. package/lib/constants/tier.js +1 -1
  178. package/lib/constants/userRole.d.ts +1 -2
  179. package/lib/constants/userRole.js +4 -16
  180. package/lib/css/components/_buttons.css +3 -3
  181. package/lib/css/components/_tables.css +5 -5
  182. package/lib/css/utils/_display.css +12 -19
  183. package/lib/css/utils/_general.css +1 -1
  184. package/lib/css/utils/_text.css +2 -1
  185. package/lib/endpointMappings.js +10 -22
  186. package/lib/hooks/useCollection.js +28 -30
  187. package/lib/hooks/useCollectionConfiguration.d.ts +0 -1
  188. package/lib/hooks/useCollectionConfiguration.js +61 -64
  189. package/lib/hooks/useCollectionItem.js +25 -28
  190. package/lib/hooks/useGuid.js +4 -5
  191. package/lib/hooks/usePrevious.js +5 -5
  192. package/lib/index.js +7 -19
  193. package/lib/redux/actionCreator.d.ts +6 -6
  194. package/lib/redux/actionCreator.js +21 -32
  195. package/lib/redux/actions/AuthAction.js +6 -6
  196. package/lib/redux/actions/ModalAction.d.ts +1 -1
  197. package/lib/redux/actions/ModalAction.js +1 -1
  198. package/lib/redux/actions/ModelAction.d.ts +1 -1
  199. package/lib/redux/actions/ModelAction.js +13 -23
  200. package/lib/redux/actions/NotificationAction.js +1 -1
  201. package/lib/redux/actions/SearchAction.js +1 -1
  202. package/lib/redux/actions/index.js +6 -15
  203. package/lib/redux/configureReducers.d.ts +2 -5
  204. package/lib/redux/configureReducers.js +20 -42
  205. package/lib/redux/configureStore.d.ts +2 -2
  206. package/lib/redux/configureStore.js +41 -69
  207. package/lib/redux/helpers.js +2 -1
  208. package/lib/redux/reducers/authReducer.js +4 -5
  209. package/lib/redux/reducers/index.js +6 -8
  210. package/lib/redux/reducers/modalsReducer.js +12 -33
  211. package/lib/redux/reducers/modelsReducer.d.ts +2 -2
  212. package/lib/redux/reducers/modelsReducer.js +48 -52
  213. package/lib/redux/reducers/notificationsReducer.js +9 -10
  214. package/lib/redux/reducers/searchReducer.js +6 -6
  215. package/lib/redux/sagas/appInsightsSaga.js +19 -61
  216. package/lib/redux/sagas/authSaga.js +246 -408
  217. package/lib/redux/sagas/caliperSaga.js +106 -216
  218. package/lib/redux/sagas/clockOffsetSaga.js +24 -68
  219. package/lib/redux/sagas/configurationSaga.js +8 -45
  220. package/lib/redux/sagas/downtimeApiErrorSaga.d.ts +0 -1
  221. package/lib/redux/sagas/downtimeApiErrorSaga.js +19 -63
  222. package/lib/redux/sagas/errorSaga.d.ts +0 -1
  223. package/lib/redux/sagas/errorSaga.js +22 -62
  224. package/lib/redux/sagas/googleAnalyticsSaga.js +25 -69
  225. package/lib/redux/sagas/identityProviderSaga.js +19 -68
  226. package/lib/redux/sagas/initialDataLoadSaga.js +12 -12
  227. package/lib/redux/sagas/lockDownBrowserErrorSaga.d.ts +0 -1
  228. package/lib/redux/sagas/lockDownBrowserErrorSaga.js +22 -80
  229. package/lib/redux/sagas/modelFetchSaga.js +247 -360
  230. package/lib/redux/sagas/noStoreSaga.d.ts +1 -1
  231. package/lib/redux/sagas/noStoreSaga.js +42 -88
  232. package/lib/redux/sagas/postLoginDataSaga.js +28 -71
  233. package/lib/redux/sagas/postLoginRedirectSaga.js +25 -66
  234. package/lib/redux/sagas/rootSaga.js +50 -127
  235. package/lib/redux/sagas/sentrySaga.js +26 -86
  236. package/lib/redux/sagas/userIdSaga.js +13 -53
  237. package/lib/services/codeProviderService.js +14 -24
  238. package/lib/services/dateService.js +5 -8
  239. package/lib/services/documentService.js +3 -3
  240. package/lib/services/fetchService.js +79 -130
  241. package/lib/services/persistenceService.d.ts +4 -4
  242. package/lib/services/persistenceService.js +20 -22
  243. package/lib/services/ticketProviderService.js +17 -27
  244. package/lib/services/tokenPersistenceService.js +3 -3
  245. package/lib/services/windowService.js +9 -9
  246. package/lib/startup.d.ts +1 -1
  247. package/lib/startup.js +31 -52
  248. package/lib/types/Artifact.js +1 -1
  249. package/lib/types/Collection.d.ts +3 -3
  250. package/lib/types/Notification.d.ts +2 -2
  251. package/lib/types/OptionalRecord.d.ts +1 -1
  252. package/lib/types/OwnerSchedule.d.ts +3 -1
  253. package/lib/types/PropertyOfType.d.ts +3 -3
  254. package/lib/types/RoleDescription.d.ts +0 -1
  255. package/lib/types/auth/index.js +8 -17
  256. package/lib/types/index.js +29 -38
  257. package/lib/types/net/ErrorHandler.d.ts +1 -1
  258. package/lib/types/net/FetchConfig.d.ts +1 -1
  259. package/lib/types/net/FetchErrorData.js +1 -1
  260. package/lib/types/net/FetchResult.d.ts +2 -2
  261. package/lib/types/net/HTTPMethod.d.ts +1 -1
  262. package/lib/types/net/HTTPStatusCode.js +1 -1
  263. package/lib/types/net/OAuthTokenOrNull.d.ts +1 -1
  264. package/lib/types/net/TokenAccessFunction.d.ts +1 -1
  265. package/lib/types/net/index.js +17 -26
  266. package/lib/utils/baseActivity.d.ts +2 -2
  267. package/lib/utils/baseActivity.js +14 -22
  268. package/lib/utils/baseRole.js +5 -5
  269. package/lib/utils/collection.js +145 -153
  270. package/lib/utils/cookies.js +11 -29
  271. package/lib/utils/date.js +97 -121
  272. package/lib/utils/dom.js +51 -50
  273. package/lib/utils/domainIdentifier.js +3 -7
  274. package/lib/utils/entityUserRole.js +1 -1
  275. package/lib/utils/error.d.ts +1 -1
  276. package/lib/utils/error.js +5 -5
  277. package/lib/utils/events.js +8 -10
  278. package/lib/utils/externalGroup.js +10 -10
  279. package/lib/utils/externalProviders.js +3 -3
  280. package/lib/utils/externalTerms.js +2 -6
  281. package/lib/utils/fetch.d.ts +1 -1
  282. package/lib/utils/fetch.js +92 -95
  283. package/lib/utils/group.js +6 -9
  284. package/lib/utils/groupDates.d.ts +1 -1
  285. package/lib/utils/groupDates.js +15 -15
  286. package/lib/utils/groupRoles.js +18 -22
  287. package/lib/utils/lockDownBrowser.js +4 -4
  288. package/lib/utils/logger.js +9 -8
  289. package/lib/utils/lti.js +2 -2
  290. package/lib/utils/model.d.ts +2 -2
  291. package/lib/utils/model.js +25 -29
  292. package/lib/utils/number.js +6 -12
  293. package/lib/utils/promise.d.ts +6 -1
  294. package/lib/utils/promise.js +20 -8
  295. package/lib/utils/quill.js +25 -39
  296. package/lib/utils/route.d.ts +2 -2
  297. package/lib/utils/route.js +32 -34
  298. package/lib/utils/search.d.ts +1 -1
  299. package/lib/utils/search.js +38 -41
  300. package/lib/utils/shard.js +15 -18
  301. package/lib/utils/sort.d.ts +3 -3
  302. package/lib/utils/sort.js +30 -34
  303. package/lib/utils/string.js +5 -6
  304. package/lib/utils/table.d.ts +3 -3
  305. package/lib/utils/table.js +10 -12
  306. package/lib/utils/timezone.js +8 -26
  307. package/lib/utils/url.d.ts +2 -1
  308. package/lib/utils/url.js +64 -118
  309. package/lib/utils/user.js +35 -40
  310. package/lib/utils/userAgent.js +5 -5
  311. package/lib/utils/userRole.d.ts +3 -3
  312. package/lib/utils/userRole.js +16 -22
  313. package/package.json +74 -67
  314. package/lib/config/eslint/index.cjs +0 -21
  315. package/lib/config/eslint/lib/order.cjs +0 -22
  316. package/lib/config/eslint/lib/prettier.cjs +0 -18
  317. package/lib/config/eslint/lib/typescript.cjs +0 -86
  318. package/lib/config/eslint/react.cjs +0 -9
@@ -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,58 +1,19 @@
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
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
16
- }) : (function(o, m, k, k2) {
17
- if (k2 === undefined) k2 = k;
18
- o[k2] = m[k];
19
- }));
20
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
- Object.defineProperty(o, "default", { enumerable: true, value: v });
22
- }) : function(o, v) {
23
- o["default"] = v;
24
- });
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
- };
39
- var __importDefault = (this && this.__importDefault) || function (mod) {
40
- return (mod && mod.__esModule) ? mod : { "default": mod };
41
- };
42
2
  Object.defineProperty(exports, "__esModule", { value: true });
43
3
  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 () {
4
+ const tslib_1 = require("tslib");
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const core_1 = require("@material-ui/core");
7
+ const MoreVert_1 = tslib_1.__importDefault(require("@material-ui/icons/MoreVert"));
8
+ const react_1 = tslib_1.__importStar(require("react"));
9
+ const ActionList = ({ actions = [], model = null, className, alwaysShowKebab }) => {
10
+ const anchorRef = react_1.default.useRef(null);
11
+ const [infoMenuAnchorElement, setInfoMenuAnchorElement] = (0, react_1.useState)(undefined);
12
+ const onActionItemClick = (action) => () => {
52
13
  setInfoMenuAnchorElement(undefined);
53
14
  action === null || action === void 0 ? void 0 : action();
54
- }; };
55
- var handleListKeyDown = function (event) {
15
+ };
16
+ const handleListKeyDown = (event) => {
56
17
  var _a;
57
18
  if (event.key === 'Tab' || event.key === 'Escape' || event.key === 'Esc') {
58
19
  event.preventDefault();
@@ -60,35 +21,21 @@ var ActionList = function (_a) {
60
21
  (_a = anchorRef.current) === null || _a === void 0 ? void 0 : _a.focus();
61
22
  }
62
23
  };
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; });
24
+ let allowedActions = actions.filter((a) => a.predicate);
25
+ const actionCount = allowedActions.length;
26
+ const defaultAction = actionCount === 1 && !alwaysShowKebab ? allowedActions[0] : allowedActions.find(a => !!a.isDefault);
66
27
  if (defaultAction) {
67
- allowedActions = allowedActions.filter(function (a) { return a !== defaultAction; });
28
+ allowedActions = allowedActions.filter(a => a !== defaultAction);
68
29
  }
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
- })))));
30
+ 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 => {
31
+ setInfoMenuAnchorElement(event.currentTarget);
32
+ }, "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 => {
33
+ setInfoMenuAnchorElement(event.currentTarget);
34
+ }, "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
35
+ ? [
36
+ ...(index > 0 ? [(0, jsx_runtime_1.jsx)(core_1.Divider, {})] : []),
37
+ (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)
38
+ ]
39
+ : undefined) }) }) }) }))) })] }))] }));
93
40
  };
94
41
  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*/
@@ -1,22 +1,13 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  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')))));
4
+ const tslib_1 = require("tslib");
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const Button_1 = tslib_1.__importDefault(require("@material-ui/core/Button"));
7
+ const react_bootstrap_1 = require("react-bootstrap");
8
+ const ConnectedModal_1 = tslib_1.__importDefault(require("./ConnectedModal"));
9
+ const AlertDialog = (props) => {
10
+ const { isOpen, title, description, onProceed, proceedText, onCancel, cancelText, hideCancel, onDestroy, destroyText, manualBackground } = props;
11
+ 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
12
  };
22
13
  exports.AlertDialog = AlertDialog;
@@ -1,58 +1,32 @@
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
- var __rest = (this && this.__rest) || function (s, e) {
14
- var t = {};
15
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
- t[p] = s[p];
17
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
- t[p[i]] = s[p[i]];
21
- }
22
- return t;
23
- };
24
- var __importDefault = (this && this.__importDefault) || function (mod) {
25
- return (mod && mod.__esModule) ? mod : { "default": mod };
26
- };
27
2
  Object.defineProperty(exports, "__esModule", { value: true });
28
3
  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");
4
+ const tslib_1 = require("tslib");
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const CheckCircle_1 = tslib_1.__importDefault(require("@material-ui/icons/CheckCircle"));
7
+ const Error_1 = tslib_1.__importDefault(require("@material-ui/icons/Error"));
8
+ const Info_1 = tslib_1.__importDefault(require("@material-ui/icons/Info"));
9
+ const Warning_1 = tslib_1.__importDefault(require("@material-ui/icons/Warning"));
10
+ const react_bootstrap_1 = require("react-bootstrap");
35
11
  function getIconForVariant(variant, iconClassName) {
36
- var combinedIconClassName = "self-start mr2 " + (iconClassName ? " " + iconClassName : '');
12
+ const combinedIconClassName = `self-start mr2 ${iconClassName ? ` ${iconClassName}` : ''}`;
37
13
  switch (variant) {
38
14
  case 'success':
39
- return react_1.default.createElement(CheckCircle_1.default, { className: combinedIconClassName });
15
+ return (0, jsx_runtime_1.jsx)(CheckCircle_1.default, { className: combinedIconClassName });
40
16
  case 'info':
41
- return react_1.default.createElement(Info_1.default, { className: combinedIconClassName });
17
+ return (0, jsx_runtime_1.jsx)(Info_1.default, { className: combinedIconClassName });
42
18
  case 'warning':
43
- return react_1.default.createElement(Warning_1.default, { className: combinedIconClassName });
19
+ return (0, jsx_runtime_1.jsx)(Warning_1.default, { className: combinedIconClassName });
44
20
  case 'danger':
45
- return react_1.default.createElement(Error_1.default, { className: combinedIconClassName });
21
+ return (0, jsx_runtime_1.jsx)(Error_1.default, { className: combinedIconClassName });
46
22
  default:
47
23
  return null;
48
24
  }
49
25
  }
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));
26
+ const AlertWithIcon = props => {
27
+ const { iconClassName, className, children, variant } = props, otherProps = tslib_1.__rest(props, ["iconClassName", "className", "children", "variant"]);
28
+ const combinedClassName = `alert-with-icon${className ? ` ${className}` : ''}`;
29
+ const Icon = getIconForVariant(variant, iconClassName);
30
+ return ((0, jsx_runtime_1.jsxs)(react_bootstrap_1.Alert, Object.assign({ className: combinedClassName, variant: variant }, otherProps, { children: [Icon, props.children] })));
57
31
  };
58
32
  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;
@@ -1,40 +1,16 @@
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
- var __rest = (this && this.__rest) || function (s, e) {
14
- var t = {};
15
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
- t[p] = s[p];
17
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
- t[p[i]] = s[p[i]];
21
- }
22
- return t;
23
- };
24
- var __importDefault = (this && this.__importDefault) || function (mod) {
25
- return (mod && mod.__esModule) ? mod : { "default": mod };
26
- };
27
2
  Object.defineProperty(exports, "__esModule", { value: true });
28
- var react_1 = __importDefault(require("react"));
29
- var react_bootstrap_1 = require("react-bootstrap");
30
- var ConnectedModalComponent_1 = __importDefault(require("./HOC/ConnectedModalComponent"));
31
- var ConnectedModal = function (_a) {
32
- var
3
+ const tslib_1 = require("tslib");
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_bootstrap_1 = require("react-bootstrap");
6
+ const ConnectedModalComponent_1 = tslib_1.__importDefault(require("./HOC/ConnectedModalComponent"));
7
+ const ConnectedModal = (_a) => {
8
+ var {
33
9
  // exclude props that shouldn't be passed to the Modal
34
- guid = _a.guid, modals = _a.modals, isTopOpenFullscreenModal = _a.isTopOpenFullscreenModal, dispatch = _a.dispatch, modalProps = __rest(_a, ["guid", "modals", "isTopOpenFullscreenModal", "dispatch"]);
35
- return react_1.default.createElement(react_bootstrap_1.Modal, __assign({}, modalProps));
10
+ guid, modals, isTopOpenFullscreenModal, dispatch } = _a, modalProps = tslib_1.__rest(_a, ["guid", "modals", "isTopOpenFullscreenModal", "dispatch"]);
11
+ return (0, jsx_runtime_1.jsx)(react_bootstrap_1.Modal, Object.assign({}, modalProps));
36
12
  };
37
13
  /**
38
14
  * Wrapped version of "react-bootstrap"'s `Modal` component. Uses `ConnectedModalComponent` to coordinate modal state in redux.
39
15
  */
40
- exports.default = ConnectedModalComponent_1.default(ConnectedModal);
16
+ exports.default = (0, ConnectedModalComponent_1.default)(ConnectedModal);
@@ -1,4 +1,4 @@
1
- import React, { Component } from 'react';
1
+ import { Component } from 'react';
2
2
  import { ExternalTerm, Group, ModelCollection } from '../../types';
3
3
  interface Props {
4
4
  title: string;
@@ -10,8 +10,8 @@ interface Props {
10
10
  declare class GroupsDropdown extends Component<Props> {
11
11
  loadGroups: () => void;
12
12
  didToggle: (isOpen: boolean) => void;
13
- renderGroupMenu: (groups: Group[]) => React.JSX.Element[] | null;
14
- render(): React.JSX.Element | null;
13
+ renderGroupMenu: (groups: Group[]) => import("react/jsx-runtime").JSX.Element[];
14
+ render(): import("react/jsx-runtime").JSX.Element | null;
15
15
  }
16
- declare const _default: import("react-redux").ConnectedComponent<typeof GroupsDropdown, Pick<React.ClassAttributes<GroupsDropdown> & Props, "ref" | "title" | "id" | "key" | "anyRoleButLearner">>;
16
+ declare const _default: import("react-redux").ConnectedComponent<typeof GroupsDropdown, import("react-redux").Omit<import("react").ClassAttributes<GroupsDropdown> & Props, "externalTerms" | "groups">>;
17
17
  export default _default;
@@ -1,86 +1,48 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- extendStatics(d, b);
11
- function __() { this.constructor = d; }
12
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
- };
14
- })();
15
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16
- if (k2 === undefined) k2 = k;
17
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
18
- }) : (function(o, m, k, k2) {
19
- if (k2 === undefined) k2 = k;
20
- o[k2] = m[k];
21
- }));
22
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
23
- Object.defineProperty(o, "default", { enumerable: true, value: v });
24
- }) : function(o, v) {
25
- o["default"] = v;
26
- });
27
- var __importStar = (this && this.__importStar) || function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
2
  Object.defineProperty(exports, "__esModule", { value: true });
35
- var react_1 = __importStar(require("react"));
36
- var react_bootstrap_1 = require("react-bootstrap");
37
- var react_redux_1 = require("react-redux");
38
- var react_router_bootstrap_1 = require("react-router-bootstrap");
39
- var actionCreator_1 = require("../../redux/actionCreator");
40
- var date_1 = require("../../utils/date");
41
- var groupDates_1 = require("../../utils/groupDates");
42
- var groupRoles_1 = require("../../utils/groupRoles");
43
- var sort_1 = require("../../utils/sort");
44
- var ManagedNavDropdown_1 = require("./ManagedNavDropdown");
45
- var GroupsDropdown = /** @class */ (function (_super) {
46
- __extends(GroupsDropdown, _super);
47
- function GroupsDropdown() {
48
- var _this = _super !== null && _super.apply(this, arguments) || this;
49
- _this.loadGroups = function () {
50
- actionCreator_1.dispatchModelFetchRequest({ modelName: 'groups' });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ const react_1 = require("react");
5
+ const react_bootstrap_1 = require("react-bootstrap");
6
+ const react_redux_1 = require("react-redux");
7
+ const react_router_bootstrap_1 = require("react-router-bootstrap");
8
+ const actionCreator_1 = require("../../redux/actionCreator");
9
+ const date_1 = require("../../utils/date");
10
+ const groupDates_1 = require("../../utils/groupDates");
11
+ const groupRoles_1 = require("../../utils/groupRoles");
12
+ const sort_1 = require("../../utils/sort");
13
+ const ManagedNavDropdown_1 = require("./ManagedNavDropdown");
14
+ class GroupsDropdown extends react_1.Component {
15
+ constructor() {
16
+ super(...arguments);
17
+ this.loadGroups = () => {
18
+ (0, actionCreator_1.dispatchModelFetchRequest)({ modelName: 'groups' });
51
19
  };
52
- _this.didToggle = function (isOpen) {
20
+ this.didToggle = (isOpen) => {
53
21
  if (isOpen) {
54
- _this.loadGroups();
22
+ this.loadGroups();
55
23
  }
56
24
  };
57
- _this.renderGroupMenu = function (groups) {
58
- if (!groups) {
59
- return null;
60
- }
61
- return groups.sort(sort_1.sortByNameNatural).map(function (group) {
62
- var groupURL = "/courses/" + group.id;
63
- return (react_1.default.createElement(react_router_bootstrap_1.LinkContainer, { key: group.id, to: "" + groupURL },
64
- react_1.default.createElement(react_bootstrap_1.Dropdown.Item, null, group.name)));
25
+ this.renderGroupMenu = (groups) => {
26
+ return groups.sort(sort_1.sortByNameNatural).map(group => {
27
+ const groupURL = `/courses/${group.id}`;
28
+ return ((0, jsx_runtime_1.jsx)(react_router_bootstrap_1.LinkContainer, { to: groupURL, children: (0, jsx_runtime_1.jsx)(react_bootstrap_1.Dropdown.Item, { children: group.name }) }, group.id));
65
29
  });
66
30
  };
67
- return _this;
68
31
  }
69
- GroupsDropdown.prototype.render = function () {
70
- var _a = this.props, title = _a.title, id = _a.id, groups = _a.groups, externalTerms = _a.externalTerms, anyRoleButLearner = _a.anyRoleButLearner;
71
- var groupsFilteredByRole = anyRoleButLearner ? groupRoles_1.groupsAsAnythingButLearner(groups) : groupRoles_1.groupsAsLearner(groups);
72
- var currentGroups = groupDates_1.filterGroupsByEndDate(groupsFilteredByRole, externalTerms, date_1.isNowBeforeDate);
32
+ render() {
33
+ const { title, id, groups, externalTerms, anyRoleButLearner } = this.props;
34
+ const groupsFilteredByRole = anyRoleButLearner ? (0, groupRoles_1.groupsAsAnythingButLearner)(groups) : (0, groupRoles_1.groupsAsLearner)(groups);
35
+ const currentGroups = (0, groupDates_1.filterGroupsByEndDate)(groupsFilteredByRole, externalTerms, date_1.isNowBeforeDate);
73
36
  if (currentGroups.length === 0) {
74
37
  return null;
75
38
  }
76
- return (react_1.default.createElement(ManagedNavDropdown_1.ManagedNavDropdown, { title: title, id: id, didToggle: this.didToggle }, this.renderGroupMenu(currentGroups)));
77
- };
78
- return GroupsDropdown;
79
- }(react_1.Component));
80
- var mapStateToProps = function (state) {
39
+ return ((0, jsx_runtime_1.jsx)(ManagedNavDropdown_1.ManagedNavDropdown, { title: title, id: id, didToggle: this.didToggle, children: this.renderGroupMenu(currentGroups) }));
40
+ }
41
+ }
42
+ const mapStateToProps = (state) => {
81
43
  return {
82
44
  groups: !!state.models && !!state.models.groups ? state.models.groups : {},
83
45
  externalTerms: state.models.externalTerms
84
46
  };
85
47
  };
86
- exports.default = react_redux_1.connect(mapStateToProps)(GroupsDropdown);
48
+ exports.default = (0, react_redux_1.connect)(mapStateToProps)(GroupsDropdown);
@@ -1,4 +1,4 @@
1
- import React, { Component } from 'react';
1
+ import { Component } from 'react';
2
2
  import { NavDropdownProps } from 'react-bootstrap';
3
3
  declare enum EVENT_SOURCE {
4
4
  MOUSE_ENTER = "mouseEnter",
@@ -27,6 +27,6 @@ export declare class ManagedNavDropdown extends Component<ManagedNavDropdownProp
27
27
  onMouseLeave: () => void;
28
28
  onToggle: (nextIsOpen: boolean, event: any, source: Record<string, unknown>) => void;
29
29
  didToggle: () => void;
30
- render(): React.JSX.Element;
30
+ render(): import("react/jsx-runtime").JSX.Element;
31
31
  }
32
32
  export {};