@oneblink/apps-react 8.14.0 → 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.
- package/dist/OneBlinkAutoSaveForm.d.ts +1 -1
- package/dist/OneBlinkAutoSaveForm.js +6 -8
- package/dist/OneBlinkAutoSaveForm.js.map +1 -1
- package/dist/OneBlinkForm.js +3 -2
- package/dist/OneBlinkForm.js.map +1 -1
- package/dist/OneBlinkFormBase.d.ts +1 -1
- package/dist/OneBlinkFormBase.js +49 -146
- package/dist/OneBlinkFormBase.js.map +1 -1
- package/dist/OneBlinkReadOnlyForm.d.ts +1 -1
- package/dist/OneBlinkReadOnlyForm.js +2 -1
- package/dist/OneBlinkReadOnlyForm.js.map +1 -1
- package/dist/PaymentReceipt.d.ts +1 -1
- package/dist/PaymentReceipt.js +9 -30
- package/dist/PaymentReceipt.js.map +1 -1
- package/dist/components/ArcGISWebMap.d.ts +3 -3
- package/dist/components/ArcGISWebMap.js +25 -38
- package/dist/components/ArcGISWebMap.js.map +1 -1
- package/dist/components/Clickable.d.ts +1 -1
- package/dist/components/Clickable.js +2 -1
- package/dist/components/Clickable.js.map +1 -1
- package/dist/components/ConfirmDialog.d.ts +2 -2
- package/dist/components/ConfirmDialog.js +7 -14
- package/dist/components/ConfirmDialog.js.map +1 -1
- package/dist/components/CopyToClipboardIconButton.d.ts +1 -1
- package/dist/components/CopyToClipboardIconButton.js +10 -14
- package/dist/components/CopyToClipboardIconButton.js.map +1 -1
- package/dist/components/CustomAccordion.d.ts +3 -20
- package/dist/components/ErrorSnackbar.d.ts +1 -1
- package/dist/components/ErrorSnackbar.js +6 -7
- package/dist/components/ErrorSnackbar.js.map +1 -1
- package/dist/components/ImageCropper/CropModal.d.ts +1 -1
- package/dist/components/ImageCropper/CropModal.js +2 -8
- package/dist/components/ImageCropper/CropModal.js.map +1 -1
- package/dist/components/ImageCropper/index.d.ts +1 -1
- package/dist/components/ImageCropper/index.js +3 -5
- package/dist/components/ImageCropper/index.js.map +1 -1
- package/dist/components/InputClear.js +2 -3
- package/dist/components/InputClear.js.map +1 -1
- package/dist/components/InputField.d.ts +3 -2
- package/dist/components/InputField.js +5 -2
- package/dist/components/InputField.js.map +1 -1
- package/dist/components/Lists.d.ts +1 -6
- package/dist/components/Lists.js +2 -2
- package/dist/components/Lists.js.map +1 -1
- package/dist/components/LoadingWithMessage.js +2 -6
- package/dist/components/LoadingWithMessage.js.map +1 -1
- package/dist/components/MaterialIcon.d.ts +2 -4
- package/dist/components/MaterialIcon.js +4 -4
- package/dist/components/MaterialIcon.js.map +1 -1
- package/dist/components/NotificationGrid.d.ts +2 -2
- package/dist/components/NotificationGrid.js +4 -7
- package/dist/components/NotificationGrid.js.map +1 -1
- package/dist/components/QuillHTML.d.ts +1 -1
- package/dist/components/QuillHTML.js +2 -1
- package/dist/components/QuillHTML.js.map +1 -1
- package/dist/components/SuccessSnackbar.d.ts +1 -1
- package/dist/components/SuccessSnackbar.js +3 -6
- package/dist/components/SuccessSnackbar.js.map +1 -1
- package/dist/components/ValidationErrorsCard.d.ts +2 -2
- package/dist/components/ValidationErrorsCard.js +32 -49
- package/dist/components/ValidationErrorsCard.js.map +1 -1
- package/dist/components/calendar-bookings/CalendarBookingsCancelForm.d.ts +1 -1
- package/dist/components/calendar-bookings/CalendarBookingsCancelForm.js +5 -6
- package/dist/components/calendar-bookings/CalendarBookingsCancelForm.js.map +1 -1
- package/dist/components/calendar-bookings/CalendarBookingsContainer.d.ts +1 -1
- package/dist/components/calendar-bookings/CalendarBookingsContainer.js +9 -11
- package/dist/components/calendar-bookings/CalendarBookingsContainer.js.map +1 -1
- package/dist/components/calendar-bookings/CalendarBookingsForm.d.ts +1 -1
- package/dist/components/calendar-bookings/CalendarBookingsForm.js +33 -45
- package/dist/components/calendar-bookings/CalendarBookingsForm.js.map +1 -1
- package/dist/components/calendar-bookings/CalendarBookingsProvider.d.ts +1 -1
- package/dist/components/calendar-bookings/CalendarBookingsProvider.js +2 -6
- package/dist/components/calendar-bookings/CalendarBookingsProvider.js.map +1 -1
- package/dist/components/calendar-bookings/CalendarBookingsReschedulingForm.d.ts +1 -1
- package/dist/components/calendar-bookings/CalendarBookingsReschedulingForm.js +5 -6
- package/dist/components/calendar-bookings/CalendarBookingsReschedulingForm.js.map +1 -1
- package/dist/components/calendar-bookings/ErrorModal.js +7 -11
- package/dist/components/calendar-bookings/ErrorModal.js.map +1 -1
- package/dist/components/downloadable-files/LayoutProvider.d.ts +1 -1
- package/dist/components/downloadable-files/LayoutProvider.js +2 -1
- package/dist/components/downloadable-files/LayoutProvider.js.map +1 -1
- package/dist/components/downloadable-files/index.d.ts +1 -1
- package/dist/components/downloadable-files/index.js +3 -5
- package/dist/components/downloadable-files/index.js.map +1 -1
- package/dist/components/downloadable-files/resource-components.d.ts +3 -3
- package/dist/components/downloadable-files/resource-components.js +9 -32
- package/dist/components/downloadable-files/resource-components.js.map +1 -1
- package/dist/components/formStore/FormStoreTableProvider.d.ts +1 -1
- package/dist/components/formStore/FormStoreTableProvider.js +5 -15
- package/dist/components/formStore/FormStoreTableProvider.js.map +1 -1
- package/dist/components/formStore/OneBlinkFormStoreClearFiltersButton.d.ts +1 -1
- package/dist/components/formStore/OneBlinkFormStoreClearFiltersButton.js +3 -2
- package/dist/components/formStore/OneBlinkFormStoreClearFiltersButton.js.map +1 -1
- package/dist/components/formStore/OneBlinkFormStoreColumnsButton.d.ts +1 -1
- package/dist/components/formStore/OneBlinkFormStoreColumnsButton.js +21 -54
- package/dist/components/formStore/OneBlinkFormStoreColumnsButton.js.map +1 -1
- package/dist/components/formStore/OneBlinkFormStoreDownloadButton.d.ts +2 -2
- package/dist/components/formStore/OneBlinkFormStoreDownloadButton.js +7 -26
- package/dist/components/formStore/OneBlinkFormStoreDownloadButton.js.map +1 -1
- package/dist/components/formStore/OneBlinkFormStoreProvider.d.ts +1 -1
- package/dist/components/formStore/OneBlinkFormStoreProvider.js +4 -5
- package/dist/components/formStore/OneBlinkFormStoreProvider.js.map +1 -1
- package/dist/components/formStore/OneBlinkFormStoreRefreshButton.d.ts +1 -1
- package/dist/components/formStore/OneBlinkFormStoreRefreshButton.js +3 -2
- package/dist/components/formStore/OneBlinkFormStoreRefreshButton.js.map +1 -1
- package/dist/components/formStore/OneBlinkFormStoreTable.d.ts +1 -1
- package/dist/components/formStore/OneBlinkFormStoreTable.js +128 -94
- package/dist/components/formStore/OneBlinkFormStoreTable.js.map +1 -1
- package/dist/components/formStore/display/ElementDisplay.d.ts +3 -4
- package/dist/components/formStore/display/ElementDisplay.js +9 -12
- package/dist/components/formStore/display/ElementDisplay.js.map +1 -1
- package/dist/components/formStore/display/FormStoreIcon.d.ts +1 -1
- package/dist/components/formStore/display/FormStoreIcon.js +2 -2
- package/dist/components/formStore/display/FormStoreIcon.js.map +1 -1
- package/dist/components/formStore/table/ActionedByTableCell.d.ts +1 -1
- package/dist/components/formStore/table/ActionedByTableCell.js +6 -7
- package/dist/components/formStore/table/ActionedByTableCell.js.map +1 -1
- package/dist/components/formStore/table/ColumnFilters.d.ts +3 -3
- package/dist/components/formStore/table/ColumnFilters.js +84 -100
- package/dist/components/formStore/table/ColumnFilters.js.map +1 -1
- package/dist/components/formStore/table/FormElementTableCell.d.ts +1 -1
- package/dist/components/formStore/table/FormElementTableCell.js +34 -97
- package/dist/components/formStore/table/FormElementTableCell.js.map +1 -1
- package/dist/components/formStore/table/HeaderCellMoreButton.d.ts +4 -4
- package/dist/components/formStore/table/HeaderCellMoreButton.js +26 -32
- package/dist/components/formStore/table/HeaderCellMoreButton.js.map +1 -1
- package/dist/components/formStore/table/Pickers.d.ts +4 -4
- package/dist/components/formStore/table/Pickers.js +14 -13
- package/dist/components/formStore/table/Pickers.js.map +1 -1
- package/dist/components/formStore/table/RepeatableSetCell.js +16 -21
- package/dist/components/formStore/table/RepeatableSetCell.js.map +1 -1
- package/dist/components/formStore/table/RepeatableSetCellAccordion.js +2 -4
- package/dist/components/formStore/table/RepeatableSetCellAccordion.js.map +1 -1
- package/dist/components/formStore/table/TableCellCopyButton.d.ts +1 -1
- package/dist/components/formStore/table/TableCellCopyButton.js +2 -3
- package/dist/components/formStore/table/TableCellCopyButton.js.map +1 -1
- package/dist/components/formStore/table/generateColumns.d.ts +5 -6
- package/dist/components/formStore/table/generateColumns.js +23 -18
- package/dist/components/formStore/table/generateColumns.js.map +1 -1
- package/dist/components/formStore/table/getVersionedState.d.ts +4 -3
- package/dist/components/formStore/table/getVersionedState.js +23 -6
- package/dist/components/formStore/table/getVersionedState.js.map +1 -1
- package/dist/components/formStore/table/useFormStoreTable.d.ts +146 -37
- package/dist/components/formStore/table/useFormStoreTable.js +266 -199
- package/dist/components/formStore/table/useFormStoreTable.js.map +1 -1
- package/dist/components/formStore/useFormStoreTableContext.d.ts +142 -33
- package/dist/components/messages/ErrorMessage.js +3 -3
- package/dist/components/messages/ErrorMessage.js.map +1 -1
- package/dist/components/messages/LargeIconMessage.js +2 -6
- package/dist/components/messages/LargeIconMessage.js.map +1 -1
- package/dist/components/messages/NoResourcesYet.d.ts +1 -1
- package/dist/components/messages/NoResourcesYet.js +2 -1
- package/dist/components/messages/NoResourcesYet.js.map +1 -1
- package/dist/components/mfa/MfaDialog.d.ts +1 -1
- package/dist/components/mfa/MfaDialog.js +9 -48
- package/dist/components/mfa/MfaDialog.js.map +1 -1
- package/dist/components/mfa/MultiFactorAuthentication.d.ts +2 -5
- package/dist/components/mfa/MultiFactorAuthentication.js +14 -45
- package/dist/components/mfa/MultiFactorAuthentication.js.map +1 -1
- package/dist/components/payments/PaymentForm.d.ts +1 -1
- package/dist/components/payments/PaymentForm.js +4 -9
- package/dist/components/payments/PaymentForm.js.map +1 -1
- package/dist/components/payments/WestpacQuickStreamPaymentForm.d.ts +1 -1
- package/dist/components/payments/WestpacQuickStreamPaymentForm.js +11 -45
- package/dist/components/payments/WestpacQuickStreamPaymentForm.js.map +1 -1
- package/dist/components/receipts/Receipt.d.ts +1 -1
- package/dist/components/receipts/Receipt.js +2 -2
- package/dist/components/receipts/Receipt.js.map +1 -1
- package/dist/components/receipts/ReceiptButton.d.ts +1 -1
- package/dist/components/receipts/ReceiptButton.js +3 -2
- package/dist/components/receipts/ReceiptButton.js.map +1 -1
- package/dist/components/receipts/ReceiptList.d.ts +1 -1
- package/dist/components/receipts/ReceiptList.js +2 -9
- package/dist/components/receipts/ReceiptList.js.map +1 -1
- package/dist/components/receipts/ReceiptListItem.d.ts +1 -1
- package/dist/components/receipts/ReceiptListItem.js +2 -11
- package/dist/components/receipts/ReceiptListItem.js.map +1 -1
- package/dist/components/renderer/AnnotationModal.d.ts +1 -1
- package/dist/components/renderer/AnnotationModal.js +6 -14
- package/dist/components/renderer/AnnotationModal.js.map +1 -1
- package/dist/components/renderer/AutocompleteDropdown.d.ts +1 -1
- package/dist/components/renderer/AutocompleteDropdown.js +15 -34
- package/dist/components/renderer/AutocompleteDropdown.js.map +1 -1
- package/dist/components/renderer/CopyToClipboardButton.d.ts +1 -1
- package/dist/components/renderer/CopyToClipboardButton.js +2 -4
- package/dist/components/renderer/CopyToClipboardButton.js.map +1 -1
- package/dist/components/renderer/CustomisableButtonInner.js +2 -4
- package/dist/components/renderer/CustomisableButtonInner.js.map +1 -1
- package/dist/components/renderer/FormElementLabelContainer.d.ts +3 -3
- package/dist/components/renderer/FormElementLabelContainer.js +7 -14
- package/dist/components/renderer/FormElementLabelContainer.js.map +1 -1
- package/dist/components/renderer/FormElementOptions.d.ts +1 -1
- package/dist/components/renderer/FormElementOptions.js +4 -5
- package/dist/components/renderer/FormElementOptions.js.map +1 -1
- package/dist/components/renderer/FormElementValidationMessage.js +3 -5
- package/dist/components/renderer/FormElementValidationMessage.js.map +1 -1
- package/dist/components/renderer/LookupButton.d.ts +1 -1
- package/dist/components/renderer/LookupButton.js +4 -8
- package/dist/components/renderer/LookupButton.js.map +1 -1
- package/dist/components/renderer/LookupNotification.d.ts +1 -1
- package/dist/components/renderer/LookupNotification.js +14 -36
- package/dist/components/renderer/LookupNotification.js.map +1 -1
- package/dist/components/renderer/Modal.d.ts +3 -3
- package/dist/components/renderer/Modal.js +5 -10
- package/dist/components/renderer/Modal.js.map +1 -1
- package/dist/components/renderer/OnLoading.d.ts +1 -1
- package/dist/components/renderer/OnLoading.js +3 -3
- package/dist/components/renderer/OnLoading.js.map +1 -1
- package/dist/components/renderer/OneBlinkAppsErrorOriginalMessage.d.ts +1 -1
- package/dist/components/renderer/OneBlinkAppsErrorOriginalMessage.js +2 -4
- package/dist/components/renderer/OneBlinkAppsErrorOriginalMessage.js.map +1 -1
- package/dist/components/renderer/OneBlinkFormElements.d.ts +1 -1
- package/dist/components/renderer/OneBlinkFormElements.js +61 -90
- package/dist/components/renderer/OneBlinkFormElements.js.map +1 -1
- package/dist/components/renderer/PageFormElements.d.ts +1 -1
- package/dist/components/renderer/PageFormElements.js +3 -5
- package/dist/components/renderer/PageFormElements.js.map +1 -1
- package/dist/components/renderer/ProgressBar.d.ts +1 -1
- package/dist/components/renderer/ProgressBar.js +2 -1
- package/dist/components/renderer/ProgressBar.js.map +1 -1
- package/dist/components/renderer/ReverseGeocode.d.ts +1 -1
- package/dist/components/renderer/ReverseGeocode.js +2 -1
- package/dist/components/renderer/ReverseGeocode.js.map +1 -1
- package/dist/components/renderer/ToggleAllCheckbox.js +4 -5
- package/dist/components/renderer/ToggleAllCheckbox.js.map +1 -1
- package/dist/components/renderer/Tooltip.d.ts +1 -1
- package/dist/components/renderer/Tooltip.js +3 -1
- package/dist/components/renderer/Tooltip.js.map +1 -1
- package/dist/components/renderer/attachments/AttachmentStatus.d.ts +1 -1
- package/dist/components/renderer/attachments/AttachmentStatus.js +6 -15
- package/dist/components/renderer/attachments/AttachmentStatus.js.map +1 -1
- package/dist/components/renderer/attachments/DropdownMenu.js +30 -42
- package/dist/components/renderer/attachments/DropdownMenu.js.map +1 -1
- package/dist/components/renderer/attachments/FileCard.d.ts +1 -1
- package/dist/components/renderer/attachments/FileCard.js +2 -10
- package/dist/components/renderer/attachments/FileCard.js.map +1 -1
- package/dist/components/renderer/attachments/FileCardContent.d.ts +1 -1
- package/dist/components/renderer/attachments/FileCardContent.js +3 -4
- package/dist/components/renderer/attachments/FileCardContent.js.map +1 -1
- package/dist/components/renderer/attachments/ImagePreviewUnavailable.d.ts +1 -1
- package/dist/components/renderer/attachments/ImagePreviewUnavailable.js +2 -5
- package/dist/components/renderer/attachments/ImagePreviewUnavailable.js.map +1 -1
- package/dist/components/renderer/attachments/ProgressBar.js +2 -4
- package/dist/components/renderer/attachments/ProgressBar.js.map +1 -1
- package/dist/form-elements/ComplianceButton.js +3 -4
- package/dist/form-elements/ComplianceButton.js.map +1 -1
- package/dist/form-elements/FormElementABN.d.ts +1 -1
- package/dist/form-elements/FormElementABN.js +18 -28
- package/dist/form-elements/FormElementABN.js.map +1 -1
- package/dist/form-elements/FormElementAPINSWLiquorLicence.d.ts +2 -2
- package/dist/form-elements/FormElementAPINSWLiquorLicence.js +3 -21
- package/dist/form-elements/FormElementAPINSWLiquorLicence.js.map +1 -1
- package/dist/form-elements/FormElementArcGISWebMap.d.ts +1 -1
- package/dist/form-elements/FormElementArcGISWebMap.js +21 -36
- package/dist/form-elements/FormElementArcGISWebMap.js.map +1 -1
- package/dist/form-elements/FormElementAutocomplete.d.ts +1 -1
- package/dist/form-elements/FormElementAutocomplete.js +5 -9
- package/dist/form-elements/FormElementAutocomplete.js.map +1 -1
- package/dist/form-elements/FormElementBSB.d.ts +1 -1
- package/dist/form-elements/FormElementBSB.js +17 -30
- package/dist/form-elements/FormElementBSB.js.map +1 -1
- package/dist/form-elements/FormElementBarcodeScanner.d.ts +1 -1
- package/dist/form-elements/FormElementBarcodeScanner.js +16 -50
- package/dist/form-elements/FormElementBarcodeScanner.js.map +1 -1
- package/dist/form-elements/FormElementBoolean.d.ts +1 -1
- package/dist/form-elements/FormElementBoolean.js +4 -4
- package/dist/form-elements/FormElementBoolean.js.map +1 -1
- package/dist/form-elements/FormElementCalculation.d.ts +1 -1
- package/dist/form-elements/FormElementCalculation.js +2 -9
- package/dist/form-elements/FormElementCalculation.js.map +1 -1
- package/dist/form-elements/FormElementCamera.d.ts +1 -1
- package/dist/form-elements/FormElementCamera.js +7 -53
- package/dist/form-elements/FormElementCamera.js.map +1 -1
- package/dist/form-elements/FormElementCaptcha.d.ts +1 -1
- package/dist/form-elements/FormElementCaptcha.js +2 -4
- package/dist/form-elements/FormElementCaptcha.js.map +1 -1
- package/dist/form-elements/FormElementCheckBoxes.d.ts +1 -1
- package/dist/form-elements/FormElementCheckBoxes.js +23 -33
- package/dist/form-elements/FormElementCheckBoxes.js.map +1 -1
- package/dist/form-elements/FormElementCivicaNameRecord.d.ts +1 -1
- package/dist/form-elements/FormElementCivicaNameRecord.js +2 -1
- package/dist/form-elements/FormElementCivicaNameRecord.js.map +1 -1
- package/dist/form-elements/FormElementCivicaStreetName.d.ts +1 -1
- package/dist/form-elements/FormElementCivicaStreetName.js +2 -4
- package/dist/form-elements/FormElementCivicaStreetName.js.map +1 -1
- package/dist/form-elements/FormElementCompliance.d.ts +1 -1
- package/dist/form-elements/FormElementCompliance.js +13 -25
- package/dist/form-elements/FormElementCompliance.js.map +1 -1
- package/dist/form-elements/FormElementDate.d.ts +1 -1
- package/dist/form-elements/FormElementDate.js +2 -9
- package/dist/form-elements/FormElementDate.js.map +1 -1
- package/dist/form-elements/FormElementDateTime.d.ts +1 -1
- package/dist/form-elements/FormElementDateTime.js +2 -9
- package/dist/form-elements/FormElementDateTime.js.map +1 -1
- package/dist/form-elements/FormElementEmail.d.ts +1 -1
- package/dist/form-elements/FormElementEmail.js +4 -13
- package/dist/form-elements/FormElementEmail.js.map +1 -1
- package/dist/form-elements/FormElementFile.js +2 -12
- package/dist/form-elements/FormElementFile.js.map +1 -1
- package/dist/form-elements/FormElementFiles.d.ts +1 -1
- package/dist/form-elements/FormElementFiles.js +9 -17
- package/dist/form-elements/FormElementFiles.js.map +1 -1
- package/dist/form-elements/FormElementForm.d.ts +1 -1
- package/dist/form-elements/FormElementForm.js +2 -1
- package/dist/form-elements/FormElementForm.js.map +1 -1
- package/dist/form-elements/FormElementFreshdeskDependentField.d.ts +1 -1
- package/dist/form-elements/FormElementFreshdeskDependentField.js +2 -1
- package/dist/form-elements/FormElementFreshdeskDependentField.js.map +1 -1
- package/dist/form-elements/FormElementGeoscapeAddress.d.ts +1 -1
- package/dist/form-elements/FormElementGeoscapeAddress.js +2 -4
- package/dist/form-elements/FormElementGeoscapeAddress.js.map +1 -1
- package/dist/form-elements/FormElementGoogleAddress.d.ts +1 -1
- package/dist/form-elements/FormElementGoogleAddress.js +2 -7
- package/dist/form-elements/FormElementGoogleAddress.js.map +1 -1
- package/dist/form-elements/FormElementHTML.d.ts +1 -1
- package/dist/form-elements/FormElementHTML.js +2 -3
- package/dist/form-elements/FormElementHTML.js.map +1 -1
- package/dist/form-elements/FormElementHeading.d.ts +1 -1
- package/dist/form-elements/FormElementHeading.js +7 -8
- package/dist/form-elements/FormElementHeading.js.map +1 -1
- package/dist/form-elements/FormElementImage.d.ts +1 -1
- package/dist/form-elements/FormElementImage.js +3 -3
- package/dist/form-elements/FormElementImage.js.map +1 -1
- package/dist/form-elements/FormElementLocation.d.ts +1 -1
- package/dist/form-elements/FormElementLocation.js +16 -47
- package/dist/form-elements/FormElementLocation.js.map +1 -1
- package/dist/form-elements/FormElementLookupButton.d.ts +2 -3
- package/dist/form-elements/FormElementLookupButton.js +4 -7
- package/dist/form-elements/FormElementLookupButton.js.map +1 -1
- package/dist/form-elements/FormElementNumber.d.ts +1 -1
- package/dist/form-elements/FormElementNumber.js +3 -14
- package/dist/form-elements/FormElementNumber.js.map +1 -1
- package/dist/form-elements/FormElementPointAddress.d.ts +2 -2
- package/dist/form-elements/FormElementPointAddress.js +6 -13
- package/dist/form-elements/FormElementPointAddress.js.map +1 -1
- package/dist/form-elements/FormElementPointAddressV3.d.ts +1 -1
- package/dist/form-elements/FormElementPointAddressV3.js +2 -9
- package/dist/form-elements/FormElementPointAddressV3.js.map +1 -1
- package/dist/form-elements/FormElementPointCadastralParcel.d.ts +1 -1
- package/dist/form-elements/FormElementPointCadastralParcel.js +14 -26
- package/dist/form-elements/FormElementPointCadastralParcel.js.map +1 -1
- package/dist/form-elements/FormElementRadio.d.ts +1 -1
- package/dist/form-elements/FormElementRadio.js +24 -30
- package/dist/form-elements/FormElementRadio.js.map +1 -1
- package/dist/form-elements/FormElementRepeatableSet.d.ts +1 -1
- package/dist/form-elements/FormElementRepeatableSet.js +21 -39
- package/dist/form-elements/FormElementRepeatableSet.js.map +1 -1
- package/dist/form-elements/FormElementSection.d.ts +1 -1
- package/dist/form-elements/FormElementSection.js +16 -34
- package/dist/form-elements/FormElementSection.js.map +1 -1
- package/dist/form-elements/FormElementSelect.d.ts +1 -1
- package/dist/form-elements/FormElementSelect.js +12 -23
- package/dist/form-elements/FormElementSelect.js.map +1 -1
- package/dist/form-elements/FormElementSignature.d.ts +1 -1
- package/dist/form-elements/FormElementSignature.js +21 -46
- package/dist/form-elements/FormElementSignature.js.map +1 -1
- package/dist/form-elements/FormElementSummary.d.ts +1 -1
- package/dist/form-elements/FormElementSummary.js +5 -4
- package/dist/form-elements/FormElementSummary.js.map +1 -1
- package/dist/form-elements/FormElementTelephone.d.ts +1 -1
- package/dist/form-elements/FormElementTelephone.js +4 -13
- package/dist/form-elements/FormElementTelephone.js.map +1 -1
- package/dist/form-elements/FormElementText.d.ts +1 -1
- package/dist/form-elements/FormElementText.js +6 -21
- package/dist/form-elements/FormElementText.js.map +1 -1
- package/dist/form-elements/FormElementTextarea.d.ts +1 -1
- package/dist/form-elements/FormElementTextarea.js +6 -20
- package/dist/form-elements/FormElementTextarea.js.map +1 -1
- package/dist/form-elements/FormElementTime.d.ts +1 -1
- package/dist/form-elements/FormElementTime.js +2 -9
- package/dist/form-elements/FormElementTime.js.map +1 -1
- package/dist/form-elements/OptionButton.js +3 -5
- package/dist/form-elements/OptionButton.js.map +1 -1
- package/dist/hooks/attachments/useAttachmentBlobs.d.ts +1 -1
- package/dist/hooks/attachments/useAttachmentBlobs.js +2 -1
- package/dist/hooks/attachments/useAttachmentBlobs.js.map +1 -1
- package/dist/hooks/form-date-picker/useFormDatePickerProps.d.ts +7 -8
- package/dist/hooks/form-date-picker/useFormDatePickerProps.js +8 -10
- package/dist/hooks/form-date-picker/useFormDatePickerProps.js.map +1 -1
- package/dist/hooks/useAuth.d.ts +1 -1
- package/dist/hooks/useAuth.js +2 -1
- package/dist/hooks/useAuth.js.map +1 -1
- package/dist/hooks/useDrafts.d.ts +1 -1
- package/dist/hooks/useDrafts.js +2 -1
- package/dist/hooks/useDrafts.js.map +1 -1
- package/dist/hooks/useDynamicOptionsLoaderState.d.ts +1 -1
- package/dist/hooks/useDynamicOptionsLoaderState.js +4 -13
- package/dist/hooks/useDynamicOptionsLoaderState.js.map +1 -1
- package/dist/hooks/useFormElementLookups.d.ts +1 -1
- package/dist/hooks/useFormElementLookups.js +2 -1
- package/dist/hooks/useFormElementLookups.js.map +1 -1
- package/dist/hooks/useFormSubmissionModelContext.d.ts +1 -1
- package/dist/hooks/useFormSubmissionModelContext.js +2 -1
- package/dist/hooks/useFormSubmissionModelContext.js.map +1 -1
- package/dist/hooks/useFormSubmissionState.d.ts +1 -1
- package/dist/hooks/useFormSubmissionState.js +1 -1
- package/dist/hooks/useFormSubmissionState.js.map +1 -1
- package/dist/hooks/useIsHovering.d.ts +1 -1
- package/dist/hooks/useIsHovering.js +4 -4
- package/dist/hooks/useIsHovering.js.map +1 -1
- package/dist/hooks/useIsOffline.d.ts +1 -1
- package/dist/hooks/useIsOffline.js +2 -1
- package/dist/hooks/useIsOffline.js.map +1 -1
- package/dist/hooks/useIsPageVisible.d.ts +1 -1
- package/dist/hooks/useIsPageVisible.js +2 -1
- package/dist/hooks/useIsPageVisible.js.map +1 -1
- package/dist/hooks/useMfa.d.ts +1 -1
- package/dist/hooks/useMfa.js +2 -1
- package/dist/hooks/useMfa.js.map +1 -1
- package/dist/hooks/usePages.d.ts +1 -1
- package/dist/hooks/usePendingSubmissions.d.ts +1 -1
- package/dist/hooks/usePendingSubmissions.js +2 -1
- package/dist/hooks/usePendingSubmissions.js.map +1 -1
- package/dist/hooks/useReCAPTCHAProps.d.ts +1 -1
- package/dist/hooks/useReCAPTCHAProps.js.map +1 -1
- package/package.json +20 -24
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmDialog.js","sourceRoot":"","sources":["../../src/components/ConfirmDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EACL,MAAM,EACN,aAAa,EACb,WAAW,EACX,aAAa,EACb,MAAM,EACN,MAAM,GAEP,MAAM,eAAe,CAAA;AACtB,OAAO,
|
|
1
|
+
{"version":3,"file":"ConfirmDialog.js","sourceRoot":"","sources":["../../src/components/ConfirmDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EACL,MAAM,EACN,aAAa,EACb,WAAW,EACX,aAAa,EACb,MAAM,EACN,MAAM,GAEP,MAAM,eAAe,CAAA;AACtB,OAAO,YAAY,MAAM,uBAAuB,CAAA;AAChD,OAAO,aAAa,MAAM,iBAAiB,CAAA;AAqB3C,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,MAAM,EACN,OAAO,EACP,QAAQ,EACR,SAAS,EACT,KAAK,EACL,iBAAiB,EACjB,iBAAiB,EACjB,OAAO,EACP,eAAe,EACf,QAAQ,GACF;IACN,MAAM,SAAS,GAAG,YAAY,EAAE,CAAA;IAChC,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;IAC7D,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAe,IAAI,CAAC,CAAA;IAC5D,MAAM,aAAa,GAAG,KAAK,CAAC,WAAW,CAAC,KAAK,IAAI,EAAE;QACjD,eAAe,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O,CAAE,YAAY,uBAG5B,EAET,KAAC,MAAM,IACL,OAAO,EAAC,WAAW,EACnB,OAAO,EAAE,YAAY,EACrB,SAAS,QACT,SAAS,EAAE,iBAAiB,EAC5B,eAAe,EAAC,OAAO,EACvB,OAAO,EAAE,aAAa,kBACR,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,aAAa,EACpC,QAAQ,EAAE,QAAQ,YAEjB,iBAAiB,GACX,IACK,IACT,EACT,KAAC,MAAM,cACL,KAAC,aAAa,IAAC,IAAI,EAAE,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,YAC7C,+BAAoB,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,YAAG,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,GAAQ,GAC7C,GACT,IACM,CAClB,CAAA;AACH,CAAC","sourcesContent":["import * as React from 'react'\nimport {\n Dialog,\n DialogActions,\n DialogTitle,\n DialogContent,\n Button,\n Portal,\n DialogProps,\n} from '@mui/material'\nimport useIsMounted from '../hooks/useIsMounted'\nimport ErrorSnackbar from './ErrorSnackbar'\n\ntype Props = {\n isOpen: boolean\n onClose: () => void\n onConfirm: (abortSignal: AbortSignal) => unknown\n children: React.ReactNode\n title: string\n confirmButtonText: string\n confirmButtonIcon: React.ReactNode\n cypress?: {\n dialog?: string\n confirmButton?: string\n cancelButton?: string\n error?: string\n title?: string\n }\n TransitionProps?: NonNullable<DialogProps['slotProps']>['transition']\n disabled?: boolean\n}\n\nexport default function ConfirmDialog({\n isOpen,\n onClose,\n children,\n onConfirm,\n title,\n confirmButtonText,\n confirmButtonIcon,\n cypress,\n TransitionProps,\n disabled,\n}: Props) {\n const isMounted = useIsMounted()\n const [isConfirming, setIsConfirming] = React.useState(false)\n const [error, setError] = React.useState<Error | null>(null)\n const handleConfirm = React.useCallback(async () => {\n setIsConfirming(true)\n setError(null)\n let newError = null\n\n const abortController = new AbortController()\n try {\n await onConfirm(abortController.signal)\n } catch (error) {\n newError = error as Error\n }\n\n if (isMounted.current && !abortController.signal.aborted) {\n setIsConfirming(false)\n setError(newError)\n }\n }, [isMounted, onConfirm])\n return (\n <React.Fragment>\n <Dialog\n open={isOpen}\n maxWidth=\"sm\"\n fullWidth\n onClose={!isConfirming ? onClose : undefined}\n data-cypress={cypress?.dialog}\n slotProps={{\n transition: {\n onExiting: () => setError(null),\n ...(TransitionProps ? TransitionProps : {}),\n },\n }}\n >\n <DialogTitle data-cypress={cypress?.title}>{title}</DialogTitle>\n <DialogContent dividers>{children}</DialogContent>\n <DialogActions>\n <Button\n disabled={isConfirming}\n onClick={onClose}\n data-cypress={cypress?.cancelButton}\n >\n Cancel\n </Button>\n\n <Button\n variant=\"contained\"\n loading={isConfirming}\n autoFocus\n startIcon={confirmButtonIcon}\n loadingPosition=\"start\"\n onClick={handleConfirm}\n data-cypress={cypress?.confirmButton}\n disabled={disabled}\n >\n {confirmButtonText}\n </Button>\n </DialogActions>\n </Dialog>\n <Portal>\n <ErrorSnackbar open={!!error} onClose={setError}>\n <span data-cypress={cypress?.error}>{error?.message}</span>\n </ErrorSnackbar>\n </Portal>\n </React.Fragment>\n )\n}\n"]}
|
|
@@ -5,6 +5,6 @@ type Props = {
|
|
|
5
5
|
large?: boolean;
|
|
6
6
|
noMarginY?: boolean;
|
|
7
7
|
} & React.ComponentProps<typeof IconButton>;
|
|
8
|
-
export declare function CopyToClipBoardIconButton({ text, large, noMarginY, className, ...rest }: Props):
|
|
8
|
+
export declare function CopyToClipBoardIconButton({ text, large, noMarginY, className, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
declare const _default: React.MemoExoticComponent<typeof CopyToClipBoardIconButton>;
|
|
10
10
|
export default _default;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import copy from 'copy-to-clipboard';
|
|
3
4
|
import { IconButton, Tooltip, Snackbar, Portal } from '@mui/material';
|
|
@@ -15,20 +16,15 @@ export function CopyToClipBoardIconButton({ text, large, noMarginY, className, .
|
|
|
15
16
|
const handleClose = React.useCallback(() => {
|
|
16
17
|
setIsCopyToClipboardOpen(false);
|
|
17
18
|
}, []);
|
|
18
|
-
return (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
vertical: 'bottom',
|
|
28
|
-
horizontal: 'right',
|
|
29
|
-
}, open: isCopyToClipboardOpen, onClose: handleClose, autoHideDuration: 1500, ContentProps: {
|
|
30
|
-
'aria-describedby': 'copy-clip-board-message-id',
|
|
31
|
-
}, message: React.createElement("span", { id: "copy-clip-board-message-id", "data-cypress": "copied-text-to-clip-board-message" }, "Copied to Clipboard") }))));
|
|
19
|
+
return (_jsxs(_Fragment, { children: [_jsx(Tooltip, { title: "Copy to clipboard", children: _jsx(IconButton, { onClick: (e) => {
|
|
20
|
+
e.stopPropagation();
|
|
21
|
+
copyToClipboard();
|
|
22
|
+
}, "data-cypress": "copy-to-clip-board-button", className: className, sx: noMarginY ? noMargin : undefined, ...rest, children: _jsx(MaterialIcon, { style: large ? undefined : { fontSize: 18 }, children: "file_copy" }) }) }), _jsx(Portal, { children: _jsx(Snackbar, { anchorOrigin: {
|
|
23
|
+
vertical: 'bottom',
|
|
24
|
+
horizontal: 'right',
|
|
25
|
+
}, open: isCopyToClipboardOpen, onClose: handleClose, autoHideDuration: 1500, ContentProps: {
|
|
26
|
+
'aria-describedby': 'copy-clip-board-message-id',
|
|
27
|
+
}, message: _jsx("span", { id: "copy-clip-board-message-id", "data-cypress": "copied-text-to-clip-board-message", children: "Copied to Clipboard" }) }) })] }));
|
|
32
28
|
}
|
|
33
29
|
export default React.memo(CopyToClipBoardIconButton);
|
|
34
30
|
//# sourceMappingURL=CopyToClipboardIconButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CopyToClipboardIconButton.js","sourceRoot":"","sources":["../../src/components/CopyToClipboardIconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,IAAI,MAAM,mBAAmB,CAAA;AACpC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAW,MAAM,EAAE,MAAM,eAAe,CAAA;AAC9E,OAAO,YAAY,MAAM,gBAAgB,CAAA;AAQzC,MAAM,QAAQ,GAAY;IACxB,SAAS,EAAE,CAAC,CAAC;IACb,YAAY,EAAE,CAAC,CAAC;CACjB,CAAA;AACD,MAAM,UAAU,yBAAyB,CAAC,EACxC,IAAI,EACJ,KAAK,EACL,SAAS,EACT,SAAS,EACT,GAAG,IAAI,EACD;IACN,MAAM,CAAC,qBAAqB,EAAE,wBAAwB,CAAC,GACrD,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;IACvB,MAAM,eAAe,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QAC7C,IAAI,CAAC,IAAI,CAAC,CAAA;QACV,wBAAwB,CAAC,IAAI,CAAC,CAAA;IAChC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAA;IACV,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QACzC,wBAAwB,CAAC,KAAK,CAAC,CAAA;IACjC,CAAC,EAAE,EAAE,CAAC,CAAA;IACN,OAAO,CACL
|
|
1
|
+
{"version":3,"file":"CopyToClipboardIconButton.js","sourceRoot":"","sources":["../../src/components/CopyToClipboardIconButton.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,IAAI,MAAM,mBAAmB,CAAA;AACpC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAW,MAAM,EAAE,MAAM,eAAe,CAAA;AAC9E,OAAO,YAAY,MAAM,gBAAgB,CAAA;AA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,EAAE,IAAI,EACtB,YAAY,EAAE;wBACZ,kBAAkB,EAAE,4BAA4B;qBACjD,EACD,OAAO,EACL,eACE,EAAE,EAAC,4BAA4B,kBAClB,mCAAmC,oCAG3C,GAET,GACK,IACR,CACJ,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAA","sourcesContent":["import * as React from 'react'\nimport copy from 'copy-to-clipboard'\nimport { IconButton, Tooltip, Snackbar, SxProps, Portal } from '@mui/material'\nimport MaterialIcon from './MaterialIcon'\n\ntype Props = {\n text: string\n large?: boolean\n noMarginY?: boolean\n} & React.ComponentProps<typeof IconButton>\n\nconst noMargin: SxProps = {\n marginTop: -1,\n marginBottom: -1,\n}\nexport function CopyToClipBoardIconButton({\n text,\n large,\n noMarginY,\n className,\n ...rest\n}: Props) {\n const [isCopyToClipboardOpen, setIsCopyToClipboardOpen] =\n React.useState(false)\n const copyToClipboard = React.useCallback(() => {\n copy(text)\n setIsCopyToClipboardOpen(true)\n }, [text])\n const handleClose = React.useCallback(() => {\n setIsCopyToClipboardOpen(false)\n }, [])\n return (\n <>\n <Tooltip title=\"Copy to clipboard\">\n <IconButton\n onClick={(e) => {\n e.stopPropagation()\n copyToClipboard()\n }}\n data-cypress=\"copy-to-clip-board-button\"\n className={className}\n sx={noMarginY ? noMargin : undefined}\n {...rest}\n >\n <MaterialIcon style={large ? undefined : { fontSize: 18 }}>\n file_copy\n </MaterialIcon>\n </IconButton>\n </Tooltip>\n <Portal>\n <Snackbar\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'right',\n }}\n open={isCopyToClipboardOpen}\n onClose={handleClose}\n autoHideDuration={1500}\n ContentProps={{\n 'aria-describedby': 'copy-clip-board-message-id',\n }}\n message={\n <span\n id=\"copy-clip-board-message-id\"\n data-cypress=\"copied-text-to-clip-board-message\"\n >\n Copied to Clipboard\n </span>\n }\n />\n </Portal>\n </>\n )\n}\n\nexport default React.memo(CopyToClipBoardIconButton)\n"]}
|
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
export declare const CustomAccordion: import("@emotion/styled").StyledComponent<{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
defaultExpanded?: boolean;
|
|
5
|
-
disabled?: boolean;
|
|
6
|
-
disableGutters?: boolean;
|
|
7
|
-
expanded?: boolean;
|
|
8
|
-
onChange?: (event: React.SyntheticEvent, expanded: boolean) => void;
|
|
9
|
-
sx?: import("@mui/material").SxProps<import("@mui/material").Theme>;
|
|
10
|
-
TransitionComponent?: React.JSXElementConstructor<import("@mui/material/transitions").TransitionProps & {
|
|
11
|
-
children?: React.ReactElement<any, any>;
|
|
12
|
-
}>;
|
|
13
|
-
TransitionProps?: import("@mui/material/transitions").TransitionProps;
|
|
14
|
-
} & import("@mui/material").AccordionSlotsAndSlotProps & Omit<import("@mui/material").PaperOwnProps, "classes" | "onChange"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
15
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
16
|
-
}, "children" | keyof import("@mui/material/OverridableComponent").CommonProps | "sx" | "onChange" | "elevation" | "disabled" | "TransitionComponent" | "TransitionProps" | "variant" | "disableGutters" | "square" | "defaultExpanded" | "expanded" | keyof import("@mui/material").AccordionSlotsAndSlotProps> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
17
|
-
export declare const CustomAccordionSummary: import("@emotion/styled").StyledComponent<import("@mui/material").AccordionSummaryOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
18
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
19
|
-
}, "className" | "style" | "children" | "classes" | "sx" | "tabIndex" | "disabled" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "expandIcon"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
20
|
-
export declare const CustomAccordionDetails: import("@emotion/styled").StyledComponent<import("@mui/material").AccordionDetailsProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
1
|
+
export declare const CustomAccordion: import("@emotion/styled").StyledComponent<any, {}, {}>;
|
|
2
|
+
export declare const CustomAccordionSummary: import("@emotion/styled").StyledComponent<any, {}, {}>;
|
|
3
|
+
export declare const CustomAccordionDetails: import("@emotion/styled").StyledComponent<any, {}, {}>;
|
|
@@ -3,6 +3,6 @@ declare function ErrorSnackbar({ open, onClose, children, }: {
|
|
|
3
3
|
open: boolean;
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
onClose: (arg: null) => unknown;
|
|
6
|
-
}):
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
declare const _default: React.MemoExoticComponent<typeof ErrorSnackbar>;
|
|
8
8
|
export default _default;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { Snackbar, IconButton, Alert as MuiAlert, styled, } from '@mui/material';
|
|
3
4
|
import MaterialIcon from './MaterialIcon';
|
|
4
|
-
|
|
5
|
-
return
|
|
6
|
-
}
|
|
5
|
+
function Alert({ ref, ...props }) {
|
|
6
|
+
return _jsx(MuiAlert, { elevation: 6, ref: ref, variant: "filled", ...props });
|
|
7
|
+
}
|
|
7
8
|
const StyledIcon = styled(MaterialIcon)(() => ({
|
|
8
9
|
fontSize: 20,
|
|
9
10
|
}));
|
|
@@ -13,12 +14,10 @@ function ErrorSnackbar({ open, onClose, children, }) {
|
|
|
13
14
|
onClose(null);
|
|
14
15
|
}
|
|
15
16
|
}, [onClose]);
|
|
16
|
-
return (
|
|
17
|
+
return (_jsx(Snackbar, { anchorOrigin: {
|
|
17
18
|
vertical: 'bottom',
|
|
18
19
|
horizontal: 'right',
|
|
19
|
-
}, open: open, onClose: handleClose, className: "ob-error-snackbar" },
|
|
20
|
-
React.createElement(Alert, { severity: "error", action: React.createElement(IconButton, { key: "close", "aria-label": "Close", color: "inherit", onClick: handleClose, "data-cypress": "error-snackbar-close", size: "large" },
|
|
21
|
-
React.createElement(StyledIcon, null, "close")) }, children)));
|
|
20
|
+
}, open: open, onClose: handleClose, className: "ob-error-snackbar", children: _jsx(Alert, { severity: "error", action: _jsx(IconButton, { "aria-label": "Close", color: "inherit", onClick: handleClose, "data-cypress": "error-snackbar-close", size: "large", children: _jsx(StyledIcon, { children: "close" }) }, "close"), children: children }) }));
|
|
22
21
|
}
|
|
23
22
|
export default React.memo(ErrorSnackbar);
|
|
24
23
|
//# sourceMappingURL=ErrorSnackbar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorSnackbar.js","sourceRoot":"","sources":["../../src/components/ErrorSnackbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EACL,QAAQ,EACR,UAAU,EACV,KAAK,IAAI,QAAQ,EAEjB,MAAM,GACP,MAAM,eAAe,CAAA;AACtB,OAAO,YAAY,MAAM,gBAAgB,CAAA;AAEzC,
|
|
1
|
+
{"version":3,"file":"ErrorSnackbar.js","sourceRoot":"","sources":["../../src/components/ErrorSnackbar.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EACL,QAAQ,EACR,UAAU,EACV,KAAK,IAAI,QAAQ,EAEjB,MAAM,GACP,MAAM,eAAe,CAAA;AACtB,OAAO,YAAY,MAAM,gBAAgB,CAAA;AAEzC,SAAS,KAAK,CAAC,EAAE,GAAG,EAAE,GAAG,KAAK,EAAc;IAC1C,OAAO,KAAC,QAAQ,IAAC,SAAS,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAC,QAAQ,KAAK,KAAK,GAAI,CAAA;AACzE,CAAC;AAED,MAAM,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IAC7C,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC,CAAA;AAEH,SAAS,aAAa,CAAC,EACrB,IAAI,EACJ,OAAO,EACP,QAAQ,GAKT;IACC,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,CACnC,CAAC,CAAU,EAAE,MAAe,EAAE,EAAE;QAC9B,IAAI,MAAM,KAAK,WAAW,EAAE,CAAC;YAC3B,OAAO,CAAC,IAAI,CAAC,CAAA;QACf,CAAC;IACH,CAAC,EACD,CAAC,OAAO,CAAC,CACV,CAAA;IACD,OAAO,CACL,KAAC,QAAQ,IACP,YAAY,EAAE;YACZ,QAAQ,EAAE,QAAQ;YAClB,UAAU,EAAE,OAAO;SACpB,EACD,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,WAAW,EACpB,SAAS,EAAC,mBAAmB,YAE7B,KAAC,KAAK,IACJ,QAAQ,EAAC,OAAO,EAChB,MAAM,EACJ,KAAC,UAAU,kBAEE,OAAO,EAClB,KAAK,EAAC,SAAS,EACf,OAAO,EAAE,WAAW,kBACP,sBAAsB,EACnC,IAAI,EAAC,OAAO,YAEZ,KAAC,UAAU,wBAAmB,IAP1B,OAAO,CAQA,YAGd,QAAQ,GACH,GACC,CACZ,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA","sourcesContent":["import * as React from 'react'\nimport {\n Snackbar,\n IconButton,\n Alert as MuiAlert,\n AlertProps,\n styled,\n} from '@mui/material'\nimport MaterialIcon from './MaterialIcon'\n\nfunction Alert({ ref, ...props }: AlertProps) {\n return <MuiAlert elevation={6} ref={ref} variant=\"filled\" {...props} />\n}\n\nconst StyledIcon = styled(MaterialIcon)(() => ({\n fontSize: 20,\n}))\n\nfunction ErrorSnackbar({\n open,\n onClose,\n children,\n}: {\n open: boolean\n children: React.ReactNode\n onClose: (arg: null) => unknown\n}) {\n const handleClose = React.useCallback(\n (e: unknown, reason?: string) => {\n if (reason !== 'clickaway') {\n onClose(null)\n }\n },\n [onClose],\n )\n return (\n <Snackbar\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'right',\n }}\n open={open}\n onClose={handleClose}\n className=\"ob-error-snackbar\"\n >\n <Alert\n severity=\"error\"\n action={\n <IconButton\n key=\"close\"\n aria-label=\"Close\"\n color=\"inherit\"\n onClick={handleClose}\n data-cypress=\"error-snackbar-close\"\n size=\"large\"\n >\n <StyledIcon>close</StyledIcon>\n </IconButton>\n }\n >\n {children}\n </Alert>\n </Snackbar>\n )\n}\n\nexport default React.memo(ErrorSnackbar)\n"]}
|
|
@@ -4,6 +4,6 @@ declare function CropModal({ imageSrc, onClose, onSave, }: {
|
|
|
4
4
|
imageSrc: string;
|
|
5
5
|
onClose: () => void;
|
|
6
6
|
onSave: (imageArea: PercentCrop) => void;
|
|
7
|
-
}):
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
declare const _default: React.MemoExoticComponent<typeof CropModal>;
|
|
9
9
|
export default _default;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import ImageCropper from '.';
|
|
3
4
|
import scrollingService from '../../services/scrolling-service';
|
|
@@ -14,14 +15,7 @@ function CropModal({ imageSrc, onClose, onSave, }) {
|
|
|
14
15
|
scrollingService.enableScrolling();
|
|
15
16
|
};
|
|
16
17
|
}, []);
|
|
17
|
-
return (
|
|
18
|
-
React.createElement("div", { className: "modal-background-faded" }),
|
|
19
|
-
React.createElement("div", { className: "ob-crop ob-border-radius" },
|
|
20
|
-
React.createElement("div", { className: "ob-crop__content ob-border-radius" },
|
|
21
|
-
React.createElement(ImageCropper, { imgSrc: imageSrc, onCropComplete: setCroppedAreaPercent })),
|
|
22
|
-
React.createElement("div", { className: "ob-annotation__buttons ob-annotation__buttons-actions" },
|
|
23
|
-
React.createElement("button", { type: "button", className: "button is-light ob-button ob-annotation__button ob-annotation__button-action cypress-crop-cancel-button", onClick: onClose }, "Cancel"),
|
|
24
|
-
React.createElement("button", { type: "button", className: "button is-primary ob-button ob-annotation__button ob-annotation__button-action cypress-crop-save-button", disabled: !croppedAreaPercent, onClick: handleSaveCrop }, "Save")))));
|
|
18
|
+
return (_jsxs("div", { className: "modal is-active", children: [_jsx("div", { className: "modal-background-faded" }), _jsxs("div", { className: "ob-crop ob-border-radius", children: [_jsx("div", { className: "ob-crop__content ob-border-radius", children: _jsx(ImageCropper, { imgSrc: imageSrc, onCropComplete: setCroppedAreaPercent }) }), _jsxs("div", { className: "ob-annotation__buttons ob-annotation__buttons-actions", children: [_jsx("button", { type: "button", className: "button is-light ob-button ob-annotation__button ob-annotation__button-action cypress-crop-cancel-button", onClick: onClose, children: "Cancel" }), _jsx("button", { type: "button", className: "button is-primary ob-button ob-annotation__button ob-annotation__button-action cypress-crop-save-button", disabled: !croppedAreaPercent, onClick: handleSaveCrop, children: "Save" })] })] })] }));
|
|
25
19
|
}
|
|
26
20
|
export default React.memo(CropModal);
|
|
27
21
|
//# sourceMappingURL=CropModal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CropModal.js","sourceRoot":"","sources":["../../../src/components/ImageCropper/CropModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,YAAY,MAAM,GAAG,CAAA;AAC5B,OAAO,gBAAgB,MAAM,kCAAkC,CAAA;AAG/D,SAAS,SAAS,CAAC,EACjB,Q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C,OAAO,GAAG,EAAE;YACV,gBAAgB,CAAC,eAAe,EAAE,CAAA;QACpC,CAAC,CAAA;IACH,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,OAAO,CACL,eAAK,SAAS,EAAC,iBAAiB,aAC9B,cAAK,SAAS,EAAC,wBAAwB,GAAO,EAC9C,eAAK,SAAS,EAAC,0BAA0B,aACvC,cAAK,SAAS,EAAC,mCAAmC,YAChD,KAAC,YAAY,IACX,MAAM,EAAE,QAAQ,EAChB,cAAc,EAAE,qBAAqB,GACrC,GACE,EACN,eAAK,SAAS,EAAC,uDAAuD,aACpE,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,yGAAyG,EACnH,OAAO,EAAE,OAAO,uBAGT,EACT,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,yGAAyG,EACnH,QAAQ,EAAE,CAAC,kBAAkB,EAC7B,OAAO,EAAE,cAAc,qBAGhB,IACL,IACF,IACF,CACP,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA","sourcesContent":["import * as React from 'react'\nimport ImageCropper from '.'\nimport scrollingService from '../../services/scrolling-service'\nimport { PercentCrop } from 'react-image-crop'\n\nfunction CropModal({\n imageSrc,\n onClose,\n onSave,\n}: {\n imageSrc: string\n onClose: () => void\n onSave: (imageArea: PercentCrop) => void\n}) {\n const [croppedAreaPercent, setCroppedAreaPercent] =\n React.useState<PercentCrop | null>(null)\n\n const handleSaveCrop = React.useCallback(async () => {\n if (!croppedAreaPercent) return\n\n onSave(croppedAreaPercent)\n }, [croppedAreaPercent, onSave])\n\n React.useEffect(() => {\n scrollingService.disableScrolling()\n\n return () => {\n scrollingService.enableScrolling()\n }\n }, [])\n\n return (\n <div className=\"modal is-active\">\n <div className=\"modal-background-faded\"></div>\n <div className=\"ob-crop ob-border-radius\">\n <div className=\"ob-crop__content ob-border-radius\">\n <ImageCropper\n imgSrc={imageSrc}\n onCropComplete={setCroppedAreaPercent}\n />\n </div>\n <div className=\"ob-annotation__buttons ob-annotation__buttons-actions\">\n <button\n type=\"button\"\n className=\"button is-light ob-button ob-annotation__button ob-annotation__button-action cypress-crop-cancel-button\"\n onClick={onClose}\n >\n Cancel\n </button>\n <button\n type=\"button\"\n className=\"button is-primary ob-button ob-annotation__button ob-annotation__button-action cypress-crop-save-button\"\n disabled={!croppedAreaPercent}\n onClick={handleSaveCrop}\n >\n Save\n </button>\n </div>\n </div>\n </div>\n )\n}\n\nexport default React.memo(CropModal)\n"]}
|
|
@@ -7,7 +7,7 @@ declare const _default: React.MemoExoticComponent<({ imgSrc, disabled, onCropCom
|
|
|
7
7
|
onCropComplete: (croppedAreaPixels: PercentCrop) => void;
|
|
8
8
|
outputAspectRatio?: number;
|
|
9
9
|
cropperHeight?: number;
|
|
10
|
-
}) =>
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element>;
|
|
11
11
|
export default _default;
|
|
12
12
|
export declare const getAspectRatio: ({ width, height, }: {
|
|
13
13
|
width: number;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import React, { memo, useEffect } from 'react';
|
|
2
3
|
import ReactImageCrop from 'react-image-crop';
|
|
3
4
|
import { CropContainer } from './resource-components';
|
|
@@ -82,12 +83,9 @@ const ImageCropper = ({ imgSrc, disabled, onCropComplete, outputAspectRatio, cro
|
|
|
82
83
|
};
|
|
83
84
|
}
|
|
84
85
|
}, [imageRef]);
|
|
85
|
-
return (
|
|
86
|
-
React.createElement(CropContainer, { className: "ob-cropper__cropper-wrapper", height: cropperHeight, ref: cropperWrapperRef },
|
|
87
|
-
React.createElement(ReactImageCrop, { crop: crop, aspect: outputAspectRatio, onChange: handleSetCrop, onComplete: handleCropComplete, disabled: disabled, className: clsx('ob-cropper__cropper', {
|
|
86
|
+
return (_jsx("div", { className: "ob-cropper__container", children: _jsx(CropContainer, { className: "ob-cropper__cropper-wrapper", height: cropperHeight, ref: cropperWrapperRef, children: _jsx(ReactImageCrop, { crop: crop, aspect: outputAspectRatio, onChange: handleSetCrop, onComplete: handleCropComplete, disabled: disabled, className: clsx('ob-cropper__cropper', {
|
|
88
87
|
'ob-cropper__cropper-full-height': fullHeight,
|
|
89
|
-
}), ruleOfThirds: true, keepSelection: true }
|
|
90
|
-
React.createElement("img", { src: imgSrc, className: "ob-cropper__image", onLoad: handleLoadImage, ref: imageRef })))));
|
|
88
|
+
}), ruleOfThirds: true, keepSelection: true, children: _jsx("img", { src: imgSrc, className: "ob-cropper__image", onLoad: handleLoadImage, ref: imageRef }) }) }) }));
|
|
91
89
|
};
|
|
92
90
|
export default memo(ImageCropper);
|
|
93
91
|
export const getAspectRatio = ({ width, height, }) => width / height;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ImageCropper/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAC9C,OAAO,cAAqC,MAAM,kBAAkB,CAAA;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAErD,OAAO,IAAI,MAAM,MAAM,CAAA;AAEvB,MAAM,WAAW,GAAgB;IAC/B,IAAI,EAAE,GAAG;IACT,MAAM,EAAE,GAAG;IACX,KAAK,EAAE,GAAG;IACV,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;CACL,CAAA;AAED,MAAM,6BAA6B,GAAG,CAAC,EACrC,iBAAiB,EACjB,UAAU,EACV,WAAW,GAKZ,EAAe,EAAE;IAChB,MAAM,WAAW,GAAG,UAAU,GAAG,WAAW,CAAA;IAE5C,wFAAwF;IACxF,IAAI,KAAa,CAAA;IACjB,IAAI,MAAc,CAAA;IAClB,IAAI,WAAW,IAAI,iBAAiB,EAAE,CAAC;QACrC,oEAAoE;QACpE,MAAM,GAAG,GAAG,CAAA;QACZ,MAAM,aAA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GAAG,CAAC,GAAG,kBAAkB,CAAC,MAAM,CAAA;IAElD,MAAM,sBAAsB,GAAG,GAAG,EAAE,CAClC,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAA;IAC5C,MAAM,sBAAsB,GAAG,GAAG,EAAE,CAClC,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAA;IAE7C,aAAa,CAAC,KAAK,GAAG,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,mCAAI,oBAAoB,EAAE,CAAA;IAC3D,aAAa,CAAC,MAAM,GAAG,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,mCAAI,qBAAqB,EAAE,CAAA;IAE9D,4DAA4D;IAC5D,UAAU,CAAC,SAAS,CAClB,MAAM;IACN,WAAW;IACX,sBAAsB,EAAE;IACxB,WAAW;IACX,sBAAsB,EAAE;IACxB,eAAe;IACf,oBAAoB,EAAE;IACtB,gBAAgB;IAChB,qBAAqB,EAAE;IACvB,gBAAgB;IAChB,CAAC;IACD,gBAAgB;IAChB,CAAC;IACD,oBAAoB;IACpB,aAAa,CAAC,KAAK;IACnB,qBAAqB;IACrB,aAAa,CAAC,MAAM,CACrB,CAAA;IAED,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,aAAa,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;YAC5B,OAAO,CAAC,IAAI,CAAC,CAAA;QACf,CAAC,EAAE,QAAQ,CAAC,CAAA;IACd,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React, { memo, useEffect } from 'react'\nimport ReactImageCrop, { Crop, PercentCrop } from 'react-image-crop'\nimport { CropContainer } from './resource-components'\n\nimport clsx from 'clsx'\nexport { PercentCrop }\nconst defaultCrop: PercentCrop = {\n unit: '%',\n height: 100,\n width: 100,\n x: 0,\n y: 0,\n}\n\nconst getDefaultCropFromAspectRatio = ({\n outputAspectRatio,\n imageWidth,\n imageHeight,\n}: {\n outputAspectRatio: number\n imageWidth: number\n imageHeight: number\n}): PercentCrop => {\n const imageAspect = imageWidth / imageHeight\n\n // Compute the largest rectangle that fits within the image and matches the aspect ratio\n let width: number\n let height: number\n if (imageAspect >= outputAspectRatio) {\n // Image is wider than desired aspect: constrain width by the height\n height = 100\n const widthInPixels = imageHeight * outputAspectRatio\n // as percent\n width = (widthInPixels / imageWidth) * 100\n } else {\n // Image is taller/narrower than desired aspect: constrain height by the width\n width = 100\n const heightInPixels = imageWidth * outputAspectRatio\n // as percent\n height = (heightInPixels / imageHeight) * 100\n }\n\n // Center the crop\n const x = Math.round((100 - width) / 2)\n const y = Math.round((100 - height) / 2)\n\n return {\n unit: '%',\n width,\n height,\n x,\n y,\n }\n}\n\nconst ImageCropper = ({\n imgSrc,\n disabled,\n onCropComplete,\n outputAspectRatio,\n cropperHeight,\n}: {\n imgSrc: string\n disabled?: boolean\n onCropComplete: (croppedAreaPixels: PercentCrop) => void\n outputAspectRatio?: number\n cropperHeight?: number\n}) => {\n const cropperWrapperRef = React.useRef<HTMLDivElement>(null)\n const imageRef = React.useRef<HTMLImageElement>(null)\n\n const [fullHeight, setFullHeight] = React.useState(false)\n\n const [crop, setCrop] = React.useState<Crop | undefined>(() =>\n outputAspectRatio ? undefined : defaultCrop,\n )\n\n const handleSetCrop = React.useCallback((_, c: PercentCrop) => {\n setCrop(c)\n }, [])\n\n const handleCropComplete = React.useCallback(\n (_, c: PercentCrop) => {\n onCropComplete(c)\n },\n [onCropComplete],\n )\n\n const handleLoadImage = React.useCallback(\n ({ currentTarget }: React.SyntheticEvent<HTMLImageElement, Event>) => {\n if (!outputAspectRatio) return\n setCrop(\n getDefaultCropFromAspectRatio({\n outputAspectRatio,\n imageWidth: currentTarget.width,\n imageHeight: currentTarget.height,\n }),\n )\n },\n [outputAspectRatio],\n )\n\n // Resize magic to account for images that are larger than the dialog can hold\n useEffect(() => {\n if (imageRef.current && cropperWrapperRef.current) {\n const resizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n if (!cropperWrapperRef.current) continue\n\n const imageElHeight = entry.contentRect.height\n const cropperWrapperHeight = cropperWrapperRef.current.clientHeight\n\n if (Math.ceil(imageElHeight) < Math.ceil(cropperWrapperHeight)) {\n setFullHeight(false)\n } else {\n setFullHeight(true)\n }\n }\n })\n resizeObserver.observe(imageRef.current)\n\n return () => {\n resizeObserver.disconnect()\n }\n }\n }, [imageRef])\n\n return (\n <div className=\"ob-cropper__container\">\n <CropContainer\n className=\"ob-cropper__cropper-wrapper\"\n height={cropperHeight}\n ref={cropperWrapperRef}\n >\n <ReactImageCrop\n crop={crop}\n aspect={outputAspectRatio}\n onChange={handleSetCrop}\n onComplete={handleCropComplete}\n disabled={disabled}\n className={clsx('ob-cropper__cropper', {\n 'ob-cropper__cropper-full-height': fullHeight,\n })}\n ruleOfThirds\n keepSelection\n >\n <img\n src={imgSrc}\n className=\"ob-cropper__image\"\n onLoad={handleLoadImage}\n ref={imageRef}\n />\n </ReactImageCrop>\n </CropContainer>\n </div>\n )\n}\n\nexport default memo(ImageCropper)\n\nexport const getAspectRatio = ({\n width,\n height,\n}: {\n width: number\n height: number\n}) => width / height\n\nconst createImage = (url: string): Promise<HTMLImageElement> => {\n return new Promise((resolve, reject) => {\n const image = new Image()\n image.onload = () => {\n resolve(image)\n }\n image.onerror = (error) => {\n reject(error)\n }\n image.src = url\n return image\n })\n}\n\nexport const generateCroppedImageBlob = async ({\n croppedAreaPercent,\n imgSrc,\n size,\n fileType,\n}: {\n croppedAreaPercent: PercentCrop\n imgSrc: string\n /**\n * If provided, the cropped image will be resized to the given size. If not\n * provided, the cropped image will be the same size as the cropped portion of\n * the source image.\n */\n size?: {\n width: number\n height: number\n }\n fileType?: string\n}): Promise<Blob | null> => {\n if (!croppedAreaPercent || !imgSrc) {\n return null\n }\n // Source image/canvas\n const image = await createImage(imgSrc)\n const canvas = document.createElement('canvas')\n const ctx = canvas.getContext('2d')\n if (!ctx) {\n return null\n }\n canvas.width = image.width\n canvas.height = image.height\n ctx.drawImage(image, 0, 0)\n\n // Destination image/canvas\n const croppedCanvas = document.createElement('canvas')\n const croppedCtx = croppedCanvas.getContext('2d')\n if (!croppedCtx) {\n return null\n }\n\n const widthPercentAsPixels = () =>\n (image.width / 100) * croppedAreaPercent.width\n const heightPercentAsPixels = () =>\n (image.height / 100) * croppedAreaPercent.height\n\n const sourceXPercentAsPixels = () =>\n (image.width / 100) * croppedAreaPercent.x\n const sourceYPercentAsPixels = () =>\n (image.height / 100) * croppedAreaPercent.y\n\n croppedCanvas.width = size?.width ?? widthPercentAsPixels()\n croppedCanvas.height = size?.height ?? heightPercentAsPixels()\n\n // Draw the cropped source image onto the destination canvas\n croppedCtx.drawImage(\n canvas,\n // source x\n sourceXPercentAsPixels(),\n // source y\n sourceYPercentAsPixels(),\n // source width\n widthPercentAsPixels(),\n // source height\n heightPercentAsPixels(),\n // destination x\n 0,\n // destination y\n 0,\n // destination width\n croppedCanvas.width,\n // destination height\n croppedCanvas.height,\n )\n\n return new Promise((resolve) => {\n croppedCanvas.toBlob((file) => {\n resolve(file)\n }, fileType)\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ImageCropper/index.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAC9C,OAAO,cAAqC,MAAM,kBAAkB,CAAA;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAErD,OAAO,IAAI,MAAM,MAAM,CAAA;AAEvB,MAAM,WAAW,GAAgB;IAC/B,IAAI,EAAE,GAAG;IACT,MAAM,EAAE,GAAG;IACX,KAAK,EAAE,GAAG;IACV,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;CACL,CAAA;AAED,MAAM,6BAA6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AC,IAAI,CAAC,CAAA;QACf,CAAC,EAAE,QAAQ,CAAC,CAAA;IACd,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React, { memo, useEffect } from 'react'\nimport ReactImageCrop, { Crop, PercentCrop } from 'react-image-crop'\nimport { CropContainer } from './resource-components'\n\nimport clsx from 'clsx'\nexport { PercentCrop }\nconst defaultCrop: PercentCrop = {\n unit: '%',\n height: 100,\n width: 100,\n x: 0,\n y: 0,\n}\n\nconst getDefaultCropFromAspectRatio = ({\n outputAspectRatio,\n imageWidth,\n imageHeight,\n}: {\n outputAspectRatio: number\n imageWidth: number\n imageHeight: number\n}): PercentCrop => {\n const imageAspect = imageWidth / imageHeight\n\n // Compute the largest rectangle that fits within the image and matches the aspect ratio\n let width: number\n let height: number\n if (imageAspect >= outputAspectRatio) {\n // Image is wider than desired aspect: constrain width by the height\n height = 100\n const widthInPixels = imageHeight * outputAspectRatio\n // as percent\n width = (widthInPixels / imageWidth) * 100\n } else {\n // Image is taller/narrower than desired aspect: constrain height by the width\n width = 100\n const heightInPixels = imageWidth * outputAspectRatio\n // as percent\n height = (heightInPixels / imageHeight) * 100\n }\n\n // Center the crop\n const x = Math.round((100 - width) / 2)\n const y = Math.round((100 - height) / 2)\n\n return {\n unit: '%',\n width,\n height,\n x,\n y,\n }\n}\n\nconst ImageCropper = ({\n imgSrc,\n disabled,\n onCropComplete,\n outputAspectRatio,\n cropperHeight,\n}: {\n imgSrc: string\n disabled?: boolean\n onCropComplete: (croppedAreaPixels: PercentCrop) => void\n outputAspectRatio?: number\n cropperHeight?: number\n}) => {\n const cropperWrapperRef = React.useRef<HTMLDivElement>(null)\n const imageRef = React.useRef<HTMLImageElement>(null)\n\n const [fullHeight, setFullHeight] = React.useState(false)\n\n const [crop, setCrop] = React.useState<Crop | undefined>(() =>\n outputAspectRatio ? undefined : defaultCrop,\n )\n\n const handleSetCrop = React.useCallback((_: unknown, c: PercentCrop) => {\n setCrop(c)\n }, [])\n\n const handleCropComplete = React.useCallback(\n (_: unknown, c: PercentCrop) => {\n onCropComplete(c)\n },\n [onCropComplete],\n )\n\n const handleLoadImage = React.useCallback(\n ({ currentTarget }: React.SyntheticEvent<HTMLImageElement, Event>) => {\n if (!outputAspectRatio) return\n setCrop(\n getDefaultCropFromAspectRatio({\n outputAspectRatio,\n imageWidth: currentTarget.width,\n imageHeight: currentTarget.height,\n }),\n )\n },\n [outputAspectRatio],\n )\n\n // Resize magic to account for images that are larger than the dialog can hold\n useEffect(() => {\n if (imageRef.current && cropperWrapperRef.current) {\n const resizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n if (!cropperWrapperRef.current) continue\n\n const imageElHeight = entry.contentRect.height\n const cropperWrapperHeight = cropperWrapperRef.current.clientHeight\n\n if (Math.ceil(imageElHeight) < Math.ceil(cropperWrapperHeight)) {\n setFullHeight(false)\n } else {\n setFullHeight(true)\n }\n }\n })\n resizeObserver.observe(imageRef.current)\n\n return () => {\n resizeObserver.disconnect()\n }\n }\n }, [imageRef])\n\n return (\n <div className=\"ob-cropper__container\">\n <CropContainer\n className=\"ob-cropper__cropper-wrapper\"\n height={cropperHeight}\n ref={cropperWrapperRef}\n >\n <ReactImageCrop\n crop={crop}\n aspect={outputAspectRatio}\n onChange={handleSetCrop}\n onComplete={handleCropComplete}\n disabled={disabled}\n className={clsx('ob-cropper__cropper', {\n 'ob-cropper__cropper-full-height': fullHeight,\n })}\n ruleOfThirds\n keepSelection\n >\n <img\n src={imgSrc}\n className=\"ob-cropper__image\"\n onLoad={handleLoadImage}\n ref={imageRef}\n />\n </ReactImageCrop>\n </CropContainer>\n </div>\n )\n}\n\nexport default memo(ImageCropper)\n\nexport const getAspectRatio = ({\n width,\n height,\n}: {\n width: number\n height: number\n}) => width / height\n\nconst createImage = (url: string): Promise<HTMLImageElement> => {\n return new Promise((resolve, reject) => {\n const image = new Image()\n image.onload = () => {\n resolve(image)\n }\n image.onerror = (error) => {\n reject(error)\n }\n image.src = url\n return image\n })\n}\n\nexport const generateCroppedImageBlob = async ({\n croppedAreaPercent,\n imgSrc,\n size,\n fileType,\n}: {\n croppedAreaPercent: PercentCrop\n imgSrc: string\n /**\n * If provided, the cropped image will be resized to the given size. If not\n * provided, the cropped image will be the same size as the cropped portion of\n * the source image.\n */\n size?: {\n width: number\n height: number\n }\n fileType?: string\n}): Promise<Blob | null> => {\n if (!croppedAreaPercent || !imgSrc) {\n return null\n }\n // Source image/canvas\n const image = await createImage(imgSrc)\n const canvas = document.createElement('canvas')\n const ctx = canvas.getContext('2d')\n if (!ctx) {\n return null\n }\n canvas.width = image.width\n canvas.height = image.height\n ctx.drawImage(image, 0, 0)\n\n // Destination image/canvas\n const croppedCanvas = document.createElement('canvas')\n const croppedCtx = croppedCanvas.getContext('2d')\n if (!croppedCtx) {\n return null\n }\n\n const widthPercentAsPixels = () =>\n (image.width / 100) * croppedAreaPercent.width\n const heightPercentAsPixels = () =>\n (image.height / 100) * croppedAreaPercent.height\n\n const sourceXPercentAsPixels = () =>\n (image.width / 100) * croppedAreaPercent.x\n const sourceYPercentAsPixels = () =>\n (image.height / 100) * croppedAreaPercent.y\n\n croppedCanvas.width = size?.width ?? widthPercentAsPixels()\n croppedCanvas.height = size?.height ?? heightPercentAsPixels()\n\n // Draw the cropped source image onto the destination canvas\n croppedCtx.drawImage(\n canvas,\n // source x\n sourceXPercentAsPixels(),\n // source y\n sourceYPercentAsPixels(),\n // source width\n widthPercentAsPixels(),\n // source height\n heightPercentAsPixels(),\n // destination x\n 0,\n // destination y\n 0,\n // destination width\n croppedCanvas.width,\n // destination height\n croppedCanvas.height,\n )\n\n return new Promise((resolve) => {\n croppedCanvas.toBlob((file) => {\n resolve(file)\n }, fileType)\n })\n}\n"]}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { Box, IconButton, Icon } from '@mui/material';
|
|
3
4
|
const InputClear = ({ onClear, select, value }) => {
|
|
4
5
|
if (!value || (Array.isArray(value) && !value.length))
|
|
5
6
|
return null;
|
|
6
|
-
return (
|
|
7
|
-
React.createElement(IconButton, { size: "small", onClick: onClear },
|
|
8
|
-
React.createElement(Icon, null, "close"))));
|
|
7
|
+
return (_jsx(Box, { mr: select ? 2 : 0, alignItems: "center", display: "flex", children: _jsx(IconButton, { size: "small", onClick: onClear, children: _jsx(Icon, { children: "close" }) }) }));
|
|
9
8
|
};
|
|
10
9
|
export default React.memo(InputClear);
|
|
11
10
|
//# sourceMappingURL=InputClear.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputClear.js","sourceRoot":"","sources":["../../src/components/InputClear.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAOrD,MAAM,UAAU,GAAG,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAS,EAAE,EAAE;IACvD,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;QAAE,OAAO,IAAI,CAAA;IAClE,OAAO,CACL,
|
|
1
|
+
{"version":3,"file":"InputClear.js","sourceRoot":"","sources":["../../src/components/InputClear.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAOrD,MAAM,UAAU,GAAG,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAS,EAAE,EAAE;IACvD,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;QAAE,OAAO,IAAI,CAAA;IAClE,OAAO,CACL,KAAC,GAAG,IAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,UAAU,EAAC,QAAQ,EAAC,OAAO,EAAC,MAAM,YACzD,KAAC,UAAU,IAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,OAAO,YACvC,KAAC,IAAI,wBAAa,GACP,GACT,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,KAAK,CAAC,IAAI,CAAQ,UAAU,CAAC,CAAA","sourcesContent":["import * as React from 'react'\nimport { Box, IconButton, Icon } from '@mui/material'\ninterface Props {\n onClear: () => void\n select?: boolean\n value: unknown\n}\n\nconst InputClear = ({ onClear, select, value }: Props) => {\n if (!value || (Array.isArray(value) && !value.length)) return null\n return (\n <Box mr={select ? 2 : 0} alignItems=\"center\" display=\"flex\">\n <IconButton size=\"small\" onClick={onClear}>\n <Icon>close</Icon>\n </IconButton>\n </Box>\n )\n}\n\nexport default React.memo<Props>(InputClear)\n"]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
type Props =
|
|
2
|
+
import { TextFieldProps } from '@mui/material';
|
|
3
|
+
type Props = TextFieldProps & {
|
|
4
4
|
onClear?: () => void;
|
|
5
|
+
InputProps?: NonNullable<TextFieldProps['slotProps']>['input'];
|
|
5
6
|
};
|
|
6
7
|
declare const _default: React.NamedExoticComponent<Props>;
|
|
7
8
|
export default _default;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { TextField } from '@mui/material';
|
|
3
4
|
import InputClear from './InputClear';
|
|
@@ -7,11 +8,13 @@ const InputField = ({ margin = 'dense', variant = 'outlined', size = 'small', In
|
|
|
7
8
|
return InputProps;
|
|
8
9
|
if (onClear) {
|
|
9
10
|
return {
|
|
10
|
-
endAdornment: (
|
|
11
|
+
endAdornment: (_jsx(InputClear, { select: props.select, value: props.value, onClear: onClear })),
|
|
11
12
|
};
|
|
12
13
|
}
|
|
13
14
|
}, [InputProps, onClear, props.select, props.value]);
|
|
14
|
-
return (
|
|
15
|
+
return (_jsx(TextField, { variant: variant, margin: margin, slotProps: {
|
|
16
|
+
input: inputProps,
|
|
17
|
+
}, size: size, ...props }));
|
|
15
18
|
};
|
|
16
19
|
export default React.memo(InputField);
|
|
17
20
|
//# sourceMappingURL=InputField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputField.js","sourceRoot":"","sources":["../../src/components/InputField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"InputField.js","sourceRoot":"","sources":["../../src/components/InputField.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,SAAS,EAAkB,MAAM,eAAe,CAAA;AACzD,OAAO,UAAU,MAAM,cAAc,CAAA;AAOrC,MAAM,UAAU,GAAG,CAAC,EAClB,MAAM,GAAG,OAAO,EAChB,OAAO,GAAG,UAAU,EACpB,IAAI,GAAG,OAAO,EACd,UAAU,EACV,OAAO,EACP,GAAG,KAAK,EACF,EAAE,EAAE;IACV,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACpC,IAAI,UAAU;YAAE,OAAO,UAAU,CAAA;QACjC,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO;gBACL,YAAY,EAAE,CACZ,KAAC,UAAU,IACT,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,OAAO,EAAE,OAAO,GAChB,CACH;aACF,CAAA;QACH,CAAC;IACH,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAA;IAEpD,OAAO,CACL,KAAC,SAAS,IACR,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE;YACT,KAAK,EAAE,UAAU;SAClB,EACD,IAAI,EAAE,IAAI,KACN,KAAK,GACT,CACH,CAAA;AACH,CAAC,CAAA;AAED,eAAe,KAAK,CAAC,IAAI,CAAQ,UAAU,CAAC,CAAA","sourcesContent":["import * as React from 'react'\nimport { TextField, TextFieldProps } from '@mui/material'\nimport InputClear from './InputClear'\n\ntype Props = TextFieldProps & {\n onClear?: () => void\n InputProps?: NonNullable<TextFieldProps['slotProps']>['input']\n}\n\nconst InputField = ({\n margin = 'dense',\n variant = 'outlined',\n size = 'small',\n InputProps,\n onClear,\n ...props\n}: Props) => {\n const inputProps = React.useMemo(() => {\n if (InputProps) return InputProps\n if (onClear) {\n return {\n endAdornment: (\n <InputClear\n select={props.select}\n value={props.value}\n onClear={onClear}\n />\n ),\n }\n }\n }, [InputProps, onClear, props.select, props.value])\n\n return (\n <TextField\n variant={variant}\n margin={margin}\n slotProps={{\n input: inputProps,\n }}\n size={size}\n {...props}\n />\n )\n}\n\nexport default React.memo<Props>(InputField)\n"]}
|
|
@@ -6,10 +6,5 @@ type ListItemsProps = {
|
|
|
6
6
|
};
|
|
7
7
|
export declare const OrderedList: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<Theme> & ListItemsProps, React.DetailedHTMLProps<React.OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, {}>;
|
|
8
8
|
export declare const UnorderedList: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<Theme> & ListItemsProps, React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, {}>;
|
|
9
|
-
|
|
10
|
-
spaced?: boolean;
|
|
11
|
-
};
|
|
12
|
-
export declare const ListItem: import("@emotion/styled").StyledComponent<Omit<import("@mui/material").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
13
|
-
ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
|
|
14
|
-
}, "className" | "p" | "style" | "children" | "classes" | "sx" | "color" | "height" | "width" | "display" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "order" | "overflow" | "visibility" | "align" | "top" | "bottom" | "right" | "left" | "border" | "boxShadow" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "boxSizing" | "columnGap" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "justifyContent" | "justifyItems" | "justifySelf" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "whiteSpace" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "padding" | "paddingBlock" | "paddingInline" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint" | "variant" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping">, "ref"> & import("@mui/system").MUIStyledCommonProps<Theme> & ListProps, {}, {}>;
|
|
9
|
+
export declare const ListItem: import("@emotion/styled").StyledComponent<any, {}, {}>;
|
|
15
10
|
export {};
|
package/dist/components/Lists.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import Typography from '@mui/material/Typography';
|
|
3
3
|
import { styled } from '@mui/material';
|
|
4
4
|
const noPaddingY = {
|
|
@@ -28,7 +28,7 @@ export const UnorderedList = styled('ul', {
|
|
|
28
28
|
};
|
|
29
29
|
});
|
|
30
30
|
function Li(props) {
|
|
31
|
-
return (
|
|
31
|
+
return (_jsx(Typography, { ...props, component: "li", color: "inherit", variant: "body2" }));
|
|
32
32
|
}
|
|
33
33
|
export const ListItem = styled(Li, {
|
|
34
34
|
shouldForwardProp: (prop) => prop !== 'spaced',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Lists.js","sourceRoot":"","sources":["../../src/components/Lists.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Lists.js","sourceRoot":"","sources":["../../src/components/Lists.tsx"],"names":[],"mappings":";AACA,OAAO,UAAU,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,MAAM,EAAS,MAAM,eAAe,CAAA;AAO7C,MAAM,UAAU,GAAG;IACjB,UAAU,EAAE,CAAC;IACb,aAAa,EAAE,CAAC;CACjB,CAAA;AAED,MAAM,aAAa,GAAG,CAAC,KAAY,EAAE,EAAE,CAAC,CAAC;IACvC,MAAM,EAAE,CAAC;IACT,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IAClC,SAAS,EAAE,SAAS;IACpB,gBAAgB,EAAE,UAAU;CAC7B,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,EAAE;IACtC,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,gBAAgB;CACvD,CAAC,CAAiB,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE;IAC/C,OAAO;QACL,GAAG,aAAa,CAAC,KAAK,CAAC;QACvB,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;KACtC,CAAA;AACH,CAAC,CAAC,CAAA;AACF,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,EAAE;IACxC,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,gBAAgB;CACvD,CAAC,CAAiB,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE;IAC/C,OAAO;QACL,GAAG,aAAa,CAAC,KAAK,CAAC;QACvB,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;KACtC,CAAA;AACH,CAAC,CAAC,CAAA;AAMF,SAAS,EAAE,CAAC,KAA2D;IACrE,OAAO,CACL,KAAC,UAAU,OAAK,KAAK,EAAE,SAAS,EAAC,IAAI,EAAC,KAAK,EAAC,SAAS,EAAC,OAAO,EAAC,OAAO,GAAG,CACzE,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,EAAE,EAAE;IACjC,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,QAAQ;CAC/C,CAAC,CAAY,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE;IAC3B,OAAO;QACL,OAAO,EAAE,WAAW;QACpB,GAAG,CAAC,MAAM;YACR,CAAC,CAAC;gBACE,UAAU,EAAE,GAAG;aAChB;YACH,CAAC,CAAC,EAAE,CAAC;KACR,CAAA;AACH,CAAC,CAAC,CAAA","sourcesContent":["import * as React from 'react'\nimport Typography from '@mui/material/Typography'\nimport { styled, Theme } from '@mui/material'\n\ntype ListItemsProps = {\n children: React.ReactNode\n disablePadding?: boolean\n}\n\nconst noPaddingY = {\n paddingTop: 0,\n paddingBottom: 0,\n}\n\nconst getListStyles = (theme: Theme) => ({\n margin: 0,\n padding: theme.spacing(1, 1, 1, 4),\n listStyle: 'inherit',\n '& > ul, & > ol': noPaddingY,\n})\n\nexport const OrderedList = styled('ol', {\n shouldForwardProp: (prop) => prop !== 'disablePadding',\n})<ListItemsProps>(({ theme, disablePadding }) => {\n return {\n ...getListStyles(theme),\n ...(disablePadding ? noPaddingY : {}),\n }\n})\nexport const UnorderedList = styled('ul', {\n shouldForwardProp: (prop) => prop !== 'disablePadding',\n})<ListItemsProps>(({ theme, disablePadding }) => {\n return {\n ...getListStyles(theme),\n ...(disablePadding ? noPaddingY : {}),\n }\n})\n\ntype ListProps = {\n spaced?: boolean\n}\n\nfunction Li(props: Omit<React.ComponentProps<typeof Typography>, 'ref'>) {\n return (\n <Typography {...props} component=\"li\" color=\"inherit\" variant=\"body2\" />\n )\n}\n\nexport const ListItem = styled(Li, {\n shouldForwardProp: (prop) => prop !== 'spaced',\n})<ListProps>(({ spaced }) => {\n return {\n display: 'list-item',\n ...(spaced\n ? {\n lineHeight: 1.9,\n }\n : {}),\n }\n})\n"]}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { Box, CircularProgress, Grid, Typography } from '@mui/material';
|
|
3
4
|
const Loading = ({ message }) => {
|
|
4
|
-
return (
|
|
5
|
-
React.createElement(Grid, { container: true, spacing: 2, className: "ob-loading" },
|
|
6
|
-
React.createElement(Grid, { xs: 12, container: true, item: true, justifyContent: "center" },
|
|
7
|
-
React.createElement(CircularProgress, null)),
|
|
8
|
-
message && (React.createElement(Grid, { xs: 12, container: true, item: true, justifyContent: "center", className: "ob-loading-message" },
|
|
9
|
-
React.createElement(Typography, { variant: "body2", align: "center" }, message))))));
|
|
5
|
+
return (_jsx(Box, { p: 2, className: "ob-loading-with-message", children: _jsxs(Grid, { container: true, spacing: 2, className: "ob-loading", children: [_jsx(Grid, { size: { xs: 12 }, container: true, justifyContent: "center", children: _jsx(CircularProgress, {}) }), message && (_jsx(Grid, { size: { xs: 12 }, container: true, justifyContent: "center", className: "ob-loading-message", children: _jsx(Typography, { variant: "body2", align: "center", children: message }) }))] }) }));
|
|
10
6
|
};
|
|
11
7
|
export default React.memo(Loading);
|
|
12
8
|
//# sourceMappingURL=LoadingWithMessage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadingWithMessage.js","sourceRoot":"","sources":["../../src/components/LoadingWithMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,GAAG,EAAE,gBAAgB,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAKvE,MAAM,OAAO,GAAG,CAAC,EAAE,OAAO,EAAS,EAAE,EAAE;IACrC,OAAO,CACL,
|
|
1
|
+
{"version":3,"file":"LoadingWithMessage.js","sourceRoot":"","sources":["../../src/components/LoadingWithMessage.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,GAAG,EAAE,gBAAgB,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAKvE,MAAM,OAAO,GAAG,CAAC,EAAE,OAAO,EAAS,EAAE,EAAE;IACrC,OAAO,CACL,KAAC,GAAG,IAAC,CAAC,EAAE,CAAC,EAAE,SAAS,EAAC,yBAAyB,YAC5C,MAAC,IAAI,IAAC,SAAS,QAAC,OAAO,EAAE,CAAC,EAAE,SAAS,EAAC,YAAY,aAChD,KAAC,IAAI,IAAC,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,SAAS,QAAC,cAAc,EAAC,QAAQ,YACvD,KAAC,gBAAgB,KAAoB,GAChC,EACN,OAAO,IAAI,CACV,KAAC,IAAI,IACH,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAChB,SAAS,QACT,cAAc,EAAC,QAAQ,EACvB,SAAS,EAAC,oBAAoB,YAE9B,KAAC,UAAU,IAAC,OAAO,EAAC,OAAO,EAAC,KAAK,EAAC,QAAQ,YACvC,OAAO,GACG,GACR,CACR,IACI,GACH,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,KAAK,CAAC,IAAI,CAAQ,OAAO,CAAC,CAAA","sourcesContent":["import * as React from 'react'\nimport { Box, CircularProgress, Grid, Typography } from '@mui/material'\ntype Props = {\n message?: string\n}\n\nconst Loading = ({ message }: Props) => {\n return (\n <Box p={2} className=\"ob-loading-with-message\">\n <Grid container spacing={2} className=\"ob-loading\">\n <Grid size={{ xs: 12 }} container justifyContent=\"center\">\n <CircularProgress></CircularProgress>\n </Grid>\n {message && (\n <Grid\n size={{ xs: 12 }}\n container\n justifyContent=\"center\"\n className=\"ob-loading-message\"\n >\n <Typography variant=\"body2\" align=\"center\">\n {message}\n </Typography>\n </Grid>\n )}\n </Grid>\n </Box>\n )\n}\n\nexport default React.memo<Props>(Loading)\n"]}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}, "className" | "style" | "children" | "classes" | "sx" | "color" | "fontSize" | "baseClassName">, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
5
|
-
export default _default;
|
|
2
|
+
import { Icon } from '@mui/material';
|
|
3
|
+
export default function MaterialIcon({ className, ref, ...props }: React.ComponentProps<typeof Icon>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Icon } from '@mui/material';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
-
export default
|
|
5
|
-
return (
|
|
6
|
-
}
|
|
4
|
+
export default function MaterialIcon({ className, ref, ...props }) {
|
|
5
|
+
return (_jsx(Icon, { ref: ref, role: "img", className: clsx('ob-icon', className), "aria-hidden": true, ...props }));
|
|
6
|
+
}
|
|
7
7
|
//# sourceMappingURL=MaterialIcon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MaterialIcon.js","sourceRoot":"","sources":["../../src/components/MaterialIcon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MaterialIcon.js","sourceRoot":"","sources":["../../src/components/MaterialIcon.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,IAAI,MAAM,MAAM,CAAA;AAEvB,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EAC0B;IAClC,OAAO,CACL,KAAC,IAAI,IACH,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,KAAK,EACV,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,0BAEjC,KAAK,GACT,CACH,CAAA;AACH,CAAC","sourcesContent":["import * as React from 'react'\nimport { Icon } from '@mui/material'\nimport clsx from 'clsx'\n\nexport default function MaterialIcon({\n className,\n ref,\n ...props\n}: React.ComponentProps<typeof Icon>) {\n return (\n <Icon\n ref={ref}\n role=\"img\"\n className={clsx('ob-icon', className)}\n aria-hidden\n {...props}\n />\n )\n}\n"]}
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
export declare function NotificationGrid({ className, gridClassName, children, }: React.PropsWithChildren<{
|
|
3
3
|
gridClassName: string;
|
|
4
4
|
className: string;
|
|
5
|
-
}>):
|
|
5
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export declare function NotificationGridItem({ label, value, fullWidth, className, labelClassName, valueClassName, }: {
|
|
7
7
|
label: string;
|
|
8
8
|
value: string | undefined;
|
|
@@ -10,4 +10,4 @@ export declare function NotificationGridItem({ label, value, fullWidth, classNam
|
|
|
10
10
|
className: string;
|
|
11
11
|
labelClassName: string;
|
|
12
12
|
valueClassName: string;
|
|
13
|
-
}):
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Grid } from '@mui/material';
|
|
3
3
|
export function NotificationGrid({ className, gridClassName, children, }) {
|
|
4
|
-
return (
|
|
5
|
-
React.createElement(Grid, { container: true, spacing: 1, className: gridClassName }, children)));
|
|
4
|
+
return (_jsx("div", { className: `notification ${className}`, children: _jsx(Grid, { container: true, spacing: 1, className: gridClassName, children: children }) }));
|
|
6
5
|
}
|
|
7
6
|
export function NotificationGridItem({ label, value, fullWidth, className, labelClassName, valueClassName, }) {
|
|
8
7
|
if (!value) {
|
|
9
8
|
return null;
|
|
10
9
|
}
|
|
11
|
-
return (
|
|
10
|
+
return (_jsxs(Grid, { className: className, sx: (theme) => ({
|
|
12
11
|
flexBasis: '100%',
|
|
13
12
|
flexGrow: 0,
|
|
14
13
|
maxWidth: '100%',
|
|
@@ -24,8 +23,6 @@ export function NotificationGridItem({ label, value, fullWidth, className, label
|
|
|
24
23
|
maxWidth: '33.33%',
|
|
25
24
|
},
|
|
26
25
|
}),
|
|
27
|
-
}) },
|
|
28
|
-
React.createElement("label", { className: `is-size-6 has-text-weight-semibold ${labelClassName}` }, label),
|
|
29
|
-
React.createElement("div", { className: valueClassName }, value)));
|
|
26
|
+
}), children: [_jsx("label", { className: `is-size-6 has-text-weight-semibold ${labelClassName}`, children: label }), _jsx("div", { className: valueClassName, children: value })] }));
|
|
30
27
|
}
|
|
31
28
|
//# sourceMappingURL=NotificationGrid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationGrid.js","sourceRoot":"","sources":["../../src/components/NotificationGrid.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NotificationGrid.js","sourceRoot":"","sources":["../../src/components/NotificationGr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CACR,CAAA;AACH,CAAC","sourcesContent":["import * as React from 'react'\nimport { Grid } from '@mui/material'\n\nexport function NotificationGrid({\n className,\n gridClassName,\n children,\n}: React.PropsWithChildren<{\n gridClassName: string\n className: string\n}>) {\n return (\n <div className={`notification ${className}`}>\n <Grid container spacing={1} className={gridClassName}>\n {children}\n </Grid>\n </div>\n )\n}\n\nexport function NotificationGridItem({\n label,\n value,\n fullWidth,\n className,\n labelClassName,\n valueClassName,\n}: {\n label: string\n value: string | undefined\n fullWidth?: boolean\n className: string\n labelClassName: string\n valueClassName: string\n}) {\n if (!value) {\n return null\n }\n\n return (\n <Grid\n className={className}\n sx={(theme) => ({\n flexBasis: '100%',\n flexGrow: 0,\n maxWidth: '100%',\n\n ...(fullWidth\n ? {}\n : {\n [theme.breakpoints.up('sm').replace('@media', '@container')]: {\n flexBasis: '50%',\n maxWidth: '50%',\n },\n [theme.breakpoints.up('lg').replace('@media', '@container')]: {\n flexBasis: '33.33%',\n maxWidth: '33.33%',\n },\n }),\n })}\n >\n <label className={`is-size-6 has-text-weight-semibold ${labelClassName}`}>\n {label}\n </label>\n <div className={valueClassName}>{value}</div>\n </Grid>\n )\n}\n"]}
|