studiokit-scaffolding-js 4.5.2 → 4.5.3-next.2.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 (367) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +127 -127
  3. package/lib/components/ActionList.d.ts +20 -20
  4. package/lib/components/ActionList.js +94 -94
  5. package/lib/components/AlertDialog.d.ts +18 -18
  6. package/lib/components/AlertDialog.js +21 -21
  7. package/lib/components/AlertWithIcon.d.ts +7 -7
  8. package/lib/components/AlertWithIcon.js +57 -57
  9. package/lib/components/ConnectedModal.d.ts +6 -6
  10. package/lib/components/ConnectedModal.js +11 -11
  11. package/lib/components/Dropdowns/GroupsDropdown.d.ts +18 -18
  12. package/lib/components/Dropdowns/GroupsDropdown.js +90 -90
  13. package/lib/components/Dropdowns/ManagedNavDropdown.d.ts +32 -32
  14. package/lib/components/Dropdowns/ManagedNavDropdown.js +118 -118
  15. package/lib/components/Dropdowns/UserDropdown.d.ts +6 -6
  16. package/lib/components/Dropdowns/UserDropdown.js +76 -76
  17. package/lib/components/Dropdowns/index.d.ts +3 -3
  18. package/lib/components/Dropdowns/index.js +12 -12
  19. package/lib/components/EntityOwnerList.d.ts +11 -11
  20. package/lib/components/EntityOwnerList.js +63 -63
  21. package/lib/components/ErrorBoundary.d.ts +11 -11
  22. package/lib/components/ErrorBoundary.js +74 -74
  23. package/lib/components/Forms/DateField.d.ts +13 -13
  24. package/lib/components/Forms/DateField.js +99 -99
  25. package/lib/components/Forms/TimeField.d.ts +11 -11
  26. package/lib/components/Forms/TimeField.js +112 -112
  27. package/lib/components/Forms/index.d.ts +2 -2
  28. package/lib/components/Forms/index.js +14 -14
  29. package/lib/components/Groups/CreateEditCopySaveButtons.d.ts +10 -10
  30. package/lib/components/Groups/CreateEditCopySaveButtons.js +18 -18
  31. package/lib/components/Groups/GroupCreateOrEditCommonProps.d.ts +6 -6
  32. package/lib/components/Groups/GroupCreateOrEditCommonProps.js +2 -2
  33. package/lib/components/Groups/RosterSyncInfo.d.ts +5 -5
  34. package/lib/components/Groups/RosterSyncInfo.js +54 -54
  35. package/lib/components/HOC/AccessibleAppComponent.d.ts +15 -15
  36. package/lib/components/HOC/AccessibleAppComponent.js +135 -135
  37. package/lib/components/HOC/ActivityRequiredComponent.d.ts +102 -102
  38. package/lib/components/HOC/ActivityRequiredComponent.js +117 -117
  39. package/lib/components/HOC/AsyncComponent.d.ts +37 -37
  40. package/lib/components/HOC/AsyncComponent.js +136 -136
  41. package/lib/components/HOC/AuthenticatedComponent.d.ts +10 -10
  42. package/lib/components/HOC/AuthenticatedComponent.js +104 -104
  43. package/lib/components/HOC/CollectionComponent.d.ts +61 -61
  44. package/lib/components/HOC/CollectionComponent.js +175 -175
  45. package/lib/components/HOC/CollectionFirstItemComponent.d.ts +67 -67
  46. package/lib/components/HOC/CollectionFirstItemComponent.js +94 -94
  47. package/lib/components/HOC/CollectionItemComponent.d.ts +61 -61
  48. package/lib/components/HOC/CollectionItemComponent.js +172 -172
  49. package/lib/components/HOC/ConnectedModalComponent.d.ts +26 -26
  50. package/lib/components/HOC/ConnectedModalComponent.js +110 -110
  51. package/lib/components/HOC/DataDependentComponent.d.ts +61 -61
  52. package/lib/components/HOC/DataDependentComponent.js +90 -90
  53. package/lib/components/HOC/EntityComponent.d.ts +83 -83
  54. package/lib/components/HOC/EntityComponent.js +120 -120
  55. package/lib/components/HOC/FullscreenModalComponent.d.ts +74 -74
  56. package/lib/components/HOC/FullscreenModalComponent.js +173 -173
  57. package/lib/components/HOC/GroupActivityRequiredComponent.d.ts +32 -32
  58. package/lib/components/HOC/GroupActivityRequiredComponent.js +53 -53
  59. package/lib/components/HOC/GuidComponent.d.ts +14 -14
  60. package/lib/components/HOC/GuidComponent.js +72 -72
  61. package/lib/components/HOC/ModelContextDependencyVerifyComponent.d.ts +172 -172
  62. package/lib/components/HOC/ModelContextDependencyVerifyComponent.js +72 -72
  63. package/lib/components/HOC/ModelErrorRedirectComponent.d.ts +69 -69
  64. package/lib/components/HOC/ModelErrorRedirectComponent.js +101 -101
  65. package/lib/components/HOC/SearchPersistorComponent.d.ts +66 -66
  66. package/lib/components/HOC/SearchPersistorComponent.js +178 -178
  67. package/lib/components/HOC/UnauthenticatedComponent.d.ts +62 -62
  68. package/lib/components/HOC/UnauthenticatedComponent.js +90 -90
  69. package/lib/components/HOC/UserComponent.d.ts +3 -3
  70. package/lib/components/HOC/UserComponent.js +12 -12
  71. package/lib/components/Icons/IconExternalUser.d.ts +3 -3
  72. package/lib/components/Icons/IconExternalUser.js +24 -24
  73. package/lib/components/Icons/IconImpersonation.d.ts +3 -3
  74. package/lib/components/Icons/IconImpersonation.js +24 -24
  75. package/lib/components/Icons/IconStopImpersonating.d.ts +3 -3
  76. package/lib/components/Icons/IconStopImpersonating.js +24 -24
  77. package/lib/components/Impersonation/Button.d.ts +7 -7
  78. package/lib/components/Impersonation/Button.js +61 -61
  79. package/lib/components/Impersonation/Link.d.ts +7 -7
  80. package/lib/components/Impersonation/Link.js +58 -58
  81. package/lib/components/Impersonation/UserDetail.css +22 -22
  82. package/lib/components/Impersonation/UserDetail.d.ts +22 -22
  83. package/lib/components/Impersonation/UserDetail.js +23 -23
  84. package/lib/components/Loading.d.ts +4 -4
  85. package/lib/components/Loading.js +24 -24
  86. package/lib/components/Lti/Confirm.d.ts +8 -8
  87. package/lib/components/Lti/Confirm.js +37 -37
  88. package/lib/components/Lti/CreateNonLtiGroupAlertDialog.d.ts +15 -15
  89. package/lib/components/Lti/CreateNonLtiGroupAlertDialog.js +83 -83
  90. package/lib/components/Lti/Launch.d.ts +21 -21
  91. package/lib/components/Lti/Launch.js +52 -52
  92. package/lib/components/Lti/LaunchGroup.d.ts +9 -9
  93. package/lib/components/Lti/LaunchGroup.js +45 -45
  94. package/lib/components/NewVersionAlert.d.ts +18 -18
  95. package/lib/components/NewVersionAlert.js +97 -97
  96. package/lib/components/NotFound.d.ts +3 -3
  97. package/lib/components/NotFound.js +28 -28
  98. package/lib/components/Notifications.d.ts +39 -39
  99. package/lib/components/Notifications.js +175 -175
  100. package/lib/components/Quill/Formats/Image.d.ts +46 -0
  101. package/lib/components/Quill/Formats/Image.js +90 -0
  102. package/lib/components/Quill/Formats/List.d.ts +15 -0
  103. package/lib/components/Quill/Formats/List.js +79 -0
  104. package/lib/components/Quill/Formats/Video.d.ts +11 -0
  105. package/lib/components/Quill/Formats/Video.js +50 -0
  106. package/lib/components/{Blots → Quill/Specs}/CustomImageSpec.d.ts +15 -14
  107. package/lib/components/{Blots → Quill/Specs}/CustomImageSpec.js +54 -45
  108. package/lib/components/{Blots → Quill/Specs}/CustomVideoSpec.d.ts +16 -16
  109. package/lib/components/{Blots → Quill/Specs}/CustomVideoSpec.js +47 -47
  110. package/lib/components/Quill/TableModule/Blots/BaseTableBlot.d.ts +29 -0
  111. package/lib/components/Quill/TableModule/Blots/BaseTableBlot.js +126 -0
  112. package/lib/components/Quill/TableModule/Blots/TableBlot.d.ts +20 -0
  113. package/lib/components/Quill/TableModule/Blots/TableBlot.js +69 -0
  114. package/lib/components/Quill/TableModule/Blots/TableBodyBlot.d.ts +18 -0
  115. package/lib/components/Quill/TableModule/Blots/TableBodyBlot.js +71 -0
  116. package/lib/components/Quill/TableModule/Blots/TableCellBlot.d.ts +34 -0
  117. package/lib/components/Quill/TableModule/Blots/TableCellBlot.js +236 -0
  118. package/lib/components/Quill/TableModule/Blots/TableContainer.d.ts +16 -0
  119. package/lib/components/Quill/TableModule/Blots/TableContainer.js +103 -0
  120. package/lib/components/Quill/TableModule/Blots/TableRowBlot.d.ts +22 -0
  121. package/lib/components/Quill/TableModule/Blots/TableRowBlot.js +91 -0
  122. package/lib/components/Quill/TableModule/constants.d.ts +34 -0
  123. package/lib/components/Quill/TableModule/constants.js +42 -0
  124. package/lib/components/Quill/TableModule/index.css +171 -0
  125. package/lib/components/Quill/TableModule/index.d.ts +23 -0
  126. package/lib/components/Quill/TableModule/index.js +312 -0
  127. package/lib/components/Quill/TableModule/utils.d.ts +9 -0
  128. package/lib/components/Quill/TableModule/utils.js +54 -0
  129. package/lib/components/Quill/accessibilityFix.d.ts +19 -0
  130. package/lib/components/Quill/accessibilityFix.js +267 -0
  131. package/lib/components/Quill/index.d.ts +1 -0
  132. package/lib/components/Quill/index.js +27 -0
  133. package/lib/components/RefreshIndicator/Bordered.d.ts +7 -7
  134. package/lib/components/RefreshIndicator/Bordered.js +35 -35
  135. package/lib/components/RefreshIndicator/Inline.d.ts +4 -4
  136. package/lib/components/RefreshIndicator/Inline.js +36 -36
  137. package/lib/components/RefreshIndicator/index.d.ts +21 -21
  138. package/lib/components/RefreshIndicator/index.js +116 -116
  139. package/lib/components/SearchControls.d.ts +14 -14
  140. package/lib/components/SearchControls.js +34 -34
  141. package/lib/components/SentryRoute.d.ts +3 -3
  142. package/lib/components/SentryRoute.js +25 -25
  143. package/lib/components/Tables/RoleFilter.d.ts +14 -14
  144. package/lib/components/Tables/RoleFilter.js +53 -53
  145. package/lib/components/Tables/TextFilter.d.ts +7 -7
  146. package/lib/components/Tables/TextFilter.js +26 -26
  147. package/lib/components/UserRoles/Add.d.ts +31 -31
  148. package/lib/components/UserRoles/Add.js +165 -165
  149. package/lib/components/UserRoles/Context.d.ts +32 -32
  150. package/lib/components/UserRoles/Context.js +13 -13
  151. package/lib/components/UserRoles/RoleCell.d.ts +7 -7
  152. package/lib/components/UserRoles/RoleCell.js +106 -106
  153. package/lib/components/UserRoles/Select.d.ts +26 -26
  154. package/lib/components/UserRoles/Select.js +58 -58
  155. package/lib/components/UserRoles/Table.d.ts +7 -7
  156. package/lib/components/UserRoles/Table.js +109 -109
  157. package/lib/components/UserRoles/index.d.ts +108 -108
  158. package/lib/components/UserRoles/index.js +464 -464
  159. package/lib/constants/baseActivity.d.ts +25 -25
  160. package/lib/constants/baseActivity.js +29 -29
  161. package/lib/constants/baseRole.d.ts +9 -9
  162. package/lib/constants/baseRole.js +13 -13
  163. package/lib/constants/configuration.d.ts +8 -8
  164. package/lib/constants/configuration.js +39 -39
  165. package/lib/constants/externalProviderType.d.ts +5 -5
  166. package/lib/constants/externalProviderType.js +9 -9
  167. package/lib/constants/index.d.ts +8 -8
  168. package/lib/constants/index.js +20 -20
  169. package/lib/constants/mockData.d.ts +82 -82
  170. package/lib/constants/mockData.js +339 -339
  171. package/lib/constants/modelStatus.d.ts +10 -10
  172. package/lib/constants/modelStatus.js +14 -14
  173. package/lib/constants/notificationType.d.ts +7 -7
  174. package/lib/constants/notificationType.js +11 -11
  175. package/lib/constants/shard.d.ts +6 -6
  176. package/lib/constants/shard.js +10 -10
  177. package/lib/constants/tier.d.ts +6 -6
  178. package/lib/constants/tier.js +10 -10
  179. package/lib/constants/userRole.d.ts +2 -2
  180. package/lib/constants/userRole.js +21 -21
  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 +85 -85
  184. package/lib/css/components/_bootstrap-grid.css +28 -28
  185. package/lib/css/components/_buttons.css +325 -325
  186. package/lib/css/components/_forms.css +91 -91
  187. package/lib/css/components/_menu.css +56 -56
  188. package/lib/css/components/_modals.css +41 -41
  189. package/lib/css/components/_tables.css +426 -426
  190. package/lib/css/components/_tags.css +12 -12
  191. package/lib/css/index-with-variables.css +14 -14
  192. package/lib/css/index.css +13 -13
  193. package/lib/css/utils/_border.css +463 -463
  194. package/lib/css/utils/_color.css +271 -271
  195. package/lib/css/utils/_display.css +312 -312
  196. package/lib/css/utils/_general.css +48 -48
  197. package/lib/css/utils/_icon.css +16 -16
  198. package/lib/css/utils/_text.css +24 -24
  199. package/lib/css/utils/_width.css +60 -60
  200. package/lib/css/variables.css +70 -70
  201. package/lib/endpointMappings.d.ts +4 -4
  202. package/lib/endpointMappings.js +163 -163
  203. package/lib/hooks/useCollection.d.ts +6 -6
  204. package/lib/hooks/useCollection.js +61 -61
  205. package/lib/hooks/useCollectionConfiguration.d.ts +28 -28
  206. package/lib/hooks/useCollectionConfiguration.js +69 -69
  207. package/lib/hooks/useCollectionItem.d.ts +6 -6
  208. package/lib/hooks/useCollectionItem.js +54 -54
  209. package/lib/hooks/useGuid.d.ts +4 -4
  210. package/lib/hooks/useGuid.js +14 -14
  211. package/lib/hooks/usePrevious.d.ts +5 -5
  212. package/lib/hooks/usePrevious.js +18 -18
  213. package/lib/index.d.ts +8 -8
  214. package/lib/index.js +30 -30
  215. package/lib/redux/actionCreator.d.ts +5 -5
  216. package/lib/redux/actionCreator.js +16 -16
  217. package/lib/redux/actions.d.ts +12 -12
  218. package/lib/redux/actions.js +30 -30
  219. package/lib/redux/configureReducers.d.ts +22 -22
  220. package/lib/redux/configureReducers.js +94 -94
  221. package/lib/redux/configureStore.d.ts +14 -14
  222. package/lib/redux/configureStore.js +118 -118
  223. package/lib/redux/helpers.d.ts +2 -2
  224. package/lib/redux/helpers.js +7 -7
  225. package/lib/redux/reducers/index.d.ts +4 -4
  226. package/lib/redux/reducers/index.js +12 -12
  227. package/lib/redux/reducers/modalsReducer.d.ts +8 -8
  228. package/lib/redux/reducers/modalsReducer.js +54 -54
  229. package/lib/redux/reducers/notificationsReducer.d.ts +9 -9
  230. package/lib/redux/reducers/notificationsReducer.js +27 -27
  231. package/lib/redux/reducers/searchReducer.d.ts +17 -17
  232. package/lib/redux/reducers/searchReducer.js +23 -23
  233. package/lib/redux/sagas/caliperSaga.d.ts +2 -2
  234. package/lib/redux/sagas/caliperSaga.js +296 -296
  235. package/lib/redux/sagas/clockOffsetSaga.d.ts +10 -10
  236. package/lib/redux/sagas/clockOffsetSaga.js +81 -81
  237. package/lib/redux/sagas/configurationSaga.d.ts +1 -1
  238. package/lib/redux/sagas/configurationSaga.js +48 -48
  239. package/lib/redux/sagas/errorSaga.d.ts +2 -2
  240. package/lib/redux/sagas/errorSaga.js +66 -66
  241. package/lib/redux/sagas/identityProviderSaga.d.ts +2 -2
  242. package/lib/redux/sagas/identityProviderSaga.js +91 -91
  243. package/lib/redux/sagas/initialDataLoadSaga.d.ts +1 -1
  244. package/lib/redux/sagas/initialDataLoadSaga.js +33 -33
  245. package/lib/redux/sagas/postLoginDataSaga.d.ts +9 -9
  246. package/lib/redux/sagas/postLoginDataSaga.js +87 -87
  247. package/lib/redux/sagas/postLoginRedirectSaga.d.ts +6 -6
  248. package/lib/redux/sagas/postLoginRedirectSaga.js +96 -96
  249. package/lib/redux/sagas/rootSaga.d.ts +5 -5
  250. package/lib/redux/sagas/rootSaga.js +144 -144
  251. package/lib/redux/sagas/sentrySaga.d.ts +1 -1
  252. package/lib/redux/sagas/sentrySaga.js +103 -103
  253. package/lib/services/codeProviderService.d.ts +3 -3
  254. package/lib/services/codeProviderService.js +36 -36
  255. package/lib/services/documentService.d.ts +10 -10
  256. package/lib/services/documentService.js +17 -17
  257. package/lib/services/persistenceService.d.ts +13 -13
  258. package/lib/services/persistenceService.js +45 -45
  259. package/lib/services/ticketProviderService.d.ts +3 -3
  260. package/lib/services/ticketProviderService.js +40 -40
  261. package/lib/services/windowService.d.ts +9 -9
  262. package/lib/services/windowService.js +15 -15
  263. package/lib/setupTests.d.ts +1 -1
  264. package/lib/setupTests.js +25 -25
  265. package/lib/startup.d.ts +29 -29
  266. package/lib/startup.js +128 -128
  267. package/lib/types/AppConfiguration.d.ts +32 -32
  268. package/lib/types/AppConfiguration.js +2 -2
  269. package/lib/types/Artifact.d.ts +14 -14
  270. package/lib/types/Artifact.js +9 -9
  271. package/lib/types/BaseReduxState.d.ts +57 -57
  272. package/lib/types/BaseReduxState.js +2 -2
  273. package/lib/types/Client.d.ts +6 -6
  274. package/lib/types/Client.js +2 -2
  275. package/lib/types/Collection.d.ts +175 -175
  276. package/lib/types/Collection.js +2 -2
  277. package/lib/types/Configuration.d.ts +12 -12
  278. package/lib/types/Configuration.js +2 -2
  279. package/lib/types/DeepLinkingResponseRequest.d.ts +4 -4
  280. package/lib/types/DeepLinkingResponseRequest.js +2 -2
  281. package/lib/types/DeletableModel.d.ts +4 -4
  282. package/lib/types/DeletableModel.js +2 -2
  283. package/lib/types/External.d.ts +31 -31
  284. package/lib/types/External.js +2 -2
  285. package/lib/types/Group.d.ts +19 -19
  286. package/lib/types/Group.js +2 -2
  287. package/lib/types/IdentityProvider.d.ts +11 -11
  288. package/lib/types/IdentityProvider.js +2 -2
  289. package/lib/types/LtiLaunch.d.ts +20 -20
  290. package/lib/types/LtiLaunch.js +2 -2
  291. package/lib/types/NameOnlyEntity.d.ts +3 -3
  292. package/lib/types/NameOnlyEntity.js +2 -2
  293. package/lib/types/Notification.d.ts +15 -15
  294. package/lib/types/Notification.js +2 -2
  295. package/lib/types/OptionalRecord.d.ts +4 -4
  296. package/lib/types/OptionalRecord.js +2 -2
  297. package/lib/types/OwnerSchedule.d.ts +9 -9
  298. package/lib/types/OwnerSchedule.js +2 -2
  299. package/lib/types/PropertyOfType.d.ts +12 -12
  300. package/lib/types/PropertyOfType.js +2 -2
  301. package/lib/types/RoleDescription.d.ts +4 -4
  302. package/lib/types/RoleDescription.js +2 -2
  303. package/lib/types/Search.d.ts +11 -11
  304. package/lib/types/Search.js +2 -2
  305. package/lib/types/SimpleLocation.d.ts +46 -46
  306. package/lib/types/SimpleLocation.js +2 -2
  307. package/lib/types/UniTime.d.ts +17 -17
  308. package/lib/types/UniTime.js +2 -2
  309. package/lib/types/User.d.ts +68 -68
  310. package/lib/types/User.js +2 -2
  311. package/lib/types/UserRole.d.ts +14 -14
  312. package/lib/types/UserRole.js +2 -2
  313. package/lib/types/index.d.ts +21 -21
  314. package/lib/types/index.js +33 -33
  315. package/lib/utils/baseActivity.d.ts +63 -63
  316. package/lib/utils/baseActivity.js +155 -155
  317. package/lib/utils/baseRole.d.ts +2 -2
  318. package/lib/utils/baseRole.js +38 -38
  319. package/lib/utils/collection.d.ts +43 -43
  320. package/lib/utils/collection.js +340 -340
  321. package/lib/utils/date.d.ts +162 -162
  322. package/lib/utils/date.js +401 -401
  323. package/lib/utils/dom.d.ts +25 -0
  324. package/lib/utils/dom.js +201 -0
  325. package/lib/utils/domainIdentifier.d.ts +2 -2
  326. package/lib/utils/domainIdentifier.js +12 -12
  327. package/lib/utils/entityUserRole.d.ts +3 -3
  328. package/lib/utils/entityUserRole.js +5 -5
  329. package/lib/utils/externalGroup.d.ts +4 -4
  330. package/lib/utils/externalGroup.js +32 -32
  331. package/lib/utils/externalProviders.d.ts +2 -2
  332. package/lib/utils/externalProviders.js +11 -11
  333. package/lib/utils/externalTerms.d.ts +2 -2
  334. package/lib/utils/externalTerms.js +10 -10
  335. package/lib/utils/group.d.ts +15 -15
  336. package/lib/utils/group.js +15 -15
  337. package/lib/utils/groupDates.d.ts +9 -9
  338. package/lib/utils/groupDates.js +52 -52
  339. package/lib/utils/groupRoles.d.ts +8 -8
  340. package/lib/utils/groupRoles.js +43 -43
  341. package/lib/utils/logger.d.ts +10 -10
  342. package/lib/utils/logger.js +34 -34
  343. package/lib/utils/lti.d.ts +3 -3
  344. package/lib/utils/lti.js +9 -9
  345. package/lib/utils/model.d.ts +15 -15
  346. package/lib/utils/model.js +58 -58
  347. package/lib/utils/number.d.ts +13 -13
  348. package/lib/utils/number.js +32 -32
  349. package/lib/utils/promise.d.ts +5 -5
  350. package/lib/utils/promise.js +17 -17
  351. package/lib/utils/route.d.ts +5 -5
  352. package/lib/utils/route.js +69 -69
  353. package/lib/utils/shard.d.ts +3 -3
  354. package/lib/utils/shard.js +45 -45
  355. package/lib/utils/sort.d.ts +11 -11
  356. package/lib/utils/sort.js +69 -69
  357. package/lib/utils/string.d.ts +2 -2
  358. package/lib/utils/string.js +16 -16
  359. package/lib/utils/timezone.d.ts +2 -2
  360. package/lib/utils/timezone.js +32 -32
  361. package/lib/utils/url.d.ts +23 -23
  362. package/lib/utils/url.js +163 -163
  363. package/lib/utils/user.d.ts +8 -8
  364. package/lib/utils/user.js +73 -73
  365. package/lib/utils/userRole.d.ts +27 -27
  366. package/lib/utils/userRole.js +68 -68
  367. package/package.json +195 -192
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,127 +1,127 @@
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
- * **Features**: In GitLab from an issue, create a branch off of `develop`
90
- * **Hotfixes**: Create a `hotfix` branch off of `master` (manually or in GitLab by making an MR)
91
- 1. Update the version number by appending `-next.1.1` (or `-alpha.1` for hotfix branches)
92
- * e.g. If the current version is `1.0.0`, the new branch should be `1.0.0-next.1.1` (`1.0.1-alpha.1` for hotfix)
93
- * **NOTE:** if **more than one** branch is being developed on at the same time, simply increment the **first** number after "next"
94
- * e.g. `1.0.0-next.2.1` for the second issue branch (this won't apply for hotfixes)
95
- 1. Development Loop
96
- 1. Add/update new components, utils, or styles
97
- 1. Add/update unit tests for those components or utils to confirm basic functionality
98
- 1. Increment the **last** number in the version, e.g. `1.0.0-next.2.1` => `1.0.0-next.2.2` (`1.0.1-alpha.1` => `1.0.1-alpha.2` for hotfixes)
99
- 1. Push to gitlab. Azure DevOps will run a pipeline and publish this version to npmjs.org
100
- 1. Install the new version in the project(s) you are working on by updating its `package.json` and running `yarn`
101
- 1. Repeat as needed
102
- 1. Merging
103
- * After the Merge Request is approved, **remove** the "next" or "alpha" suffix from the version **before** merging
104
- * For **hotfix** branches, increment the version to the new patch number, e.g. `1.0.1`
105
- 1. Release
106
- * **Features**: After merging, create a new "release" branch from `develop` and follow the "git flow" release steps as normal
107
- * **Hotfixes**: Finish the "git flow" hotfix steps as normal from the hotfix branch
108
- * Azure DevOps will run a pipeline to publish the version merged to `master` to npmjs.org
109
-
110
- ## Styles
111
-
112
- Styles are organized into the following folders and files inside of `src/css`
113
-
114
- 1. `variables.css`
115
- * Global constant variables
116
- * Common app-specific variables
117
- 1. `utils`
118
- * Assorted utility styles, similar to tachyons
119
- * Break out similar styles into separate files once a few similar ones exist
120
- * e.g. `_display.css` contains all `display: ...;` related modifier styles
121
- 1. `base`
122
- * `_base.css`: Generic tags, .skip-main link, and .main-content
123
- * `_typography.css`: Default fonts, font scale, and text colors
124
- 1. `components`
125
- * Global component specific styles (e.g. not functional like tachyons)
126
-
127
- 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
+ * **Features**: In GitLab from an issue, create a branch off of `develop`
90
+ * **Hotfixes**: Create a `hotfix` branch off of `master` (manually or in GitLab by making an MR)
91
+ 1. Update the version number by appending `-next.1.1` (or `-alpha.1` for hotfix branches)
92
+ * e.g. If the current version is `1.0.0`, the new branch should be `1.0.0-next.1.1` (`1.0.1-alpha.1` for hotfix)
93
+ * **NOTE:** if **more than one** branch is being developed on at the same time, simply increment the **first** number after "next"
94
+ * e.g. `1.0.0-next.2.1` for the second issue branch (this won't apply for hotfixes)
95
+ 1. Development Loop
96
+ 1. Add/update new components, utils, or styles
97
+ 1. Add/update unit tests for those components or utils to confirm basic functionality
98
+ 1. Increment the **last** number in the version, e.g. `1.0.0-next.2.1` => `1.0.0-next.2.2` (`1.0.1-alpha.1` => `1.0.1-alpha.2` for hotfixes)
99
+ 1. Push to gitlab. Azure DevOps will run a pipeline and publish this version to npmjs.org
100
+ 1. Install the new version in the project(s) you are working on by updating its `package.json` and running `yarn`
101
+ 1. Repeat as needed
102
+ 1. Merging
103
+ * After the Merge Request is approved, **remove** the "next" or "alpha" suffix from the version **before** merging
104
+ * For **hotfix** branches, increment the version to the new patch number, e.g. `1.0.1`
105
+ 1. Release
106
+ * **Features**: After merging, create a new "release" branch from `develop` and follow the "git flow" release steps as normal
107
+ * **Hotfixes**: Finish the "git flow" hotfix steps as normal from the hotfix branch
108
+ * Azure DevOps will run a pipeline to publish the version merged to `master` to npmjs.org
109
+
110
+ ## Styles
111
+
112
+ Styles are organized into the following folders and files inside of `src/css`
113
+
114
+ 1. `variables.css`
115
+ * Global constant variables
116
+ * Common app-specific variables
117
+ 1. `utils`
118
+ * Assorted utility styles, similar to tachyons
119
+ * Break out similar styles into separate files once a few similar ones exist
120
+ * e.g. `_display.css` contains all `display: ...;` related modifier styles
121
+ 1. `base`
122
+ * `_base.css`: Generic tags, .skip-main link, and .main-content
123
+ * `_typography.css`: Default fonts, font scale, and text colors
124
+ 1. `components`
125
+ * Global component specific styles (e.g. not functional like tachyons)
126
+
127
+ Your project’s css folders and files should follow this same pattern.
@@ -1,20 +1,20 @@
1
- import { FunctionComponent } from 'react';
2
- import { Model } from 'studiokit-net-js';
3
- export interface ActionListProps {
4
- actions?: ListAction[];
5
- model: Model | null;
6
- className?: string;
7
- /** Even when there is a single ListAction, show the kebab menu */
8
- alwaysShowKebab?: boolean;
9
- }
10
- export interface ListAction {
11
- predicate: boolean;
12
- action: () => void;
13
- name: string;
14
- icon: JSX.Element;
15
- className: string;
16
- id: string;
17
- isDefault?: boolean;
18
- disabled?: boolean;
19
- }
20
- export declare const ActionList: FunctionComponent<ActionListProps>;
1
+ import { FunctionComponent } from 'react';
2
+ import { Model } from 'studiokit-net-js';
3
+ export interface ActionListProps {
4
+ actions?: ListAction[];
5
+ model: Model | null;
6
+ className?: string;
7
+ /** Even when there is a single ListAction, show the kebab menu */
8
+ alwaysShowKebab?: boolean;
9
+ }
10
+ export interface ListAction {
11
+ predicate: boolean;
12
+ action: () => void;
13
+ name: string;
14
+ icon: JSX.Element;
15
+ className: string;
16
+ id: string;
17
+ isDefault?: boolean;
18
+ disabled?: boolean;
19
+ }
20
+ export declare const ActionList: FunctionComponent<ActionListProps>;
@@ -1,94 +1,94 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
43
- 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 () {
52
- setInfoMenuAnchorElement(undefined);
53
- action === null || action === void 0 ? void 0 : action();
54
- }; };
55
- var handleListKeyDown = function (event) {
56
- var _a;
57
- if (event.key === 'Tab' || event.key === 'Escape' || event.key === 'Esc') {
58
- event.preventDefault();
59
- setInfoMenuAnchorElement(undefined);
60
- (_a = anchorRef.current) === null || _a === void 0 ? void 0 : _a.focus();
61
- }
62
- };
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; });
66
- if (defaultAction) {
67
- allowedActions = allowedActions.filter(function (a) { return a !== defaultAction; });
68
- }
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
- })))));
93
- };
94
- exports.ActionList = ActionList;
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
+ Object.defineProperty(exports, "__esModule", { value: true });
43
+ 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 () {
52
+ setInfoMenuAnchorElement(undefined);
53
+ action === null || action === void 0 ? void 0 : action();
54
+ }; };
55
+ var handleListKeyDown = function (event) {
56
+ var _a;
57
+ if (event.key === 'Tab' || event.key === 'Escape' || event.key === 'Esc') {
58
+ event.preventDefault();
59
+ setInfoMenuAnchorElement(undefined);
60
+ (_a = anchorRef.current) === null || _a === void 0 ? void 0 : _a.focus();
61
+ }
62
+ };
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; });
66
+ if (defaultAction) {
67
+ allowedActions = allowedActions.filter(function (a) { return a !== defaultAction; });
68
+ }
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
+ })))));
93
+ };
94
+ exports.ActionList = ActionList;
@@ -1,18 +1,18 @@
1
- import { FunctionComponent, MouseEventHandler } from 'react';
2
- export interface AlertDialogProps {
3
- id?: string;
4
- isOpen: boolean;
5
- title: string | JSX.Element;
6
- description?: string | JSX.Element | void;
7
- onProceed?: MouseEventHandler<HTMLElement>;
8
- proceedText?: string;
9
- /** onCancel is needed for closing using the X button, clicking the backdrop, or clicking the cancel button*/
10
- onCancel: MouseEventHandler<HTMLElement>;
11
- cancelText?: string;
12
- hideCancel?: boolean;
13
- onDestroy?: MouseEventHandler<HTMLElement>;
14
- destroyText?: string;
15
- manualBackground?: boolean;
16
- }
17
- declare const AlertDialog: FunctionComponent<AlertDialogProps>;
18
- export default AlertDialog;
1
+ import { FunctionComponent, MouseEventHandler } from 'react';
2
+ export interface AlertDialogProps {
3
+ id?: string;
4
+ isOpen: boolean;
5
+ title: string | JSX.Element;
6
+ description?: string | JSX.Element | void;
7
+ onProceed?: MouseEventHandler<HTMLElement>;
8
+ proceedText?: string;
9
+ /** onCancel is needed for closing using the X button, clicking the backdrop, or clicking the cancel button*/
10
+ onCancel: MouseEventHandler<HTMLElement>;
11
+ cancelText?: string;
12
+ hideCancel?: boolean;
13
+ onDestroy?: MouseEventHandler<HTMLElement>;
14
+ destroyText?: string;
15
+ manualBackground?: boolean;
16
+ }
17
+ declare const AlertDialog: FunctionComponent<AlertDialogProps>;
18
+ export default AlertDialog;
@@ -1,21 +1,21 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- var Button_1 = __importDefault(require("@material-ui/core/Button"));
7
- var react_1 = __importDefault(require("react"));
8
- var react_bootstrap_1 = require("react-bootstrap");
9
- var ConnectedModal_1 = __importDefault(require("./ConnectedModal"));
10
- var AlertDialog = function (props) {
11
- 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;
12
- return (react_1.default.createElement(ConnectedModal_1.default, { show: isOpen, onHide: onCancel, className: "z-9999" + (manualBackground ? ' bg-black-50' : '') },
13
- react_1.default.createElement(react_bootstrap_1.Modal.Header, { closeButton: true },
14
- react_1.default.createElement(react_bootstrap_1.Modal.Title, null, title)),
15
- !!description && react_1.default.createElement(react_bootstrap_1.Modal.Body, null, description),
16
- react_1.default.createElement(react_bootstrap_1.Modal.Footer, null,
17
- !!onProceed && (react_1.default.createElement(Button_1.default, { id: "alert-dialog-proceed-btn", variant: "contained", "aria-label": proceedText || 'Confirm', color: "primary", className: "fr", onClick: onProceed }, proceedText || 'Confirm')),
18
- !hideCancel && (react_1.default.createElement(Button_1.default, { id: "alert-dialog-cancel-btn", "aria-label": cancelText || 'Cancel', className: (onDestroy ? 'fr' : 'fl') + " " + (onProceed ? 'mr1' : ''), onClick: onCancel }, cancelText || 'Cancel')),
19
- !!onDestroy && (react_1.default.createElement(Button_1.default, { id: "alert-dialog-destroy-btn", "aria-label": destroyText || 'Destroy', color: "secondary", className: "fl color-red", onClick: onDestroy }, destroyText || 'Destroy')))));
20
- };
21
- exports.default = AlertDialog;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ var Button_1 = __importDefault(require("@material-ui/core/Button"));
7
+ var react_1 = __importDefault(require("react"));
8
+ var react_bootstrap_1 = require("react-bootstrap");
9
+ var ConnectedModal_1 = __importDefault(require("./ConnectedModal"));
10
+ var AlertDialog = function (props) {
11
+ 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;
12
+ return (react_1.default.createElement(ConnectedModal_1.default, { show: isOpen, onHide: onCancel, className: "z-9999" + (manualBackground ? ' bg-black-50' : '') },
13
+ react_1.default.createElement(react_bootstrap_1.Modal.Header, { closeButton: true },
14
+ react_1.default.createElement(react_bootstrap_1.Modal.Title, null, title)),
15
+ !!description && react_1.default.createElement(react_bootstrap_1.Modal.Body, null, description),
16
+ react_1.default.createElement(react_bootstrap_1.Modal.Footer, null,
17
+ !!onProceed && (react_1.default.createElement(Button_1.default, { id: "alert-dialog-proceed-btn", variant: "contained", "aria-label": proceedText || 'Confirm', color: "primary", className: "fr", onClick: onProceed }, proceedText || 'Confirm')),
18
+ !hideCancel && (react_1.default.createElement(Button_1.default, { id: "alert-dialog-cancel-btn", "aria-label": cancelText || 'Cancel', className: (onDestroy ? 'fr' : 'fl') + " " + (onProceed ? 'mr1' : ''), onClick: onCancel }, cancelText || 'Cancel')),
19
+ !!onDestroy && (react_1.default.createElement(Button_1.default, { id: "alert-dialog-destroy-btn", "aria-label": destroyText || 'Destroy', color: "secondary", className: "fl color-red", onClick: onDestroy }, destroyText || 'Destroy')))));
20
+ };
21
+ exports.default = AlertDialog;
@@ -1,7 +1,7 @@
1
- import { FunctionComponent } from 'react';
2
- import { AlertProps } from 'react-bootstrap';
3
- export interface AlertWithIconProps extends AlertProps {
4
- iconClassName?: string;
5
- }
6
- declare const AlertWithIcon: FunctionComponent<AlertWithIconProps>;
7
- export default AlertWithIcon;
1
+ import { FunctionComponent } from 'react';
2
+ import { AlertProps } from 'react-bootstrap';
3
+ export interface AlertWithIconProps extends AlertProps {
4
+ iconClassName?: string;
5
+ }
6
+ declare const AlertWithIcon: FunctionComponent<AlertWithIconProps>;
7
+ export default AlertWithIcon;