@oneblink/apps-react 8.14.0-beta.2 → 9.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (416) hide show
  1. package/dist/OneBlinkAutoSaveForm.d.ts +1 -1
  2. package/dist/OneBlinkAutoSaveForm.js +6 -8
  3. package/dist/OneBlinkAutoSaveForm.js.map +1 -1
  4. package/dist/OneBlinkForm.js +3 -2
  5. package/dist/OneBlinkForm.js.map +1 -1
  6. package/dist/OneBlinkFormBase.d.ts +1 -1
  7. package/dist/OneBlinkFormBase.js +49 -146
  8. package/dist/OneBlinkFormBase.js.map +1 -1
  9. package/dist/OneBlinkReadOnlyForm.d.ts +1 -1
  10. package/dist/OneBlinkReadOnlyForm.js +2 -1
  11. package/dist/OneBlinkReadOnlyForm.js.map +1 -1
  12. package/dist/PaymentReceipt.d.ts +1 -1
  13. package/dist/PaymentReceipt.js +9 -30
  14. package/dist/PaymentReceipt.js.map +1 -1
  15. package/dist/components/ArcGISWebMap.d.ts +3 -3
  16. package/dist/components/ArcGISWebMap.js +25 -38
  17. package/dist/components/ArcGISWebMap.js.map +1 -1
  18. package/dist/components/Clickable.d.ts +1 -1
  19. package/dist/components/Clickable.js +2 -1
  20. package/dist/components/Clickable.js.map +1 -1
  21. package/dist/components/ConfirmDialog.d.ts +2 -2
  22. package/dist/components/ConfirmDialog.js +7 -14
  23. package/dist/components/ConfirmDialog.js.map +1 -1
  24. package/dist/components/CopyToClipboardIconButton.d.ts +1 -1
  25. package/dist/components/CopyToClipboardIconButton.js +10 -14
  26. package/dist/components/CopyToClipboardIconButton.js.map +1 -1
  27. package/dist/components/CustomAccordion.d.ts +3 -20
  28. package/dist/components/ErrorSnackbar.d.ts +1 -1
  29. package/dist/components/ErrorSnackbar.js +6 -7
  30. package/dist/components/ErrorSnackbar.js.map +1 -1
  31. package/dist/components/ImageCropper/CropModal.d.ts +1 -1
  32. package/dist/components/ImageCropper/CropModal.js +2 -8
  33. package/dist/components/ImageCropper/CropModal.js.map +1 -1
  34. package/dist/components/ImageCropper/index.d.ts +1 -1
  35. package/dist/components/ImageCropper/index.js +3 -5
  36. package/dist/components/ImageCropper/index.js.map +1 -1
  37. package/dist/components/InputClear.js +2 -3
  38. package/dist/components/InputClear.js.map +1 -1
  39. package/dist/components/InputField.d.ts +3 -2
  40. package/dist/components/InputField.js +5 -2
  41. package/dist/components/InputField.js.map +1 -1
  42. package/dist/components/Lists.d.ts +1 -6
  43. package/dist/components/Lists.js +2 -2
  44. package/dist/components/Lists.js.map +1 -1
  45. package/dist/components/LoadingWithMessage.js +2 -6
  46. package/dist/components/LoadingWithMessage.js.map +1 -1
  47. package/dist/components/MaterialIcon.d.ts +2 -4
  48. package/dist/components/MaterialIcon.js +4 -4
  49. package/dist/components/MaterialIcon.js.map +1 -1
  50. package/dist/components/NotificationGrid.d.ts +2 -2
  51. package/dist/components/NotificationGrid.js +4 -7
  52. package/dist/components/NotificationGrid.js.map +1 -1
  53. package/dist/components/QuillHTML.d.ts +1 -1
  54. package/dist/components/QuillHTML.js +2 -1
  55. package/dist/components/QuillHTML.js.map +1 -1
  56. package/dist/components/SuccessSnackbar.d.ts +1 -1
  57. package/dist/components/SuccessSnackbar.js +3 -6
  58. package/dist/components/SuccessSnackbar.js.map +1 -1
  59. package/dist/components/ValidationErrorsCard.d.ts +2 -2
  60. package/dist/components/ValidationErrorsCard.js +32 -49
  61. package/dist/components/ValidationErrorsCard.js.map +1 -1
  62. package/dist/components/calendar-bookings/CalendarBookingsCancelForm.d.ts +1 -1
  63. package/dist/components/calendar-bookings/CalendarBookingsCancelForm.js +5 -6
  64. package/dist/components/calendar-bookings/CalendarBookingsCancelForm.js.map +1 -1
  65. package/dist/components/calendar-bookings/CalendarBookingsContainer.d.ts +1 -1
  66. package/dist/components/calendar-bookings/CalendarBookingsContainer.js +9 -11
  67. package/dist/components/calendar-bookings/CalendarBookingsContainer.js.map +1 -1
  68. package/dist/components/calendar-bookings/CalendarBookingsForm.d.ts +1 -1
  69. package/dist/components/calendar-bookings/CalendarBookingsForm.js +33 -45
  70. package/dist/components/calendar-bookings/CalendarBookingsForm.js.map +1 -1
  71. package/dist/components/calendar-bookings/CalendarBookingsProvider.d.ts +1 -1
  72. package/dist/components/calendar-bookings/CalendarBookingsProvider.js +2 -6
  73. package/dist/components/calendar-bookings/CalendarBookingsProvider.js.map +1 -1
  74. package/dist/components/calendar-bookings/CalendarBookingsReschedulingForm.d.ts +1 -1
  75. package/dist/components/calendar-bookings/CalendarBookingsReschedulingForm.js +5 -6
  76. package/dist/components/calendar-bookings/CalendarBookingsReschedulingForm.js.map +1 -1
  77. package/dist/components/calendar-bookings/ErrorModal.js +7 -11
  78. package/dist/components/calendar-bookings/ErrorModal.js.map +1 -1
  79. package/dist/components/downloadable-files/LayoutProvider.d.ts +1 -1
  80. package/dist/components/downloadable-files/LayoutProvider.js +2 -1
  81. package/dist/components/downloadable-files/LayoutProvider.js.map +1 -1
  82. package/dist/components/downloadable-files/index.d.ts +1 -1
  83. package/dist/components/downloadable-files/index.js +3 -5
  84. package/dist/components/downloadable-files/index.js.map +1 -1
  85. package/dist/components/downloadable-files/resource-components.d.ts +3 -3
  86. package/dist/components/downloadable-files/resource-components.js +9 -32
  87. package/dist/components/downloadable-files/resource-components.js.map +1 -1
  88. package/dist/components/formStore/FormStoreTableProvider.d.ts +1 -1
  89. package/dist/components/formStore/FormStoreTableProvider.js +5 -15
  90. package/dist/components/formStore/FormStoreTableProvider.js.map +1 -1
  91. package/dist/components/formStore/OneBlinkFormStoreClearFiltersButton.d.ts +1 -1
  92. package/dist/components/formStore/OneBlinkFormStoreClearFiltersButton.js +3 -2
  93. package/dist/components/formStore/OneBlinkFormStoreClearFiltersButton.js.map +1 -1
  94. package/dist/components/formStore/OneBlinkFormStoreColumnsButton.d.ts +1 -1
  95. package/dist/components/formStore/OneBlinkFormStoreColumnsButton.js +21 -54
  96. package/dist/components/formStore/OneBlinkFormStoreColumnsButton.js.map +1 -1
  97. package/dist/components/formStore/OneBlinkFormStoreDownloadButton.d.ts +2 -2
  98. package/dist/components/formStore/OneBlinkFormStoreDownloadButton.js +7 -26
  99. package/dist/components/formStore/OneBlinkFormStoreDownloadButton.js.map +1 -1
  100. package/dist/components/formStore/OneBlinkFormStoreProvider.d.ts +1 -1
  101. package/dist/components/formStore/OneBlinkFormStoreProvider.js +4 -5
  102. package/dist/components/formStore/OneBlinkFormStoreProvider.js.map +1 -1
  103. package/dist/components/formStore/OneBlinkFormStoreRefreshButton.d.ts +1 -1
  104. package/dist/components/formStore/OneBlinkFormStoreRefreshButton.js +3 -2
  105. package/dist/components/formStore/OneBlinkFormStoreRefreshButton.js.map +1 -1
  106. package/dist/components/formStore/OneBlinkFormStoreTable.d.ts +1 -1
  107. package/dist/components/formStore/OneBlinkFormStoreTable.js +128 -94
  108. package/dist/components/formStore/OneBlinkFormStoreTable.js.map +1 -1
  109. package/dist/components/formStore/display/ElementDisplay.d.ts +3 -4
  110. package/dist/components/formStore/display/ElementDisplay.js +9 -12
  111. package/dist/components/formStore/display/ElementDisplay.js.map +1 -1
  112. package/dist/components/formStore/display/FormStoreIcon.d.ts +1 -1
  113. package/dist/components/formStore/display/FormStoreIcon.js +2 -2
  114. package/dist/components/formStore/display/FormStoreIcon.js.map +1 -1
  115. package/dist/components/formStore/table/ActionedByTableCell.d.ts +1 -1
  116. package/dist/components/formStore/table/ActionedByTableCell.js +6 -7
  117. package/dist/components/formStore/table/ActionedByTableCell.js.map +1 -1
  118. package/dist/components/formStore/table/ColumnFilters.d.ts +3 -3
  119. package/dist/components/formStore/table/ColumnFilters.js +84 -100
  120. package/dist/components/formStore/table/ColumnFilters.js.map +1 -1
  121. package/dist/components/formStore/table/FormElementTableCell.d.ts +1 -1
  122. package/dist/components/formStore/table/FormElementTableCell.js +34 -97
  123. package/dist/components/formStore/table/FormElementTableCell.js.map +1 -1
  124. package/dist/components/formStore/table/HeaderCellMoreButton.d.ts +4 -4
  125. package/dist/components/formStore/table/HeaderCellMoreButton.js +26 -32
  126. package/dist/components/formStore/table/HeaderCellMoreButton.js.map +1 -1
  127. package/dist/components/formStore/table/Pickers.d.ts +4 -4
  128. package/dist/components/formStore/table/Pickers.js +14 -13
  129. package/dist/components/formStore/table/Pickers.js.map +1 -1
  130. package/dist/components/formStore/table/RepeatableSetCell.js +16 -21
  131. package/dist/components/formStore/table/RepeatableSetCell.js.map +1 -1
  132. package/dist/components/formStore/table/RepeatableSetCellAccordion.js +2 -4
  133. package/dist/components/formStore/table/RepeatableSetCellAccordion.js.map +1 -1
  134. package/dist/components/formStore/table/TableCellCopyButton.d.ts +1 -1
  135. package/dist/components/formStore/table/TableCellCopyButton.js +2 -3
  136. package/dist/components/formStore/table/TableCellCopyButton.js.map +1 -1
  137. package/dist/components/formStore/table/generateColumns.d.ts +5 -6
  138. package/dist/components/formStore/table/generateColumns.js +23 -18
  139. package/dist/components/formStore/table/generateColumns.js.map +1 -1
  140. package/dist/components/formStore/table/getVersionedState.d.ts +4 -3
  141. package/dist/components/formStore/table/getVersionedState.js +23 -6
  142. package/dist/components/formStore/table/getVersionedState.js.map +1 -1
  143. package/dist/components/formStore/table/useFormStoreTable.d.ts +146 -37
  144. package/dist/components/formStore/table/useFormStoreTable.js +266 -199
  145. package/dist/components/formStore/table/useFormStoreTable.js.map +1 -1
  146. package/dist/components/formStore/useFormStoreTableContext.d.ts +142 -33
  147. package/dist/components/messages/ErrorMessage.js +3 -3
  148. package/dist/components/messages/ErrorMessage.js.map +1 -1
  149. package/dist/components/messages/LargeIconMessage.js +2 -6
  150. package/dist/components/messages/LargeIconMessage.js.map +1 -1
  151. package/dist/components/messages/NoResourcesYet.d.ts +1 -1
  152. package/dist/components/messages/NoResourcesYet.js +2 -1
  153. package/dist/components/messages/NoResourcesYet.js.map +1 -1
  154. package/dist/components/mfa/MfaDialog.d.ts +1 -1
  155. package/dist/components/mfa/MfaDialog.js +9 -48
  156. package/dist/components/mfa/MfaDialog.js.map +1 -1
  157. package/dist/components/mfa/MultiFactorAuthentication.d.ts +2 -5
  158. package/dist/components/mfa/MultiFactorAuthentication.js +14 -45
  159. package/dist/components/mfa/MultiFactorAuthentication.js.map +1 -1
  160. package/dist/components/payments/PaymentForm.d.ts +1 -1
  161. package/dist/components/payments/PaymentForm.js +4 -9
  162. package/dist/components/payments/PaymentForm.js.map +1 -1
  163. package/dist/components/payments/WestpacQuickStreamPaymentForm.d.ts +1 -1
  164. package/dist/components/payments/WestpacQuickStreamPaymentForm.js +11 -45
  165. package/dist/components/payments/WestpacQuickStreamPaymentForm.js.map +1 -1
  166. package/dist/components/receipts/Receipt.d.ts +1 -1
  167. package/dist/components/receipts/Receipt.js +2 -2
  168. package/dist/components/receipts/Receipt.js.map +1 -1
  169. package/dist/components/receipts/ReceiptButton.d.ts +1 -1
  170. package/dist/components/receipts/ReceiptButton.js +3 -2
  171. package/dist/components/receipts/ReceiptButton.js.map +1 -1
  172. package/dist/components/receipts/ReceiptList.d.ts +1 -1
  173. package/dist/components/receipts/ReceiptList.js +2 -9
  174. package/dist/components/receipts/ReceiptList.js.map +1 -1
  175. package/dist/components/receipts/ReceiptListItem.d.ts +1 -1
  176. package/dist/components/receipts/ReceiptListItem.js +2 -11
  177. package/dist/components/receipts/ReceiptListItem.js.map +1 -1
  178. package/dist/components/renderer/AnnotationModal.d.ts +1 -1
  179. package/dist/components/renderer/AnnotationModal.js +6 -14
  180. package/dist/components/renderer/AnnotationModal.js.map +1 -1
  181. package/dist/components/renderer/AutocompleteDropdown.d.ts +1 -1
  182. package/dist/components/renderer/AutocompleteDropdown.js +15 -34
  183. package/dist/components/renderer/AutocompleteDropdown.js.map +1 -1
  184. package/dist/components/renderer/CopyToClipboardButton.d.ts +1 -1
  185. package/dist/components/renderer/CopyToClipboardButton.js +2 -4
  186. package/dist/components/renderer/CopyToClipboardButton.js.map +1 -1
  187. package/dist/components/renderer/CustomisableButtonInner.js +2 -4
  188. package/dist/components/renderer/CustomisableButtonInner.js.map +1 -1
  189. package/dist/components/renderer/FormElementLabelContainer.d.ts +3 -3
  190. package/dist/components/renderer/FormElementLabelContainer.js +7 -14
  191. package/dist/components/renderer/FormElementLabelContainer.js.map +1 -1
  192. package/dist/components/renderer/FormElementOptions.d.ts +1 -1
  193. package/dist/components/renderer/FormElementOptions.js +4 -5
  194. package/dist/components/renderer/FormElementOptions.js.map +1 -1
  195. package/dist/components/renderer/FormElementValidationMessage.js +3 -5
  196. package/dist/components/renderer/FormElementValidationMessage.js.map +1 -1
  197. package/dist/components/renderer/LookupButton.d.ts +1 -1
  198. package/dist/components/renderer/LookupButton.js +4 -8
  199. package/dist/components/renderer/LookupButton.js.map +1 -1
  200. package/dist/components/renderer/LookupNotification.d.ts +1 -1
  201. package/dist/components/renderer/LookupNotification.js +14 -36
  202. package/dist/components/renderer/LookupNotification.js.map +1 -1
  203. package/dist/components/renderer/Modal.d.ts +3 -3
  204. package/dist/components/renderer/Modal.js +5 -10
  205. package/dist/components/renderer/Modal.js.map +1 -1
  206. package/dist/components/renderer/OnLoading.d.ts +1 -1
  207. package/dist/components/renderer/OnLoading.js +3 -3
  208. package/dist/components/renderer/OnLoading.js.map +1 -1
  209. package/dist/components/renderer/OneBlinkAppsErrorOriginalMessage.d.ts +1 -1
  210. package/dist/components/renderer/OneBlinkAppsErrorOriginalMessage.js +2 -4
  211. package/dist/components/renderer/OneBlinkAppsErrorOriginalMessage.js.map +1 -1
  212. package/dist/components/renderer/OneBlinkFormElements.d.ts +1 -1
  213. package/dist/components/renderer/OneBlinkFormElements.js +61 -90
  214. package/dist/components/renderer/OneBlinkFormElements.js.map +1 -1
  215. package/dist/components/renderer/PageFormElements.d.ts +1 -1
  216. package/dist/components/renderer/PageFormElements.js +3 -5
  217. package/dist/components/renderer/PageFormElements.js.map +1 -1
  218. package/dist/components/renderer/ProgressBar.d.ts +1 -1
  219. package/dist/components/renderer/ProgressBar.js +2 -1
  220. package/dist/components/renderer/ProgressBar.js.map +1 -1
  221. package/dist/components/renderer/ReverseGeocode.d.ts +1 -1
  222. package/dist/components/renderer/ReverseGeocode.js +2 -1
  223. package/dist/components/renderer/ReverseGeocode.js.map +1 -1
  224. package/dist/components/renderer/ToggleAllCheckbox.js +4 -5
  225. package/dist/components/renderer/ToggleAllCheckbox.js.map +1 -1
  226. package/dist/components/renderer/Tooltip.d.ts +1 -1
  227. package/dist/components/renderer/Tooltip.js +3 -1
  228. package/dist/components/renderer/Tooltip.js.map +1 -1
  229. package/dist/components/renderer/attachments/AttachmentStatus.d.ts +1 -1
  230. package/dist/components/renderer/attachments/AttachmentStatus.js +6 -15
  231. package/dist/components/renderer/attachments/AttachmentStatus.js.map +1 -1
  232. package/dist/components/renderer/attachments/DropdownMenu.js +30 -42
  233. package/dist/components/renderer/attachments/DropdownMenu.js.map +1 -1
  234. package/dist/components/renderer/attachments/FileCard.d.ts +1 -1
  235. package/dist/components/renderer/attachments/FileCard.js +2 -10
  236. package/dist/components/renderer/attachments/FileCard.js.map +1 -1
  237. package/dist/components/renderer/attachments/FileCardContent.d.ts +1 -1
  238. package/dist/components/renderer/attachments/FileCardContent.js +3 -4
  239. package/dist/components/renderer/attachments/FileCardContent.js.map +1 -1
  240. package/dist/components/renderer/attachments/ImagePreviewUnavailable.d.ts +1 -1
  241. package/dist/components/renderer/attachments/ImagePreviewUnavailable.js +2 -5
  242. package/dist/components/renderer/attachments/ImagePreviewUnavailable.js.map +1 -1
  243. package/dist/components/renderer/attachments/ProgressBar.js +2 -4
  244. package/dist/components/renderer/attachments/ProgressBar.js.map +1 -1
  245. package/dist/form-elements/ComplianceButton.js +3 -4
  246. package/dist/form-elements/ComplianceButton.js.map +1 -1
  247. package/dist/form-elements/FormElementABN.d.ts +1 -1
  248. package/dist/form-elements/FormElementABN.js +18 -28
  249. package/dist/form-elements/FormElementABN.js.map +1 -1
  250. package/dist/form-elements/FormElementAPINSWLiquorLicence.d.ts +2 -2
  251. package/dist/form-elements/FormElementAPINSWLiquorLicence.js +3 -21
  252. package/dist/form-elements/FormElementAPINSWLiquorLicence.js.map +1 -1
  253. package/dist/form-elements/FormElementArcGISWebMap.d.ts +1 -1
  254. package/dist/form-elements/FormElementArcGISWebMap.js +21 -36
  255. package/dist/form-elements/FormElementArcGISWebMap.js.map +1 -1
  256. package/dist/form-elements/FormElementAutocomplete.d.ts +1 -1
  257. package/dist/form-elements/FormElementAutocomplete.js +5 -9
  258. package/dist/form-elements/FormElementAutocomplete.js.map +1 -1
  259. package/dist/form-elements/FormElementBSB.d.ts +1 -1
  260. package/dist/form-elements/FormElementBSB.js +17 -30
  261. package/dist/form-elements/FormElementBSB.js.map +1 -1
  262. package/dist/form-elements/FormElementBarcodeScanner.d.ts +1 -1
  263. package/dist/form-elements/FormElementBarcodeScanner.js +16 -50
  264. package/dist/form-elements/FormElementBarcodeScanner.js.map +1 -1
  265. package/dist/form-elements/FormElementBoolean.d.ts +1 -1
  266. package/dist/form-elements/FormElementBoolean.js +4 -4
  267. package/dist/form-elements/FormElementBoolean.js.map +1 -1
  268. package/dist/form-elements/FormElementCalculation.d.ts +1 -1
  269. package/dist/form-elements/FormElementCalculation.js +2 -9
  270. package/dist/form-elements/FormElementCalculation.js.map +1 -1
  271. package/dist/form-elements/FormElementCamera.d.ts +1 -1
  272. package/dist/form-elements/FormElementCamera.js +7 -53
  273. package/dist/form-elements/FormElementCamera.js.map +1 -1
  274. package/dist/form-elements/FormElementCaptcha.d.ts +1 -1
  275. package/dist/form-elements/FormElementCaptcha.js +2 -4
  276. package/dist/form-elements/FormElementCaptcha.js.map +1 -1
  277. package/dist/form-elements/FormElementCheckBoxes.d.ts +1 -1
  278. package/dist/form-elements/FormElementCheckBoxes.js +23 -33
  279. package/dist/form-elements/FormElementCheckBoxes.js.map +1 -1
  280. package/dist/form-elements/FormElementCivicaNameRecord.d.ts +1 -1
  281. package/dist/form-elements/FormElementCivicaNameRecord.js +2 -1
  282. package/dist/form-elements/FormElementCivicaNameRecord.js.map +1 -1
  283. package/dist/form-elements/FormElementCivicaStreetName.d.ts +1 -1
  284. package/dist/form-elements/FormElementCivicaStreetName.js +2 -4
  285. package/dist/form-elements/FormElementCivicaStreetName.js.map +1 -1
  286. package/dist/form-elements/FormElementCompliance.d.ts +1 -1
  287. package/dist/form-elements/FormElementCompliance.js +13 -25
  288. package/dist/form-elements/FormElementCompliance.js.map +1 -1
  289. package/dist/form-elements/FormElementDate.d.ts +1 -1
  290. package/dist/form-elements/FormElementDate.js +2 -9
  291. package/dist/form-elements/FormElementDate.js.map +1 -1
  292. package/dist/form-elements/FormElementDateTime.d.ts +1 -1
  293. package/dist/form-elements/FormElementDateTime.js +2 -9
  294. package/dist/form-elements/FormElementDateTime.js.map +1 -1
  295. package/dist/form-elements/FormElementEmail.d.ts +1 -1
  296. package/dist/form-elements/FormElementEmail.js +4 -13
  297. package/dist/form-elements/FormElementEmail.js.map +1 -1
  298. package/dist/form-elements/FormElementFile.js +2 -12
  299. package/dist/form-elements/FormElementFile.js.map +1 -1
  300. package/dist/form-elements/FormElementFiles.d.ts +1 -1
  301. package/dist/form-elements/FormElementFiles.js +9 -17
  302. package/dist/form-elements/FormElementFiles.js.map +1 -1
  303. package/dist/form-elements/FormElementForm.d.ts +1 -1
  304. package/dist/form-elements/FormElementForm.js +2 -1
  305. package/dist/form-elements/FormElementForm.js.map +1 -1
  306. package/dist/form-elements/FormElementFreshdeskDependentField.d.ts +1 -1
  307. package/dist/form-elements/FormElementFreshdeskDependentField.js +2 -1
  308. package/dist/form-elements/FormElementFreshdeskDependentField.js.map +1 -1
  309. package/dist/form-elements/FormElementGeoscapeAddress.d.ts +1 -1
  310. package/dist/form-elements/FormElementGeoscapeAddress.js +2 -4
  311. package/dist/form-elements/FormElementGeoscapeAddress.js.map +1 -1
  312. package/dist/form-elements/FormElementGoogleAddress.d.ts +1 -1
  313. package/dist/form-elements/FormElementGoogleAddress.js +2 -7
  314. package/dist/form-elements/FormElementGoogleAddress.js.map +1 -1
  315. package/dist/form-elements/FormElementHTML.d.ts +1 -1
  316. package/dist/form-elements/FormElementHTML.js +2 -3
  317. package/dist/form-elements/FormElementHTML.js.map +1 -1
  318. package/dist/form-elements/FormElementHeading.d.ts +1 -1
  319. package/dist/form-elements/FormElementHeading.js +7 -8
  320. package/dist/form-elements/FormElementHeading.js.map +1 -1
  321. package/dist/form-elements/FormElementImage.d.ts +1 -1
  322. package/dist/form-elements/FormElementImage.js +3 -3
  323. package/dist/form-elements/FormElementImage.js.map +1 -1
  324. package/dist/form-elements/FormElementLocation.d.ts +1 -1
  325. package/dist/form-elements/FormElementLocation.js +16 -47
  326. package/dist/form-elements/FormElementLocation.js.map +1 -1
  327. package/dist/form-elements/FormElementLookupButton.d.ts +2 -3
  328. package/dist/form-elements/FormElementLookupButton.js +4 -7
  329. package/dist/form-elements/FormElementLookupButton.js.map +1 -1
  330. package/dist/form-elements/FormElementNumber.d.ts +1 -1
  331. package/dist/form-elements/FormElementNumber.js +3 -14
  332. package/dist/form-elements/FormElementNumber.js.map +1 -1
  333. package/dist/form-elements/FormElementPointAddress.d.ts +2 -2
  334. package/dist/form-elements/FormElementPointAddress.js +6 -13
  335. package/dist/form-elements/FormElementPointAddress.js.map +1 -1
  336. package/dist/form-elements/FormElementPointAddressV3.d.ts +1 -1
  337. package/dist/form-elements/FormElementPointAddressV3.js +2 -9
  338. package/dist/form-elements/FormElementPointAddressV3.js.map +1 -1
  339. package/dist/form-elements/FormElementPointCadastralParcel.d.ts +1 -1
  340. package/dist/form-elements/FormElementPointCadastralParcel.js +14 -26
  341. package/dist/form-elements/FormElementPointCadastralParcel.js.map +1 -1
  342. package/dist/form-elements/FormElementRadio.d.ts +1 -1
  343. package/dist/form-elements/FormElementRadio.js +24 -30
  344. package/dist/form-elements/FormElementRadio.js.map +1 -1
  345. package/dist/form-elements/FormElementRepeatableSet.d.ts +1 -1
  346. package/dist/form-elements/FormElementRepeatableSet.js +21 -39
  347. package/dist/form-elements/FormElementRepeatableSet.js.map +1 -1
  348. package/dist/form-elements/FormElementSection.d.ts +1 -1
  349. package/dist/form-elements/FormElementSection.js +16 -34
  350. package/dist/form-elements/FormElementSection.js.map +1 -1
  351. package/dist/form-elements/FormElementSelect.d.ts +1 -1
  352. package/dist/form-elements/FormElementSelect.js +12 -23
  353. package/dist/form-elements/FormElementSelect.js.map +1 -1
  354. package/dist/form-elements/FormElementSignature.d.ts +1 -1
  355. package/dist/form-elements/FormElementSignature.js +21 -46
  356. package/dist/form-elements/FormElementSignature.js.map +1 -1
  357. package/dist/form-elements/FormElementSummary.d.ts +1 -1
  358. package/dist/form-elements/FormElementSummary.js +5 -4
  359. package/dist/form-elements/FormElementSummary.js.map +1 -1
  360. package/dist/form-elements/FormElementTelephone.d.ts +1 -1
  361. package/dist/form-elements/FormElementTelephone.js +4 -13
  362. package/dist/form-elements/FormElementTelephone.js.map +1 -1
  363. package/dist/form-elements/FormElementText.d.ts +1 -1
  364. package/dist/form-elements/FormElementText.js +6 -21
  365. package/dist/form-elements/FormElementText.js.map +1 -1
  366. package/dist/form-elements/FormElementTextarea.d.ts +1 -1
  367. package/dist/form-elements/FormElementTextarea.js +6 -20
  368. package/dist/form-elements/FormElementTextarea.js.map +1 -1
  369. package/dist/form-elements/FormElementTime.d.ts +1 -1
  370. package/dist/form-elements/FormElementTime.js +2 -9
  371. package/dist/form-elements/FormElementTime.js.map +1 -1
  372. package/dist/form-elements/OptionButton.js +3 -5
  373. package/dist/form-elements/OptionButton.js.map +1 -1
  374. package/dist/hooks/attachments/useAttachmentBlobs.d.ts +1 -1
  375. package/dist/hooks/attachments/useAttachmentBlobs.js +2 -1
  376. package/dist/hooks/attachments/useAttachmentBlobs.js.map +1 -1
  377. package/dist/hooks/form-date-picker/useFormDatePickerProps.d.ts +7 -8
  378. package/dist/hooks/form-date-picker/useFormDatePickerProps.js +8 -10
  379. package/dist/hooks/form-date-picker/useFormDatePickerProps.js.map +1 -1
  380. package/dist/hooks/useAuth.d.ts +1 -1
  381. package/dist/hooks/useAuth.js +2 -1
  382. package/dist/hooks/useAuth.js.map +1 -1
  383. package/dist/hooks/useDrafts.d.ts +1 -1
  384. package/dist/hooks/useDrafts.js +2 -1
  385. package/dist/hooks/useDrafts.js.map +1 -1
  386. package/dist/hooks/useDynamicOptionsLoaderState.d.ts +1 -1
  387. package/dist/hooks/useDynamicOptionsLoaderState.js +4 -13
  388. package/dist/hooks/useDynamicOptionsLoaderState.js.map +1 -1
  389. package/dist/hooks/useFormElementLookups.d.ts +1 -1
  390. package/dist/hooks/useFormElementLookups.js +2 -1
  391. package/dist/hooks/useFormElementLookups.js.map +1 -1
  392. package/dist/hooks/useFormSubmissionModelContext.d.ts +1 -1
  393. package/dist/hooks/useFormSubmissionModelContext.js +2 -1
  394. package/dist/hooks/useFormSubmissionModelContext.js.map +1 -1
  395. package/dist/hooks/useFormSubmissionState.d.ts +1 -1
  396. package/dist/hooks/useFormSubmissionState.js +1 -1
  397. package/dist/hooks/useFormSubmissionState.js.map +1 -1
  398. package/dist/hooks/useIsHovering.d.ts +1 -1
  399. package/dist/hooks/useIsHovering.js +4 -4
  400. package/dist/hooks/useIsHovering.js.map +1 -1
  401. package/dist/hooks/useIsOffline.d.ts +1 -1
  402. package/dist/hooks/useIsOffline.js +2 -1
  403. package/dist/hooks/useIsOffline.js.map +1 -1
  404. package/dist/hooks/useIsPageVisible.d.ts +1 -1
  405. package/dist/hooks/useIsPageVisible.js +2 -1
  406. package/dist/hooks/useIsPageVisible.js.map +1 -1
  407. package/dist/hooks/useMfa.d.ts +1 -1
  408. package/dist/hooks/useMfa.js +2 -1
  409. package/dist/hooks/useMfa.js.map +1 -1
  410. package/dist/hooks/usePages.d.ts +1 -1
  411. package/dist/hooks/usePendingSubmissions.d.ts +1 -1
  412. package/dist/hooks/usePendingSubmissions.js +2 -1
  413. package/dist/hooks/usePendingSubmissions.js.map +1 -1
  414. package/dist/hooks/useReCAPTCHAProps.d.ts +1 -1
  415. package/dist/hooks/useReCAPTCHAProps.js.map +1 -1
  416. package/package.json +21 -25
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import * as React from 'react';
2
3
  import { offlineService } from '@oneblink/apps';
