@anzusystems/common-admin 2.0.0-rc.25 → 2.0.0-rc.27
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/AnzuSystemsCommonAdmin.d.ts +22 -1
- package/dist/AnzuSystemsCommonAdmin.js.map +1 -1
- package/dist/common-admin.css +1 -1
- package/dist/common-admin.js +185 -181
- package/dist/domains/anzuUser/components/AAnzuUserDatatable.vue_vue_type_script_setup_true_lang.js +101 -100
- package/dist/domains/anzuUser/components/AAnzuUserDatatable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/anzuUser/components/AUserCreateInSystemButton.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/domains/anzuUser/components/AUserMetadataRepairDialog.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/domains/anzuUser/components/AUserMetadataRepairDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/anzuUser/components/AUserSystemOverview.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/domains/auth/composables/refreshSession.d.ts +7 -0
- package/dist/domains/auth/composables/refreshSession.js +26 -19
- package/dist/domains/auth/composables/refreshSession.js.map +1 -1
- package/dist/domains/auth/composables/sessionEnd.d.ts +37 -0
- package/dist/domains/auth/composables/sessionEnd.js +65 -0
- package/dist/domains/auth/composables/sessionEnd.js.map +1 -0
- package/dist/domains/collab/components/ACollabCountdown.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/domains/collab/components/ACollabCountdown.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/collab/composables/collabInit.js +13 -13
- package/dist/domains/collab/composables/collabInit.js.map +1 -1
- package/dist/domains/collab/composables/collabRoom.js +98 -96
- package/dist/domains/collab/composables/collabRoom.js.map +1 -1
- package/dist/domains/collab/composables/collabState.d.ts +1 -0
- package/dist/domains/collab/composables/collabState.js +6 -5
- package/dist/domains/collab/composables/collabState.js.map +1 -1
- package/dist/domains/customDataForm/components/ACustomDataForm.vue_vue_type_script_setup_true_lang.js +53 -52
- package/dist/domains/customDataForm/components/ACustomDataForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/customDataForm/components/ACustomDataFormElement.vue_vue_type_script_setup_true_lang.js +78 -77
- package/dist/domains/customDataForm/components/ACustomDataFormElement.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/customDataForm/types/CustomDataForm.d.ts +3 -0
- package/dist/domains/customDataForm/utils/customDataFormElementName.d.ts +18 -0
- package/dist/domains/customDataForm/utils/customDataFormElementName.js +9 -0
- package/dist/domains/customDataForm/utils/customDataFormElementName.js.map +1 -0
- package/dist/domains/dam/api/damAssetApi.d.ts +1 -1
- package/dist/domains/dam/api/damAssetApi.js +90 -85
- package/dist/domains/dam/api/damAssetApi.js.map +1 -1
- package/dist/domains/dam/assetDetail/components/AssetImage.vue.d.ts +11 -1
- package/dist/domains/dam/assetDetail/components/AssetImage.vue_vue_type_script_setup_true_lang.js +31 -7
- package/dist/domains/dam/assetDetail/components/AssetImage.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetDetail/components/AssetImageMetaIcons.vue.d.ts +10 -0
- package/dist/domains/dam/assetDetail/components/AssetImageMetaIcons.vue_vue_type_script_setup_true_lang.js +59 -32
- package/dist/domains/dam/assetDetail/components/AssetImageMetaIcons.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetDetail/store/assetDetailStore.d.ts +8 -0
- package/dist/domains/dam/assetSelect/components/AAssetListInner.vue.d.ts +8 -0
- package/dist/domains/dam/assetSelect/components/AAssetSelect.vue.d.ts +10 -2
- package/dist/domains/dam/assetSelect/components/AAssetSelect.vue_vue_type_script_setup_true_lang.js +148 -113
- package/dist/domains/dam/assetSelect/components/AAssetSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetSelect/components/AAssetSelectMedia.vue.d.ts +6 -2
- package/dist/domains/dam/assetSelect/components/AAssetSelectMedia.vue_vue_type_script_setup_true_lang.js +143 -108
- package/dist/domains/dam/assetSelect/components/AAssetSelectMedia.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetSelect/components/AssetImagePreview.vue.d.ts +9 -2
- package/dist/domains/dam/assetSelect/components/AssetImagePreview.vue_vue_type_script_setup_true_lang.js +23 -5
- package/dist/domains/dam/assetSelect/components/AssetImagePreview.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetSelect/components/AssetSelectDetailTabs.js +6 -0
- package/dist/domains/dam/assetSelect/components/AssetSelectDetailTabs.js.map +1 -0
- package/dist/domains/dam/assetSelect/components/AssetSelectDetailTabs.vue.d.ts +25 -0
- package/dist/domains/dam/assetSelect/components/AssetSelectDetailTabs.vue_vue_type_script_setup_true_lang.js +59 -0
- package/dist/domains/dam/assetSelect/components/AssetSelectDetailTabs.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/domains/dam/assetSelect/components/AssetSelectListTable.js +1 -0
- package/dist/domains/dam/assetSelect/components/AssetSelectListTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetSelect/components/AssetSelectListTiles.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetSelect/components/AssetSelectSingleUseUsage.js +6 -0
- package/dist/domains/dam/assetSelect/components/AssetSelectSingleUseUsage.js.map +1 -0
- package/dist/domains/dam/assetSelect/components/AssetSelectSingleUseUsage.vue.d.ts +11 -0
- package/dist/domains/dam/assetSelect/components/AssetSelectSingleUseUsage.vue_vue_type_script_setup_true_lang.js +92 -0
- package/dist/domains/dam/assetSelect/components/AssetSelectSingleUseUsage.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/domains/dam/assetSelect/components/AssetSelectTableRowItem.vue_vue_type_script_setup_true_lang.js +35 -27
- package/dist/domains/dam/assetSelect/components/AssetSelectTableRowItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetSelect/components/AssetSelectTilesItem.vue_vue_type_script_setup_true_lang.js +35 -27
- package/dist/domains/dam/assetSelect/components/AssetSelectTilesItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetSelect/composables/assetSelectDisabledReason.d.ts +18 -0
- package/dist/domains/dam/assetSelect/composables/assetSelectDisabledReason.js +28 -0
- package/dist/domains/dam/assetSelect/composables/assetSelectDisabledReason.js.map +1 -0
- package/dist/domains/dam/assetSelect/composables/assetSelectItemActions.d.ts +4 -0
- package/dist/domains/dam/assetSelect/composables/assetSelectItemActions.js +37 -28
- package/dist/domains/dam/assetSelect/composables/assetSelectItemActions.js.map +1 -1
- package/dist/domains/dam/assetSelect/composables/assetSelectListActions.d.ts +46 -3
- package/dist/domains/dam/assetSelect/composables/assetSelectListActions.js +136 -93
- package/dist/domains/dam/assetSelect/composables/assetSelectListActions.js.map +1 -1
- package/dist/domains/dam/assetSelect/composables/assetSelectSingleUseUsage.d.ts +848 -0
- package/dist/domains/dam/assetSelect/composables/assetSelectSingleUseUsage.js +83 -0
- package/dist/domains/dam/assetSelect/composables/assetSelectSingleUseUsage.js.map +1 -0
- package/dist/domains/dam/assetSelect/composables/assetSelectTakeOver.d.ts +17 -0
- package/dist/domains/dam/assetSelect/composables/assetSelectTakeOver.js +23 -0
- package/dist/domains/dam/assetSelect/composables/assetSelectTakeOver.js.map +1 -0
- package/dist/domains/dam/assetSelect/filter/AssetFilter.d.ts +3 -3
- package/dist/domains/dam/assetSelect/filter/AssetFilter.js +1 -1
- package/dist/domains/dam/assetSelect/filter/AssetFilter.js.map +1 -1
- package/dist/domains/dam/assetSelect/store/assetSelectStore.d.ts +118 -4
- package/dist/domains/dam/assetSelect/store/assetSelectStore.js +135 -87
- package/dist/domains/dam/assetSelect/store/assetSelectStore.js.map +1 -1
- package/dist/domains/dam/author/composables/authorActions.js +3 -1
- package/dist/domains/dam/author/composables/authorActions.js.map +1 -1
- package/dist/domains/dam/author/composables/cachedAuthors.js +6 -2
- package/dist/domains/dam/author/composables/cachedAuthors.js.map +1 -1
- package/dist/domains/dam/author/composables/damCredit.d.ts +3 -1
- package/dist/domains/dam/author/composables/damCredit.js +13 -12
- package/dist/domains/dam/author/composables/damCredit.js.map +1 -1
- package/dist/domains/dam/author/composables/damSourceBadge.d.ts +13 -0
- package/dist/domains/dam/author/composables/damSourceBadge.js +11 -0
- package/dist/domains/dam/author/composables/damSourceBadge.js.map +1 -0
- package/dist/domains/dam/author/factory/AuthorFactory.js +2 -0
- package/dist/domains/dam/author/factory/AuthorFactory.js.map +1 -1
- package/dist/domains/dam/author/types/DamAuthor.d.ts +8 -0
- package/dist/domains/dam/composables/commonAdminCoreDamOptions.d.ts +3 -0
- package/dist/domains/dam/composables/commonAdminCoreDamOptions.js +4 -1
- package/dist/domains/dam/composables/commonAdminCoreDamOptions.js.map +1 -1
- package/dist/domains/dam/config/api/damAssetCustomFormApi.js +17 -16
- package/dist/domains/dam/config/api/damAssetCustomFormApi.js.map +1 -1
- package/dist/domains/dam/cropper/components/DamAssetImageRoiSelect.vue_vue_type_script_setup_true_lang.js +62 -48
- package/dist/domains/dam/cropper/components/DamAssetImageRoiSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/cropper/store/imageRoiStore.d.ts +2 -0
- package/dist/domains/dam/imageWidget/components/AImageMediaWidget.vue.d.ts +14 -1
- package/dist/domains/dam/imageWidget/components/AImageMediaWidget.vue_vue_type_script_setup_true_lang.js +7 -1
- package/dist/domains/dam/imageWidget/components/AImageMediaWidget.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/AImagePublicInput.vue.d.ts +6 -1
- package/dist/domains/dam/imageWidget/components/AImagePublicInput.vue_vue_type_script_setup_true_lang.js +91 -88
- package/dist/domains/dam/imageWidget/components/AImagePublicInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/AImageWidget.vue.d.ts +14 -1
- package/dist/domains/dam/imageWidget/components/AImageWidget.vue_vue_type_script_setup_true_lang.js +7 -1
- package/dist/domains/dam/imageWidget/components/AImageWidget.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/AImageWidgetMultiple.vue.d.ts +14 -0
- package/dist/domains/dam/imageWidget/components/AImageWidgetMultiple.vue_vue_type_script_setup_true_lang.js +7 -1
- package/dist/domains/dam/imageWidget/components/AImageWidgetMultiple.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/AImageWidgetSimple.vue.d.ts +6 -0
- package/dist/domains/dam/imageWidget/components/ImageDetailDialogMetadata.vue.d.ts +7 -0
- package/dist/domains/dam/imageWidget/components/ImageDetailDialogMetadata.vue_vue_type_script_setup_true_lang.js +123 -111
- package/dist/domains/dam/imageWidget/components/ImageDetailDialogMetadata.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/ImageDetailSingleUseWarning.js +6 -0
- package/dist/domains/dam/imageWidget/components/ImageDetailSingleUseWarning.js.map +1 -0
- package/dist/domains/dam/imageWidget/components/ImageDetailSingleUseWarning.vue.d.ts +11 -0
- package/dist/domains/dam/imageWidget/components/ImageDetailSingleUseWarning.vue_vue_type_script_setup_true_lang.js +59 -0
- package/dist/domains/dam/imageWidget/components/ImageDetailSingleUseWarning.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/domains/dam/imageWidget/components/ImageMediaWidgetInner.vue.d.ts +18 -1
- package/dist/domains/dam/imageWidget/components/ImageMediaWidgetInner.vue_vue_type_script_setup_true_lang.js +338 -337
- package/dist/domains/dam/imageWidget/components/ImageMediaWidgetInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/ImageWidgetInner.vue.d.ts +22 -1
- package/dist/domains/dam/imageWidget/components/ImageWidgetInner.vue_vue_type_script_setup_true_lang.js +366 -363
- package/dist/domains/dam/imageWidget/components/ImageWidgetInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleInner.vue.d.ts +18 -0
- package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleInner.vue_vue_type_script_setup_true_lang.js +376 -311
- package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/imageWidget/composables/commonAdminImageOptions.d.ts +9 -0
- package/dist/domains/dam/imageWidget/composables/commonAdminImageOptions.js +19 -17
- package/dist/domains/dam/imageWidget/composables/commonAdminImageOptions.js.map +1 -1
- package/dist/domains/dam/imageWidget/composables/imageApiCms.d.ts +36 -1
- package/dist/domains/dam/imageWidget/composables/imageApiCms.js +84 -36
- package/dist/domains/dam/imageWidget/composables/imageApiCms.js.map +1 -1
- package/dist/domains/dam/imageWidget/composables/imageDialogDamAuthors.d.ts +5 -0
- package/dist/domains/dam/imageWidget/composables/imageDialogDamAuthors.js +93 -80
- package/dist/domains/dam/imageWidget/composables/imageDialogDamAuthors.js.map +1 -1
- package/dist/domains/dam/imageWidget/composables/imageSaveErrors.d.ts +8 -0
- package/dist/domains/dam/imageWidget/composables/imageSaveErrors.js +22 -0
- package/dist/domains/dam/imageWidget/composables/imageSaveErrors.js.map +1 -0
- package/dist/domains/dam/imageWidget/composables/imageSingleUseUsageFetch.d.ts +11 -0
- package/dist/domains/dam/imageWidget/composables/imageSingleUseUsageFetch.js +15 -0
- package/dist/domains/dam/imageWidget/composables/imageSingleUseUsageFetch.js.map +1 -0
- package/dist/domains/dam/imageWidget/store/imageMediaWidgetStore.d.ts +8 -0
- package/dist/domains/dam/imageWidget/store/imageStore.d.ts +15 -0
- package/dist/domains/dam/imageWidget/store/imageStore.js +24 -14
- package/dist/domains/dam/imageWidget/store/imageStore.js.map +1 -1
- package/dist/domains/dam/imageWidget/utils/damImage.d.ts +10 -1
- package/dist/domains/dam/imageWidget/utils/damImage.js +24 -12
- package/dist/domains/dam/imageWidget/utils/damImage.js.map +1 -1
- package/dist/domains/dam/types/Asset.d.ts +29 -1
- package/dist/domains/dam/types/Asset.js +9 -2
- package/dist/domains/dam/types/Asset.js.map +1 -1
- package/dist/domains/dam/types/AssetFile.d.ts +1 -0
- package/dist/domains/dam/types/AssetFile.js.map +1 -1
- package/dist/domains/dam/types/AssetLicence.d.ts +6 -1
- package/dist/domains/dam/types/AssetSelect.d.ts +9 -4
- package/dist/domains/dam/types/AssetSelect.js.map +1 -1
- package/dist/domains/dam/types/ImageAware.d.ts +9 -0
- package/dist/domains/dam/types/ImageAware.js +7 -0
- package/dist/domains/dam/types/ImageAware.js.map +1 -0
- package/dist/domains/dam/uploadQueue/components/AssetCustomMetadataFormMassOperations.vue_vue_type_script_setup_true_lang.js +42 -41
- package/dist/domains/dam/uploadQueue/components/AssetCustomMetadataFormMassOperations.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/uploadQueue/components/UploadQueueDialog.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/domains/dam/uploadQueue/components/UploadQueueEditable.vue_vue_type_script_setup_true_lang.js +59 -58
- package/dist/domains/dam/uploadQueue/components/UploadQueueEditable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/uploadQueue/components/UploadQueueItemErrorOverlay.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/domains/dam/uploadQueue/components/UploadQueueItemErrorOverlay.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/uploadQueue/composables/uploadService.d.ts +6 -0
- package/dist/domains/dam/uploadQueue/composables/uploadService.js +69 -55
- package/dist/domains/dam/uploadQueue/composables/uploadService.js.map +1 -1
- package/dist/domains/dam/uploadQueue/presets/queuePresets.js +21 -17
- package/dist/domains/dam/uploadQueue/presets/queuePresets.js.map +1 -1
- package/dist/domains/dam/uploadQueue/presets/uploadPresets.d.ts +4 -0
- package/dist/domains/dam/uploadQueue/presets/uploadPresets.js +15 -14
- package/dist/domains/dam/uploadQueue/presets/uploadPresets.js.map +1 -1
- package/dist/domains/dam/user/composables/cachedAssetLicences.d.ts +2 -0
- package/dist/domains/dam/user/composables/cachedAssetLicences.js +11 -8
- package/dist/domains/dam/user/composables/cachedAssetLicences.js.map +1 -1
- package/dist/domains/filters/bookmarks/components/FilterBookmarkDialog.vue_vue_type_script_setup_true_lang.js +190 -184
- package/dist/domains/filters/bookmarks/components/FilterBookmarkDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/filters/components/AFilterTimeInterval.js +1 -1
- package/dist/domains/filters/components/AFilterTimeInterval.vue_vue_type_script_setup_true_lang.js +85 -84
- package/dist/domains/filters/components/AFilterTimeInterval.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/filters/composables/filterFactory.d.ts +13 -1
- package/dist/domains/filters/composables/filterFactory.js +171 -120
- package/dist/domains/filters/composables/filterFactory.js.map +1 -1
- package/dist/domains/filters/composables/filterTimeIntervalTools.js +6 -6
- package/dist/domains/filters/composables/filterTimeIntervalTools.js.map +1 -1
- package/dist/domains/filters/datatable/components/ADatatableOrdering.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/domains/filters/datatable/components/ADatatableOrdering.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/filters/datatable/components/ADatatablePagination.vue_vue_type_script_setup_true_lang.js +49 -49
- package/dist/domains/filters/datatable/components/ADatatablePagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/filters/datatable/components/ALiveListingPill.vue.d.ts +3 -0
- package/dist/domains/filters/datatable/components/ALiveListingPill.vue_vue_type_script_setup_true_lang.js +54 -27
- package/dist/domains/filters/datatable/components/ALiveListingPill.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/filters/utils/filterInjectionKeys.d.ts +1 -0
- package/dist/domains/filters/utils/filterInjectionKeys.js +2 -2
- package/dist/domains/filters/utils/filterInjectionKeys.js.map +1 -1
- package/dist/domains/job/api/jobApi.js +3 -3
- package/dist/domains/job/api/jobApi.js.map +1 -1
- package/dist/domains/listEditor/components/ANestedSortableListEditor.vue.d.ts +1 -1
- package/dist/domains/listEditor/components/ANestedSortableListEditor.vue_vue_type_script_setup_true_lang.js +385 -351
- package/dist/domains/listEditor/components/ANestedSortableListEditor.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/listEditor/components/ASortableListEditor.vue_vue_type_script_setup_true_lang.js +277 -260
- package/dist/domains/listEditor/components/ASortableListEditor.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/listEditor/composables/useKeyboardNav.d.ts +4 -0
- package/dist/domains/listEditor/composables/useKeyboardNav.js +33 -20
- package/dist/domains/listEditor/composables/useKeyboardNav.js.map +1 -1
- package/dist/domains/log/components/ALogDatatable.vue.d.ts +1 -0
- package/dist/domains/log/components/ALogDatatable.vue_vue_type_script_setup_true_lang.js +70 -66
- package/dist/domains/log/components/ALogDatatable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/log/components/ALogListView.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/domains/log/components/ALogListView.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/log/filter/logFilter.d.ts +5 -0
- package/dist/domains/log/filter/logFilter.js +2 -2
- package/dist/domains/log/filter/logFilter.js.map +1 -1
- package/dist/domains/remoteAutocomplete/components/AFilterRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js +89 -92
- package/dist/domains/remoteAutocomplete/components/AFilterRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/remoteAutocomplete/components/AFilterRemoteAutocompleteWithMinimal.vue_vue_type_script_setup_true_lang.js +123 -119
- package/dist/domains/remoteAutocomplete/components/AFilterRemoteAutocompleteWithMinimal.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/remoteAutocomplete/components/AFormRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js +26 -24
- package/dist/domains/remoteAutocomplete/components/AFormRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/system/appShell/components/ALayoutSwitch.js +1 -0
- package/dist/domains/system/appShell/components/ALayoutSwitch.vue.d.ts +3 -0
- package/dist/domains/system/appShell/components/ALayoutSwitch.vue_vue_type_script_setup_true_lang.js +38 -16
- package/dist/domains/system/appShell/components/ALayoutSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/system/composables/alerts.js +57 -40
- package/dist/domains/system/composables/alerts.js.map +1 -1
- package/dist/domains/system/systemBar/components/ASystemBar.vue_vue_type_script_setup_true_lang.js +39 -38
- package/dist/domains/system/systemBar/components/ASystemBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/system/systemBar/components/ASystemBarSessionEnded.js +6 -0
- package/dist/domains/system/systemBar/components/ASystemBarSessionEnded.js.map +1 -0
- package/dist/domains/system/systemBar/components/ASystemBarSessionEnded.vue.d.ts +3 -0
- package/dist/domains/system/systemBar/components/ASystemBarSessionEnded.vue_vue_type_script_setup_true_lang.js +53 -0
- package/dist/domains/system/systemBar/components/ASystemBarSessionEnded.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/domains/ui/datetime/components/ADatetimePicker.js +1 -1
- package/dist/domains/ui/datetime/components/ADatetimePicker.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/domains/ui/datetime/components/ADatetimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/ui/file/composables/formatAndSizeCheck.js +1 -1
- package/dist/domains/ui/file/composables/formatAndSizeCheck.js.map +1 -1
- package/dist/domains/ui/view/components/ALogoutView.vue_vue_type_script_setup_true_lang.js +9 -8
- package/dist/domains/ui/view/components/ALogoutView.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/lib.d.ts +9 -5
- package/dist/locales/cs/common/alert.js +8 -0
- package/dist/locales/cs/common/alert.js.map +1 -1
- package/dist/locales/cs/common/assetSelect.js +361 -0
- package/dist/locales/cs/common/assetSelect.js.map +1 -1
- package/dist/locales/cs/common/damCustomFormElement.js +258 -0
- package/dist/locales/cs/common/damCustomFormElement.js.map +1 -0
- package/dist/locales/cs/common/damImage.js +237 -1
- package/dist/locales/cs/common/damImage.js.map +1 -1
- package/dist/locales/cs/common/filter.js +1 -9
- package/dist/locales/cs/common/filter.js.map +1 -1
- package/dist/locales/cs/common/system.js +26 -0
- package/dist/locales/cs/common/system.js.map +1 -1
- package/dist/locales/cs/error/apiForbiddenOperation.js +113 -7
- package/dist/locales/cs/error/apiForbiddenOperation.js.map +1 -1
- package/dist/locales/cs/error/apiValidation.js +8 -0
- package/dist/locales/cs/error/apiValidation.js.map +1 -1
- package/dist/locales/cs.d.ts +120 -1
- package/dist/locales/cs.js +20 -18
- package/dist/locales/cs.js.map +1 -1
- package/dist/locales/en/common/alert.js +8 -0
- package/dist/locales/en/common/alert.js.map +1 -1
- package/dist/locales/en/common/assetSelect.js +361 -0
- package/dist/locales/en/common/assetSelect.js.map +1 -1
- package/dist/locales/en/common/damCustomFormElement.js +258 -0
- package/dist/locales/en/common/damCustomFormElement.js.map +1 -0
- package/dist/locales/en/common/damImage.js +237 -1
- package/dist/locales/en/common/damImage.js.map +1 -1
- package/dist/locales/en/common/filter.js +1 -9
- package/dist/locales/en/common/filter.js.map +1 -1
- package/dist/locales/en/common/system.js +26 -0
- package/dist/locales/en/common/system.js.map +1 -1
- package/dist/locales/en/error/apiForbiddenOperation.js +113 -7
- package/dist/locales/en/error/apiForbiddenOperation.js.map +1 -1
- package/dist/locales/en/error/apiValidation.js +8 -0
- package/dist/locales/en/error/apiValidation.js.map +1 -1
- package/dist/locales/en.d.ts +120 -1
- package/dist/locales/en.js +20 -18
- package/dist/locales/en.js.map +1 -1
- package/dist/locales/sk/common/alert.js +8 -0
- package/dist/locales/sk/common/alert.js.map +1 -1
- package/dist/locales/sk/common/assetSelect.js +361 -0
- package/dist/locales/sk/common/assetSelect.js.map +1 -1
- package/dist/locales/sk/common/damCustomFormElement.js +258 -0
- package/dist/locales/sk/common/damCustomFormElement.js.map +1 -0
- package/dist/locales/sk/common/damImage.js +237 -1
- package/dist/locales/sk/common/damImage.js.map +1 -1
- package/dist/locales/sk/common/filter.js +1 -9
- package/dist/locales/sk/common/filter.js.map +1 -1
- package/dist/locales/sk/common/system.js +26 -0
- package/dist/locales/sk/common/system.js.map +1 -1
- package/dist/locales/sk/error/apiForbiddenOperation.js +113 -7
- package/dist/locales/sk/error/apiForbiddenOperation.js.map +1 -1
- package/dist/locales/sk/error/apiValidation.js +8 -0
- package/dist/locales/sk/error/apiValidation.js.map +1 -1
- package/dist/locales/sk.d.ts +120 -1
- package/dist/locales/sk.js +20 -18
- package/dist/locales/sk.js.map +1 -1
- package/dist/plugins/i18n.d.ts +120 -1
- package/dist/shared/utils/datetimePickerValue.js +9 -6
- package/dist/shared/utils/datetimePickerValue.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AFormRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js","names":["$slots","_useModel","_openBlock","_createBlock","_component_VAutocomplete","_withCtx","_createVNode","_component_VListItem","_mergeProps","_component_VChip","_createTextVNode","_toDisplayString","_createElementBlock","_renderSlot","ACollabLockedByUser","ACollabLockedByUser_default","_hoisted_1","_hoisted_2","SEARCH_DEBOUNCE_MS","AFormRemoteAutocomplete_vue_vue_type_script_setup_true_lang_default","\"modelValue\"","\"modelModifiers\"","\"selected\"","\"selectedModifiers\"","__expose","__emit","props","__props","emit","filterInnerConfig","inject","FilterInnerConfigKey","filterInnerData","FilterInnerDataKey","componentName","getCurrentInstance","isUndefined","filterByFieldProp","filterSortByProp","modelValue","useModel","isArray","newValue","cloneDeep","modelValueSelected","useCommonAdminCollabOptions","releaseFieldLock","ref","changeFieldData","acquireFieldLock","lockedByUserLocal","collabOptions","isDefined","useCollabField","releaseCollabFieldLock","changeCollabFieldData","acquireCollabFieldLock","watch","lockedByUser","search","isFocused","modelValueAutocomplete","apiRequestCounter","useI18n","system","SystemScopeKey","subject","SubjectScopeKey","onBlur","errorMessageComputed","computed","unref","item","labelComputed","path","stringSplitOnFirstOccurrence","t","requiredComputed","disabledComputed","usePagination","isNull","fetchedItems","selectedItemsCache","isFirstLoad","prefetchCompleted","allItems","itemsMap","addToMap","requestsRunning","loadingLocal","loadingComputed","resetToEmptyState","value","updateSelected","findItem","obj","id","byIdsCounter","loadListItems","requestId","idsArray","ids","res","selectedNewValue","tryLoadModelValue","idsToFetch","tryLoadValue","fetchedData","showErrorsDefault","prefetch","tryAutoFetch","useAlerts","apiSearch","query","pagination","requestCounter","error","mode","onFocus","onMouseEnter","singleItemSelectedTitle","onSearchUpdate","text","onClickClear","onChipCloseClick","closedItem","watchDebounced","oldValue","onAutocompleteModelUpdate","cloned","noDataText","isEmpty","openBlock","createBlock","VAutocomplete","createSlots","withCtx","itemProps","createVNode","VListItem","mergeProps","internalItem","chipProps","VChip","createTextVNode","toDisplayString","createElementBlock","createCommentVNode","renderSlot","_ctx"],"sources":["../../../../src/domains/remoteAutocomplete/components/AFormRemoteAutocomplete.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"T extends string | number\">\nimport type { AFormFieldValidation } from '@/shared/types/Validation'\nimport { watchDebounced } from '@vueuse/core'\nimport { computed, getCurrentInstance, inject, type Ref, ref, watch, unref } from 'vue'\nimport type { ValueObjectOption } from '@/shared/types/ValueObject'\nimport { cloneDeep, isArray, isDefined, isEmpty, isNull, isUndefined } from '@/shared/utils/common'\nimport { SubjectScopeKey, SystemScopeKey } from '@/shared/injectionKeys'\nimport { stringSplitOnFirstOccurrence } from '@/shared/utils/string'\nimport { useI18n } from 'vue-i18n'\nimport type { DocId, IntegerId, IntegerIdNullable } from '@/shared/types/common'\nimport ACollabLockedByUser from '@/domains/collab/components/ACollabLockedByUser.vue'\nimport type { CollabComponentConfig, CollabFieldData } from '@/domains/collab/types/Collab'\nimport { useCollabField } from '@/domains/collab/composables/collabField'\nimport { useCommonAdminCollabOptions } from '@/domains/collab/composables/commonAdminCollabOptions'\nimport type { FilterConfig, FilterData } from '@/domains/filters/composables/filterFactory'\nimport { FilterInnerConfigKey, FilterInnerDataKey } from '@/domains/filters/utils/filterInjectionKeys'\nimport type { DatatableSortBy } from '@/domains/filters/datatable/utils/datatableColumns'\nimport { type Pagination, usePagination } from '@/domains/api/composables/pagination'\nimport { useAlerts } from '@/domains/system/composables/alerts'\n\ntype ModelValueType = T | T[] | null | undefined\n\nconst props = withDefaults(\n defineProps<{\n label?: string | undefined\n required?: boolean | undefined\n multiple?: boolean\n clearable?: boolean\n v?: AFormFieldValidation | null\n errorMessage?: string\n hideDetails?: boolean\n hideLabel?: boolean\n fetchItems: (\n pagination: Ref<Pagination>,\n filterData: FilterData,\n filterConfig: FilterConfig\n ) => Promise<ValueObjectOption<T>[]>\n fetchItemsByIds: (ids: T[]) => Promise<ValueObjectOption<T>[]>\n filterByField: string\n filterSortBy?: DatatableSortBy\n loading?: boolean\n collab?: CollabComponentConfig\n disabled?: boolean | undefined\n readonly?: boolean\n chips?: boolean\n closableChips?: boolean\n disableAutoSingleSelect?: boolean // auto select works only when modelValue is empty/null and prefetch is set to 'mounted'\n prefetch?: 'hover' | 'focus' | 'mounted' | false\n minSearchChars?: number\n minSearchText?: string | undefined\n }>(),\n {\n label: undefined,\n required: undefined,\n multiple: false,\n clearable: false,\n v: null,\n errorMessage: undefined,\n hideDetails: false,\n hideLabel: false,\n filterSortBy: null,\n loading: false,\n collab: undefined,\n disabled: undefined,\n chips: false,\n closableChips: false,\n disableAutoSingleSelect: false,\n prefetch: false,\n minSearchChars: 2,\n minSearchText: undefined,\n }\n)\nconst emit = defineEmits<{\n (e: 'searchChange', data: string): void\n (e: 'searchChangeDebounced', data: string): void\n (e: 'blur', data: ModelValueType): void\n (e: 'focus', data: ModelValueType): void\n (e: 'click:chipClose', data: ValueObjectOption<T>): void\n}>()\n\nconst SEARCH_DEBOUNCE_MS = 300\n\nconst filterInnerConfig = inject(FilterInnerConfigKey)\nconst filterInnerData = inject(FilterInnerDataKey)\n\nconst componentName = getCurrentInstance()?.type.__name\n\nif (isUndefined(filterInnerConfig) || isUndefined(filterInnerData)) {\n throw new Error(`[${componentName}] Incorrect provide/inject config.`)\n}\n// eslint-disable-next-line vue/no-setup-props-reactivity-loss\nconst filterByFieldProp = props.filterByField\n// eslint-disable-next-line vue/no-setup-props-reactivity-loss\nconst filterSortByProp = props.filterSortBy\n\nif (isUndefined(filterInnerConfig.fields[filterByFieldProp]) || isUndefined(filterInnerData[filterByFieldProp])) {\n throw new Error(\n `[${componentName}] Incorrect filter inner config. ` +\n `FilterByField is '${filterByFieldProp}' and available options are ${Object.keys(filterInnerData).join(', ')}.`\n )\n}\n\nconst modelValue = defineModel<ModelValueType>({\n required: true,\n set(newValue) {\n return isArray(newValue) ? cloneDeep(newValue) : newValue\n },\n})\n\nconst modelValueSelected = defineModel<ValueObjectOption<T> | ValueObjectOption<T>[] | null>('selected', {\n required: false,\n default: null,\n set(newValue) {\n return isArray(newValue) ? cloneDeep(newValue) : newValue\n },\n})\n\n// Collaboration\nconst { collabOptions } = useCommonAdminCollabOptions()\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst releaseFieldLock = ref((data: CollabFieldData) => {})\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst changeFieldData = ref((data: CollabFieldData) => {})\nconst acquireFieldLock = ref(() => {})\nconst lockedByUserLocal = ref<IntegerIdNullable>(null)\n// eslint-disable-next-line vue/no-setup-props-reactivity-loss\nif (collabOptions.value.enabled && isDefined(props.collab)) {\n const { releaseCollabFieldLock, changeCollabFieldData, acquireCollabFieldLock, lockedByUser } = useCollabField(\n props.collab.room,\n props.collab.field,\n false,\n true\n )\n releaseFieldLock.value = releaseCollabFieldLock\n changeFieldData.value = changeCollabFieldData\n acquireFieldLock.value = acquireCollabFieldLock\n watch(\n lockedByUser,\n (newValue) => {\n lockedByUserLocal.value = newValue\n },\n { immediate: true }\n )\n}\n\nconst search = ref('')\nconst isFocused = ref(false)\nconst modelValueAutocomplete = ref<ValueObjectOption<T> | ValueObjectOption<T>[] | null>(null)\nconst apiRequestCounter = ref(0)\n\nconst { t } = useI18n()\n\nconst system = inject<string | undefined>(SystemScopeKey, undefined)\nconst subject = inject<string | undefined>(SubjectScopeKey, undefined)\n\nconst onBlur = () => {\n isFocused.value = false\n emit('blur', modelValue.value)\n props.v?.$touch()\n releaseFieldLock.value(modelValue.value)\n}\n\nconst errorMessageComputed = computed(() => {\n if (isDefined(props.errorMessage)) return [props.errorMessage]\n if (props.v?.$errors?.length) return props.v.$errors.map((item) => unref(item.$message))\n return []\n})\n\nconst labelComputed = computed(() => {\n if (isDefined(props.label)) return props.label\n if (isUndefined(system) || isUndefined(subject) || isUndefined(props.v?.$path)) return ''\n const { end: path } = stringSplitOnFirstOccurrence(props.v?.$path, '.')\n return t(system + '.' + subject + '.model.' + path)\n})\n\nconst requiredComputed = computed(() => {\n if (isDefined(props.required)) return props.required\n return (props.v?.required as { $params?: { type?: string } } | undefined)?.$params?.type === 'required'\n})\n\nconst disabledComputed = computed(() => {\n if (isDefined(props.disabled)) return props.disabled\n return !!lockedByUserLocal.value\n})\n\nconst { pagination } = usePagination(isNull(filterSortByProp) ? null : filterSortByProp.key, filterSortByProp?.order)\nconst fetchedItems = ref<ValueObjectOption<T>[]>([])\nconst selectedItemsCache = ref<ValueObjectOption<T>[]>([])\nconst isFirstLoad = ref(true)\nconst prefetchCompleted = ref(false)\n\nconst allItems = computed<ValueObjectOption<T>[]>(() => {\n const itemsMap = new Map<T, ValueObjectOption<T>>()\n const addToMap = (items: ValueObjectOption<T>[]) => {\n items.forEach((item) => {\n itemsMap.set(item.value, {\n value: item.value,\n title: item.title,\n subtitle: item.subtitle,\n } as ValueObjectOption<T>)\n })\n }\n\n addToMap(selectedItemsCache.value as ValueObjectOption<T>[])\n addToMap(fetchedItems.value as ValueObjectOption<T>[])\n\n return Array.from(itemsMap.values())\n})\n\n// Counts running requests (by ids, search, prefetch). The spinner stays on until the last one ends.\n// A single flag let a read by ids hide the spinner of a search still running, and the reverse.\nconst requestsRunning = ref(0)\nconst loadingLocal = computed(() => requestsRunning.value > 0)\nconst loadingComputed = computed(() => {\n if (loadingLocal.value) return true\n return props.loading\n})\n\nconst resetToEmptyState = (value: ModelValueType) => {\n byIdsCounter++\n selectedItemsCache.value = []\n modelValueSelected.value = isArray(value) ? [] : null\n modelValueAutocomplete.value = isArray(value) ? [] : null\n}\n\nconst updateSelected = (value: T[] | T) => {\n const findItem = (id: T): ValueObjectOption<T> =>\n allItems.value.find((obj) => obj.value === id) ?? ({ title: `${id}`, value: id } as ValueObjectOption<T>)\n return isArray(value) ? value.map(findItem) : findItem(value)\n}\n\nlet byIdsCounter = 0\nconst loadListItems = async (ids: T[] | T) => {\n const requestId = ++byIdsCounter\n requestsRunning.value++\n\n try {\n const idsArray = isArray(ids) ? ids : [ids]\n const res = await props.fetchItemsByIds(idsArray)\n if (requestId !== byIdsCounter) return selectedItemsCache.value\n selectedItemsCache.value = res\n const selectedNewValue = updateSelected(ids)\n modelValueSelected.value = selectedNewValue\n modelValueAutocomplete.value = selectedNewValue\n return selectedItemsCache.value\n } catch (e) {\n // Mirror tryLoadModelValue: don't let a failed by-ids resolve become a generic global toast (QA 85050).\n showErrorsDefault(e)\n return undefined\n } finally {\n requestsRunning.value--\n }\n}\n\nconst tryLoadModelValue = async (tryLoadValue: ModelValueType, prefetch = false) => {\n const idsToFetch = isArray(tryLoadValue) ? tryLoadValue : [tryLoadValue]\n let fetchedData: ValueObjectOption<T>[]\n requestsRunning.value++\n try {\n fetchedData = await props.fetchItemsByIds(idsToFetch as Array<IntegerId & DocId>)\n } catch (e) {\n showErrorsDefault(e)\n return false\n } finally {\n // Decremented before the prefetch below, which bails out while a request of the component runs.\n requestsRunning.value--\n }\n if (!isArray(fetchedData) || fetchedData.length === 0) return false\n selectedItemsCache.value = fetchedData\n const value = props.multiple ? fetchedData.map((item) => item.value) : fetchedData[0]!.value\n modelValue.value = value\n if (prefetch) await tryAutoFetch('force', value)\n return true\n}\n\nconst { showErrorsDefault } = useAlerts()\n\nconst apiSearch = async (query: string, requestCounter: number) => {\n requestsRunning.value++\n filterInnerData[filterByFieldProp] = query\n try {\n const res = await props.fetchItems(pagination, filterInnerData, filterInnerConfig)\n if (requestCounter === apiRequestCounter.value) fetchedItems.value = res\n } catch (error) {\n showErrorsDefault(error)\n } finally {\n requestsRunning.value--\n }\n}\n\nconst tryAutoFetch = async (mode: 'focus' | 'hover' | 'mounted' | 'force', newValue: ModelValueType) => {\n if (loadingLocal.value) return\n if (mode !== 'force') {\n if (props.prefetch === false || props.prefetch !== mode || prefetchCompleted.value) return\n }\n\n requestsRunning.value++\n try {\n const res = await props.fetchItems(pagination, filterInnerData, filterInnerConfig)\n if (apiRequestCounter.value === 0) {\n fetchedItems.value = res\n if (\n !props.disableAutoSingleSelect &&\n mode === 'mounted' &&\n res.length === 1 &&\n (isNull(newValue) || isUndefined(newValue) || (isArray(newValue) && newValue.length === 0))\n ) {\n modelValue.value = props.multiple ? [res[0]!.value] : res[0]!.value\n }\n }\n prefetchCompleted.value = true\n } catch (e) {\n showErrorsDefault(e)\n } finally {\n requestsRunning.value--\n }\n}\n\nconst onFocus = async () => {\n isFocused.value = true\n acquireFieldLock.value()\n await tryAutoFetch('focus', modelValue.value)\n emit('focus', modelValue.value)\n}\n\nconst onMouseEnter = async () => {\n await tryAutoFetch('hover', modelValue.value)\n}\n\nconst singleItemSelectedTitle = computed(() => {\n if (!props.multiple && selectedItemsCache.value[0]) {\n return selectedItemsCache.value[0].title\n }\n return undefined\n})\n\n// Clearing the field first emits a `null` search. Reading its length threw when the field had no focus.\nconst onSearchUpdate = (query: string | null) => {\n const text = query ?? ''\n if (!props.multiple && !isFocused.value && text.length === 0) return // vuetify fix\n if (singleItemSelectedTitle.value === text) return\n search.value = text\n}\n\n// Empties the value at once and fetches the list once for an empty search\n// through the search counter, so a stale answer cannot overwrite it.\nconst onClickClear = () => {\n modelValue.value = props.multiple ? [] : null\n apiRequestCounter.value++\n apiSearch('', apiRequestCounter.value)\n}\n\nconst onChipCloseClick = (closedItem: ValueObjectOption<T>) => {\n if (isArray(modelValue.value)) {\n modelValue.value = modelValue.value.filter((item) => item !== closedItem.value)\n return\n }\n if (closedItem.value === modelValue.value && props.clearable) {\n modelValue.value = null\n }\n}\n\nwatchDebounced(\n search,\n (newValue: string | null, oldValue: string | null) => {\n const query = newValue ?? ''\n if (query === (oldValue ?? '')) return\n if (query.length > 0 && query.length < props.minSearchChars) return\n if (query.length === 0 && props.prefetch === false) {\n fetchedItems.value = []\n return\n }\n apiRequestCounter.value++\n apiSearch(query, apiRequestCounter.value)\n emit('searchChangeDebounced', query)\n },\n { debounce: SEARCH_DEBOUNCE_MS }\n)\n\nwatch(search, (newValue, oldValue) => {\n if (newValue !== oldValue) {\n emit('searchChange', newValue)\n }\n})\n\nconst onAutocompleteModelUpdate = (newValue: ValueObjectOption<T> | readonly ValueObjectOption<T>[] | null) => {\n const cloned = cloneDeep(newValue) as ValueObjectOption<T> | ValueObjectOption<T>[] | null\n modelValueSelected.value = cloned\n if (isNull(cloned) || isUndefined(cloned)) {\n modelValue.value = null\n return\n }\n if (isArray(cloned)) {\n modelValue.value = cloned.map((item) => item.value)\n return\n }\n modelValue.value = cloned.value\n}\n\nconst noDataText = computed(() => {\n if (loadingLocal.value) {\n return '$vuetify.loading'\n }\n if (fetchedItems.value.length === 0 && search.value.length < props.minSearchChars) {\n return isUndefined(props.minSearchText)\n ? t('common.filter.filterMinChars', { min: props.minSearchChars })\n : props.minSearchText\n }\n return undefined\n})\n\nwatch(\n modelValue,\n async (newValue, oldValue) => {\n if (newValue === oldValue) return\n if (isFirstLoad.value) {\n isFirstLoad.value = false\n await tryAutoFetch('mounted', newValue)\n }\n if (collabOptions.value.enabled && isFocused.value) {\n changeFieldData.value(newValue)\n }\n if (isEmpty(newValue)) {\n resetToEmptyState(newValue)\n return\n }\n await loadListItems(newValue as T[] | T)\n },\n { immediate: true }\n)\n\ndefineExpose({\n tryLoadModelValue,\n})\n</script>\n\n<template>\n <VAutocomplete\n :model-value=\"modelValueAutocomplete as any\"\n :items=\"allItems\"\n no-filter\n :multiple=\"multiple\"\n :clearable=\"clearable\"\n :error-messages=\"errorMessageComputed\"\n :chips=\"chips || multiple || closableChips\"\n :hide-details=\"hideDetails\"\n :loading=\"loadingComputed\"\n :disabled=\"disabledComputed\"\n :readonly=\"readonly\"\n :no-data-text=\"noDataText\"\n return-object\n autocomplete=\"off\"\n :hide-selected=\"closableChips\"\n :closable-chips=\"closableChips && !loadingComputed && !disabledComputed && !readonly\"\n @update:search=\"onSearchUpdate\"\n @update:model-value=\"onAutocompleteModelUpdate\"\n @blur=\"onBlur\"\n @focus=\"onFocus\"\n @mouseenter=\"onMouseEnter\"\n @click:clear=\"onClickClear\"\n >\n <template #item=\"{ props: itemProps, internalItem }\">\n <VListItem\n v-bind=\"itemProps\"\n :title=\"internalItem.raw.title\"\n :subtitle=\"internalItem.raw.subtitle\"\n />\n </template>\n <template #chip=\"{ props: chipProps, internalItem }\">\n <VChip\n :closable=\"chipProps.closable as boolean\"\n close-label=\"common.button.remove\"\n size=\"small\"\n :text=\"`${internalItem.title} (${internalItem.raw.subtitle})`\"\n :disabled=\"internalItem.props.disabled\"\n @click:close=\"onChipCloseClick(internalItem.raw)\"\n >\n {{ internalItem.raw.title }}\n <span\n v-if=\"internalItem.raw.subtitle\"\n class=\"font-italic pl-1\"\n >\n ({{ internalItem.raw.subtitle }})\n </span>\n </VChip>\n </template>\n <template #label>\n <span\n v-if=\"!hideLabel\"\n :key=\"requiredComputed + ''\"\n >\n {{ labelComputed }}\n <span\n v-if=\"requiredComputed\"\n class=\"a-required-mark\"\n />\n </span>\n </template>\n <template\n v-if=\"lockedByUserLocal\"\n #append-inner\n >\n <slot\n name=\"locked\"\n :user-id=\"lockedByUserLocal\"\n >\n <ACollabLockedByUser\n v-if=\"collab\"\n :id=\"lockedByUserLocal\"\n :users=\"collab.cachedUsers\"\n />\n </slot>\n </template>\n <template\n v-if=\"$slots.append\"\n #append\n >\n <slot name=\"append\" />\n </template>\n </VAutocomplete>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;A,GAgFMkB,KAAqB,K;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA1D3B,IAAMQ,IAAQC,GAkDRC,IAAOH,GAUPI,IAAoBC,EAAOC,EAAoB,GAC/CC,IAAkBF,EAAOG,EAAkB,GAE3CC,IAAgBC,GAAmB,CAAC,EAAE,KAAK;EAEjD,IAAIC,EAAYP,CAAiB,KAAKO,EAAYJ,CAAe,GAC/D,MAAU,MAAM,IAAIE,EAAc,mCAAmC;EAGvE,IAAMG,IAAoBX,EAAM,eAE1BY,IAAmBZ,EAAM;EAE/B,IAAIU,EAAYP,EAAkB,OAAOQ,EAAkB,KAAKD,EAAYJ,EAAgBK,EAAkB,GAC5G,MAAU,MACR,IAAIH,EAAc,qDACKG,EAAkB,8BAA8B,OAAO,KAAKL,CAAe,CAAC,CAAC,KAAK,IAAI,EAAE,EACjH;EAGF,IAAMO,IAAatC,EAA2B0B,GAAA,cAAC,EAE7C,IAAI,GAAU;GACZ,OAAOc,EAAQC,CAAQ,IAAIC,EAAUD,CAAQ,IAAIA;EACnD,EACF,CAAC,GAEKE,IAAqB3C,EAAiE0B,GAAC,YAAY,EAGvG,IAAI,GAAU;GACZ,OAAOc,EAAQC,CAAQ,IAAIC,EAAUD,CAAQ,IAAIA;EACnD,EACF,CAAC,GAGK,EAAE,qBAAkBG,GAA4B,GAEhDC,IAAmBC,GAAK,MAA0B,CAAC,CAAC,GAEpDC,IAAkBD,GAAK,MAA0B,CAAC,CAAC,GACnDE,IAAmBF,QAAU,CAAC,CAAC,GAC/BG,IAAoBH,EAAuB,IAAI;EAErD,IAAII,EAAc,MAAM,WAAWC,EAAU1B,EAAM,MA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IAAI,QAAQ,IAAG,MAClC,CAAA,K;;;;;;;;GAGO,OAAKxI,QAUP,CAREsB,EAAA,Y,aADTzB,EAAA,GAAAU,EASO,QAAA,EAPJ,KAAKiE,EAAA,QAAgB,G,IAEnBnE,EAAAC,EAAA8D,GAAA,KAAa,IAAG,KACnB,CAAA,GACQI,EAAA,SADR3E,EAAA,GAAAU,EAGE,QAHFK,EAGE,K;;E,IAIEiC,EAAA,Q;GACL,MAAA;GAED,IAAA7C,QASO,CATPQ,EASOwI,EAAA,QAAA,UAAA,EAPJ,QAASnG,EAAA,MAAiB,SAOtB,CAJGvB,EAAA,UADRzB,EAAA,GAAAC,EAIEW,IAAA;;IAFC,IAAIoC,EAAA;IACJ,OAAOvB,EAAA,OAAO;;;E,YAKb3B,EAAAA,OAAO,S;GACZ,MAAA;GAED,IAAAK,QAAsB,CAAtBQ,EAAsBwI,EAAA,QAAA,QAAA,C"}
|
|
1
|
+
{"version":3,"file":"AFormRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js","names":["$slots","_useModel","_openBlock","_createBlock","_component_VAutocomplete","_withCtx","_createVNode","_component_VListItem","_mergeProps","_component_VChip","_createTextVNode","_toDisplayString","_createElementBlock","_renderSlot","ACollabLockedByUser","ACollabLockedByUser_default","_hoisted_1","_hoisted_2","SEARCH_DEBOUNCE_MS","AFormRemoteAutocomplete_vue_vue_type_script_setup_true_lang_default","\"modelValue\"","\"modelModifiers\"","\"selected\"","\"selectedModifiers\"","__expose","__emit","props","__props","emit","filterInnerConfig","inject","FilterInnerConfigKey","filterInnerData","FilterInnerDataKey","componentName","getCurrentInstance","isUndefined","filterByFieldProp","filterSortByProp","modelValue","useModel","isArray","newValue","cloneDeep","modelValueSelected","useCommonAdminCollabOptions","releaseFieldLock","ref","changeFieldData","acquireFieldLock","lockedByUserLocal","collabOptions","isDefined","useCollabField","releaseCollabFieldLock","changeCollabFieldData","acquireCollabFieldLock","watch","lockedByUser","search","isFocused","modelValueAutocomplete","apiRequestCounter","useI18n","system","SystemScopeKey","subject","SubjectScopeKey","onBlur","errorMessageComputed","computed","unref","item","labelComputed","path","stringSplitOnFirstOccurrence","t","requiredComputed","disabledComputed","usePagination","isNull","fetchedItems","selectedItemsCache","isFirstLoad","prefetchCompleted","allItems","itemsMap","addToMap","requestsRunning","loadingLocal","loadingComputed","resetToEmptyState","value","updateSelected","findItem","obj","id","byIdsCounter","loadListItems","requestId","idsArray","ids","res","selectedNewValue","tryLoadModelValue","idsToFetch","tryLoadValue","fetchedData","showErrorsDefault","prefetch","tryAutoFetch","useAlerts","apiSearch","query","pagination","requestCounter","error","mode","onFocus","onMouseEnter","singleItemSelectedTitle","onSearchUpdate","text","onClickClear","onChipCloseClick","closedItem","watchDebounced","oldValue","onAutocompleteModelUpdate","cloned","noDataText","watchRun","run","isEmpty","openBlock","createBlock","VAutocomplete","createSlots","withCtx","itemProps","createVNode","VListItem","mergeProps","internalItem","chipProps","VChip","createTextVNode","toDisplayString","createElementBlock","createCommentVNode","renderSlot","_ctx"],"sources":["../../../../src/domains/remoteAutocomplete/components/AFormRemoteAutocomplete.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"T extends string | number\">\nimport type { AFormFieldValidation } from '@/shared/types/Validation'\nimport { watchDebounced } from '@vueuse/core'\nimport { computed, getCurrentInstance, inject, type Ref, ref, watch, unref } from 'vue'\nimport type { ValueObjectOption } from '@/shared/types/ValueObject'\nimport { cloneDeep, isArray, isDefined, isEmpty, isNull, isUndefined } from '@/shared/utils/common'\nimport { SubjectScopeKey, SystemScopeKey } from '@/shared/injectionKeys'\nimport { stringSplitOnFirstOccurrence } from '@/shared/utils/string'\nimport { useI18n } from 'vue-i18n'\nimport type { DocId, IntegerId, IntegerIdNullable } from '@/shared/types/common'\nimport ACollabLockedByUser from '@/domains/collab/components/ACollabLockedByUser.vue'\nimport type { CollabComponentConfig, CollabFieldData } from '@/domains/collab/types/Collab'\nimport { useCollabField } from '@/domains/collab/composables/collabField'\nimport { useCommonAdminCollabOptions } from '@/domains/collab/composables/commonAdminCollabOptions'\nimport type { FilterConfig, FilterData } from '@/domains/filters/composables/filterFactory'\nimport { FilterInnerConfigKey, FilterInnerDataKey } from '@/domains/filters/utils/filterInjectionKeys'\nimport type { DatatableSortBy } from '@/domains/filters/datatable/utils/datatableColumns'\nimport { type Pagination, usePagination } from '@/domains/api/composables/pagination'\nimport { useAlerts } from '@/domains/system/composables/alerts'\n\ntype ModelValueType = T | T[] | null | undefined\n\nconst props = withDefaults(\n defineProps<{\n label?: string | undefined\n required?: boolean | undefined\n multiple?: boolean\n clearable?: boolean\n v?: AFormFieldValidation | null\n errorMessage?: string\n hideDetails?: boolean\n hideLabel?: boolean\n fetchItems: (\n pagination: Ref<Pagination>,\n filterData: FilterData,\n filterConfig: FilterConfig\n ) => Promise<ValueObjectOption<T>[]>\n fetchItemsByIds: (ids: T[]) => Promise<ValueObjectOption<T>[]>\n filterByField: string\n filterSortBy?: DatatableSortBy\n loading?: boolean\n collab?: CollabComponentConfig\n disabled?: boolean | undefined\n readonly?: boolean\n chips?: boolean\n closableChips?: boolean\n disableAutoSingleSelect?: boolean // auto select works only when modelValue is empty/null and prefetch is set to 'mounted'\n prefetch?: 'hover' | 'focus' | 'mounted' | false\n minSearchChars?: number\n minSearchText?: string | undefined\n }>(),\n {\n label: undefined,\n required: undefined,\n multiple: false,\n clearable: false,\n v: null,\n errorMessage: undefined,\n hideDetails: false,\n hideLabel: false,\n filterSortBy: null,\n loading: false,\n collab: undefined,\n disabled: undefined,\n chips: false,\n closableChips: false,\n disableAutoSingleSelect: false,\n prefetch: false,\n minSearchChars: 2,\n minSearchText: undefined,\n }\n)\nconst emit = defineEmits<{\n (e: 'searchChange', data: string): void\n (e: 'searchChangeDebounced', data: string): void\n (e: 'blur', data: ModelValueType): void\n (e: 'focus', data: ModelValueType): void\n (e: 'click:chipClose', data: ValueObjectOption<T>): void\n}>()\n\nconst SEARCH_DEBOUNCE_MS = 300\n\nconst filterInnerConfig = inject(FilterInnerConfigKey)\nconst filterInnerData = inject(FilterInnerDataKey)\n\nconst componentName = getCurrentInstance()?.type.__name\n\nif (isUndefined(filterInnerConfig) || isUndefined(filterInnerData)) {\n throw new Error(`[${componentName}] Incorrect provide/inject config.`)\n}\n// eslint-disable-next-line vue/no-setup-props-reactivity-loss\nconst filterByFieldProp = props.filterByField\n// eslint-disable-next-line vue/no-setup-props-reactivity-loss\nconst filterSortByProp = props.filterSortBy\n\nif (isUndefined(filterInnerConfig.fields[filterByFieldProp]) || isUndefined(filterInnerData[filterByFieldProp])) {\n throw new Error(\n `[${componentName}] Incorrect filter inner config. ` +\n `FilterByField is '${filterByFieldProp}' and available options are ${Object.keys(filterInnerData).join(', ')}.`\n )\n}\n\nconst modelValue = defineModel<ModelValueType>({\n required: true,\n set(newValue) {\n return isArray(newValue) ? cloneDeep(newValue) : newValue\n },\n})\n\nconst modelValueSelected = defineModel<ValueObjectOption<T> | ValueObjectOption<T>[] | null>('selected', {\n required: false,\n default: null,\n set(newValue) {\n return isArray(newValue) ? cloneDeep(newValue) : newValue\n },\n})\n\n// Collaboration\nconst { collabOptions } = useCommonAdminCollabOptions()\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst releaseFieldLock = ref((data: CollabFieldData) => {})\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst changeFieldData = ref((data: CollabFieldData) => {})\nconst acquireFieldLock = ref(() => {})\nconst lockedByUserLocal = ref<IntegerIdNullable>(null)\n// eslint-disable-next-line vue/no-setup-props-reactivity-loss\nif (collabOptions.value.enabled && isDefined(props.collab)) {\n const { releaseCollabFieldLock, changeCollabFieldData, acquireCollabFieldLock, lockedByUser } = useCollabField(\n props.collab.room,\n props.collab.field,\n false,\n true\n )\n releaseFieldLock.value = releaseCollabFieldLock\n changeFieldData.value = changeCollabFieldData\n acquireFieldLock.value = acquireCollabFieldLock\n watch(\n lockedByUser,\n (newValue) => {\n lockedByUserLocal.value = newValue\n },\n { immediate: true }\n )\n}\n\nconst search = ref('')\nconst isFocused = ref(false)\nconst modelValueAutocomplete = ref<ValueObjectOption<T> | ValueObjectOption<T>[] | null>(null)\nconst apiRequestCounter = ref(0)\n\nconst { t } = useI18n()\n\nconst system = inject<string | undefined>(SystemScopeKey, undefined)\nconst subject = inject<string | undefined>(SubjectScopeKey, undefined)\n\nconst onBlur = () => {\n isFocused.value = false\n emit('blur', modelValue.value)\n props.v?.$touch()\n releaseFieldLock.value(modelValue.value)\n}\n\nconst errorMessageComputed = computed(() => {\n if (isDefined(props.errorMessage)) return [props.errorMessage]\n if (props.v?.$errors?.length) return props.v.$errors.map((item) => unref(item.$message))\n return []\n})\n\nconst labelComputed = computed(() => {\n if (isDefined(props.label)) return props.label\n if (isUndefined(system) || isUndefined(subject) || isUndefined(props.v?.$path)) return ''\n const { end: path } = stringSplitOnFirstOccurrence(props.v?.$path, '.')\n return t(system + '.' + subject + '.model.' + path)\n})\n\nconst requiredComputed = computed(() => {\n if (isDefined(props.required)) return props.required\n return (props.v?.required as { $params?: { type?: string } } | undefined)?.$params?.type === 'required'\n})\n\nconst disabledComputed = computed(() => {\n if (isDefined(props.disabled)) return props.disabled\n return !!lockedByUserLocal.value\n})\n\nconst { pagination } = usePagination(isNull(filterSortByProp) ? null : filterSortByProp.key, filterSortByProp?.order)\nconst fetchedItems = ref<ValueObjectOption<T>[]>([])\nconst selectedItemsCache = ref<ValueObjectOption<T>[]>([])\nconst isFirstLoad = ref(true)\nconst prefetchCompleted = ref(false)\n\nconst allItems = computed<ValueObjectOption<T>[]>(() => {\n const itemsMap = new Map<T, ValueObjectOption<T>>()\n const addToMap = (items: ValueObjectOption<T>[]) => {\n items.forEach((item) => {\n itemsMap.set(item.value, {\n value: item.value,\n title: item.title,\n subtitle: item.subtitle,\n } as ValueObjectOption<T>)\n })\n }\n\n addToMap(selectedItemsCache.value as ValueObjectOption<T>[])\n addToMap(fetchedItems.value as ValueObjectOption<T>[])\n\n return Array.from(itemsMap.values())\n})\n\n// Counts running requests (by ids, search, prefetch). The spinner stays on until the last one ends.\n// A single flag let a read by ids hide the spinner of a search still running, and the reverse.\nconst requestsRunning = ref(0)\nconst loadingLocal = computed(() => requestsRunning.value > 0)\nconst loadingComputed = computed(() => {\n if (loadingLocal.value) return true\n return props.loading\n})\n\nconst resetToEmptyState = (value: ModelValueType) => {\n byIdsCounter++\n selectedItemsCache.value = []\n modelValueSelected.value = isArray(value) ? [] : null\n modelValueAutocomplete.value = isArray(value) ? [] : null\n}\n\nconst updateSelected = (value: T[] | T) => {\n const findItem = (id: T): ValueObjectOption<T> =>\n allItems.value.find((obj) => obj.value === id) ?? ({ title: `${id}`, value: id } as ValueObjectOption<T>)\n return isArray(value) ? value.map(findItem) : findItem(value)\n}\n\nlet byIdsCounter = 0\nconst loadListItems = async (ids: T[] | T) => {\n const requestId = ++byIdsCounter\n requestsRunning.value++\n\n try {\n const idsArray = isArray(ids) ? ids : [ids]\n const res = await props.fetchItemsByIds(idsArray)\n if (requestId !== byIdsCounter) return selectedItemsCache.value\n selectedItemsCache.value = res\n const selectedNewValue = updateSelected(ids)\n modelValueSelected.value = selectedNewValue\n modelValueAutocomplete.value = selectedNewValue\n return selectedItemsCache.value\n } catch (e) {\n // Mirror tryLoadModelValue: don't let a failed by-ids resolve become a generic global toast (QA 85050).\n showErrorsDefault(e)\n return undefined\n } finally {\n requestsRunning.value--\n }\n}\n\nconst tryLoadModelValue = async (tryLoadValue: ModelValueType, prefetch = false) => {\n const idsToFetch = isArray(tryLoadValue) ? tryLoadValue : [tryLoadValue]\n let fetchedData: ValueObjectOption<T>[]\n requestsRunning.value++\n try {\n fetchedData = await props.fetchItemsByIds(idsToFetch as Array<IntegerId & DocId>)\n } catch (e) {\n showErrorsDefault(e)\n return false\n } finally {\n // Decremented before the prefetch below, which bails out while a request of the component runs.\n requestsRunning.value--\n }\n if (!isArray(fetchedData) || fetchedData.length === 0) return false\n selectedItemsCache.value = fetchedData\n const value = props.multiple ? fetchedData.map((item) => item.value) : fetchedData[0]!.value\n modelValue.value = value\n if (prefetch) await tryAutoFetch('force', value)\n return true\n}\n\nconst { showErrorsDefault } = useAlerts()\n\nconst apiSearch = async (query: string, requestCounter: number) => {\n requestsRunning.value++\n filterInnerData[filterByFieldProp] = query\n try {\n const res = await props.fetchItems(pagination, filterInnerData, filterInnerConfig)\n if (requestCounter === apiRequestCounter.value) fetchedItems.value = res\n } catch (error) {\n showErrorsDefault(error)\n } finally {\n requestsRunning.value--\n }\n}\n\nconst tryAutoFetch = async (mode: 'focus' | 'hover' | 'mounted' | 'force', newValue: ModelValueType) => {\n if (loadingLocal.value) return\n if (mode !== 'force') {\n if (props.prefetch === false || props.prefetch !== mode || prefetchCompleted.value) return\n }\n\n requestsRunning.value++\n try {\n const res = await props.fetchItems(pagination, filterInnerData, filterInnerConfig)\n if (apiRequestCounter.value === 0) {\n fetchedItems.value = res\n if (\n !props.disableAutoSingleSelect &&\n mode === 'mounted' &&\n res.length === 1 &&\n (isNull(newValue) || isUndefined(newValue) || (isArray(newValue) && newValue.length === 0))\n ) {\n modelValue.value = props.multiple ? [res[0]!.value] : res[0]!.value\n }\n }\n prefetchCompleted.value = true\n } catch (e) {\n showErrorsDefault(e)\n } finally {\n requestsRunning.value--\n }\n}\n\nconst onFocus = async () => {\n isFocused.value = true\n acquireFieldLock.value()\n await tryAutoFetch('focus', modelValue.value)\n emit('focus', modelValue.value)\n}\n\nconst onMouseEnter = async () => {\n await tryAutoFetch('hover', modelValue.value)\n}\n\nconst singleItemSelectedTitle = computed(() => {\n if (!props.multiple && selectedItemsCache.value[0]) {\n return selectedItemsCache.value[0].title\n }\n return undefined\n})\n\n// Clearing the field first emits a `null` search. Reading its length threw when the field had no focus.\n// The search Vuetify empties when the field loses its focus is taken too: the\n// options fetched for it stayed and a field of one value opened with them.\nconst onSearchUpdate = (query: string | null) => {\n const text = query ?? ''\n if (singleItemSelectedTitle.value === text) return\n search.value = text\n}\n\n// Empties the value at once and fetches the list once for an empty search\n// through the search counter, so a stale answer cannot overwrite it.\nconst onClickClear = () => {\n modelValue.value = props.multiple ? [] : null\n apiRequestCounter.value++\n apiSearch('', apiRequestCounter.value)\n}\n\nconst onChipCloseClick = (closedItem: ValueObjectOption<T>) => {\n if (isArray(modelValue.value)) {\n modelValue.value = modelValue.value.filter((item) => item !== closedItem.value)\n return\n }\n if (closedItem.value === modelValue.value && props.clearable) {\n modelValue.value = null\n }\n}\n\nwatchDebounced(\n search,\n (newValue: string | null, oldValue: string | null) => {\n const query = newValue ?? ''\n if (query === (oldValue ?? '')) return\n if (query.length > 0 && query.length < props.minSearchChars) return\n apiRequestCounter.value++\n if (query.length === 0 && props.prefetch === false) {\n fetchedItems.value = []\n return\n }\n apiSearch(query, apiRequestCounter.value)\n emit('searchChangeDebounced', query)\n },\n { debounce: SEARCH_DEBOUNCE_MS }\n)\n\nwatch(search, (newValue, oldValue) => {\n if (newValue !== oldValue) {\n emit('searchChange', newValue)\n }\n})\n\nconst onAutocompleteModelUpdate = (newValue: ValueObjectOption<T> | readonly ValueObjectOption<T>[] | null) => {\n const cloned = cloneDeep(newValue) as ValueObjectOption<T> | ValueObjectOption<T>[] | null\n modelValueSelected.value = cloned\n if (isNull(cloned) || isUndefined(cloned)) {\n modelValue.value = null\n return\n }\n if (isArray(cloned)) {\n modelValue.value = cloned.map((item) => item.value)\n return\n }\n modelValue.value = cloned.value\n}\n\nconst noDataText = computed(() => {\n if (loadingLocal.value) {\n return '$vuetify.loading'\n }\n if (fetchedItems.value.length === 0 && search.value.length < props.minSearchChars) {\n return isUndefined(props.minSearchText)\n ? t('common.filter.filterMinChars', { min: props.minSearchChars })\n : props.minSearchText\n }\n return undefined\n})\n\nlet watchRun = 0\nwatch(\n modelValue,\n async (newValue, oldValue) => {\n if (newValue === oldValue) return\n const run = ++watchRun\n if (isFirstLoad.value) {\n isFirstLoad.value = false\n await tryAutoFetch('mounted', newValue)\n // A parent may set the value on its mount (a remembered one), while this first run waits here.\n // That value has a run of its own, and resetting the field here would drop its label.\n if (run !== watchRun) return\n }\n if (collabOptions.value.enabled && isFocused.value) {\n changeFieldData.value(newValue)\n }\n if (isEmpty(newValue)) {\n resetToEmptyState(newValue)\n return\n }\n await loadListItems(newValue as T[] | T)\n },\n { immediate: true }\n)\n\ndefineExpose({\n tryLoadModelValue,\n})\n</script>\n\n<template>\n <VAutocomplete\n :model-value=\"modelValueAutocomplete as any\"\n :items=\"allItems\"\n no-filter\n :multiple=\"multiple\"\n :clearable=\"clearable\"\n :error-messages=\"errorMessageComputed\"\n :chips=\"chips || multiple || closableChips\"\n :hide-details=\"hideDetails\"\n :loading=\"loadingComputed\"\n :disabled=\"disabledComputed\"\n :readonly=\"readonly\"\n :no-data-text=\"noDataText\"\n return-object\n autocomplete=\"off\"\n :hide-selected=\"closableChips\"\n :closable-chips=\"closableChips && !loadingComputed && !disabledComputed && !readonly\"\n @update:search=\"onSearchUpdate\"\n @update:model-value=\"onAutocompleteModelUpdate\"\n @blur=\"onBlur\"\n @focus=\"onFocus\"\n @mouseenter=\"onMouseEnter\"\n @click:clear=\"onClickClear\"\n >\n <template #item=\"{ props: itemProps, internalItem }\">\n <VListItem\n v-bind=\"itemProps\"\n :title=\"internalItem.raw.title\"\n :subtitle=\"internalItem.raw.subtitle\"\n />\n </template>\n <template #chip=\"{ props: chipProps, internalItem }\">\n <VChip\n :closable=\"chipProps.closable as boolean\"\n close-label=\"common.button.remove\"\n size=\"small\"\n :text=\"`${internalItem.title} (${internalItem.raw.subtitle})`\"\n :disabled=\"internalItem.props.disabled\"\n @click:close=\"onChipCloseClick(internalItem.raw)\"\n >\n {{ internalItem.raw.title }}\n <span\n v-if=\"internalItem.raw.subtitle\"\n class=\"font-italic pl-1\"\n >\n ({{ internalItem.raw.subtitle }})\n </span>\n </VChip>\n </template>\n <template #label>\n <span\n v-if=\"!hideLabel\"\n :key=\"requiredComputed + ''\"\n >\n {{ labelComputed }}\n <span\n v-if=\"requiredComputed\"\n class=\"a-required-mark\"\n />\n </span>\n </template>\n <template\n v-if=\"lockedByUserLocal\"\n #append-inner\n >\n <slot\n name=\"locked\"\n :user-id=\"lockedByUserLocal\"\n >\n <ACollabLockedByUser\n v-if=\"collab\"\n :id=\"lockedByUserLocal\"\n :users=\"collab.cachedUsers\"\n />\n </slot>\n </template>\n <template\n v-if=\"$slots.append\"\n #append\n >\n <slot name=\"append\" />\n </template>\n </VAutocomplete>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;A,GAgFMkB,KAAqB,K;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA1D3B,IAAMQ,IAAQC,GAkDRC,IAAOH,GAUPI,IAAoBC,EAAOC,EAAoB,GAC/CC,IAAkBF,EAAOG,EAAkB,GAE3CC,IAAgBC,GAAmB,CAAC,EAAE,KAAK;EAEjD,IAAIC,EAAYP,CAAiB,KAAKO,EAAYJ,CAAe,GAC/D,MAAU,MAAM,IAAIE,EAAc,mCAAmC;EAGvE,IAAMG,IAAoBX,EAAM,eAE1BY,IAAmBZ,EAAM;EAE/B,IAAIU,EAAYP,EAAkB,OAAOQ,EAAkB,KAAKD,EAAYJ,EAAgBK,EAAkB,GAC5G,MAAU,MACR,IAAIH,EAAc,qDACKG,EAAkB,8BAA8B,OAAO,KAAKL,CAAe,CAAC,CAAC,KAAK,IAAI,EAAE,EACjH;EAGF,IAAMO,IAAatC,EAA2B0B,GAAA,cAAC,EAE7C,IAAI,GAAU;GACZ,OAAOc,EAAQC,CAAQ,IAAIC,EAAUD,CAAQ,IAAIA;EACnD,EACF,CAAC,GAEKE,IAAqB3C,EAAiE0B,GAAC,YAAY,EAGvG,IAAI,GAAU;GACZ,OAAOc,EAAQC,CAAQ,IAAIC,EAAUD,CAAQ,IAAIA;EACnD,EACF,CAAC,GAGK,EAAE,qBAAkBG,GAA4B,GAEhDC,IAAmBC,GAAK,MAA0B,CAAC,CAAC,GAEpDC,IAAkBD,GAAK,MAA0B,CAAC,CAAC,GACnDE,I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C,EAAAoI,EAAa,IAAI,KAAK,IAAG,KAC5B,CAAA,GACQA,EAAa,IAAI,YADzB7I,EAAA,GAAAU,EAKO,QALPI,IAGC,OACEL,EAAGoI,EAAa,IAAI,QAAQ,IAAG,MAClC,CAAA,K;;;;;;;;GAGO,OAAK1I,QAUP,CAREsB,EAAA,Y,aADTzB,EAAA,GAAAU,EASO,QAAA,EAPJ,KAAKiE,EAAA,QAAgB,G,IAEnBnE,EAAAC,EAAA8D,GAAA,KAAa,IAAG,KACnB,CAAA,GACQI,EAAA,SADR3E,EAAA,GAAAU,EAGE,QAHFK,EAGE,K;;E,IAIEiC,EAAA,Q;GACL,MAAA;GAED,IAAA7C,QASO,CATPQ,EASO0I,EAAA,QAAA,UAAA,EAPJ,QAASrG,EAAA,MAAiB,SAOtB,CAJGvB,EAAA,UADRzB,EAAA,GAAAC,EAIEW,IAAA;;IAFC,IAAIoC,EAAA;IACJ,OAAOvB,EAAA,OAAO;;;E,YAKb3B,EAAAA,OAAO,S;GACZ,MAAA;GAED,IAAAK,QAAsB,CAAtBQ,EAAsB0I,EAAA,QAAA,QAAA,C"}
|
|
@@ -4,6 +4,8 @@ type __VLS_Props = {
|
|
|
4
4
|
layouts: Record<string, Component>;
|
|
5
5
|
/** Until the first route resolves, and for a route without `meta.layout`. */
|
|
6
6
|
defaultLayout?: string;
|
|
7
|
+
/** Milliseconds a navigation is pending before the progress bar shows; a negative value turns the bar off. */
|
|
8
|
+
navigationProgressDelay?: number;
|
|
7
9
|
};
|
|
8
10
|
declare const __VLS_template: () => {
|
|
9
11
|
__VLS_Slots: {
|
|
@@ -15,6 +17,7 @@ declare const __VLS_template: () => {
|
|
|
15
17
|
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
16
18
|
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
17
19
|
defaultLayout: string;
|
|
20
|
+
navigationProgressDelay: number;
|
|
18
21
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
19
22
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
20
23
|
declare const _default: typeof __VLS_export;
|
package/dist/domains/system/appShell/components/ALayoutSwitch.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -1,28 +1,50 @@
|
|
|
1
1
|
import e from "../../components/AAlerts.js";
|
|
2
|
-
import { Fragment as t, computed as n, createBlock as r,
|
|
3
|
-
import { useRoute as
|
|
2
|
+
import { Fragment as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createVNode as o, defineComponent as s, onBeforeUnmount as c, openBlock as l, renderSlot as u, resolveDynamicComponent as d, shallowRef as f, watch as p, withCtx as m } from "vue";
|
|
3
|
+
import { NavigationFailureType as h, isNavigationFailure as g, useRoute as _, useRouter as v } from "vue-router";
|
|
4
|
+
import { VProgressLinear as y } from "vuetify/components/VProgressLinear";
|
|
4
5
|
// src/domains/system/appShell/components/ALayoutSwitch.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
6
|
+
var b = /*@__PURE__*/ s({
|
|
6
7
|
__name: "ALayoutSwitch",
|
|
7
8
|
props: {
|
|
8
9
|
layouts: {},
|
|
9
|
-
defaultLayout: { default: "AppLayoutLoader" }
|
|
10
|
+
defaultLayout: { default: "AppLayoutLoader" },
|
|
11
|
+
navigationProgressDelay: { default: 300 }
|
|
10
12
|
},
|
|
11
|
-
setup(
|
|
12
|
-
let
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
setup(s) {
|
|
14
|
+
let b = s, x = _(), S = v(), C = f(void 0);
|
|
15
|
+
p(() => x.meta, (e) => {
|
|
16
|
+
C.value = e.layout;
|
|
15
17
|
});
|
|
16
|
-
let
|
|
17
|
-
let e =
|
|
18
|
+
let w = n(() => {
|
|
19
|
+
let e = C.value || b.defaultLayout, t = b.layouts[e];
|
|
18
20
|
return t || console.error(`[ALayoutSwitch] Unknown layout '${e}'.`), t;
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
}), T = f(!1), E, D = () => {
|
|
22
|
+
clearTimeout(E), E = void 0, T.value = !1;
|
|
23
|
+
}, O = S.beforeEach(() => {
|
|
24
|
+
b.navigationProgressDelay < 0 || T.value || E !== void 0 || (E = setTimeout(() => {
|
|
25
|
+
E = void 0, T.value = !0;
|
|
26
|
+
}, b.navigationProgressDelay));
|
|
27
|
+
}), k = S.afterEach((e, t, n) => {
|
|
28
|
+
g(n, h.cancelled) || D();
|
|
29
|
+
}), A = S.onError(D);
|
|
30
|
+
return c(() => {
|
|
31
|
+
D(), O(), k(), A();
|
|
32
|
+
}), (n, s) => (l(), a(t, null, [
|
|
33
|
+
o(e),
|
|
34
|
+
T.value ? (l(), r(y, {
|
|
35
|
+
key: 0,
|
|
36
|
+
class: "a-layout-switch__navigation",
|
|
37
|
+
indeterminate: "",
|
|
38
|
+
color: "primary",
|
|
39
|
+
height: "3"
|
|
40
|
+
})) : i("", !0),
|
|
41
|
+
w.value ? (l(), r(d(w.value), { key: 1 }, {
|
|
42
|
+
default: m(() => [u(n.$slots, "default")]),
|
|
43
|
+
_: 3
|
|
44
|
+
})) : u(n.$slots, "default", {}, void 0, void 0, 2)
|
|
45
|
+
], 64));
|
|
24
46
|
}
|
|
25
47
|
});
|
|
26
|
-
export {
|
|
48
|
+
export { b as default };
|
|
27
49
|
|
|
28
50
|
//# sourceMappingURL=ALayoutSwitch.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ALayoutSwitch.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createVNode","AAlerts","_createBlock","_resolveDynamicComponent","_withCtx","_renderSlot","AAlerts_default","ALayoutSwitch_vue_vue_type_script_setup_true_lang_default","props","__props","route","useRoute","routeLayout","shallowRef","meta","current","computed","name","found","openBlock","createElementBlock","Fragment","createVNode","createBlock","resolveDynamicComponent","withCtx","renderSlot","_ctx"],"sources":["../../../../../src/domains/system/appShell/components/ALayoutSwitch.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { type Component, computed, shallowRef, watch } from 'vue'\nimport { useRoute } from 'vue-router'\nimport AAlerts from '@/domains/system/components/AAlerts.vue'\n\nconst props = withDefaults(\n defineProps<{\n /** The layouts by the name pages give in `definePage({ meta: { layout } })`. */\n layouts: Record<string, Component>\n /** Until the first route resolves, and for a route without `meta.layout`. */\n defaultLayout?: string\n }>(),\n {\n defaultLayout: 'AppLayoutLoader',\n }\n)\n\nconst route = useRoute()\n\n// Read on a change of the route's meta, not on the first render: until the first navigation resolves,\n// the default layout shows.\nconst routeLayout = shallowRef<string | undefined>(undefined)\n\nwatch(\n () => route.meta,\n (meta) => {\n routeLayout.value = (meta as { layout?: string }).layout\n }\n)\n\n// A name missing from the map renders the page without a layout, rather than hiding it behind the loader.\nconst current = computed(() => {\n const name = routeLayout.value || props.defaultLayout\n const found = props.layouts[name]\n if (!found) console.error(`[ALayoutSwitch] Unknown layout '${name}'.`)\n return found\n})\n</script>\n\n<template>\n <!--\n The single alerts host, outside the layout switch.\n A host inside a layout drops its alerts when the route switches layouts,\n e.g. a start-up error vanished when the drawer replaced the loader.\n -->\n <AAlerts />\n <component\n :is=\"current\"\n v-if=\"current\"\n >\n <slot />\n </component>\n <slot v-else />\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ALayoutSwitch.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createVNode","AAlerts","_createBlock","_component_VProgressLinear","_resolveDynamicComponent","_withCtx","_renderSlot","AAlerts_default","ALayoutSwitch_vue_vue_type_script_setup_true_lang_default","props","__props","route","useRoute","router","useRouter","routeLayout","shallowRef","meta","current","computed","name","found","navigating","progressTimer","stopProgress","removeBeforeEach","removeAfterEach","isNavigationFailure","failure","NavigationFailureType","removeOnError","onBeforeUnmount","openBlock","createElementBlock","Fragment","createVNode","createBlock","VProgressLinear","createCommentVNode","resolveDynamicComponent","withCtx","renderSlot","_ctx"],"sources":["../../../../../src/domains/system/appShell/components/ALayoutSwitch.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { type Component, computed, onBeforeUnmount, shallowRef, watch } from 'vue'\nimport { isNavigationFailure, NavigationFailureType, useRoute, useRouter } from 'vue-router'\nimport AAlerts from '@/domains/system/components/AAlerts.vue'\n\nconst props = withDefaults(\n defineProps<{\n /** The layouts by the name pages give in `definePage({ meta: { layout } })`. */\n layouts: Record<string, Component>\n /** Until the first route resolves, and for a route without `meta.layout`. */\n defaultLayout?: string\n /** Milliseconds a navigation is pending before the progress bar shows; a negative value turns the bar off. */\n navigationProgressDelay?: number\n }>(),\n {\n defaultLayout: 'AppLayoutLoader',\n navigationProgressDelay: 300,\n }\n)\n\nconst route = useRoute()\nconst router = useRouter()\n\n// Read on a change of the route's meta, not on the first render: until the first navigation resolves,\n// the default layout shows.\nconst routeLayout = shallowRef<string | undefined>(undefined)\n\nwatch(\n () => route.meta,\n (meta) => {\n routeLayout.value = (meta as { layout?: string }).layout\n }\n)\n\n// A name missing from the map renders the page without a layout, rather than hiding it behind the loader.\nconst current = computed(() => {\n const name = routeLayout.value || props.defaultLayout\n const found = props.layouts[name]\n if (!found) console.error(`[ALayoutSwitch] Unknown layout '${name}'.`)\n return found\n})\n\n// The old page stays until the new one's chunks are in, which on a slow network\n// or the first visit after a deploy takes seconds, with nothing else showing.\nconst navigating = shallowRef(false)\nlet progressTimer: ReturnType<typeof setTimeout> | undefined\nconst stopProgress = () => {\n clearTimeout(progressTimer)\n progressTimer = undefined\n navigating.value = false\n}\nconst removeBeforeEach = router.beforeEach(() => {\n if (props.navigationProgressDelay < 0 || navigating.value || progressTimer !== undefined) return\n progressTimer = setTimeout(() => {\n progressTimer = undefined\n navigating.value = true\n }, props.navigationProgressDelay)\n})\nconst removeAfterEach = router.afterEach((_to, _from, failure) => {\n // A newer navigation replaced this one and is still pending.\n if (isNavigationFailure(failure, NavigationFailureType.cancelled)) return\n stopProgress()\n})\nconst removeOnError = router.onError(stopProgress)\nonBeforeUnmount(() => {\n stopProgress()\n removeBeforeEach()\n removeAfterEach()\n removeOnError()\n})\n</script>\n\n<template>\n <!--\n The single alerts host, outside the layout switch.\n A host inside a layout drops its alerts when the route switches layouts,\n e.g. a start-up error vanished when the drawer replaced the loader.\n -->\n <AAlerts />\n <VProgressLinear\n v-if=\"navigating\"\n class=\"a-layout-switch__navigation\"\n indeterminate\n color=\"primary\"\n height=\"3\"\n />\n <component\n :is=\"current\"\n v-if=\"current\"\n >\n <slot />\n </component>\n <slot v-else />\n</template>\n\n<style lang=\"scss\">\n.a-layout-switch__navigation {\n position: fixed !important;\n inset: 0 0 auto;\n // Above the layout's app bar and drawer (1000 and up), below overlays (2000) and the alerts.\n z-index: 1500 !important;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;EAKA,IAAMU,IAAQC,GAeRC,IAAQC,EAAS,GACjBC,IAASC,EAAU,GAInBC,IAAcC,EAA+B,KAAA,CAAS;EAE5D,QACQL,EAAM,OACX,MAAS;GACR,EAAY,QAASM,EAA6B;EACpD,CACF;EAGA,IAAMC,IAAUC,QAAe;GAC7B,IAAMC,IAAOL,EAAY,SAASN,EAAM,eAClCY,IAAQZ,EAAM,QAAQW;GAE5B,OADKC,KAAO,QAAQ,MAAM,mCAAmCD,EAAK,GAAG,GAC9DC;EACT,CAAC,GAIKC,IAAaN,EAAW,EAAK,GAC/BO,GACEC,UAAqB;GAGzB,AAFA,aAAaD,CAAa,GAC1B,IAAgB,KAAA,GAChB,EAAW,QAAQ;EACrB,GACME,IAAmBZ,EAAO,iBAAiB;GAC/C,AAAIJ,EAAM,0BAA0B,KAAKa,EAAW,SAASC,MAAkB,KAAA,MAC/E,IAAgB,iBAAiB;IAE/B,AADA,IAAgB,KAAA,GAChB,EAAW,QAAQ;GACrB,GAAGd,EAAM,uBAAuB;EAClC,CAAC,GACKiB,IAAkBb,EAAO,WAAW,GAAK,GAAO,MAAY;GAEhE,AAAIc,EAAoBC,GAASC,EAAsB,SAAS,KAChEL,EAAa;EACf,CAAC,GACKM,IAAgBjB,EAAO,QAAQW,CAAY;E,OACjDO,QAAsB;GAIpB,AAHAP,EAAa,GACbC,EAAiB,GACjBC,EAAgB,GAChBI,EAAc;EAChB,CAAC,I;GASC9B,EAAWC,CAAA;GAEHqB,EAAA,SADRvB,EAAA,GAAAG,EAMEC,GAAA;;IAJA,OAAM;IACN,eAAA;IACA,OAAM;IACN,QAAO;;GAIDe,EAAA,SAFRnB,EAAA,GAAAG,EAKYE,EAJLc,EAAA,KAAO,GAAA,EAAA,KAAA,EAAA,GAAA;IAGZ,SAAAb,QAAQ,CAARC,EAAQoC,EAAA,QAAA,SAAA,C;;G,MAEVpC,EAAeoC,EAAA,QAAA,WAAA,CAAA,GAAA,KAAA,GAAA,KAAA,GAAA,CAAA"}
|
|
@@ -12,71 +12,88 @@ import { isAnzuApiCancelledError as d } from "../../../shared/error/AnzuApiCance
|
|
|
12
12
|
import { AuthUnavailableError as f } from "../../../shared/error/AuthUnavailableError.js";
|
|
13
13
|
import { SessionExpiredError as p } from "../../../shared/error/SessionExpiredError.js";
|
|
14
14
|
import { isInCauseChain as m } from "../../../shared/error/isInCauseChain.js";
|
|
15
|
+
import { resolveImageSaveErrorMessage as h } from "../../dam/imageWidget/composables/imageSaveErrors.js";
|
|
16
|
+
import { extractImageSaveErrorInfo as g } from "../../dam/imageWidget/composables/imageApiCms.js";
|
|
17
|
+
import { useSessionEnd as _ } from "../../auth/composables/sessionEnd.js";
|
|
15
18
|
// src/domains/system/composables/alerts.ts
|
|
16
|
-
var
|
|
17
|
-
function
|
|
18
|
-
let
|
|
19
|
+
var v = 3, y = 3e4, b = -Infinity, x = 3e3, S = 6e3, C = -Infinity, w = "\n";
|
|
20
|
+
function T() {
|
|
21
|
+
let w = (t, n = v) => {
|
|
19
22
|
e("success", t, n * 1e3);
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
+
}, T = (e, n = v) => {
|
|
24
|
+
w(t(e), n);
|
|
25
|
+
}, E = (t, n = v) => {
|
|
23
26
|
e("error", t, n * 1e3);
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
+
}, D = (e, n = v) => {
|
|
28
|
+
E(t(e), n);
|
|
29
|
+
}, O = (t, n = v) => {
|
|
27
30
|
e("info", t, n * 1e3);
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
+
}, k = (e, n = v) => {
|
|
32
|
+
O(t(e), n);
|
|
33
|
+
}, A = (t, n = v) => {
|
|
31
34
|
e("warning", t, n * 1e3);
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
+
}, j = (e, n = v) => {
|
|
36
|
+
A(t(e), n);
|
|
37
|
+
}, M = (n = v) => {
|
|
35
38
|
e("error", t("common.alert.fixValidationErrors"), n * 1e3);
|
|
36
|
-
},
|
|
39
|
+
}, N = (n, r = v) => {
|
|
37
40
|
e("success", t("common.alert.recordWas." + n), r * 1e3);
|
|
38
|
-
},
|
|
41
|
+
}, P = (r, i = -1, a = !1) => {
|
|
39
42
|
let o = t, s = n, c = [o("common.alert.fixApiValidationErrors")];
|
|
40
43
|
for (let e of r) {
|
|
41
44
|
let t = "";
|
|
42
|
-
a ? t += e.field : s(e.field) ? t += o(e.field) : e.field.includes("[") ? t +=
|
|
45
|
+
a ? t += e.field : s(e.field) ? t += o(e.field) : e.field.includes("[") ? t += V(e.field) : t += e.field.split(".").at(-1);
|
|
43
46
|
let n = /* @__PURE__ */ new Set();
|
|
44
47
|
for (let t of e.errors) s("error.apiValidation." + t) ? n.add(o("error.apiValidation." + t)) : n.add(o("error.apiValidation.noTranslation"));
|
|
45
48
|
t.length > 0 && c.push(t + ": " + Array.from(n).join(", "));
|
|
46
49
|
}
|
|
47
50
|
e("error", c.join("\n"), i * 1e3);
|
|
48
|
-
},
|
|
51
|
+
}, F = (r, i = -1) => {
|
|
49
52
|
let a = t, o = n, s = a("error.apiForbiddenOperation.noTranslation");
|
|
50
53
|
o("error.apiForbiddenOperation." + r) && (s = a("error.apiForbiddenOperation." + r)), e("error", s, i * 1e3);
|
|
51
|
-
},
|
|
54
|
+
}, I = (n = -1) => {
|
|
52
55
|
e("error", t("common.alert.unknownError"), n * 1e3);
|
|
53
|
-
},
|
|
56
|
+
}, L = (n = v) => {
|
|
54
57
|
e("error", t("common.alert.forbiddenError"), n * 1e3);
|
|
55
|
-
},
|
|
58
|
+
}, R = (n = -1) => {
|
|
56
59
|
let r = Date.now();
|
|
57
|
-
r -
|
|
58
|
-
},
|
|
60
|
+
r - b < y || (b = r, e("error", t("common.alert.authUnavailable"), n * 1e3));
|
|
61
|
+
}, z = () => {
|
|
62
|
+
let n = Date.now();
|
|
63
|
+
n - C < x || (C = n, e("error", t("common.alert.sessionEndedNotDone"), S));
|
|
64
|
+
}, B = (e, n = -1) => {
|
|
65
|
+
if (d(e)) return !0;
|
|
66
|
+
if (m(e, (e) => e instanceof p)) return _().sessionEnded.value && z(), !0;
|
|
67
|
+
if (m(e, (e) => e instanceof f)) return R(n), !0;
|
|
68
|
+
if (i(e)) return L(n), !0;
|
|
69
|
+
if (a(e)) return P(e.fields, n), !0;
|
|
70
|
+
if (c(e)) return D("error.apiDependencyExists.message", n), !0;
|
|
71
|
+
if (s(e)) return F(e.detail, n), !0;
|
|
72
|
+
if (l(e)) return D("error.apiTimedOut.message", n), !0;
|
|
73
|
+
let v = h(g(e), t);
|
|
74
|
+
return v ? (E(v, n), !0) : u(e) || r(e) || o(e) ? (I(n), !0) : !1;
|
|
75
|
+
}, V = (e) => {
|
|
59
76
|
let n = t, r = e.split("["), i = r[0].trim(), a = r[1].split("]"), o = a[0], s = a[1] ?? "";
|
|
60
77
|
return n(i) + "[" + o + "]: " + n(i.slice(0, -1) + s);
|
|
61
78
|
};
|
|
62
79
|
return {
|
|
63
|
-
showSuccess:
|
|
64
|
-
showSuccessT:
|
|
65
|
-
showError:
|
|
66
|
-
showErrorT:
|
|
67
|
-
showInfo:
|
|
68
|
-
showInfoT:
|
|
69
|
-
showWarning:
|
|
70
|
-
showWarningT:
|
|
71
|
-
showValidationError:
|
|
72
|
-
showRecordWas:
|
|
73
|
-
showApiValidationError:
|
|
74
|
-
showApiForbiddenOperationError:
|
|
75
|
-
showUnknownError:
|
|
76
|
-
showForbiddenError:
|
|
77
|
-
showErrorsDefault:
|
|
80
|
+
showSuccess: w,
|
|
81
|
+
showSuccessT: T,
|
|
82
|
+
showError: E,
|
|
83
|
+
showErrorT: D,
|
|
84
|
+
showInfo: O,
|
|
85
|
+
showInfoT: k,
|
|
86
|
+
showWarning: A,
|
|
87
|
+
showWarningT: j,
|
|
88
|
+
showValidationError: M,
|
|
89
|
+
showRecordWas: N,
|
|
90
|
+
showApiValidationError: P,
|
|
91
|
+
showApiForbiddenOperationError: F,
|
|
92
|
+
showUnknownError: I,
|
|
93
|
+
showForbiddenError: L,
|
|
94
|
+
showErrorsDefault: B
|
|
78
95
|
};
|
|
79
96
|
}
|
|
80
|
-
export {
|
|
97
|
+
export { w as NEW_LINE_MARK, T as useAlerts };
|
|
81
98
|
|
|
82
99
|
//# sourceMappingURL=alerts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alerts.js","names":["t","DEFAULT_DURATION_SECONDS","AUTH_UNAVAILABLE_QUIET_MS","authUnavailableShownAt","NEW_LINE_MARK","useAlerts","showSuccess","message","duration","showSuccessT","commonT","translation","showError","showErrorT","showInfo","showInfoT","showWarning","showWarningT","showValidationError","showRecordWas","variant","showApiValidationError","t","te","commonTe","texts","error","errors","fieldText","fieldIsTranslated","resolveListErrors","errorsTexts","code","showApiForbiddenOperationError","text","detail","pushAlert","showUnknownError","showForbiddenError","showAuthUnavailable","now","showErrorsDefault","isAnzuApiCancelledError","isInCauseChain","cause","SessionExpiredError","AuthUnavailableError","isAnzuApiForbiddenError","isAnzuApiValidationError","isAnzuApiDependencyExistsError","isAnzuApiForbiddenOperationError","isAnzuApiTimeoutError","isAnzuApiAxiosError","isAnzuFatalError","isAnzuApiResponseCodeError","parsedField","firstField","parsedSecond","indexNumber","secondField"],"sources":["../../../../src/domains/system/composables/alerts.ts"],"sourcesContent":["import { pushAlert } from '@/domains/system/composables/alertsQueue'\nimport { commonT, commonTe } from '@/plugins/i18n'\nimport { isAnzuFatalError } from '@/shared/error/AnzuFatalError'\nimport { isAnzuApiForbiddenError } from '@/shared/error/AnzuApiForbiddenError'\nimport { isAnzuApiValidationError, type ValidationError } from '@/shared/error/AnzuApiValidationError'\nimport { isAnzuApiResponseCodeError } from '@/shared/error/AnzuApiResponseCodeError'\nimport { isAnzuApiForbiddenOperationError } from '@/shared/error/AnzuApiForbiddenOperationError'\nimport { isAnzuApiDependencyExistsError } from '@/shared/error/AnzuApiDependencyExistsError'\nimport { isAnzuApiTimeoutError } from '@/shared/error/AnzuApiTimeoutError'\nimport { isAnzuApiAxiosError } from '@/shared/error/AnzuApiAxiosError'\nimport { isAnzuApiCancelledError } from '@/shared/error/AnzuApiCancelledError'\nimport { AuthUnavailableError } from '@/shared/error/AuthUnavailableError'\nimport { SessionExpiredError } from '@/shared/error/SessionExpiredError'\nimport { isInCauseChain } from '@/shared/error/isInCauseChain'\n\nconst DEFAULT_DURATION_SECONDS = 3\n// One \"sign-in server does not answer\" per outage: a page's requests all fail at once.\nconst AUTH_UNAVAILABLE_QUIET_MS = 30_000\nlet authUnavailableShownAt = -Infinity\n\nexport const NEW_LINE_MARK = '\\n'\n\nexport type RecordWasType = 'created' | 'deleted' | 'updated' | 'published' | 'unpublished' | 'enabled' | 'disabled'\n\nexport function useAlerts() {\n const showSuccess = (message: string, duration = DEFAULT_DURATION_SECONDS) => {\n pushAlert('success', message, duration * 1000)\n }\n\n const showSuccessT = (translation: string, duration = DEFAULT_DURATION_SECONDS) => {\n const t = commonT\n showSuccess(t(translation), duration)\n }\n\n const showError = (message: string, duration = DEFAULT_DURATION_SECONDS) => {\n pushAlert('error', message, duration * 1000)\n }\n\n const showErrorT = (translation: string, duration = DEFAULT_DURATION_SECONDS) => {\n const t = commonT\n showError(t(translation), duration)\n }\n\n const showInfo = (message: string, duration = DEFAULT_DURATION_SECONDS) => {\n pushAlert('info', message, duration * 1000)\n }\n\n const showInfoT = (translation: string, duration = DEFAULT_DURATION_SECONDS) => {\n const t = commonT\n showInfo(t(translation), duration)\n }\n\n const showWarning = (message: string, duration = DEFAULT_DURATION_SECONDS) => {\n pushAlert('warning', message, duration * 1000)\n }\n\n const showWarningT = (translation: string, duration = DEFAULT_DURATION_SECONDS) => {\n const t = commonT\n showWarning(t(translation), duration)\n }\n\n const showValidationError = (duration = DEFAULT_DURATION_SECONDS) => {\n const t = commonT\n pushAlert('error', t('common.alert.fixValidationErrors'), duration * 1000)\n }\n\n const showRecordWas = (variant: RecordWasType, duration = DEFAULT_DURATION_SECONDS) => {\n const t = commonT\n pushAlert('success', t('common.alert.recordWas.' + variant), duration * 1000)\n }\n\n const showApiValidationError = (errors: ValidationError[], duration = -1, fieldIsTranslated = false) => {\n const t = commonT\n const te = commonTe\n const texts = [t('common.alert.fixApiValidationErrors')]\n\n for (const error of errors) {\n let fieldText = ''\n if (fieldIsTranslated) {\n fieldText += error.field\n } else if (te(error.field)) {\n fieldText += t(error.field)\n } else if (error.field.includes('[')) {\n fieldText += resolveListErrors(error.field)\n } else {\n fieldText += error.field.split('.').at(-1)\n }\n const errorsTexts = new Set<string>()\n for (const code of error.errors) {\n if (te('error.apiValidation.' + code)) {\n errorsTexts.add(t('error.apiValidation.' + code))\n continue\n }\n errorsTexts.add(t('error.apiValidation.noTranslation'))\n }\n if (fieldText.length > 0) {\n texts.push(fieldText + ': ' + Array.from(errorsTexts).join(', '))\n }\n }\n pushAlert('error', texts.join(NEW_LINE_MARK), duration * 1000)\n }\n\n const showApiForbiddenOperationError = (detail: string, duration = -1) => {\n const t = commonT\n const te = commonTe\n let text = t('error.apiForbiddenOperation.noTranslation')\n if (te('error.apiForbiddenOperation.' + detail)) {\n text = t('error.apiForbiddenOperation.' + detail)\n }\n pushAlert('error', text, duration * 1000)\n }\n\n const showUnknownError = (duration = -1) => {\n const t = commonT\n pushAlert('error', t('common.alert.unknownError'), duration * 1000)\n }\n\n const showForbiddenError = (duration = DEFAULT_DURATION_SECONDS) => {\n const t = commonT\n pushAlert('error', t('common.alert.forbiddenError'), duration * 1000)\n }\n\n const showAuthUnavailable = (duration = -1) => {\n const now = Date.now()\n if (now - authUnavailableShownAt < AUTH_UNAVAILABLE_QUIET_MS) return\n authUnavailableShownAt = now\n pushAlert('error', commonT('common.alert.authUnavailable'), duration * 1000)\n }\n\n const showErrorsDefault = (error: any, duration = -1) => {\n // A cancelled request is not a failure: something newer stopped it, or its view is gone.\n // Returns `true` because callers using `if (!showErrorsDefault(e)) showUnknownError()`\n // would otherwise show \"unknown error\" on every autocomplete keystroke.\n if (isAnzuApiCancelledError(error)) return true\n // Stopped by the token refresh. Either the session is gone and\n // logout is loading, or the sign-in server did not answer.\n // The latter is reported once, not for every request stopped at the same time.\n if (isInCauseChain(error, (cause) => cause instanceof SessionExpiredError)) return true\n if (isInCauseChain(error, (cause) => cause instanceof AuthUnavailableError)) {\n showAuthUnavailable(duration)\n return true\n }\n if (isAnzuApiForbiddenError(error)) {\n showForbiddenError(duration)\n return true\n }\n if (isAnzuApiValidationError(error)) {\n showApiValidationError(error.fields, duration)\n return true\n }\n if (isAnzuApiDependencyExistsError(error)) {\n showErrorT('error.apiDependencyExists.message', duration)\n return true\n }\n if (isAnzuApiForbiddenOperationError(error)) {\n showApiForbiddenOperationError(error.detail, duration)\n return true\n }\n if (isAnzuApiTimeoutError(error)) {\n showErrorT('error.apiTimedOut.message', duration)\n return true\n }\n if (isAnzuApiAxiosError(error)) {\n showUnknownError(duration)\n return true\n }\n if (isAnzuFatalError(error)) {\n showUnknownError(duration)\n return true\n }\n if (isAnzuApiResponseCodeError(error)) {\n showUnknownError(duration)\n return true\n }\n return false\n }\n\n const resolveListErrors = (error: string) => {\n const t = commonT\n // Only called for a field that contains `[`, so the split has a second part.\n const parsedField = error.split('[')\n const firstField = parsedField[0]!.trim()\n const parsedSecond = parsedField[1]!.split(']')\n const indexNumber = parsedSecond[0]\n const secondField: string = parsedSecond[1] ?? ''\n\n return t(firstField) + '[' + indexNumber + ']: ' + t(firstField.slice(0, -1) + secondField)\n }\n\n return {\n showSuccess,\n showSuccessT,\n showError,\n showErrorT,\n showInfo,\n showInfoT,\n showWarning,\n showWarningT,\n showValidationError,\n showRecordWas,\n showApiValidationError,\n showApiForbiddenOperationError,\n showUnknownError,\n showForbiddenError,\n showErrorsDefault,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAeA,IAAMC,IAA2B,GAE3BC,IAA4B,KAC9BC,IAAyB,WAEhBC,IAAgB;AAI7B,SAAgBC,IAAY;CAC1B,IAAMC,KAAe,GAAiB,IAAWL,MAA6B;EAC5E,EAAU,WAAWM,GAASC,IAAW,GAAI;CAC/C,GAEMC,KAAgB,GAAqB,IAAWR,MAA6B;EAEjF,EAAYD,EAAEW,CAAW,GAAGH,CAAQ;CACtC,GAEMI,KAAa,GAAiB,IAAWX,MAA6B;EAC1E,EAAU,SAASM,GAASC,IAAW,GAAI;CAC7C,GAEMK,KAAc,GAAqB,IAAWZ,MAA6B;EAE/E,EAAUD,EAAEW,CAAW,GAAGH,CAAQ;CACpC,GAEMM,KAAY,GAAiB,IAAWb,MAA6B;EACzE,EAAU,QAAQM,GAASC,IAAW,GAAI;CAC5C,GAEMO,KAAa,GAAqB,IAAWd,MAA6B;EAE9E,EAASD,EAAEW,CAAW,GAAGH,CAAQ;CACnC,GAEMQ,KAAe,GAAiB,IAAWf,MAA6B;EAC5E,EAAU,WAAWM,GAASC,IAAW,GAAI;CAC/C,GAEMS,KAAgB,GAAqB,IAAWhB,MAA6B;EAEjF,EAAYD,EAAEW,CAAW,GAAGH,C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CAC5F;CAEA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"alerts.js","names":["t","DEFAULT_DURATION_SECONDS","AUTH_UNAVAILABLE_QUIET_MS","authUnavailableShownAt","SESSION_ENDED_NOT_DONE_QUIET_MS","SESSION_ENDED_NOT_DONE_DURATION_MS","sessionEndedNotDoneShownAt","NEW_LINE_MARK","useAlerts","showSuccess","message","duration","showSuccessT","commonT","translation","showError","showErrorT","showInfo","showInfoT","showWarning","showWarningT","showValidationError","showRecordWas","variant","showApiValidationError","t","te","commonTe","texts","error","errors","fieldText","fieldIsTranslated","resolveListErrors","errorsTexts","code","showApiForbiddenOperationError","text","detail","pushAlert","showUnknownError","showForbiddenError","showAuthUnavailable","now","showSessionEndedNotDone","showErrorsDefault","isAnzuApiCancelledError","isInCauseChain","cause","SessionExpiredError","useSessionEnd","AuthUnavailableError","isAnzuApiForbiddenError","isAnzuApiValidationError","isAnzuApiDependencyExistsError","isAnzuApiForbiddenOperationError","isAnzuApiTimeoutError","imageSaveErrorMessage","resolveImageSaveErrorMessage","extractImageSaveErrorInfo","isAnzuApiAxiosError","isAnzuFatalError","isAnzuApiResponseCodeError","parsedField","firstField","parsedSecond","indexNumber","secondField"],"sources":["../../../../src/domains/system/composables/alerts.ts"],"sourcesContent":["import { pushAlert } from '@/domains/system/composables/alertsQueue'\nimport { commonT, commonTe } from '@/plugins/i18n'\nimport { isAnzuFatalError } from '@/shared/error/AnzuFatalError'\nimport { isAnzuApiForbiddenError } from '@/shared/error/AnzuApiForbiddenError'\nimport { isAnzuApiValidationError, type ValidationError } from '@/shared/error/AnzuApiValidationError'\nimport { isAnzuApiResponseCodeError } from '@/shared/error/AnzuApiResponseCodeError'\nimport { isAnzuApiForbiddenOperationError } from '@/shared/error/AnzuApiForbiddenOperationError'\nimport { isAnzuApiDependencyExistsError } from '@/shared/error/AnzuApiDependencyExistsError'\nimport { isAnzuApiTimeoutError } from '@/shared/error/AnzuApiTimeoutError'\nimport { isAnzuApiAxiosError } from '@/shared/error/AnzuApiAxiosError'\nimport { isAnzuApiCancelledError } from '@/shared/error/AnzuApiCancelledError'\nimport { AuthUnavailableError } from '@/shared/error/AuthUnavailableError'\nimport { SessionExpiredError } from '@/shared/error/SessionExpiredError'\nimport { isInCauseChain } from '@/shared/error/isInCauseChain'\nimport { resolveImageSaveErrorMessage } from '@/domains/dam/imageWidget/composables/imageSaveErrors'\nimport { extractImageSaveErrorInfo } from '@/domains/dam/imageWidget/composables/imageApiCms'\nimport { useSessionEnd } from '@/domains/auth/composables/sessionEnd'\n\nconst DEFAULT_DURATION_SECONDS = 3\n// One \"sign-in server does not answer\" per outage: a page's requests all fail at once.\nconst AUTH_UNAVAILABLE_QUIET_MS = 30_000\nlet authUnavailableShownAt = -Infinity\n// One for the requests a single action fails at once.\nconst SESSION_ENDED_NOT_DONE_QUIET_MS = 3000\nconst SESSION_ENDED_NOT_DONE_DURATION_MS = 6000\nlet sessionEndedNotDoneShownAt = -Infinity\n\nexport const NEW_LINE_MARK = '\\n'\n\nexport type RecordWasType = 'created' | 'deleted' | 'updated' | 'published' | 'unpublished' | 'enabled' | 'disabled'\n\nexport function useAlerts() {\n const showSuccess = (message: string, duration = DEFAULT_DURATION_SECONDS) => {\n pushAlert('success', message, duration * 1000)\n }\n\n const showSuccessT = (translation: string, duration = DEFAULT_DURATION_SECONDS) => {\n const t = commonT\n showSuccess(t(translation), duration)\n }\n\n const showError = (message: string, duration = DEFAULT_DURATION_SECONDS) => {\n pushAlert('error', message, duration * 1000)\n }\n\n const showErrorT = (translation: string, duration = DEFAULT_DURATION_SECONDS) => {\n const t = commonT\n showError(t(translation), duration)\n }\n\n const showInfo = (message: string, duration = DEFAULT_DURATION_SECONDS) => {\n pushAlert('info', message, duration * 1000)\n }\n\n const showInfoT = (translation: string, duration = DEFAULT_DURATION_SECONDS) => {\n const t = commonT\n showInfo(t(translation), duration)\n }\n\n const showWarning = (message: string, duration = DEFAULT_DURATION_SECONDS) => {\n pushAlert('warning', message, duration * 1000)\n }\n\n const showWarningT = (translation: string, duration = DEFAULT_DURATION_SECONDS) => {\n const t = commonT\n showWarning(t(translation), duration)\n }\n\n const showValidationError = (duration = DEFAULT_DURATION_SECONDS) => {\n const t = commonT\n pushAlert('error', t('common.alert.fixValidationErrors'), duration * 1000)\n }\n\n const showRecordWas = (variant: RecordWasType, duration = DEFAULT_DURATION_SECONDS) => {\n const t = commonT\n pushAlert('success', t('common.alert.recordWas.' + variant), duration * 1000)\n }\n\n const showApiValidationError = (errors: ValidationError[], duration = -1, fieldIsTranslated = false) => {\n const t = commonT\n const te = commonTe\n const texts = [t('common.alert.fixApiValidationErrors')]\n\n for (const error of errors) {\n let fieldText = ''\n if (fieldIsTranslated) {\n fieldText += error.field\n } else if (te(error.field)) {\n fieldText += t(error.field)\n } else if (error.field.includes('[')) {\n fieldText += resolveListErrors(error.field)\n } else {\n fieldText += error.field.split('.').at(-1)\n }\n const errorsTexts = new Set<string>()\n for (const code of error.errors) {\n if (te('error.apiValidation.' + code)) {\n errorsTexts.add(t('error.apiValidation.' + code))\n continue\n }\n errorsTexts.add(t('error.apiValidation.noTranslation'))\n }\n if (fieldText.length > 0) {\n texts.push(fieldText + ': ' + Array.from(errorsTexts).join(', '))\n }\n }\n pushAlert('error', texts.join(NEW_LINE_MARK), duration * 1000)\n }\n\n const showApiForbiddenOperationError = (detail: string, duration = -1) => {\n const t = commonT\n const te = commonTe\n let text = t('error.apiForbiddenOperation.noTranslation')\n if (te('error.apiForbiddenOperation.' + detail)) {\n text = t('error.apiForbiddenOperation.' + detail)\n }\n pushAlert('error', text, duration * 1000)\n }\n\n const showUnknownError = (duration = -1) => {\n const t = commonT\n pushAlert('error', t('common.alert.unknownError'), duration * 1000)\n }\n\n const showForbiddenError = (duration = DEFAULT_DURATION_SECONDS) => {\n const t = commonT\n pushAlert('error', t('common.alert.forbiddenError'), duration * 1000)\n }\n\n const showAuthUnavailable = (duration = -1) => {\n const now = Date.now()\n if (now - authUnavailableShownAt < AUTH_UNAVAILABLE_QUIET_MS) return\n authUnavailableShownAt = now\n pushAlert('error', commonT('common.alert.authUnavailable'), duration * 1000)\n }\n\n // Not until closed: it covers the bar that says the same and offers the sign-in.\n const showSessionEndedNotDone = () => {\n const now = Date.now()\n if (now - sessionEndedNotDoneShownAt < SESSION_ENDED_NOT_DONE_QUIET_MS) return\n sessionEndedNotDoneShownAt = now\n pushAlert('error', commonT('common.alert.sessionEndedNotDone'), SESSION_ENDED_NOT_DONE_DURATION_MS)\n }\n\n const showErrorsDefault = (error: any, duration = -1) => {\n // A cancelled request is not a failure: something newer stopped it, or its view is gone.\n // Returns `true` because callers using `if (!showErrorsDefault(e)) showUnknownError()`\n // would otherwise show \"unknown error\" on every autocomplete keystroke.\n if (isAnzuApiCancelledError(error)) return true\n // Stopped by the token refresh. Either the session is gone and\n // logout is loading, or the sign-in server did not answer.\n // The latter is reported once, not for every request stopped at the same time.\n if (isInCauseChain(error, (cause) => cause instanceof SessionExpiredError)) {\n // The user kept the page for its unsaved changes: what failed must not pass for done.\n if (useSessionEnd().sessionEnded.value) showSessionEndedNotDone()\n return true\n }\n if (isInCauseChain(error, (cause) => cause instanceof AuthUnavailableError)) {\n showAuthUnavailable(duration)\n return true\n }\n if (isAnzuApiForbiddenError(error)) {\n showForbiddenError(duration)\n return true\n }\n if (isAnzuApiValidationError(error)) {\n showApiValidationError(error.fields, duration)\n return true\n }\n if (isAnzuApiDependencyExistsError(error)) {\n showErrorT('error.apiDependencyExists.message', duration)\n return true\n }\n if (isAnzuApiForbiddenOperationError(error)) {\n showApiForbiddenOperationError(error.detail, duration)\n return true\n }\n if (isAnzuApiTimeoutError(error)) {\n showErrorT('error.apiTimedOut.message', duration)\n return true\n }\n // Any save that writes image rows (an article, a gallery, a person) can be refused by the single use rule.\n // Also a bare axios error: `bulkUpdateImages` rejects with one.\n const imageSaveErrorMessage = resolveImageSaveErrorMessage(extractImageSaveErrorInfo(error), commonT)\n if (imageSaveErrorMessage) {\n showError(imageSaveErrorMessage, duration)\n return true\n }\n if (isAnzuApiAxiosError(error)) {\n showUnknownError(duration)\n return true\n }\n if (isAnzuFatalError(error)) {\n showUnknownError(duration)\n return true\n }\n if (isAnzuApiResponseCodeError(error)) {\n showUnknownError(duration)\n return true\n }\n return false\n }\n\n const resolveListErrors = (error: string) => {\n const t = commonT\n // Only called for a field that contains `[`, so the split has a second part.\n const parsedField = error.split('[')\n const firstField = parsedField[0]!.trim()\n const parsedSecond = parsedField[1]!.split(']')\n const indexNumber = parsedSecond[0]\n const secondField: string = parsedSecond[1] ?? ''\n\n return t(firstField) + '[' + indexNumber + ']: ' + t(firstField.slice(0, -1) + secondField)\n }\n\n return {\n showSuccess,\n showSuccessT,\n showError,\n showErrorT,\n showInfo,\n showInfoT,\n showWarning,\n showWarningT,\n showValidationError,\n showRecordWas,\n showApiValidationError,\n showApiForbiddenOperationError,\n showUnknownError,\n showForbiddenError,\n showErrorsDefault,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,IAAMC,IAA2B,GAE3BC,IAA4B,KAC9BC,IAAyB,WAEvBC,IAAkC,KAClCC,IAAqC,KACvCC,IAA6B,WAEpBC,IAAgB;AAI7B,SAAgBC,IAAY;CAC1B,IAAMC,KAAe,GAAiB,IAAWR,MAA6B;EAC5E,EAAU,WAAWS,GAASC,IAAW,GAAI;CAC/C,GAEMC,KAAgB,GAAqB,IAAWX,MAA6B;EAEjF,EAAYD,EAAEc,CAAW,GAAGH,CAAQ;CACtC,GAEMI,KAAa,GAAiB,IAAWd,MAA6B;EAC1E,EAAU,SAASS,GAASC,IAAW,GAAI;CAC7C,GAEMK,KAAc,GAAqB,IAAWf,MAA6B;EAE/E,EAAUD,EAAEc,CAAW,GAAGH,CAAQ;CACpC,GAEMM,KAAY,GAAiB,IAAWhB,MAA6B;EACzE,EAAU,QAAQS,GAASC,IAAW,GAAI;CAC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+BP,EAAM,QAAQlB,CAAQ,GAC9C;EAET,IAAI6C,EAAsB3B,CAAK,GAE7B,OADAb,EAAW,6BAA6BL,CAAQ,GACzC;EAIT,IAAM8C,IAAwBC,EAA6BC,EAA0B9B,CAAK,GAAGhB,CAAO;EAiBpG,OAhBI4C,KACF1C,EAAU0C,GAAuB9C,CAAQ,GAClC,MAELiD,EAAoB/B,CAAK,KAIzBgC,EAAiBhC,CAAK,KAItBiC,EAA2BjC,CAAK,KAClCW,EAAiB7B,CAAQ,GAClB,MAEF;CACT,GAEMsB,KAAqB,MAAkB;EAC3C,IAAMR,IAAIZ,GAEJkD,IAAclC,EAAM,MAAM,GAAG,GAC7BmC,IAAaD,EAAY,EAAE,CAAE,KAAK,GAClCE,IAAeF,EAAY,EAAE,CAAE,MAAM,GAAG,GACxCG,IAAcD,EAAa,IAC3BE,IAAsBF,EAAa,MAAM;EAE/C,OAAOxC,EAAEuC,CAAU,IAAI,MAAME,IAAc,QAAQzC,EAAEuC,EAAW,MAAM,GAAG,EAAE,IAAIG,CAAW;CAC5F;CAEA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
|
package/dist/domains/system/systemBar/components/ASystemBar.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import e from "./ASystemBarNewVersion.js";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
2
|
+
import t from "./ASystemBarSessionEnded.js";
|
|
3
|
+
import { isUndefined as n } from "../../../../shared/utils/common.js";
|
|
4
|
+
import { AnzuNewVersionFetchError as r, isAnzuNewVersionFetchError as i } from "../../../../shared/error/AnzuNewVersionFetchError.js";
|
|
5
|
+
import { useUserActivity as a } from "../../composables/useUserActivity.js";
|
|
6
|
+
import { useSystemBar as o } from "../composables/systemBar.js";
|
|
7
|
+
import { Fragment as s, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createVNode as p, defineComponent as m, onBeforeUnmount as h, openBlock as g, ref as _, resolveDynamicComponent as v, watch as y, withCtx as b } from "vue";
|
|
8
|
+
import { useIntervalFn as x } from "@vueuse/core";
|
|
9
|
+
import { VAppBar as S } from "vuetify/components/VAppBar";
|
|
9
10
|
// src/domains/system/systemBar/components/ASystemBar.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
-
var
|
|
11
|
+
var C = { class: "text-center w-100 text-body-small pb-1" }, w = 5, T = /*@__PURE__*/ m({
|
|
11
12
|
__name: "ASystemBar",
|
|
12
13
|
props: {
|
|
13
14
|
currentVersion: {},
|
|
@@ -15,59 +16,59 @@ var y = { class: "text-center w-100 text-body-small pb-1" }, b = 5, x = /*@__PUR
|
|
|
15
16
|
jsonRelativePath: { default: "config.json" },
|
|
16
17
|
minInactiveTime: { default: 5e3 }
|
|
17
18
|
},
|
|
18
|
-
setup(
|
|
19
|
-
let
|
|
20
|
-
|
|
19
|
+
setup(m) {
|
|
20
|
+
let T = m, E = _(!1), D = _(null), O = _(0), k = 0, A = !1, { newVersion: j } = o(), M = async () => {
|
|
21
|
+
D.value && D.value.abort(), D.value = new AbortController();
|
|
21
22
|
let e = (e) => e instanceof Error && e.name === "AbortError";
|
|
22
23
|
try {
|
|
23
|
-
let e = await fetch(`/${
|
|
24
|
+
let e = await fetch(`/${T.jsonRelativePath}?random=${Date.now()}`, { signal: D.value.signal });
|
|
24
25
|
if (e.ok) {
|
|
25
|
-
let
|
|
26
|
-
if (!
|
|
26
|
+
let t = e.headers.get("content-type");
|
|
27
|
+
if (!t || !t.includes("application/json")) throw new r("Unable to load env config. Incorrect content type.");
|
|
27
28
|
let i = await e.json();
|
|
28
|
-
if (Object.keys(i).length < 1) throw new
|
|
29
|
-
|
|
29
|
+
if (Object.keys(i).length < 1) throw new r("Unable to load env config. Incorrect response body.");
|
|
30
|
+
E.value = !n(i.appVersion) && i.appVersion !== T.currentVersion, j.value = E.value, k = 0, A = !1;
|
|
30
31
|
return;
|
|
31
32
|
}
|
|
32
|
-
throw new
|
|
33
|
+
throw new r("Unable to load env config. Incorrect response code.");
|
|
33
34
|
} catch (t) {
|
|
34
35
|
if (e(t)) return;
|
|
35
|
-
throw
|
|
36
|
+
throw i(t) ? t : t instanceof SyntaxError ? new r("Unable to load env config. Syntax error.", t) : t instanceof Error ? new r("Unable to load env config. " + t.message, t) : new r("Unable to load env config. Unknown error.", t);
|
|
36
37
|
}
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
}, N = c(() => e), { pause: P, resume: F } = x(() => {
|
|
39
|
+
M().catch((e) => {
|
|
40
|
+
i(e) ? (k++, k >= w && !A && (A = !0, console.error(`[ASystemBar] Version check failed ${k} consecutive times:`, e))) : console.warn(e);
|
|
40
41
|
});
|
|
41
|
-
},
|
|
42
|
-
let
|
|
43
|
-
clearTimeout(
|
|
42
|
+
}, T.checkInterval), { isWindowActive: I } = a(), L, R = (e = 1, t = 3) => {
|
|
43
|
+
let n = Math.min(1e3 * e, 3e3);
|
|
44
|
+
clearTimeout(L), L = setTimeout(async () => {
|
|
44
45
|
try {
|
|
45
|
-
await
|
|
46
|
-
} catch (
|
|
47
|
-
|
|
46
|
+
await M();
|
|
47
|
+
} catch (n) {
|
|
48
|
+
n instanceof r && (n.message.includes("Failed to fetch") || n.message.includes("NetworkError")) && e < t ? R(e + 1, t) : console.error("Version check failed:", n);
|
|
48
49
|
}
|
|
49
|
-
},
|
|
50
|
+
}, n);
|
|
50
51
|
};
|
|
51
|
-
return
|
|
52
|
+
return y(I, (e) => {
|
|
52
53
|
let t = Date.now();
|
|
53
54
|
if (e) {
|
|
54
|
-
let e = t -
|
|
55
|
-
|
|
56
|
-
} else
|
|
57
|
-
}, { immediate: !0 }),
|
|
58
|
-
clearTimeout(
|
|
59
|
-
}), (e,
|
|
55
|
+
let e = t - O.value;
|
|
56
|
+
F(), e > T.minInactiveTime && R();
|
|
57
|
+
} else O.value = t, P();
|
|
58
|
+
}, { immediate: !0 }), h(() => {
|
|
59
|
+
clearTimeout(L), D.value && D.value.abort();
|
|
60
|
+
}), (e, n) => (g(), d(s, null, [p(t), E.value ? (g(), l(S, {
|
|
60
61
|
key: 0,
|
|
61
62
|
height: "48",
|
|
62
63
|
color: "orange-accent-3",
|
|
63
64
|
elevation: "0",
|
|
64
65
|
order: -1
|
|
65
66
|
}, {
|
|
66
|
-
default:
|
|
67
|
+
default: b(() => [f("div", C, [(g(), l(v(N.value)))])]),
|
|
67
68
|
_: 1
|
|
68
|
-
})) :
|
|
69
|
+
})) : u("", !0)], 64));
|
|
69
70
|
}
|
|
70
71
|
});
|
|
71
|
-
export {
|
|
72
|
+
export { T as default };
|
|
72
73
|
|
|
73
74
|
//# sourceMappingURL=ASystemBar.vue_vue_type_script_setup_true_lang.js.map
|