3
4
  import useBooleanState from '../hooks/useBooleanState';
@@ -54,7 +55,7 @@ export function IsOfflineContextProvider({ children, }) {
54
55
  const [isOffline, goOffline, goOnline] = useBooleanState(defaultValue);
55
56
  useNetworkChangeEffect('online', goOnline);
56
57
  useNetworkChangeEffect('offline', goOffline);
57
- return (React.createElement(IsOfflineContext.Provider, { value: isOffline }, children));
58
+ return (_jsx(IsOfflineContext.Provider, { value: isOffline, children: children }));
58
59
  }
59
60
  /**
60
61
  * This function is a react hook for determining whether an application is in an
@@ -1 +1 @@
1
- {"version":3,"file":"useIsOffline.js","sourceRoot":"","sources":["../../src/hooks/useIsOffline.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,eAAe,MAAM,0BAA0B,CAAA;AAEtD,MAAM,YAAY,GAAG,cAAc,CAAC,SAAS,EAAE,CAAA;AAE/C,MAAM,gBAAgB,GAAG,KAAK,CAAC,aAAa,CAAU,YAAY,CAAC,CAAA;AAEnE;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,IAA0B,EAC1B,QAAuB,EACvB,EAAE;IACF,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,sDAAsD;QACtD,sDAAsD;QACtD,qBAAqB;QACrB,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAA;QAClD,OAAO,CAAC,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;QAExC,OAAO,GAAG,EAAE;YACV,OAAO,CAAC,mBAAmB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;QAC7C,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAA;AACtB,CAAC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,UAAU,wBAAwB,CAAC,EACvC,QAAQ,GAGT;IACC,MAAM,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC,GAAG,eAAe,CAAC,YAAY,CAAC,CAAA;IAEtE,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IAC1C,sBAAsB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;IAE5C,OAAO,CACL,oBAAC,gBAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,SAAS,IACxC,QAAQ,CACiB,CAC7B,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY;IAClC,OAAO,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAA;AAC3C,CAAC","sourcesContent":["import * as React from 'react'\n\nimport { offlineService } from '@oneblink/apps'\nimport useBooleanState from '../hooks/useBooleanState'\n\nconst defaultValue = offlineService.isOffline()\n\nconst IsOfflineContext = React.createContext<boolean>(defaultValue)\n\n/**\n * @param type\n * @param listener\n * @group Hooks\n */\nexport const useNetworkChangeEffect = (\n type: 'online' | 'offline',\n listener: () => unknown,\n) => {\n React.useEffect(() => {\n // Stupid cordova seems to require that offline/online\n // listeners are set on the document and browsers seem\n // to require window.\n const element = window.cordova ? document : window\n element.addEventListener(type, listener)\n\n return () => {\n element.removeEventListener(type, listener)\n }\n }, [type, listener])\n}\n\n/**\n * IsOfflineContextProvider is a React Component that provides the `isOffline`\n * state for components further down your component tree to consume. It should\n * be used to wrap the components requiring the state.\n *\n * - **This component is required in your component tree to be able to consume the\n * [`useIsOffline`](./useIsOffline.html) hook.**\n *\n * ### Usage\n *\n * ```jsx\n * import { IsOfflineContextProvider } from '@oneblink/apps-react'\n *\n * const TopLevelComponent = () => {\n * return (\n * <IsOfflineContextProvider>\n * <div>\n * <ComponentThatRequiresOfflineState />\n * </div>\n * </IsOfflineContextProvider>\n * )\n * }\n *\n * export default TopLevelComponent\n * ```\n *\n * @param props\n * @returns\n * @group Components\n */\nexport function IsOfflineContextProvider({\n children,\n}: {\n children: React.ReactNode\n}) {\n const [isOffline, goOffline, goOnline] = useBooleanState(defaultValue)\n\n useNetworkChangeEffect('online', goOnline)\n useNetworkChangeEffect('offline', goOffline)\n\n return (\n <IsOfflineContext.Provider value={isOffline}>\n {children}\n </IsOfflineContext.Provider>\n )\n}\n\n/**\n * This function is a react hook for determining whether an application is in an\n * offline state.\n *\n * - **This component requires\n * [`<IsOfflineContextProvider/>`](./IsOfflineContextProvider.html) to be\n * present in your component tree.**\n *\n * ## Example\n *\n * ```js\n * import { useIsOffline } from '@oneblink/apps-react'\n *\n * const isOffline = useIsOffline()\n * ```\n *\n * @returns\n * @group Hooks\n */\nexport default function useIsOffline() {\n return React.useContext(IsOfflineContext)\n}\n"]}
1
+ {"version":3,"file":"useIsOffline.js","sourceRoot":"","sources":["../../src/hooks/useIsOffline.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,eAAe,MAAM,0BAA0B,CAAA;AAEtD,MAAM,YAAY,GAAG,cAAc,CAAC,SAAS,EAAE,CAAA;AAE/C,MAAM,gBAAgB,GAAG,KAAK,CAAC,aAAa,CAAU,YAAY,CAAC,CAAA;AAEnE;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,IAA0B,EAC1B,QAAuB,EACvB,EAAE;IACF,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,sDAAsD;QACtD,sDAAsD;QACtD,qBAAqB;QACrB,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAA;QAClD,OAAO,CAAC,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;QAExC,OAAO,GAAG,EAAE;YACV,OAAO,CAAC,mBAAmB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;QAC7C,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAA;AACtB,CAAC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,UAAU,wBAAwB,CAAC,EACvC,QAAQ,GAGT;IACC,MAAM,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC,GAAG,eAAe,CAAC,YAAY,CAAC,CAAA;IAEtE,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IAC1C,sBAAsB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;IAE5C,OAAO,CACL,KAAC,gBAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,SAAS,YACxC,QAAQ,GACiB,CAC7B,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY;IAClC,OAAO,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAA;AAC3C,CAAC","sourcesContent":["import * as React from 'react'\n\nimport { offlineService } from '@oneblink/apps'\nimport useBooleanState from '../hooks/useBooleanState'\n\nconst defaultValue = offlineService.isOffline()\n\nconst IsOfflineContext = React.createContext<boolean>(defaultValue)\n\n/**\n * @param type\n * @param listener\n * @group Hooks\n */\nexport const useNetworkChangeEffect = (\n type: 'online' | 'offline',\n listener: () => unknown,\n) => {\n React.useEffect(() => {\n // Stupid cordova seems to require that offline/online\n // listeners are set on the document and browsers seem\n // to require window.\n const element = window.cordova ? document : window\n element.addEventListener(type, listener)\n\n return () => {\n element.removeEventListener(type, listener)\n }\n }, [type, listener])\n}\n\n/**\n * IsOfflineContextProvider is a React Component that provides the `isOffline`\n * state for components further down your component tree to consume. It should\n * be used to wrap the components requiring the state.\n *\n * - **This component is required in your component tree to be able to consume the\n * [`useIsOffline`](./useIsOffline.html) hook.**\n *\n * ### Usage\n *\n * ```jsx\n * import { IsOfflineContextProvider } from '@oneblink/apps-react'\n *\n * const TopLevelComponent = () => {\n * return (\n * <IsOfflineContextProvider>\n * <div>\n * <ComponentThatRequiresOfflineState />\n * </div>\n * </IsOfflineContextProvider>\n * )\n * }\n *\n * export default TopLevelComponent\n * ```\n *\n * @param props\n * @returns\n * @group Components\n */\nexport function IsOfflineContextProvider({\n children,\n}: {\n children: React.ReactNode\n}) {\n const [isOffline, goOffline, goOnline] = useBooleanState(defaultValue)\n\n useNetworkChangeEffect('online', goOnline)\n useNetworkChangeEffect('offline', goOffline)\n\n return (\n <IsOfflineContext.Provider value={isOffline}>\n {children}\n </IsOfflineContext.Provider>\n )\n}\n\n/**\n * This function is a react hook for determining whether an application is in an\n * offline state.\n *\n * - **This component requires\n * [`<IsOfflineContextProvider/>`](./IsOfflineContextProvider.html) to be\n * present in your component tree.**\n *\n * ## Example\n *\n * ```js\n * import { useIsOffline } from '@oneblink/apps-react'\n *\n * const isOffline = useIsOffline()\n * ```\n *\n * @returns\n * @group Hooks\n */\nexport default function useIsOffline() {\n return React.useContext(IsOfflineContext)\n}\n"]}
@@ -4,6 +4,6 @@ type Props = {
4
4
  isPageVisible: IsPageVisibleContextValue;
5
5
  children: React.ReactNode;
6
6
  };
7
- export declare function IsPageVisibleProvider({ isPageVisible, children }: Props): React.JSX.Element;
7
+ export declare function IsPageVisibleProvider({ isPageVisible, children }: Props): import("react/jsx-runtime").JSX.Element;
8
8
  export default function useIsPageVisible(): boolean;
9
9
  export {};
@@ -1,7 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import * as React from 'react';
2
3
  const IsPageVisibleContext = React.createContext(false);
3
4
  export function IsPageVisibleProvider({ isPageVisible, children }) {
4
- return (React.createElement(IsPageVisibleContext.Provider, { value: isPageVisible }, children));
5
+ return (_jsx(IsPageVisibleContext.Provider, { value: isPageVisible, children: children }));
5
6
  }
6
7
  export default function useIsPageVisible() {
7
8
  return React.useContext(IsPageVisibleContext);
@@ -1 +1 @@
1
- {"version":3,"file":"useIsPageVisible.js","sourceRoot":"","sources":["../../src/hooks/useIsPageVisible.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAS9B,MAAM,oBAAoB,GACxB,KAAK,CAAC,aAAa,CAA4B,KAAK,CAAC,CAAA;AAEvD,MAAM,UAAU,qBAAqB,CAAC,EAAE,aAAa,EAAE,QAAQ,EAAS;IACtE,OAAO,CACL,oBAAC,oBAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,aAAa,IAChD,QAAQ,CACqB,CACjC,CAAA;AACH,CAAC;AAED,MAAM,CAAC,OAAO,UAAU,gBAAgB;IACtC,OAAO,KAAK,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAA;AAC/C,CAAC","sourcesContent":["import * as React from 'react'\n\ntype IsPageVisibleContextValue = boolean\n\ntype Props = {\n isPageVisible: IsPageVisibleContextValue\n children: React.ReactNode\n}\n\nconst IsPageVisibleContext =\n React.createContext<IsPageVisibleContextValue>(false)\n\nexport function IsPageVisibleProvider({ isPageVisible, children }: Props) {\n return (\n <IsPageVisibleContext.Provider value={isPageVisible}>\n {children}\n </IsPageVisibleContext.Provider>\n )\n}\n\nexport default function useIsPageVisible() {\n return React.useContext(IsPageVisibleContext)\n}\n"]}
1
+ {"version":3,"file":"useIsPageVisible.js","sourceRoot":"","sources":["../../src/hooks/useIsPageVisible.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAS9B,MAAM,oBAAoB,GACxB,KAAK,CAAC,aAAa,CAA4B,KAAK,CAAC,CAAA;AAEvD,MAAM,UAAU,qBAAqB,CAAC,EAAE,aAAa,EAAE,QAAQ,EAAS;IACtE,OAAO,CACL,KAAC,oBAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,aAAa,YAChD,QAAQ,GACqB,CACjC,CAAA;AACH,CAAC;AAED,MAAM,CAAC,OAAO,UAAU,gBAAgB;IACtC,OAAO,KAAK,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAA;AAC/C,CAAC","sourcesContent":["import * as React from 'react'\n\ntype IsPageVisibleContextValue = boolean\n\ntype Props = {\n isPageVisible: IsPageVisibleContextValue\n children: React.ReactNode\n}\n\nconst IsPageVisibleContext =\n React.createContext<IsPageVisibleContextValue>(false)\n\nexport function IsPageVisibleProvider({ isPageVisible, children }: Props) {\n return (\n <IsPageVisibleContext.Provider value={isPageVisible}>\n {children}\n </IsPageVisibleContext.Provider>\n )\n}\n\nexport default function useIsPageVisible() {\n return React.useContext(IsPageVisibleContext)\n}\n"]}
@@ -63,7 +63,7 @@ export declare const MfaContext: React.Context<MfaState & {
63
63
  export declare function MfaProvider({ children, isExternalIdentityProviderUser, }: {
64
64
  children: React.ReactNode;
65
65
  isExternalIdentityProviderUser: boolean;
66
- }): React.JSX.Element;
66
+ }): import("react/jsx-runtime").JSX.Element;
67
67
  export default function useMfa(): MfaState & {
68
68
  beginMfaSetup: () => void;
69
69
  cancelMfaSetup: () => void;
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import * as React from 'react';
2
3
  import { authService } from '@oneblink/apps';
3
4
  export const MfaContext = React.createContext({
@@ -180,7 +181,7 @@ export function MfaProvider({ children, isExternalIdentityProviderUser, }) {
180
181
  cancelDisablingMfa,
181
182
  completeDisablingMfa,
182
183
  ]);
183
- return React.createElement(MfaContext.Provider, { value: value }, children);
184
+ return _jsx(MfaContext.Provider, { value: value, children: children });
184
185
  }
185
186
  export default function useMfa() {
186
187
  return React.useContext(MfaContext);
@@ -1 +1 @@
1
- {"version":3,"file":"useMfa.js","sourceRoot":"","sources":["../../src/hooks/useMfa.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,WA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AAA;IAChE,IAAI,CAAC,aAAa,IAAI,8BAA8B,EAAE,CAAC;QACrD,OAAO,IAAI,CAAA;IACb,CAAC;IACD,OAAO,YAAY,CAAA;AACrB,CAAC","sourcesContent":["import * as React from 'react'\nimport { authService } from '@oneblink/apps'\n\ntype MfaState = {\n isExternalIdentityProviderUser: boolean\n isLoading: boolean\n isMfaEnabled: boolean\n loadingError?: Error\n isSettingUpMfa: boolean\n isDisablingMfa: boolean\n setupError?: Error\n mfaSetup?: Awaited<ReturnType<typeof authService.setupMfa>>\n}\n\nexport const MfaContext = React.createContext<\n MfaState & {\n beginMfaSetup: () => void\n cancelMfaSetup: () => void\n completeMfaSetup: () => void\n beginDisablingMfa: () => void\n cancelDisablingMfa: () => void\n completeDisablingMfa: () => void\n clearMfaSetupError: () => void\n loadMfa: () => void\n }\n>({\n isExternalIdentityProviderUser: false,\n isLoading: true,\n isMfaEnabled: false,\n isSettingUpMfa: false,\n isDisablingMfa: false,\n beginMfaSetup: () => {},\n cancelMfaSetup: () => {},\n completeMfaSetup: () => {},\n beginDisablingMfa: () => {},\n cancelDisablingMfa: () => {},\n completeDisablingMfa: () => {},\n clearMfaSetupError: () => {},\n loadMfa: () => {},\n})\n\n/**\n * React Component that provides the context for the\n * `useUserMeetsMfaRequirement()` hook and `<MultiFactorAuthentication />`\n * component, to be used by components further down your component tree. **It\n * should only be included in your component tree once and ideally at the root\n * of the application.**\n *\n * #### Example\n *\n * ```js\n * import * as React from 'react'\n * import {\n * MfaProvider,\n * useUserMeetsMfaRequirement,\n * } from '@oneblink/apps-react'\n *\n * function Component() {\n * const { isLoading, userMeetsMfaRequirement } =\n * useUserMeetsMfaRequirement(true)\n * // use MFA Requirement details here\n * }\n *\n * function App() {\n * return (\n * <MfaProvider isExternalIdentityProviderUser={false}>\n * <Component />\n * </MfaProvider>\n * )\n * }\n *\n * const root = document.getElementById('root')\n * if (root) {\n * ReactDOM.render(<App />, root)\n * }\n * ```\n *\n * @param props\n * @returns\n * @group Components\n */\nexport function MfaProvider({\n children,\n isExternalIdentityProviderUser,\n}: {\n children: React.ReactNode\n isExternalIdentityProviderUser: boolean\n}) {\n const [state, setState] = React.useState<MfaState>({\n isExternalIdentityProviderUser,\n isLoading: !isExternalIdentityProviderUser,\n isMfaEnabled: false,\n isSettingUpMfa: false,\n isDisablingMfa: false,\n })\n\n const loadMfa = React.useCallback(async (abortSignal?: AbortSignal) => {\n setState((currentState) => ({\n ...currentState,\n isLoading: true,\n isMfaEnabled: false,\n loadingError: undefined,\n }))\n try {\n const newIsMfaEnabled = await authService.checkIsMfaEnabled()\n if (!abortSignal?.aborted) {\n setState((currentState) => ({\n ...currentState,\n isLoading: false,\n isMfaEnabled: newIsMfaEnabled,\n }))\n }\n } catch (error) {\n setState((currentState) => ({\n ...currentState,\n isLoading: false,\n loadingError: error as Error,\n }))\n }\n }, [])\n\n const clearMfaSetupError = React.useCallback(() => {\n setState((currentState) => ({\n ...currentState,\n setupError: undefined,\n }))\n }, [])\n\n const cancelMfaSetup = React.useCallback(() => {\n setState((currentState) => ({\n ...currentState,\n mfaSetup: undefined,\n }))\n }, [])\n\n const completeMfaSetup = React.useCallback(() => {\n setState((currentState) => ({\n ...currentState,\n isMfaEnabled: true,\n mfaSetup: undefined,\n }))\n }, [])\n\n const beginMfaSetup = React.useCallback(async () => {\n setState((currentState) => ({\n ...currentState,\n isSettingUpMfa: true,\n mfaSetup: undefined,\n setupError: undefined,\n }))\n try {\n const newMfaSetup = await authService.setupMfa()\n setState((currentState) => ({\n ...currentState,\n isSettingUpMfa: false,\n mfaSetup: newMfaSetup,\n }))\n } catch (error) {\n setState((currentState) => ({\n ...currentState,\n isSettingUpMfa: false,\n setupError: error as Error,\n }))\n }\n }, [])\n\n const beginDisablingMfa = React.useCallback(() => {\n setState((currentState) => ({\n ...currentState,\n isDisablingMfa: true,\n }))\n }, [])\n\n const cancelDisablingMfa = React.useCallback(() => {\n setState((currentState) => ({\n ...currentState,\n isDisablingMfa: false,\n }))\n }, [])\n\n const completeDisablingMfa = React.useCallback(async () => {\n await authService.disableMfa()\n setState((currentState) => ({\n ...currentState,\n isDisablingMfa: false,\n isMfaEnabled: false,\n }))\n }, [])\n\n React.useEffect(() => {\n if (isExternalIdentityProviderUser) {\n return\n }\n\n loadMfa()\n\n return () => {}\n }, [isExternalIdentityProviderUser, loadMfa])\n\n const value = React.useMemo(() => {\n return {\n ...state,\n clearMfaSetupError,\n loadMfa,\n beginMfaSetup,\n cancelMfaSetup,\n completeMfaSetup,\n beginDisablingMfa,\n cancelDisablingMfa,\n completeDisablingMfa,\n }\n }, [\n state,\n clearMfaSetupError,\n loadMfa,\n beginMfaSetup,\n cancelMfaSetup,\n completeMfaSetup,\n beginDisablingMfa,\n cancelDisablingMfa,\n completeDisablingMfa,\n ])\n\n return <MfaContext.Provider value={value}>{children}</MfaContext.Provider>\n}\n\nexport default function useMfa() {\n return React.useContext(MfaContext)\n}\n\n/**\n * React hook to check if the logged in user meets the MFA requirement of your\n * application. Will throw an Error if used outside of the `<MfaProvider />`\n * component.\n *\n * Example\n *\n * ```js\n * import { useUserMeetsMfaRequirement } from '@oneblink/apps-react'\n *\n * const isMfaRequired = true\n *\n * function Component() {\n * const userMeetsMfaRequirement =\n * useUserMeetsMfaRequirement(isMfaRequired)\n * }\n * ```\n *\n * @returns\n * @group Hooks\n */\nexport function useUserMeetsMfaRequirement(isMfaRequired: boolean) {\n const context = React.useContext(MfaContext)\n\n if (!context) {\n throw new Error(\n `\"useUserMeetsMfaRequirement\" hook was used outside of the \"<MfaProvider />\" component's children.`,\n )\n }\n\n const { isMfaEnabled, isExternalIdentityProviderUser } = context\n if (!isMfaRequired || isExternalIdentityProviderUser) {\n return true\n }\n return isMfaEnabled\n}\n"]}
1
+ {"version":3,"file":"useMfa.js","sourceRoot":"","sources":["../../src/hooks/useMfa.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,gBA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C,aAAa,IAAI,8BAA8B,EAAE,CAAC;QACrD,OAAO,IAAI,CAAA;IACb,CAAC;IACD,OAAO,YAAY,CAAA;AACrB,CAAC","sourcesContent":["import * as React from 'react'\nimport { authService } from '@oneblink/apps'\n\ntype MfaState = {\n isExternalIdentityProviderUser: boolean\n isLoading: boolean\n isMfaEnabled: boolean\n loadingError?: Error\n isSettingUpMfa: boolean\n isDisablingMfa: boolean\n setupError?: Error\n mfaSetup?: Awaited<ReturnType<typeof authService.setupMfa>>\n}\n\nexport const MfaContext = React.createContext<\n MfaState & {\n beginMfaSetup: () => void\n cancelMfaSetup: () => void\n completeMfaSetup: () => void\n beginDisablingMfa: () => void\n cancelDisablingMfa: () => void\n completeDisablingMfa: () => void\n clearMfaSetupError: () => void\n loadMfa: () => void\n }\n>({\n isExternalIdentityProviderUser: false,\n isLoading: true,\n isMfaEnabled: false,\n isSettingUpMfa: false,\n isDisablingMfa: false,\n beginMfaSetup: () => {},\n cancelMfaSetup: () => {},\n completeMfaSetup: () => {},\n beginDisablingMfa: () => {},\n cancelDisablingMfa: () => {},\n completeDisablingMfa: () => {},\n clearMfaSetupError: () => {},\n loadMfa: () => {},\n})\n\n/**\n * React Component that provides the context for the\n * `useUserMeetsMfaRequirement()` hook and `<MultiFactorAuthentication />`\n * component, to be used by components further down your component tree. **It\n * should only be included in your component tree once and ideally at the root\n * of the application.**\n *\n * #### Example\n *\n * ```js\n * import * as React from 'react'\n * import {\n * MfaProvider,\n * useUserMeetsMfaRequirement,\n * } from '@oneblink/apps-react'\n *\n * function Component() {\n * const { isLoading, userMeetsMfaRequirement } =\n * useUserMeetsMfaRequirement(true)\n * // use MFA Requirement details here\n * }\n *\n * function App() {\n * return (\n * <MfaProvider isExternalIdentityProviderUser={false}>\n * <Component />\n * </MfaProvider>\n * )\n * }\n *\n * const root = document.getElementById('root')\n * if (root) {\n * ReactDOM.render(<App />, root)\n * }\n * ```\n *\n * @param props\n * @returns\n * @group Components\n */\nexport function MfaProvider({\n children,\n isExternalIdentityProviderUser,\n}: {\n children: React.ReactNode\n isExternalIdentityProviderUser: boolean\n}) {\n const [state, setState] = React.useState<MfaState>({\n isExternalIdentityProviderUser,\n isLoading: !isExternalIdentityProviderUser,\n isMfaEnabled: false,\n isSettingUpMfa: false,\n isDisablingMfa: false,\n })\n\n const loadMfa = React.useCallback(async (abortSignal?: AbortSignal) => {\n setState((currentState) => ({\n ...currentState,\n isLoading: true,\n isMfaEnabled: false,\n loadingError: undefined,\n }))\n try {\n const newIsMfaEnabled = await authService.checkIsMfaEnabled()\n if (!abortSignal?.aborted) {\n setState((currentState) => ({\n ...currentState,\n isLoading: false,\n isMfaEnabled: newIsMfaEnabled,\n }))\n }\n } catch (error) {\n setState((currentState) => ({\n ...currentState,\n isLoading: false,\n loadingError: error as Error,\n }))\n }\n }, [])\n\n const clearMfaSetupError = React.useCallback(() => {\n setState((currentState) => ({\n ...currentState,\n setupError: undefined,\n }))\n }, [])\n\n const cancelMfaSetup = React.useCallback(() => {\n setState((currentState) => ({\n ...currentState,\n mfaSetup: undefined,\n }))\n }, [])\n\n const completeMfaSetup = React.useCallback(() => {\n setState((currentState) => ({\n ...currentState,\n isMfaEnabled: true,\n mfaSetup: undefined,\n }))\n }, [])\n\n const beginMfaSetup = React.useCallback(async () => {\n setState((currentState) => ({\n ...currentState,\n isSettingUpMfa: true,\n mfaSetup: undefined,\n setupError: undefined,\n }))\n try {\n const newMfaSetup = await authService.setupMfa()\n setState((currentState) => ({\n ...currentState,\n isSettingUpMfa: false,\n mfaSetup: newMfaSetup,\n }))\n } catch (error) {\n setState((currentState) => ({\n ...currentState,\n isSettingUpMfa: false,\n setupError: error as Error,\n }))\n }\n }, [])\n\n const beginDisablingMfa = React.useCallback(() => {\n setState((currentState) => ({\n ...currentState,\n isDisablingMfa: true,\n }))\n }, [])\n\n const cancelDisablingMfa = React.useCallback(() => {\n setState((currentState) => ({\n ...currentState,\n isDisablingMfa: false,\n }))\n }, [])\n\n const completeDisablingMfa = React.useCallback(async () => {\n await authService.disableMfa()\n setState((currentState) => ({\n ...currentState,\n isDisablingMfa: false,\n isMfaEnabled: false,\n }))\n }, [])\n\n React.useEffect(() => {\n if (isExternalIdentityProviderUser) {\n return\n }\n\n loadMfa()\n\n return () => {}\n }, [isExternalIdentityProviderUser, loadMfa])\n\n const value = React.useMemo(() => {\n return {\n ...state,\n clearMfaSetupError,\n loadMfa,\n beginMfaSetup,\n cancelMfaSetup,\n completeMfaSetup,\n beginDisablingMfa,\n cancelDisablingMfa,\n completeDisablingMfa,\n }\n }, [\n state,\n clearMfaSetupError,\n loadMfa,\n beginMfaSetup,\n cancelMfaSetup,\n completeMfaSetup,\n beginDisablingMfa,\n cancelDisablingMfa,\n completeDisablingMfa,\n ])\n\n return <MfaContext.Provider value={value}>{children}</MfaContext.Provider>\n}\n\nexport default function useMfa() {\n return React.useContext(MfaContext)\n}\n\n/**\n * React hook to check if the logged in user meets the MFA requirement of your\n * application. Will throw an Error if used outside of the `<MfaProvider />`\n * component.\n *\n * Example\n *\n * ```js\n * import { useUserMeetsMfaRequirement } from '@oneblink/apps-react'\n *\n * const isMfaRequired = true\n *\n * function Component() {\n * const userMeetsMfaRequirement =\n * useUserMeetsMfaRequirement(isMfaRequired)\n * }\n * ```\n *\n * @returns\n * @group Hooks\n */\nexport function useUserMeetsMfaRequirement(isMfaRequired: boolean) {\n const context = React.useContext(MfaContext)\n\n if (!context) {\n throw new Error(\n `\"useUserMeetsMfaRequirement\" hook was used outside of the \"<MfaProvider />\" component's children.`,\n )\n }\n\n const { isMfaEnabled, isExternalIdentityProviderUser } = context\n if (!isMfaRequired || isExternalIdentityProviderUser) {\n return true\n }\n return isMfaEnabled\n}\n"]}
@@ -22,5 +22,5 @@ export default function usePages({ pages, formElementsValidation, formElementsCo
22
22
  setPageId: (pageId: string) => void;
23
23
  goToPreviousPage: () => void;
24
24
  goToNextPage: () => void;
25
- scrollToTopOfPageHTMLElementRef: React.RefObject<HTMLDivElement>;
25
+ scrollToTopOfPageHTMLElementRef: React.RefObject<HTMLDivElement | null>;
26
26
  };
@@ -91,7 +91,7 @@ export declare function PendingSubmissionsContextProvider({ isPendingQueueEnable
91
91
  successNotificationTimeoutMs?: number;
92
92
  /** Your application components */
93
93
  children: React.ReactNode;
94
- }): React.JSX.Element;
94
+ }): import("react/jsx-runtime").JSX.Element;
95
95
  /**
96
96
  * React hook to get the context value for Pending Submissions. Will throw an
97
97
  * Error if used outside of the `<PendingSubmissionsContextProvider />`
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import * as React from 'react';
2
3
  import { submissionService } from '@oneblink/apps';
3
4
  import useBooleanState from './useBooleanState';
@@ -178,7 +179,7 @@ export function PendingSubmissionsContextProvider({ isPendingQueueEnabled, succe
178
179
  submittedNotificationCount,
179
180
  hideSuccessNotification,
180
181
  ]);
181
- return (React.createElement(PendingSubmissionsContext.Provider, { value: value }, children));
182
+ return (_jsx(PendingSubmissionsContext.Provider, { value: value, children: children }));
182
183
  }
183
184
  /**
184
185
  * React hook to get the context value for Pending Submissions. Will throw an
@@ -1 +1 @@
1
- {"version":3,"file":"usePendingSubmissions.js","sourceRoot":"","sources":["../../src/hooks/usePendingSubmissions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,eAAe,MAAM,mBAAmB,CAAA;AAC/C,OAAO,YAAY,MAAM,gBAAgB,CAAA;AACzC,OAAO,YAAY,MAAM,gBAAgB,CAAA;AAqCzC,MAAM,YAAY,GAAG;IACnB,SAAS,EAAE,KAAK;IAChB,SAAS,EAAE,IAAI;IACf,kBAAkB,EAAE,EAAE;CACvB,CAAA;AAED,MAAM,yBAAyB,GAAG,KAAK,CAAC,aAAa,CAEnD,SAAS,CAAC,CAAA;AAEZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;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QACL,2BAA2B;QAC3B,sBAAsB;QACtB,wBAAwB;QACxB,mBAAmB;QACnB,wBAAwB;QACxB,0BAA0B;QAC1B,uBAAuB;KACxB,CACF,CAAA;IAED,OAAO,CACL,oBAAC,yBAAyB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,IAC7C,QAAQ,CAC0B,CACtC,CAAA;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,qBAAqB;IAC3C,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,yBAAyB,CAAC,CAAA;IACzD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CACb,oHAAoH,CACrH,CAAA;IACH,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC","sourcesContent":["import * as React from 'react'\nimport { submissionService } from '@oneblink/apps'\nimport useBooleanState from './useBooleanState'\nimport useIsMounted from './useIsMounted'\nimport useIsOffline from './useIsOffline'\n\n/** The value returned from `usePendingSubmissions()` hook */\nexport type PendingSubmissionsContextValue = {\n /** `true` if the pending submissions are currently loading */\n isLoading: boolean\n /** An Error object if loading pending submissions fails */\n loadError: Error | null\n /**\n * The submissions that were submitted offline and can be processed when back\n * online\n */\n pendingSubmissions: submissionService.PendingFormSubmission[]\n /** `true` submissions that where submitted offline are being processed */\n isProcessingPendingQueue: boolean\n /** A function to trigger processing of the pending queue */\n processPendingQueue: () => unknown\n /**\n * A function to trigger loading of the submissions that were submitted\n * offline\n */\n reloadPendingSubmissions: () => unknown\n /** A function to remove a submission from the pending submissions */\n deletePendingSubmission: (pendingTimestamp: string) => unknown\n /** `true` if a submission being processed fails */\n isShowingFailedNotification: boolean\n /** A function to hide the notification when a submission fails to process */\n hideFailedNotification: () => unknown\n /** `true` if a submission being processed completes successfully. */\n isShowingSuccessNotification: boolean\n /**\n * A function to hide the notification after a submission completed\n * successfully\n */\n hideSuccessNotification: () => unknown\n}\n\nconst defaultState = {\n isLoading: false,\n loadError: null,\n pendingSubmissions: [],\n}\n\nconst PendingSubmissionsContext = React.createContext<\n PendingSubmissionsContextValue | undefined\n>(undefined)\n\n/**\n * React Component that provides the context for the `usePendingSubmissions()`\n * hook to be used by components further down your component tree. **It should\n * only be included in your component tree once and ideally at the root of the\n * application.**\n *\n * #### Example\n *\n * ```jsx\n * import * as React from 'react'\n * import {\n * PendingSubmissionsContextProvider,\n * usePendingSubmissions,\n * } from '@oneblink/apps-react'\n *\n * function Component() {\n * const pendingSubmissionsContext = usePendingSubmissions()\n * // use pending submissions here\n * }\n *\n * function App() {\n * return (\n * <PendingSubmissionsContextProvider\n * isPendingQueueEnabled\n * successNotificationTimeoutMs={3000}\n * >\n * <Component />\n * </PendingSubmissionsContextProvider>\n * )\n * }\n *\n * const root = document.getElementById('root')\n * if (root) {\n * ReactDOM.render(<App />, root)\n * }\n * ```\n *\n * @param props\n * @returns\n * @group Components\n */\nexport function PendingSubmissionsContextProvider({\n isPendingQueueEnabled,\n successNotificationTimeoutMs = 5000,\n children,\n}: {\n /**\n * `true` if pending queue is enabled, otherwise `false`. Can be used prevent\n * offline submissions from being processed.\n */\n isPendingQueueEnabled: boolean\n /**\n * When a submission is processed successfully the\n * `isShowingSuccessNotification` will be temporarily set to `true`, it will\n * be set back to `false` after 5 seconds. This prop will allow you to\n * customise how long to wait before hiding the notification with a\n * milliseconds value.\n */\n successNotificationTimeoutMs?: number\n /** Your application components */\n children: React.ReactNode\n}) {\n const isMounted = useIsMounted()\n const isOffline = useIsOffline()\n\n // Using a number as state so we can reset the timer used to close\n // the snack bar each time a pending queue item is processed\n const [submittedNotificationCount, setSubmittedNotificationCount] =\n React.useState(0)\n const hideSuccessNotification = React.useCallback(() => {\n setSubmittedNotificationCount(0)\n }, [])\n const [\n isShowingFailedNotification,\n showFailedNotification,\n hideFailedNotification,\n ] = useBooleanState(false)\n const [isProcessingPendingQueue, setIsProcessingPendingQueue] =\n React.useState(false)\n const [state, setState] = React.useState<{\n isLoading: boolean\n loadError: Error | null\n pendingSubmissions: submissionService.PendingFormSubmission[]\n }>(defaultState)\n\n const processPendingQueue = React.useCallback(async () => {\n if (isMounted.current) {\n setIsProcessingPendingQueue(true)\n }\n\n await submissionService.processPendingQueue({\n shouldRunExternalIdGeneration: true,\n shouldRunServerValidation: true,\n })\n\n if (isMounted.current) {\n setIsProcessingPendingQueue(false)\n }\n }, [isMounted])\n\n const reloadPendingSubmissions = React.useCallback(async () => {\n if (isMounted.current) {\n setState((currentState) => ({\n isLoading: true,\n loadError: null,\n pendingSubmissions: currentState.pendingSubmissions,\n }))\n }\n let newError = null\n let newPendingSubmissions: submissionService.PendingFormSubmission[] = []\n\n try {\n newPendingSubmissions =\n await submissionService.getPendingQueueSubmissions()\n } catch (error) {\n newError = error as Error\n }\n\n if (isMounted.current) {\n setState({\n isLoading: false,\n loadError: newError,\n pendingSubmissions: newPendingSubmissions,\n })\n }\n }, [isMounted])\n\n React.useEffect(() => {\n if (!isPendingQueueEnabled) {\n return\n }\n reloadPendingSubmissions()\n return submissionService.registerPendingQueueListener(\n (pendingSubmissions, action) => {\n switch (action) {\n case 'SUBMIT_SUCCEEDED': {\n setSubmittedNotificationCount((current) => current + 1)\n break\n }\n case 'SUBMIT_FAILED': {\n showFailedNotification()\n break\n }\n case 'SUBMIT_STARTED': {\n hideFailedNotification()\n break\n }\n // EDIT_CANCELLED is here for when beginnning edit offline and then hitting cancel while online\n // among other use cases\n case 'ADDITION':\n case 'EDIT_CANCELLED': {\n processPendingQueue()\n break\n }\n }\n setState({\n isLoading: false,\n pendingSubmissions,\n loadError: null,\n })\n },\n )\n }, [\n hideFailedNotification,\n isPendingQueueEnabled,\n processPendingQueue,\n reloadPendingSubmissions,\n showFailedNotification,\n ])\n\n React.useEffect(() => {\n if (!isOffline) {\n processPendingQueue()\n }\n }, [isOffline, processPendingQueue])\n\n React.useEffect(() => {\n if (submittedNotificationCount > 0) {\n const timeoutId = setTimeout(() => {\n hideSuccessNotification()\n }, successNotificationTimeoutMs)\n return () => {\n clearTimeout(timeoutId)\n }\n }\n }, [\n hideSuccessNotification,\n submittedNotificationCount,\n successNotificationTimeoutMs,\n ])\n\n const value = React.useMemo<PendingSubmissionsContextValue>(\n () => ({\n ...state,\n isShowingFailedNotification,\n hideFailedNotification,\n isProcessingPendingQueue,\n processPendingQueue,\n reloadPendingSubmissions,\n deletePendingSubmission: submissionService.deletePendingQueueSubmission,\n isShowingSuccessNotification: submittedNotificationCount > 0,\n hideSuccessNotification,\n }),\n [\n state,\n isShowingFailedNotification,\n hideFailedNotification,\n isProcessingPendingQueue,\n processPendingQueue,\n reloadPendingSubmissions,\n submittedNotificationCount,\n hideSuccessNotification,\n ],\n )\n\n return (\n <PendingSubmissionsContext.Provider value={value}>\n {children}\n </PendingSubmissionsContext.Provider>\n )\n}\n\n/**\n * React hook to get the context value for Pending Submissions. Will throw an\n * Error if used outside of the `<PendingSubmissionsContextProvider />`\n * component.\n *\n * @returns\n * @group Hooks\n */\nexport default function usePendingSubmissions(): PendingSubmissionsContextValue {\n const value = React.useContext(PendingSubmissionsContext)\n if (!value) {\n throw new Error(\n `\"usePendingSubmissions\" hook was used outside of the \"<PendingSubmissionsContextProvider />\" component's children.`,\n )\n }\n return value\n}\n"]}
1
+ {"version":3,"file":"usePendingSubmissions.js","sourceRoot":"","sources":["../../src/hooks/usePendingSubmissions.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,eAAe,MAAM,mBAAmB,CAAA;AAC/C,OAAO,YAAY,MAAM,gBAAgB,CAAA;AACzC,OAAO,YAAY,MAAM,gBAAgB,CAAA;AAqCzC,MAAM,YAAY,GAAG;IACnB,SAAS,EAAE,KAAK;IAChB,SAAS,EAAE,IAAI;IACf,kBAAkB,EAAE,EAAE;CACvB,CAAA;AAED,MAAM,yBAAyB,GAAG,KAAK,CAAC,aAAa,CAEnD,SAAS,CAAC,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AE,0BAA0B,GAAG,CAAC;QAC5D,uBAAuB;KACxB,CAAC,EACF;QACE,KAAK;QACL,2BAA2B;QAC3B,sBAAsB;QACtB,wBAAwB;QACxB,mBAAmB;QACnB,wBAAwB;QACxB,0BAA0B;QAC1B,uBAAuB;KACxB,CACF,CAAA;IAED,OAAO,CACL,KAAC,yBAAyB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YAC7C,QAAQ,GAC0B,CACtC,CAAA;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,qBAAqB;IAC3C,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,yBAAyB,CAAC,CAAA;IACzD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CACb,oHAAoH,CACrH,CAAA;IACH,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC","sourcesContent":["import * as React from 'react'\nimport { submissionService } from '@oneblink/apps'\nimport useBooleanState from './useBooleanState'\nimport useIsMounted from './useIsMounted'\nimport useIsOffline from './useIsOffline'\n\n/** The value returned from `usePendingSubmissions()` hook */\nexport type PendingSubmissionsContextValue = {\n /** `true` if the pending submissions are currently loading */\n isLoading: boolean\n /** An Error object if loading pending submissions fails */\n loadError: Error | null\n /**\n * The submissions that were submitted offline and can be processed when back\n * online\n */\n pendingSubmissions: submissionService.PendingFormSubmission[]\n /** `true` submissions that where submitted offline are being processed */\n isProcessingPendingQueue: boolean\n /** A function to trigger processing of the pending queue */\n processPendingQueue: () => unknown\n /**\n * A function to trigger loading of the submissions that were submitted\n * offline\n */\n reloadPendingSubmissions: () => unknown\n /** A function to remove a submission from the pending submissions */\n deletePendingSubmission: (pendingTimestamp: string) => unknown\n /** `true` if a submission being processed fails */\n isShowingFailedNotification: boolean\n /** A function to hide the notification when a submission fails to process */\n hideFailedNotification: () => unknown\n /** `true` if a submission being processed completes successfully. */\n isShowingSuccessNotification: boolean\n /**\n * A function to hide the notification after a submission completed\n * successfully\n */\n hideSuccessNotification: () => unknown\n}\n\nconst defaultState = {\n isLoading: false,\n loadError: null,\n pendingSubmissions: [],\n}\n\nconst PendingSubmissionsContext = React.createContext<\n PendingSubmissionsContextValue | undefined\n>(undefined)\n\n/**\n * React Component that provides the context for the `usePendingSubmissions()`\n * hook to be used by components further down your component tree. **It should\n * only be included in your component tree once and ideally at the root of the\n * application.**\n *\n * #### Example\n *\n * ```jsx\n * import * as React from 'react'\n * import {\n * PendingSubmissionsContextProvider,\n * usePendingSubmissions,\n * } from '@oneblink/apps-react'\n *\n * function Component() {\n * const pendingSubmissionsContext = usePendingSubmissions()\n * // use pending submissions here\n * }\n *\n * function App() {\n * return (\n * <PendingSubmissionsContextProvider\n * isPendingQueueEnabled\n * successNotificationTimeoutMs={3000}\n * >\n * <Component />\n * </PendingSubmissionsContextProvider>\n * )\n * }\n *\n * const root = document.getElementById('root')\n * if (root) {\n * ReactDOM.render(<App />, root)\n * }\n * ```\n *\n * @param props\n * @returns\n * @group Components\n */\nexport function PendingSubmissionsContextProvider({\n isPendingQueueEnabled,\n successNotificationTimeoutMs = 5000,\n children,\n}: {\n /**\n * `true` if pending queue is enabled, otherwise `false`. Can be used prevent\n * offline submissions from being processed.\n */\n isPendingQueueEnabled: boolean\n /**\n * When a submission is processed successfully the\n * `isShowingSuccessNotification` will be temporarily set to `true`, it will\n * be set back to `false` after 5 seconds. This prop will allow you to\n * customise how long to wait before hiding the notification with a\n * milliseconds value.\n */\n successNotificationTimeoutMs?: number\n /** Your application components */\n children: React.ReactNode\n}) {\n const isMounted = useIsMounted()\n const isOffline = useIsOffline()\n\n // Using a number as state so we can reset the timer used to close\n // the snack bar each time a pending queue item is processed\n const [submittedNotificationCount, setSubmittedNotificationCount] =\n React.useState(0)\n const hideSuccessNotification = React.useCallback(() => {\n setSubmittedNotificationCount(0)\n }, [])\n const [\n isShowingFailedNotification,\n showFailedNotification,\n hideFailedNotification,\n ] = useBooleanState(false)\n const [isProcessingPendingQueue, setIsProcessingPendingQueue] =\n React.useState(false)\n const [state, setState] = React.useState<{\n isLoading: boolean\n loadError: Error | null\n pendingSubmissions: submissionService.PendingFormSubmission[]\n }>(defaultState)\n\n const processPendingQueue = React.useCallback(async () => {\n if (isMounted.current) {\n setIsProcessingPendingQueue(true)\n }\n\n await submissionService.processPendingQueue({\n shouldRunExternalIdGeneration: true,\n shouldRunServerValidation: true,\n })\n\n if (isMounted.current) {\n setIsProcessingPendingQueue(false)\n }\n }, [isMounted])\n\n const reloadPendingSubmissions = React.useCallback(async () => {\n if (isMounted.current) {\n setState((currentState) => ({\n isLoading: true,\n loadError: null,\n pendingSubmissions: currentState.pendingSubmissions,\n }))\n }\n let newError = null\n let newPendingSubmissions: submissionService.PendingFormSubmission[] = []\n\n try {\n newPendingSubmissions =\n await submissionService.getPendingQueueSubmissions()\n } catch (error) {\n newError = error as Error\n }\n\n if (isMounted.current) {\n setState({\n isLoading: false,\n loadError: newError,\n pendingSubmissions: newPendingSubmissions,\n })\n }\n }, [isMounted])\n\n React.useEffect(() => {\n if (!isPendingQueueEnabled) {\n return\n }\n reloadPendingSubmissions()\n return submissionService.registerPendingQueueListener(\n (pendingSubmissions, action) => {\n switch (action) {\n case 'SUBMIT_SUCCEEDED': {\n setSubmittedNotificationCount((current) => current + 1)\n break\n }\n case 'SUBMIT_FAILED': {\n showFailedNotification()\n break\n }\n case 'SUBMIT_STARTED': {\n hideFailedNotification()\n break\n }\n // EDIT_CANCELLED is here for when beginnning edit offline and then hitting cancel while online\n // among other use cases\n case 'ADDITION':\n case 'EDIT_CANCELLED': {\n processPendingQueue()\n break\n }\n }\n setState({\n isLoading: false,\n pendingSubmissions,\n loadError: null,\n })\n },\n )\n }, [\n hideFailedNotification,\n isPendingQueueEnabled,\n processPendingQueue,\n reloadPendingSubmissions,\n showFailedNotification,\n ])\n\n React.useEffect(() => {\n if (!isOffline) {\n processPendingQueue()\n }\n }, [isOffline, processPendingQueue])\n\n React.useEffect(() => {\n if (submittedNotificationCount > 0) {\n const timeoutId = setTimeout(() => {\n hideSuccessNotification()\n }, successNotificationTimeoutMs)\n return () => {\n clearTimeout(timeoutId)\n }\n }\n }, [\n hideSuccessNotification,\n submittedNotificationCount,\n successNotificationTimeoutMs,\n ])\n\n const value = React.useMemo<PendingSubmissionsContextValue>(\n () => ({\n ...state,\n isShowingFailedNotification,\n hideFailedNotification,\n isProcessingPendingQueue,\n processPendingQueue,\n reloadPendingSubmissions,\n deletePendingSubmission: submissionService.deletePendingQueueSubmission,\n isShowingSuccessNotification: submittedNotificationCount > 0,\n hideSuccessNotification,\n }),\n [\n state,\n isShowingFailedNotification,\n hideFailedNotification,\n isProcessingPendingQueue,\n processPendingQueue,\n reloadPendingSubmissions,\n submittedNotificationCount,\n hideSuccessNotification,\n ],\n )\n\n return (\n <PendingSubmissionsContext.Provider value={value}>\n {children}\n </PendingSubmissionsContext.Provider>\n )\n}\n\n/**\n * React hook to get the context value for Pending Submissions. Will throw an\n * Error if used outside of the `<PendingSubmissionsContextProvider />`\n * component.\n *\n * @returns\n * @group Hooks\n */\nexport default function usePendingSubmissions(): PendingSubmissionsContextValue {\n const value = React.useContext(PendingSubmissionsContext)\n if (!value) {\n throw new Error(\n `\"usePendingSubmissions\" hook was used outside of the \"<PendingSubmissionsContextProvider />\" component's children.`,\n )\n }\n return value\n}\n"]}
@@ -3,7 +3,7 @@ import ReCAPTCHA, { ReCAPTCHAProps } from 'react-google-recaptcha';
3
3
  import { CaptchaType } from '../typedoc';
4
4
  export default function useReCAPTCHAProps({ captchaSiteKey, captchaRef, captchaType, onCaptchaChange, }: {
5
5
  captchaSiteKey: string | undefined;
6
- captchaRef: RefObject<ReCAPTCHA>;
6
+ captchaRef: RefObject<ReCAPTCHA | null>;
7
7
  captchaType: CaptchaType | undefined;
8
8
  onCaptchaChange: (token: string | null) => void;
9
9
  }): ReCAPTCHAProps;
@@ -1 +1 @@
1
- {"version":3,"file":"useReCAPTCHAProps.js","sourceRoot":"","sources":["../../src/hooks/useReCAPTCHAProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAa,MAAM,OAAO,CAAA;AAI1C,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EACxC,cAAc,EACd,UAAU,EACV,WAAW,EACX,eAAe,GAMhB;IACC,MAAM,cAAc,GAAmB,OAAO,CAAC,GAAG,EAAE;QAClD,MAAM,SAAS,GAAG;YAChB,OAAO,EAAE,cAAc,IAAI,EAAE;YAC7B,SAAS,EAAE,kCAAkC;YAC7C,GAAG,EAAE,UAAU;SAChB,CAAA;QACD,QAAQ,WAAW,EAAE,CAAC;YACpB,KAAK,WAAW;gBACd,OAAO;oBACL,GAAG,SAAS;oBACZ,IAAI,EAAE,WAAW;oBACjB,KAAK,EAAE,QAAQ;iBAChB,CAAA;YACH,KAAK,UAAU,CAAC;YAChB,OAAO,CAAC,CAAC,CAAC;gBACR,OAAO;oBACL,GAAG,SAAS;oBACZ,QAAQ,EAAE,eAAe;iBAC1B,CAAA;YACH,CAAC;QACH,CAAC;IACH,CAAC,EAAE,CAAC,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,eAAe,CAAC,CAAC,CAAA;IAE9D,OAAO,cAAc,CAAA;AACvB,CAAC","sourcesContent":["import { useMemo, RefObject } from 'react'\nimport ReCAPTCHA, { ReCAPTCHAProps } from 'react-google-recaptcha'\nimport { CaptchaType } from '../typedoc'\n\nexport default function useReCAPTCHAProps({\n captchaSiteKey,\n captchaRef,\n captchaType,\n onCaptchaChange,\n}: {\n captchaSiteKey: string | undefined\n captchaRef: RefObject<ReCAPTCHA>\n captchaType: CaptchaType | undefined\n onCaptchaChange: (token: string | null) => void\n}) {\n const recaptchaProps: ReCAPTCHAProps = useMemo(() => {\n const baseProps = {\n sitekey: captchaSiteKey || '',\n className: 'ob-input cypress-captcha-control',\n ref: captchaRef,\n }\n switch (captchaType) {\n case 'INVISIBLE':\n return {\n ...baseProps,\n size: 'invisible',\n badge: 'inline',\n }\n case 'CHECKBOX':\n default: {\n return {\n ...baseProps,\n onChange: onCaptchaChange,\n }\n }\n }\n }, [captchaSiteKey, captchaType, captchaRef, onCaptchaChange])\n\n return recaptchaProps\n}\n"]}
1
+ {"version":3,"file":"useReCAPTCHAProps.js","sourceRoot":"","sources":["../../src/hooks/useReCAPTCHAProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAa,MAAM,OAAO,CAAA;AAI1C,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EACxC,cAAc,EACd,UAAU,EACV,WAAW,EACX,eAAe,GAMhB;IACC,MAAM,cAAc,GAAmB,OAAO,CAAC,GAAG,EAAE;QAClD,MAAM,SAAS,GAAG;YAChB,OAAO,EAAE,cAAc,IAAI,EAAE;YAC7B,SAAS,EAAE,kCAAkC;YAC7C,GAAG,EAAE,UAAU;SAChB,CAAA;QACD,QAAQ,WAAW,EAAE,CAAC;YACpB,KAAK,WAAW;gBACd,OAAO;oBACL,GAAG,SAAS;oBACZ,IAAI,EAAE,WAAW;oBACjB,KAAK,EAAE,QAAQ;iBAChB,CAAA;YACH,KAAK,UAAU,CAAC;YAChB,OAAO,CAAC,CAAC,CAAC;gBACR,OAAO;oBACL,GAAG,SAAS;oBACZ,QAAQ,EAAE,eAAe;iBAC1B,CAAA;YACH,CAAC;QACH,CAAC;IACH,CAAC,EAAE,CAAC,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,eAAe,CAAC,CAAC,CAAA;IAE9D,OAAO,cAAc,CAAA;AACvB,CAAC","sourcesContent":["import { useMemo, RefObject } from 'react'\nimport ReCAPTCHA, { ReCAPTCHAProps } from 'react-google-recaptcha'\nimport { CaptchaType } from '../typedoc'\n\nexport default function useReCAPTCHAProps({\n captchaSiteKey,\n captchaRef,\n captchaType,\n onCaptchaChange,\n}: {\n captchaSiteKey: string | undefined\n captchaRef: RefObject<ReCAPTCHA | null>\n captchaType: CaptchaType | undefined\n onCaptchaChange: (token: string | null) => void\n}) {\n const recaptchaProps: ReCAPTCHAProps = useMemo(() => {\n const baseProps = {\n sitekey: captchaSiteKey || '',\n className: 'ob-input cypress-captcha-control',\n ref: captchaRef,\n }\n switch (captchaType) {\n case 'INVISIBLE':\n return {\n ...baseProps,\n size: 'invisible',\n badge: 'inline',\n }\n case 'CHECKBOX':\n default: {\n return {\n ...baseProps,\n onChange: onCaptchaChange,\n }\n }\n }\n }, [captchaSiteKey, captchaType, captchaRef, onCaptchaChange])\n\n return recaptchaProps\n}\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oneblink/apps-react",
3
3
  "description": "Helper functions for OneBlink apps in ReactJS.",
4
- "version": "8.14.0-beta.2",
4
+ "version": "9.0.0-beta.1",
5
5
  "author": "OneBlink <developers@oneblink.io> (https://oneblink.io)",
6
6
  "bugs": {
7
7
  "url": "https://github.com/oneblink/apps-react/issues"
@@ -11,8 +11,10 @@
11
11
  "@emotion/react": "^11.11.3",
12
12
  "@emotion/styled": "^11.11.0",
13
13
  "@nylas/react": "^1.3.1",
14
- "@oneblink/sdk-core": "^8.10.0-beta.1",
15
- "@react-google-maps/api": "2.19.2",
14
+ "@oneblink/sdk-core": "^8.11.1-beta.4",
15
+ "@react-google-maps/api": "^2.20.8",
16
+ "@react-input/mask": "^2.0.4",
17
+ "@tanstack/react-table": "^8.21.3",
16
18
  "blueimp-load-image": "^5.16.0",
17
19
  "bulma": "^0.9.4",
18
20
  "bulma-slider": "2.0.4",
@@ -30,24 +32,21 @@
30
32
  "lodash.debounce": "^4.0.8",
31
33
  "lodash.throttle": "^4.1.1",
32
34
  "morph-expressions": "^1.1.1",
33
- "qrcode.react": "^4.1.0",
35
+ "qrcode.react": "^4.2.0",
34
36
  "query-string": "^8.1.0",
35
37
  "react-google-recaptcha": "^3.1.0",
36
38
  "react-image-crop": "^11.0.10",
37
- "react-input-mask": "^2.0.4",
38
- "react-signature-canvas": "^1.0.6",
39
- "react-table": "^7.8.0",
39
+ "react-signature-canvas": "^1.1.0-alpha.2",
40
40
  "sanitize-html": "^2.11.0",
41
- "use-resize-observer": "^9.1.0",
41
+ "usehooks-ts": "^3.1.1",
42
42
  "uuid": "^9.0.1",
43
43
  "xml2js": "^0.6.2"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@babel/preset-env": "^7.23.9",
47
47
  "@microsoft/eslint-plugin-sdl": "^0.2.2",
48
- "@mui/lab": "^5.0.0-alpha.152",
49
- "@mui/material": "^5.15.6",
50
- "@mui/x-date-pickers": "^6.20.2",
48
+ "@mui/material": "^7.3.6",
49
+ "@mui/x-date-pickers": "^8.22.1",
51
50
  "@oneblink/apps": "^23.7.0-beta.1",
52
51
  "@oneblink/release-cli": "^3.4.0-beta.1",
53
52
  "@oneblink/types": "github:oneblink/types",
@@ -58,18 +57,16 @@
58
57
  "@types/lodash.clonedeep": "^4.5.9",
59
58
  "@types/lodash.debounce": "^4.0.9",
60
59
  "@types/lodash.throttle": "^4.1.9",
61
- "@types/react": "^17.0.73",
60
+ "@types/react": "^19.2.7",
62
61
  "@types/react-google-recaptcha": "^2.1.9",
63
- "@types/react-input-mask": "^3.0.5",
64
62
  "@types/react-router-dom": "^5.3.3",
65
63
  "@types/react-signature-canvas": "^1.0.5",
66
- "@types/react-table": "^7.7.19",
67
64
  "@types/sanitize-html": "^2.9.5",
68
65
  "@types/ua-parser-js": "^0.7.39",
69
66
  "@types/uuid": "^9.0.8",
70
67
  "@types/xml2js": "^0.4.14",
71
- "@typescript-eslint/eslint-plugin": "^6.19.1",
72
- "@typescript-eslint/parser": "^6.19.1",
68
+ "@typescript-eslint/eslint-plugin": "^8.51.0",
69
+ "@typescript-eslint/parser": "^8.51.0",
73
70
  "copyfiles": "^2.4.1",
74
71
  "eslint": "^8.56.0",
75
72
  "eslint-config-prettier": "^9.1.0",
@@ -80,13 +77,13 @@
80
77
  "jsdom": "^27.2.0",
81
78
  "prettier": "^3.2.4",
82
79
  "prettier-plugin-jsdoc": "^1.3.0",
83
- "react": "^17.0.2",
84
- "react-dom": "^17.0.2",
80
+ "react": "^19.2.3",
81
+ "react-dom": "^19.2.3",
85
82
  "react-router-dom": "^5.3.4",
86
83
  "sass": "^1.70.0",
87
84
  "tsc-watch": "^6.0.4",
88
- "typedoc": "^0.26.9",
89
- "typescript": "^5.6.3",
85
+ "typedoc": "^0.28.15",
86
+ "typescript": "^5.9.3",
90
87
  "vitest": "^4.0.9"
91
88
  },
92
89
  "directories": {
@@ -104,12 +101,11 @@
104
101
  "main": "./dist/index.js",
105
102
  "module": "./dist/index.js",
106
103
  "peerDependencies": {
107
- "@mui/lab": "^5.0.0 || ^5.0.0-alpha.152",
108
- "@mui/material": "^5.6.1",
109
- "@mui/x-date-pickers": "^6.20.2",
104
+ "@mui/material": "^7.3.6",
105
+ "@mui/x-date-pickers": "^8.22.1",
110
106
  "@oneblink/apps": "*",
111
- "react": "^17.0.0",
112
- "react-dom": "^17.0.0",
107
+ "react": "^19.2.3",
108
+ "react-dom": "^19.2.3",
113
109
  "react-router-dom": "^5.2.0"
114
110
  },
115
111
  "publishConfig": {