@anzusystems/common-admin 2.0.0-rc.26 → 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/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/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
|
@@ -14,65 +14,78 @@ function r(r) {
|
|
|
14
14
|
function p(e) {
|
|
15
15
|
i.value = e, f(e);
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
function m(e) {
|
|
18
|
+
typeof document < "u" && Promise.resolve().then(() => {
|
|
19
|
+
let t = document.activeElement;
|
|
20
|
+
t && t !== document.body || p(e);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
let h = [...o.value];
|
|
18
24
|
n(o, (e) => {
|
|
19
25
|
if (i.value === null || e.includes(i.value)) {
|
|
20
|
-
|
|
26
|
+
h = [...e];
|
|
21
27
|
return;
|
|
22
28
|
}
|
|
23
29
|
if (e.length === 0) {
|
|
24
|
-
i.value = null,
|
|
30
|
+
i.value = null, h = [];
|
|
25
31
|
return;
|
|
26
32
|
}
|
|
27
|
-
let t =
|
|
28
|
-
p(e[Math.min(Math.max(t, 0), e.length - 1)]),
|
|
33
|
+
let t = h.indexOf(i.value);
|
|
34
|
+
p(e[Math.min(Math.max(t, 0), e.length - 1)]), h = [...e];
|
|
29
35
|
}), n(o, (e) => {
|
|
30
36
|
a.value !== null && !e.includes(a.value) && (a.value = null);
|
|
37
|
+
}), n(r.isReorderMode, (e) => {
|
|
38
|
+
e || (a.value = null);
|
|
31
39
|
});
|
|
32
|
-
function
|
|
40
|
+
function g() {
|
|
33
41
|
a.value = null;
|
|
34
42
|
}
|
|
35
|
-
function
|
|
43
|
+
function _(e) {
|
|
36
44
|
return !!e?.matches?.("input, textarea, select, [contenteditable], [contenteditable=\"true\"]");
|
|
37
45
|
}
|
|
38
|
-
function
|
|
46
|
+
function v(e) {
|
|
47
|
+
return !!e?.matches?.("button, a[href], summary, [role=\"button\"], [role=\"link\"], [role=\"menuitem\"], [role=\"checkbox\"], [role=\"switch\"], [role=\"tab\"], [role=\"option\"]");
|
|
48
|
+
}
|
|
49
|
+
function y(e, t) {
|
|
39
50
|
if (t.defaultPrevented || r.disabled?.value) return;
|
|
40
51
|
let n = o.value, i = n.indexOf(e);
|
|
41
52
|
if (i < 0) return;
|
|
42
|
-
let s = r.viewItems.value[i], c = r.isReorderMode.value, l = a.value === e, u = a.value !== null, d =
|
|
53
|
+
let s = r.viewItems.value[i], c = r.isReorderMode.value, l = a.value === e, u = a.value !== null, d = _(t.target);
|
|
43
54
|
switch (t.key) {
|
|
44
55
|
case "ArrowUp":
|
|
45
56
|
if (d) return;
|
|
46
|
-
t.preventDefault(), c && l ? r.onMoveUp?.(e) : i > 0 && p(n[i - 1]);
|
|
57
|
+
t.preventDefault(), c && l ? (r.onMoveUp?.(e), m(e)) : i > 0 && p(n[i - 1]);
|
|
47
58
|
return;
|
|
48
59
|
case "ArrowDown":
|
|
49
60
|
if (d) return;
|
|
50
|
-
t.preventDefault(), c && l ? r.onMoveDown?.(e) : i < n.length - 1 && p(n[i + 1]);
|
|
61
|
+
t.preventDefault(), c && l ? (r.onMoveDown?.(e), m(e)) : i < n.length - 1 && p(n[i + 1]);
|
|
51
62
|
return;
|
|
52
63
|
case "Home":
|
|
53
64
|
if (d) return;
|
|
54
|
-
t.preventDefault(), c && l ? r.onMoveTop?.(e) : n.length > 0 && p(n[0]);
|
|
65
|
+
t.preventDefault(), c && l ? (r.onMoveTop?.(e), m(e)) : n.length > 0 && p(n[0]);
|
|
55
66
|
return;
|
|
56
67
|
case "End":
|
|
57
68
|
if (d) return;
|
|
58
|
-
t.preventDefault(), c && l ? r.onMoveBottom?.(e) : n.length > 0 && p(n[n.length - 1]);
|
|
69
|
+
t.preventDefault(), c && l ? (r.onMoveBottom?.(e), m(e)) : n.length > 0 && p(n[n.length - 1]);
|
|
59
70
|
return;
|
|
60
71
|
case "ArrowLeft":
|
|
61
72
|
if (r.variant !== "nested" || d) return;
|
|
62
|
-
t.preventDefault(), c && l && s.canOutdent ? r.onOutdent?.(e) : s.expanded && r.onToggleChildren?.(e, !1);
|
|
73
|
+
t.preventDefault(), c && l && s.canOutdent ? (r.onOutdent?.(e), m(e)) : s.expanded && r.onToggleChildren?.(e, !1);
|
|
63
74
|
return;
|
|
64
75
|
case "ArrowRight":
|
|
65
76
|
if (r.variant !== "nested" || d) return;
|
|
66
|
-
t.preventDefault(), c && l && s.canIndent ? r.onIndent?.(e) : s.canExpand && !s.expanded && r.onToggleChildren?.(e, !0);
|
|
77
|
+
t.preventDefault(), c && l && s.canIndent ? (r.onIndent?.(e), m(e)) : s.canExpand && !s.expanded && r.onToggleChildren?.(e, !0);
|
|
67
78
|
return;
|
|
68
79
|
case "Enter":
|
|
69
80
|
case " ":
|
|
70
|
-
if (d) return;
|
|
71
|
-
t.preventDefault(), c ? l ? a.value = null : a.value = e : r.onToggleEdit?.(e);
|
|
81
|
+
if (d || v(t.target)) return;
|
|
82
|
+
t.preventDefault(), c ? l ? a.value = null : (a.value = e, r.onGrab?.(e)) : r.onToggleEdit?.(e);
|
|
72
83
|
return;
|
|
73
84
|
case "Escape":
|
|
74
85
|
if (u) {
|
|
75
|
-
t.preventDefault()
|
|
86
|
+
t.preventDefault();
|
|
87
|
+
let e = a.value;
|
|
88
|
+
a.value = null, r.onGrabCancel?.(e), m(e);
|
|
76
89
|
return;
|
|
77
90
|
}
|
|
78
91
|
if (c) {
|
|
@@ -96,8 +109,8 @@ function r(r) {
|
|
|
96
109
|
isGrabbed: c,
|
|
97
110
|
rowTabindex: d,
|
|
98
111
|
setFocus: p,
|
|
99
|
-
releaseGrab:
|
|
100
|
-
handleKeydown:
|
|
112
|
+
releaseGrab: g,
|
|
113
|
+
handleKeydown: y
|
|
101
114
|
};
|
|
102
115
|
}
|
|
103
116
|
export { r as useKeyboardNav };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useKeyboardNav.js","names":["el","useKeyboardNav","focusedKey","ref","grabbedKey","orderedKeys","computed","options","v","isFocused","key","isGrabbed","grabbedIndex","totalCount","rowTabindex","ordered","focusRowElement","setFocus","prevOrderedKeys","watch","now","oldIndex","releaseGrab","isFormField","target","handleKeydown","e","focusedItem","inReorder","isGrabbedNow","grabbedSomewhere","onFormField"],"sources":["../../../../src/domains/listEditor/composables/useKeyboardNav.ts"],"sourcesContent":["import { computed, ref, watch, type ComputedRef, type Ref } from 'vue'\nimport type { ListEditorKey } from '@/domains/listEditor/types/listEditorTypes'\n\nexport interface KeyboardNavViewItem {\n key: ListEditorKey\n expanded?: boolean\n canExpand?: boolean\n canIndent?: boolean\n canOutdent?: boolean\n}\n\nexport type KeyboardNavVariant = 'flat' | 'sortable' | 'nested'\n\nexport interface KeyboardNavOptions {\n viewItems: ComputedRef<KeyboardNavViewItem[]>\n variant: KeyboardNavVariant\n isReorderMode: Ref<boolean> | ComputedRef<boolean>\n disabled?: Ref<boolean> | ComputedRef<boolean>\n\n isEditing: (key: ListEditorKey) => boolean\n\n onToggleEdit?: (key: ListEditorKey) => void\n onCancelEdit?: (key: ListEditorKey) => void\n\n onMoveUp?: (key: ListEditorKey) => void\n onMoveDown?: (key: ListEditorKey) => void\n onMoveTop?: (key: ListEditorKey) => void\n onMoveBottom?: (key: ListEditorKey) => void\n\n onIndent?: (key: ListEditorKey) => void\n onOutdent?: (key: ListEditorKey) => void\n onToggleChildren?: (key: ListEditorKey, expand: boolean) => void\n\n onCancelReorder?: () => void\n}\n\nexport interface KeyboardNavApi {\n focusedKey: Ref<ListEditorKey | null>\n grabbedKey: Ref<ListEditorKey | null>\n /** 0-based index of the grabbed row in the current ordering, or -1 if no grab. */\n grabbedIndex: ComputedRef<number>\n /** Total count of rows currently in the editor. */\n totalCount: ComputedRef<number>\n isFocused: (key: ListEditorKey) => boolean\n isGrabbed: (key: ListEditorKey) => boolean\n rowTabindex: (key: ListEditorKey) => number\n setFocus: (key: ListEditorKey | null) => void\n releaseGrab: () => void\n handleKeydown: (key: ListEditorKey, e: KeyboardEvent) => void\n}\n\n// Roving tabindex + keyboard navigation for list-editor rows. Single tabstop\n// per editor; arrow keys move an internal pointer; reorder mode adds a \"grab\"\n// state where Enter/Space picks up the focused row and arrows move it.\nexport function useKeyboardNav(options: KeyboardNavOptions): KeyboardNavApi {\n const focusedKey = ref<ListEditorKey | null>(null)\n const grabbedKey = ref<ListEditorKey | null>(null)\n\n const orderedKeys = computed<ListEditorKey[]>(() => options.viewItems.value.map((v) => v.key))\n\n const isFocused = (key: ListEditorKey): boolean => focusedKey.value === key\n const isGrabbed = (key: ListEditorKey): boolean => grabbedKey.value === key\n\n const grabbedIndex = computed<number>(() => {\n if (grabbedKey.value === null) return -1\n return orderedKeys.value.indexOf(grabbedKey.value)\n })\n\n const totalCount = computed<number>(() => orderedKeys.value.length)\n\n function rowTabindex(key: ListEditorKey): number {\n const ordered = orderedKeys.value\n if (ordered.length === 0) return -1\n if (focusedKey.value === null) return ordered[0] === key ? 0 : -1\n return focusedKey.value === key ? 0 : -1\n }\n\n function focusRowElement(key: ListEditorKey | null) {\n if (key === null || typeof document === 'undefined') return\n void Promise.resolve().then(() => {\n const el = document.querySelector<HTMLElement>(`[data-id=\"${CSS.escape(String(key))}\"]`)\n el?.focus()\n })\n }\n\n function setFocus(key: ListEditorKey | null) {\n focusedKey.value = key\n focusRowElement(key)\n }\n\n // When the focused row is removed (e.g. via delete), fall to the row that\n // took its slot, or to the new last row if it was at the end. Without this,\n // focus vanishes to <body> after a delete and the user has to Tab back in.\n // We snapshot the previous ordering so we can look up where the focused key\n // *was* — by the time the watcher fires, the key is already gone from `now`.\n // eslint-disable-next-line vue/no-ref-object-reactivity-loss\n let prevOrderedKeys: ListEditorKey[] = [...orderedKeys.value]\n watch(orderedKeys, (now) => {\n if (focusedKey.value === null) {\n prevOrderedKeys = [...now]\n return\n }\n if (now.includes(focusedKey.value)) {\n prevOrderedKeys = [...now]\n return\n }\n if (now.length === 0) {\n focusedKey.value = null\n prevOrderedKeys = []\n return\n }\n const oldIndex = prevOrderedKeys.indexOf(focusedKey.value)\n const fallbackIndex = Math.min(Math.max(oldIndex, 0), now.length - 1)\n setFocus(now[fallbackIndex]!)\n prevOrderedKeys = [...now]\n })\n\n // Releasing a grab when the grabbed row is no longer in the list — keeps the\n // grab state consistent if the row gets removed externally.\n watch(orderedKeys, (now) => {\n if (grabbedKey.value !== null && !now.includes(grabbedKey.value)) {\n grabbedKey.value = null\n }\n })\n\n function releaseGrab() {\n grabbedKey.value = null\n }\n\n function isFormField(target: EventTarget | null): boolean {\n const el = target as HTMLElement | null\n return !!el?.matches?.('input, textarea, select, [contenteditable], [contenteditable=\"true\"]')\n }\n\n function handleKeydown(key: ListEditorKey, e: KeyboardEvent) {\n // A nested row's keydown bubbles into its ancestor rows; every key handled below calls\n // `preventDefault`, so an ancestor does not act on it a second time for its own row.\n if (e.defaultPrevented) return\n if (options.disabled?.value) return\n\n const ordered = orderedKeys.value\n const i = ordered.indexOf(key)\n if (i < 0) return\n\n // `ordered` is these view items' keys, so `i` indexes them too.\n const focusedItem = options.viewItems.value[i]!\n const inReorder = options.isReorderMode.value\n const isGrabbedNow = grabbedKey.value === key\n const grabbedSomewhere = grabbedKey.value !== null\n\n // Form fields keep native key behavior (cursor, newlines, selection) for\n // every key except Escape. Esc still closes the edit panel even mid-typing.\n const onFormField = isFormField(e.target)\n\n switch (e.key) {\n case 'ArrowUp':\n if (onFormField) return\n e.preventDefault()\n if (inReorder && isGrabbedNow) {\n options.onMoveUp?.(key)\n } else if (i > 0) {\n setFocus(ordered[i - 1]!)\n }\n return\n\n case 'ArrowDown':\n if (onFormField) return\n e.preventDefault()\n if (inReorder && isGrabbedNow) {\n options.onMoveDown?.(key)\n } else if (i < ordered.length - 1) {\n setFocus(ordered[i + 1]!)\n }\n return\n\n case 'Home':\n if (onFormField) return\n e.preventDefault()\n if (inReorder && isGrabbedNow) {\n options.onMoveTop?.(key)\n } else if (ordered.length > 0) {\n setFocus(ordered[0]!)\n }\n return\n\n case 'End':\n if (onFormField) return\n e.preventDefault()\n if (inReorder && isGrabbedNow) {\n options.onMoveBottom?.(key)\n } else if (ordered.length > 0) {\n setFocus(ordered[ordered.length - 1]!)\n }\n return\n\n case 'ArrowLeft':\n if (options.variant !== 'nested' || onFormField) return\n e.preventDefault()\n if (inReorder && isGrabbedNow && focusedItem.canOutdent) {\n options.onOutdent?.(key)\n } else if (focusedItem.expanded) {\n options.onToggleChildren?.(key, false)\n }\n return\n\n case 'ArrowRight':\n if (options.variant !== 'nested' || onFormField) return\n e.preventDefault()\n if (inReorder && isGrabbedNow && focusedItem.canIndent) {\n options.onIndent?.(key)\n } else if (focusedItem.canExpand && !focusedItem.expanded) {\n options.onToggleChildren?.(key, true)\n }\n return\n\n case 'Enter':\n case ' ': // Space\n if (onFormField) return\n e.preventDefault()\n if (inReorder) {\n if (isGrabbedNow) {\n grabbedKey.value = null\n } else {\n grabbedKey.value = key\n }\n } else {\n options.onToggleEdit?.(key)\n }\n return\n\n case 'Escape':\n if (grabbedSomewhere) {\n e.preventDefault()\n grabbedKey.value = null\n return\n }\n if (inReorder) {\n e.preventDefault()\n options.onCancelReorder?.()\n return\n }\n if (options.isEditing(key)) {\n e.preventDefault()\n options.onCancelEdit?.(key)\n return\n }\n return\n\n default:\n return\n }\n }\n\n return {\n focusedKey,\n grabbedKey,\n grabbedIndex,\n totalCount,\n isFocused,\n isGrabbed,\n rowTabindex,\n setFocus,\n releaseGrab,\n handleKeydown,\n }\n}\n"],"mappings":";;AAsDA,SAAgBC,EAAe,GAA6C;CAC1E,IAAMC,IAAaC,EAA0B,IAAI,GAC3CC,IAAaD,EAA0B,IAAI,GAE3CE,IAAcC,QAAgCC,EAAQ,UAAU,MAAM,KAAK,MAAMC,EAAE,GAAG,CAAC,GAEvFC,KAAa,MAAgCP,EAAW,UAAUQ,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iB,EAAY,YACrBpB,EAAQ,mBAAmBG,GAAK,EAAK;IAEvC;GAEF,KAAK;IACH,IAAIH,EAAQ,YAAY,YAAYwB,GAAa;IAEjD,AADAL,EAAE,eAAe,GACbE,KAAaC,KAAgBF,EAAY,YAC3CpB,EAAQ,WAAWG,CAAG,IACbiB,EAAY,aAAa,CAACA,EAAY,YAC/CpB,EAAQ,mBAAmBG,GAAK,EAAI;IAEtC;GAEF,KAAK;GACL,KAAK;IACH,IAAIqB,GAAa;IAEjB,AADAL,EAAE,eAAe,GACbE,IACEC,IACF,EAAW,QAAQ,OAEnB,EAAW,QAAQnB,IAGrBH,EAAQ,eAAeG,CAAG;IAE5B;GAEF,KAAK;IACH,IAAIoB,GAAkB;KAEpB,AADAJ,EAAE,eAAe,GACjB,EAAW,QAAQ;KACnB;IACF;IACA,IAAIE,GAAW;KAEb,AADAF,EAAE,eAAe,GACjBnB,EAAQ,kBAAkB;KAC1B;IACF;IACA,IAAIA,EAAQ,UAAUG,CAAG,GAAG;KAE1B,AADAgB,EAAE,eAAe,GACjBnB,EAAQ,eAAeG,CAAG;KAC1B;IACF;IACA;GAEF,SACE;EACJ;CACF;CAEA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"useKeyboardNav.js","names":["el","useKeyboardNav","focusedKey","ref","grabbedKey","orderedKeys","computed","options","v","isFocused","key","isGrabbed","grabbedIndex","totalCount","rowTabindex","ordered","focusRowElement","setFocus","refocusIfLost","active","prevOrderedKeys","watch","now","oldIndex","inReorder","releaseGrab","isFormField","target","isOwnControl","handleKeydown","e","focusedItem","isGrabbedNow","grabbedSomewhere","onFormField","grabbed"],"sources":["../../../../src/domains/listEditor/composables/useKeyboardNav.ts"],"sourcesContent":["import { computed, ref, watch, type ComputedRef, type Ref } from 'vue'\nimport type { ListEditorKey } from '@/domains/listEditor/types/listEditorTypes'\n\nexport interface KeyboardNavViewItem {\n key: ListEditorKey\n expanded?: boolean\n canExpand?: boolean\n canIndent?: boolean\n canOutdent?: boolean\n}\n\nexport type KeyboardNavVariant = 'flat' | 'sortable' | 'nested'\n\nexport interface KeyboardNavOptions {\n viewItems: ComputedRef<KeyboardNavViewItem[]>\n variant: KeyboardNavVariant\n isReorderMode: Ref<boolean> | ComputedRef<boolean>\n disabled?: Ref<boolean> | ComputedRef<boolean>\n\n isEditing: (key: ListEditorKey) => boolean\n\n onToggleEdit?: (key: ListEditorKey) => void\n onCancelEdit?: (key: ListEditorKey) => void\n\n onMoveUp?: (key: ListEditorKey) => void\n onMoveDown?: (key: ListEditorKey) => void\n onMoveTop?: (key: ListEditorKey) => void\n onMoveBottom?: (key: ListEditorKey) => void\n\n onIndent?: (key: ListEditorKey) => void\n onOutdent?: (key: ListEditorKey) => void\n onToggleChildren?: (key: ListEditorKey, expand: boolean) => void\n\n /** A row was picked up with Enter/Space in reorder mode. */\n onGrab?: (key: ListEditorKey) => void\n /** Escape dropped the grab: put the row back where `onGrab` found it. */\n onGrabCancel?: (key: ListEditorKey) => void\n\n onCancelReorder?: () => void\n}\n\nexport interface KeyboardNavApi {\n focusedKey: Ref<ListEditorKey | null>\n grabbedKey: Ref<ListEditorKey | null>\n /** 0-based index of the grabbed row in the current ordering, or -1 if no grab. */\n grabbedIndex: ComputedRef<number>\n /** Total count of rows currently in the editor. */\n totalCount: ComputedRef<number>\n isFocused: (key: ListEditorKey) => boolean\n isGrabbed: (key: ListEditorKey) => boolean\n rowTabindex: (key: ListEditorKey) => number\n setFocus: (key: ListEditorKey | null) => void\n releaseGrab: () => void\n handleKeydown: (key: ListEditorKey, e: KeyboardEvent) => void\n}\n\n// Roving tabindex + keyboard navigation for list-editor rows. Single tabstop\n// per editor; arrow keys move an internal pointer; reorder mode adds a \"grab\"\n// state where Enter/Space picks up the focused row and arrows move it.\nexport function useKeyboardNav(options: KeyboardNavOptions): KeyboardNavApi {\n const focusedKey = ref<ListEditorKey | null>(null)\n const grabbedKey = ref<ListEditorKey | null>(null)\n\n const orderedKeys = computed<ListEditorKey[]>(() => options.viewItems.value.map((v) => v.key))\n\n const isFocused = (key: ListEditorKey): boolean => focusedKey.value === key\n const isGrabbed = (key: ListEditorKey): boolean => grabbedKey.value === key\n\n const grabbedIndex = computed<number>(() => {\n if (grabbedKey.value === null) return -1\n return orderedKeys.value.indexOf(grabbedKey.value)\n })\n\n const totalCount = computed<number>(() => orderedKeys.value.length)\n\n function rowTabindex(key: ListEditorKey): number {\n const ordered = orderedKeys.value\n if (ordered.length === 0) return -1\n if (focusedKey.value === null) return ordered[0] === key ? 0 : -1\n return focusedKey.value === key ? 0 : -1\n }\n\n function focusRowElement(key: ListEditorKey | null) {\n if (key === null || typeof document === 'undefined') return\n void Promise.resolve().then(() => {\n const el = document.querySelector<HTMLElement>(`[data-id=\"${CSS.escape(String(key))}\"]`)\n el?.focus()\n })\n }\n\n function setFocus(key: ListEditorKey | null) {\n focusedKey.value = key\n focusRowElement(key)\n }\n\n // A move can re-create the grabbed row's element (indent/outdent puts it under another parent),\n // which drops focus to <body> and every further key with it.\n function refocusIfLost(key: ListEditorKey) {\n if (typeof document === 'undefined') return\n void Promise.resolve().then(() => {\n const active = document.activeElement\n if (!active || active === document.body) setFocus(key)\n })\n }\n\n // When the focused row is removed (e.g. via delete), fall to the row that\n // took its slot, or to the new last row if it was at the end. Without this,\n // focus vanishes to <body> after a delete and the user has to Tab back in.\n // We snapshot the previous ordering so we can look up where the focused key\n // *was* — by the time the watcher fires, the key is already gone from `now`.\n // eslint-disable-next-line vue/no-ref-object-reactivity-loss\n let prevOrderedKeys: ListEditorKey[] = [...orderedKeys.value]\n watch(orderedKeys, (now) => {\n if (focusedKey.value === null) {\n prevOrderedKeys = [...now]\n return\n }\n if (now.includes(focusedKey.value)) {\n prevOrderedKeys = [...now]\n return\n }\n if (now.length === 0) {\n focusedKey.value = null\n prevOrderedKeys = []\n return\n }\n const oldIndex = prevOrderedKeys.indexOf(focusedKey.value)\n const fallbackIndex = Math.min(Math.max(oldIndex, 0), now.length - 1)\n setFocus(now[fallbackIndex]!)\n prevOrderedKeys = [...now]\n })\n\n // Releasing a grab when the grabbed row is no longer in the list — keeps the\n // grab state consistent if the row gets removed externally.\n watch(orderedKeys, (now) => {\n if (grabbedKey.value !== null && !now.includes(grabbedKey.value)) {\n grabbedKey.value = null\n }\n })\n\n watch(options.isReorderMode, (inReorder) => {\n if (!inReorder) grabbedKey.value = null\n })\n\n function releaseGrab() {\n grabbedKey.value = null\n }\n\n function isFormField(target: EventTarget | null): boolean {\n const el = target as HTMLElement | null\n return !!el?.matches?.('input, textarea, select, [contenteditable], [contenteditable=\"true\"]')\n }\n\n // A row's own buttons and links (move up/down, edit, delete, menus) activate on Enter/Space themselves.\n function isOwnControl(target: EventTarget | null): boolean {\n const el = target as HTMLElement | null\n return !!el?.matches?.(\n 'button, a[href], summary, [role=\"button\"], [role=\"link\"], [role=\"menuitem\"], [role=\"checkbox\"], [role=\"switch\"], [role=\"tab\"], [role=\"option\"]'\n )\n }\n\n function handleKeydown(key: ListEditorKey, e: KeyboardEvent) {\n // A nested row's keydown bubbles into its ancestor rows; every key handled below calls\n // `preventDefault`, so an ancestor does not act on it a second time for its own row.\n if (e.defaultPrevented) return\n if (options.disabled?.value) return\n\n const ordered = orderedKeys.value\n const i = ordered.indexOf(key)\n if (i < 0) return\n\n // `ordered` is these view items' keys, so `i` indexes them too.\n const focusedItem = options.viewItems.value[i]!\n const inReorder = options.isReorderMode.value\n const isGrabbedNow = grabbedKey.value === key\n const grabbedSomewhere = grabbedKey.value !== null\n\n // Form fields keep native key behavior (cursor, newlines, selection) for\n // every key except Escape. Esc still closes the edit panel even mid-typing.\n const onFormField = isFormField(e.target)\n\n switch (e.key) {\n case 'ArrowUp':\n if (onFormField) return\n e.preventDefault()\n if (inReorder && isGrabbedNow) {\n options.onMoveUp?.(key)\n refocusIfLost(key)\n } else if (i > 0) {\n setFocus(ordered[i - 1]!)\n }\n return\n\n case 'ArrowDown':\n if (onFormField) return\n e.preventDefault()\n if (inReorder && isGrabbedNow) {\n options.onMoveDown?.(key)\n refocusIfLost(key)\n } else if (i < ordered.length - 1) {\n setFocus(ordered[i + 1]!)\n }\n return\n\n case 'Home':\n if (onFormField) return\n e.preventDefault()\n if (inReorder && isGrabbedNow) {\n options.onMoveTop?.(key)\n refocusIfLost(key)\n } else if (ordered.length > 0) {\n setFocus(ordered[0]!)\n }\n return\n\n case 'End':\n if (onFormField) return\n e.preventDefault()\n if (inReorder && isGrabbedNow) {\n options.onMoveBottom?.(key)\n refocusIfLost(key)\n } else if (ordered.length > 0) {\n setFocus(ordered[ordered.length - 1]!)\n }\n return\n\n case 'ArrowLeft':\n if (options.variant !== 'nested' || onFormField) return\n e.preventDefault()\n if (inReorder && isGrabbedNow && focusedItem.canOutdent) {\n options.onOutdent?.(key)\n refocusIfLost(key)\n } else if (focusedItem.expanded) {\n options.onToggleChildren?.(key, false)\n }\n return\n\n case 'ArrowRight':\n if (options.variant !== 'nested' || onFormField) return\n e.preventDefault()\n if (inReorder && isGrabbedNow && focusedItem.canIndent) {\n options.onIndent?.(key)\n refocusIfLost(key)\n } else if (focusedItem.canExpand && !focusedItem.expanded) {\n options.onToggleChildren?.(key, true)\n }\n return\n\n case 'Enter':\n case ' ': // Space\n if (onFormField || isOwnControl(e.target)) return\n e.preventDefault()\n if (inReorder) {\n if (isGrabbedNow) {\n grabbedKey.value = null\n } else {\n grabbedKey.value = key\n options.onGrab?.(key)\n }\n } else {\n options.onToggleEdit?.(key)\n }\n return\n\n case 'Escape':\n if (grabbedSomewhere) {\n e.preventDefault()\n const grabbed = grabbedKey.value!\n grabbedKey.value = null\n options.onGrabCancel?.(grabbed)\n refocusIfLost(grabbed)\n return\n }\n if (inReorder) {\n e.preventDefault()\n options.onCancelReorder?.()\n return\n }\n if (options.isEditing(key)) {\n e.preventDefault()\n options.onCancelEdit?.(key)\n return\n }\n return\n\n default:\n return\n }\n }\n\n return {\n focusedKey,\n grabbedKey,\n grabb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AGtBH,EAAQ,eAAeG,CAAG;IAE5B;GAEF,KAAK;IACH,IAAIuB,GAAkB;KACpB,EAAE,eAAe;KACjB,IAAME,IAAU/B,EAAW;KAG3B,AAFA,EAAW,QAAQ,MACnBG,EAAQ,eAAe4B,CAAO,GAC9BjB,EAAciB,CAAO;KACrB;IACF;IACA,IAAIX,GAAW;KAEb,AADAM,EAAE,eAAe,GACjBvB,EAAQ,kBAAkB;KAC1B;IACF;IACA,IAAIA,EAAQ,UAAUG,CAAG,GAAG;KAE1B,AADAoB,EAAE,eAAe,GACjBvB,EAAQ,eAAeG,CAAG;KAC1B;IACF;IACA;GAEF,SACE;EACJ;CACF;CAEA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
|
|
@@ -18,6 +18,7 @@ declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {
|
|
|
18
18
|
refresh: import('@vueuse/shared').UseDebounceFnReturn<() => Promise<void>>;
|
|
19
19
|
resetFilter: () => void;
|
|
20
20
|
submitFilter: () => void;
|
|
21
|
+
carryViewTo: (type: LogTypeType) => void;
|
|
21
22
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
22
23
|
"update:loading": (value: boolean) => any;
|
|
23
24
|
} & {
|
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
import e from "../../ui/components/ACopyText.js";
|
|
2
2
|
import t from "../../filters/datatable/components/ADatatableConfigButton.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { createDatatableColumnsConfig as
|
|
6
|
-
import { DatatablePaginationKey as
|
|
7
|
-
import { useFilterHelpers as
|
|
8
|
-
import { usePagination as
|
|
3
|
+
import n from "../../ui/datetime/components/ADatetime.js";
|
|
4
|
+
import r from "../../filters/datatable/components/ADatatablePagination.js";
|
|
5
|
+
import { createDatatableColumnsConfig as ee } from "../../filters/datatable/composables/createDatatableColumnsConfig.js";
|
|
6
|
+
import { DatatablePaginationKey as i, FilterConfigKey as a, FilterDataKey as te } from "../../filters/utils/filterInjectionKeys.js";
|
|
7
|
+
import { buildFilterHash as o, useFilterClearHelpers as s, useFilterHelpers as c } from "../../filters/composables/filterFactory.js";
|
|
8
|
+
import { usePagination as l } from "../../api/composables/pagination.js";
|
|
9
|
+
import { SortOrder as u } from "../../api/types/SortOrder.js";
|
|
9
10
|
import "../../filters/datatable/utils/datatableColumns.js";
|
|
10
|
-
import { useLogListActions as
|
|
11
|
-
import { LogType as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
11
|
+
import { useLogListActions as d } from "../composables/logActions.js";
|
|
12
|
+
import { LogType as f } from "../composables/logType.js";
|
|
13
|
+
import { logFilterStorageKey as p } from "../filter/logFilter.js";
|
|
14
|
+
import { isNull as m, isUndefined as h } from "../../../shared/utils/common.js";
|
|
15
|
+
import { isDevelopment as g } from "../../../shared/utils/development.js";
|
|
16
|
+
import { createBlock as _, createCommentVNode as v, createElementBlock as y, createElementVNode as b, createTextVNode as ne, createVNode as x, defineComponent as S, inject as C, isRef as w, mergeModels as T, onBeforeUnmount as E, onMounted as D, openBlock as O, provide as k, toDisplayString as A, unref as j, useModel as M, watch as N, withCtx as P } from "vue";
|
|
17
|
+
import { useI18n as F } from "vue-i18n";
|
|
18
|
+
import { VSpacer as I } from "vuetify/components/VGrid";
|
|
19
|
+
import { useDebounceFn as L } from "@vueuse/core";
|
|
20
|
+
import { VBtn as R } from "vuetify/components/VBtn";
|
|
21
|
+
import { VDataTableServer as z } from "vuetify/components/VDataTable";
|
|
20
22
|
// src/domains/log/components/ALogDatatable.vue?vue&type=script&setup=true&lang.ts
|
|
21
|
-
var
|
|
23
|
+
var B = { class: "d-flex align-center" }, V = { class: "a-line-clamp-2" }, re = { class: "d-flex justify-end" }, H = /*@__PURE__*/ S({
|
|
22
24
|
__name: "ALogDatatable",
|
|
23
|
-
props: /*@__PURE__*/
|
|
25
|
+
props: /*@__PURE__*/ T({
|
|
24
26
|
client: { type: Function },
|
|
25
27
|
system: {},
|
|
26
28
|
type: {},
|
|
@@ -33,75 +35,77 @@ var F = { class: "d-flex align-center" }, I = { class: "a-line-clamp-2" }, L = {
|
|
|
33
35
|
},
|
|
34
36
|
loadingModifiers: {}
|
|
35
37
|
}),
|
|
36
|
-
emits: /*@__PURE__*/
|
|
37
|
-
setup(
|
|
38
|
-
let
|
|
39
|
-
if (
|
|
40
|
-
let { t:
|
|
41
|
-
client:
|
|
42
|
-
system:
|
|
43
|
-
logPaths:
|
|
44
|
-
type:
|
|
45
|
-
loading:
|
|
46
|
-
}), { resetFilter:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}), { pagination: Z } = o("id");
|
|
50
|
-
w(r, Z);
|
|
51
|
-
let { columnsVisible: ae, columnsAll: oe, columnsHidden: Q } = n([
|
|
38
|
+
emits: /*@__PURE__*/ T(["rowClick"], ["update:loading"]),
|
|
39
|
+
setup(S, { expose: T, emit: H }) {
|
|
40
|
+
let U = S, W = H, G = M(S, "loading"), K = C(a), q = C(te);
|
|
41
|
+
if (h(K) || h(q)) throw Error("[ALogDatatable] Incorrect provide/inject config.");
|
|
42
|
+
let { t: J } = F(), { fetchList: Y, listItems: X, datatableHiddenColumns: ie, cancel: ae } = d({
|
|
43
|
+
client: U.client,
|
|
44
|
+
system: U.system,
|
|
45
|
+
logPaths: U.logPaths,
|
|
46
|
+
type: U.type,
|
|
47
|
+
loading: G
|
|
48
|
+
}), { resetFilter: oe, submitFilter: se, loadStoredFilters: ce } = c(q, K, { storeFiltersLocalStorage: p(U.system, U.type) }), { clearAll: le } = s(), { pagination: Z } = l("id");
|
|
49
|
+
k(i, Z);
|
|
50
|
+
let { columnsVisible: ue, columnsAll: de, columnsHidden: Q } = ee([
|
|
52
51
|
{ key: "id" },
|
|
53
52
|
{ key: "datetime" },
|
|
54
53
|
{ key: "levelName" },
|
|
55
54
|
{ key: "message" },
|
|
56
55
|
{ key: "context.appVersion" },
|
|
57
56
|
{ key: "context.contextId" },
|
|
58
|
-
...
|
|
57
|
+
...U.type === f.Audit ? [{ key: "context.resourceName" }, { key: "context.resourceIds" }] : [{ key: "context.httpStatus" }],
|
|
59
58
|
{ key: "context.userId" },
|
|
60
59
|
{ key: "context.ip" }
|
|
61
|
-
],
|
|
62
|
-
await
|
|
63
|
-
}),
|
|
64
|
-
t.id &&
|
|
60
|
+
], ie, "common", "log", { storeColumnsLocalStorage: `table_common_log_${U.type}` }), $ = L(async () => {
|
|
61
|
+
await Y(Z, q, K);
|
|
62
|
+
}), fe = (e, { item: t }) => {
|
|
63
|
+
t.id && W("rowClick", t);
|
|
65
64
|
};
|
|
66
|
-
return
|
|
67
|
-
|
|
68
|
-
}),
|
|
65
|
+
return D(() => {
|
|
66
|
+
le(q, K), ce(Z, $);
|
|
67
|
+
}), g() && N(() => [U.system, U.type], () => {
|
|
69
68
|
console.error("[ALogDatatable] `system` or `type` changed in place. This view must be remounted -- give it :key=\"`${system}/${type}`\". The endpoint and columns are bound at mount.");
|
|
70
|
-
}),
|
|
71
|
-
$.cancel(),
|
|
72
|
-
}),
|
|
69
|
+
}), E(() => {
|
|
70
|
+
$.cancel(), ae();
|
|
71
|
+
}), T({
|
|
73
72
|
refresh: $,
|
|
74
|
-
resetFilter: () =>
|
|
75
|
-
submitFilter: () =>
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
73
|
+
resetFilter: () => oe(Z, $),
|
|
74
|
+
submitFilter: () => se(Z, $),
|
|
75
|
+
carryViewTo: (e) => {
|
|
76
|
+
if (!localStorage) return;
|
|
77
|
+
let t = p(U.system, e), { sortBy: n } = Z.value;
|
|
78
|
+
(!n || n.key === "id" && n.order === u.Desc) && o(K, q) === "" ? localStorage.removeItem(t) : localStorage.setItem(t, o(K, q, n).slice(1));
|
|
79
|
+
}
|
|
80
|
+
}), (ee, i) => (O(), y("div", null, [b("div", B, [x(I), x(t, {
|
|
81
|
+
"columns-hidden": j(Q),
|
|
82
|
+
"onUpdate:columnsHidden": i[0] ||= (e) => w(Q) ? Q.value = e : null,
|
|
83
|
+
"columns-all": j(de)
|
|
84
|
+
}, null, 8, ["columns-hidden", "columns-all"])]), x(z, {
|
|
81
85
|
class: "a-datatable",
|
|
82
|
-
headers:
|
|
83
|
-
items:
|
|
84
|
-
"items-length":
|
|
86
|
+
headers: j(ue),
|
|
87
|
+
items: j(X),
|
|
88
|
+
"items-length": j(X).length,
|
|
85
89
|
"item-value": "id",
|
|
86
|
-
"onClick:row":
|
|
90
|
+
"onClick:row": fe
|
|
87
91
|
}, {
|
|
88
|
-
"item.datetime":
|
|
89
|
-
"item.message":
|
|
90
|
-
"item.context.resourceIds":
|
|
91
|
-
"item.context.contextId":
|
|
92
|
-
"item.context.userId":
|
|
92
|
+
"item.datetime": P(({ item: e }) => [x(n, { "date-time": e.datetime }, null, 8, ["date-time"])]),
|
|
93
|
+
"item.message": P(({ item: e }) => [b("div", V, A(e.message), 1)]),
|
|
94
|
+
"item.context.resourceIds": P(({ item: e }) => [ne(A(e.context.resourceIds.join(", ")), 1)]),
|
|
95
|
+
"item.context.contextId": P(({ item: t }) => [x(e, { value: t.context.contextId }, null, 8, ["value"])]),
|
|
96
|
+
"item.context.userId": P(({ item: t }) => [j(m)(t.context.userId) ? v("", !0) : (O(), _(e, {
|
|
93
97
|
key: 0,
|
|
94
98
|
value: t.context.userId
|
|
95
99
|
}, null, 8, ["value"]))]),
|
|
96
|
-
"item.actions":
|
|
97
|
-
to:
|
|
100
|
+
"item.actions": P(({ item: e }) => [b("div", re, [x(R, {
|
|
101
|
+
to: S.detailRoute(e),
|
|
98
102
|
class: "ml-1",
|
|
99
103
|
icon: "mdi-information-outline",
|
|
100
|
-
"aria-label":
|
|
104
|
+
"aria-label": j(J)("common.button.detail"),
|
|
101
105
|
size: "x-small",
|
|
102
106
|
variant: "text"
|
|
103
107
|
}, null, 8, ["to", "aria-label"])])]),
|
|
104
|
-
bottom:
|
|
108
|
+
bottom: P(() => [x(r, { onChange: j($) }, null, 8, ["onChange"])]),
|
|
105
109
|
_: 1
|
|
106
110
|
}, 8, [
|
|
107
111
|
"headers",
|
|
@@ -110,6 +114,6 @@ var F = { class: "d-flex align-center" }, I = { class: "a-line-clamp-2" }, L = {
|
|
|
110
114
|
])]));
|
|
111
115
|
}
|
|
112
116
|
});
|
|
113
|
-
export {
|
|
117
|
+
export { H as default };
|
|
114
118
|
|
|
115
119
|
//# sourceMappingURL=ALogDatatable.vue_vue_type_script_setup_true_lang.js.map
|
package/dist/domains/log/components/ALogDatatable.vue_vue_type_script_setup_true_lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ALogDatatable.vue_vue_type_script_setup_true_lang.js","names":["_useModel","_openBlock","_createElementBlock","_createElementVNode","_createVNode","_component_VSpacer","ADatatableConfigButton","_unref","_isRef","_component_VDataTableServer","_withCtx","ADatetime","_toDisplayString","_createTextVNode","ACopyText","_createBlock","_component_VBtn","ADatatablePagination","ACopyText_default","ADatatableConfigButton_default","ADatetime_default","ADatatablePagination_default","_hoisted_1","_hoisted_2","_hoisted_3","ALogDatatable_vue_vue_type_script_setup_true_lang_default","\"loading\"","\"loadingModifiers\"","__expose","__emit","props","__props","emit","loading","useModel","filterConfig","inject","FilterConfigKey","filterData","FilterDataKey","isUndefined","useI18n","useLogListActions","useFilterHelpers","usePagination","DatatablePaginationKey","pagination","createDatatableColumnsConfig","LogType","datatableHiddenColumns","getList","useDebounceFn","fetchList","onRowClick","item","onMounted","isDevelopment","watch","onBeforeUnmount","cancel","resetFilter","submitFilter","openBlock","createElementBlock","createElementVNode","createVNode","VSpacer","unref","columnsHidden","_cache","isRef","$event","columnsAll","VDataTableServer","columnsVisible","listItems","withCtx","toDisplayString","createTextVNode","isNull","createCommentVNode","createBlock","VBtn","t"],"sources":["../../../../src/domains/log/components/ALogDatatable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { inject, onMounted, onBeforeUnmount, provide, watch } from 'vue'\nimport type { RouteLocationRaw } from 'vue-router'\nimport { useI18n } from 'vue-i18n'\nimport { useDebounceFn } from '@vueuse/core'\nimport ACopyText from '@/domains/ui/components/ACopyText.vue'\nimport ADatatableConfigButton from '@/domains/filters/datatable/components/ADatatableConfigButton.vue'\nimport ADatetime from '@/domains/ui/datetime/components/ADatetime.vue'\nimport type { AxiosClientFn } from '@/domains/api/utils/client'\nimport ADatatablePagination from '@/domains/filters/datatable/components/ADatatablePagination.vue'\nimport { createDatatableColumnsConfig } from '@/domains/filters/datatable/composables/createDatatableColumnsConfig'\nimport { DatatablePaginationKey, FilterConfigKey, FilterDataKey } from '@/domains/filters/utils/filterInjectionKeys'\nimport { useFilterHelpers } from '@/domains/filters/composables/filterFactory'\nimport { usePagination } from '@/domains/api/composables/pagination'\nimport { SORT_BY_ID } from '@/domains/filters/datatable/utils/datatableColumns'\nimport { useLogListActions } from '@/domains/log/composables/logActions'\nimport { LOG_ENTITY } from '@/domains/log/api/logApi'\nimport { LogType, type LogPaths, type LogTypeType } from '@/domains/log/composables/logType'\nimport type { Log } from '@/domains/log/types/Log'\nimport { isNull, isUndefined } from '@/shared/utils/common'\nimport { isDevelopment } from '@/shared/utils/development'\n\ntype DatatableItem = Log\n\nconst props = defineProps<{\n client: AxiosClientFn\n system: string\n type: LogTypeType\n logPaths: LogPaths\n /** Same mapper the view uses. Needed here so the actions cell stays a real link. */\n detailRoute: (log: Log) => RouteLocationRaw\n}>()\n\nconst emit = defineEmits<{\n (e: 'rowClick', log: Log): void\n}>()\n\n// The spinner belongs to the card above this table, so the flag is owned there.\nconst loading = defineModel<boolean>('loading', { default: false })\n\nconst filterConfig = inject(FilterConfigKey)\nconst filterData = inject(FilterDataKey)\nif (isUndefined(filterConfig) || isUndefined(filterData)) {\n throw new Error('[ALogDatatable] Incorrect provide/inject config.')\n}\n\n// Read once on purpose. These are fixed for this instance's lifetime.\n// The page remounts the view via `:key` on system or type change,\n// because `useApiFetchList` closes over its client and url.\n/* eslint-disable vue/no-setup-props-reactivity-loss */\nconst { t } = useI18n()\nconst { fetchList, listItems, datatableHiddenColumns, cancel } = useLogListActions({\n client: props.client,\n system: props.system,\n logPaths: props.logPaths,\n type: props.type,\n loading,\n})\n\n// No url hash and no local storage. The `logFilter` registry keeps the filter per view in memory.\n// Nothing about a log listing is worth persisting across a reload.\nconst { resetFilter, submitFilter, loadStoredFilters } = useFilterHelpers(filterData, filterConfig, {\n storeFiltersLocalStorage: false,\n populateUrlParams: false,\n})\n\nconst { pagination } = usePagination(SORT_BY_ID)\nprovide(DatatablePaginationKey, pagination)\n\n// Keyed by type, not by system. The column sets differ between app and audit.\n// A column hidden in audit must not disappear from the app table.\nconst { columnsVisible, columnsAll, columnsHidden } = createDatatableColumnsConfig(\n [\n { key: 'id' },\n { key: 'datetime' },\n { key: 'levelName' },\n { key: 'message' },\n { key: 'context.appVersion' },\n { key: 'context.contextId' },\n ...(props.type === LogType.Audit\n ? [{ key: 'context.resourceName' }, { key: 'context.resourceIds' }]\n : [{ key: 'context.httpStatus' }]),\n { key: 'context.userId' },\n { key: 'context.ip' },\n ],\n datatableHiddenColumns,\n 'common',\n LOG_ENTITY,\n { storeColumnsLocalStorage: `table_common_log_${props.type}` }\n)\n/* eslint-enable vue/no-setup-props-reactivity-loss */\n\nconst getList = useDebounceFn(async () => {\n await fetchList(pagination, filterData, filterConfig)\n})\n\nconst onRowClick = (_event: unknown, { item }: { item: DatatableItem }) => {\n if (item.id) emit('rowClick', item)\n}\n\nonMounted(() => {\n // Both persistences are off, so it reads nothing back.\n // It still restores the page a user was on after closing a detail,\n // which `AActionCloseButtonHistory` flags for the next list.\n loadStoredFilters(pagination, getList)\n})\n\n// The code above reads props once, which is only correct while the page remounts this view via `:key`.\n// Otherwise the table would silently keep querying the old endpoint with the old columns.\nif (isDevelopment()) {\n watch(\n () => [props.system, props.type],\n () => {\n console.error(\n '[ALogDatatable] `system` or `type` changed in place. This view must be remounted -- ' +\n 'give it :key=\"`${system}/${type}`\". The endpoint and columns are bound at mount.'\n )\n }\n )\n}\n\nonBeforeUnmount(() => {\n // Both calls, in this order. `cancel()` only invalidates requests already in flight.\n // A pending debounce would fire after unmount, bump the generation past\n // that invalidation and start a request the token treats as current.\n getList.cancel()\n cancel()\n})\n\ndefineExpose({\n refresh: getList,\n resetFilter: () => resetFilter(pagination, getList),\n submitFilter: () => submitFilter(pagination, getList),\n})\n</script>\n\n<template>\n <div>\n <div class=\"d-flex align-center\">\n <VSpacer />\n <ADatatableConfigButton\n v-model:columns-hidden=\"columnsHidden\"\n :columns-all=\"columnsAll\"\n />\n </div>\n <VDataTableServer\n class=\"a-datatable\"\n :headers=\"columnsVisible\"\n :items=\"listItems\"\n :items-length=\"listItems.length\"\n item-value=\"id\"\n @click:row=\"onRowClick\"\n >\n <template #item.datetime=\"{ item }: { item: DatatableItem }\">\n <ADatetime :date-time=\"item.datetime\" />\n </template>\n <template #item.message=\"{ item }: { item: DatatableItem }\">\n <div class=\"a-line-clamp-2\">\n {{ item.message }}\n </div>\n </template>\n <template #item.context.resourceIds=\"{ item }: { item: DatatableItem }\">\n {{ item.context.resourceIds.join(', ') }}\n </template>\n <template #item.context.contextId=\"{ item }: { item: DatatableItem }\">\n <ACopyText :value=\"item.context.contextId\" />\n </template>\n <template #item.context.userId=\"{ item }: { item: DatatableItem }\">\n <ACopyText\n v-if=\"!isNull(item.context.userId)\"\n :value=\"item.context.userId\"\n />\n </template>\n <template #item.actions=\"{ item }: { item: DatatableItem }\">\n <div class=\"d-flex justify-end\">\n <!--\n `:to`, not a click handler. An anchor makes middle-click and open-in-new-tab work.\n The smoke spec also scrapes it to find a row id.\n -->\n <VBtn\n :to=\"detailRoute(item)\"\n class=\"ml-1\"\n icon=\"mdi-information-outline\"\n :aria-label=\"t('common.button.detail')\"\n size=\"x-small\"\n variant=\"text\"\n />\n </div>\n </template>\n <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CAAA,CAAM,CAACzB,EAAK,QAAQ,MAAM,I,aADnCrD,EAAA,GAAAc,EAGED,GAAA;;IADC,OAAOwC,EAAK,QAAQ;;GAGd,gBAAY5C,GAcf,EAdmB,cAAI,CAC7BP,EAaM,OAbNqB,GAaM,CARJpB,EAOEY,GAAA;IANC,IAAIe,EAAA,YAAYuB,CAAI;IACrB,OAAM;IACN,MAAK;IACJ,cAAY/C,EAAA4E,CAAA,CAAC,CAAA,sBAAA;IACd,MAAK;IACL,SAAQ;;GAIH,QAAMzE,QAC2B,CAA1CN,EAA0Ca,IAAA,EAAnB,UAAQV,EAAA2C,CAAA,EAAO,GAAA,MAAA,GAAA,CAAA,UAAA,CAAA,C"}
|
|
1
|
+
{"version":3,"file":"ALogDatatable.vue_vue_type_script_setup_true_lang.js","names":["_useModel","_openBlock","_createElementBlock","_createElementVNode","_createVNode","_component_VSpacer","ADatatableConfigButton","_unref","_isRef","_component_VDataTableServer","_withCtx","ADatetime","_toDisplayString","_createTextVNode","ACopyText","_createBlock","_component_VBtn","ADatatablePagination","ACopyText_default","ADatatableConfigButton_default","ADatetime_default","ADatatablePagination_default","_hoisted_1","_hoisted_2","_hoisted_3","ALogDatatable_vue_vue_type_script_setup_true_lang_default","\"loading\"","\"loadingModifiers\"","__expose","__emit","props","__props","emit","loading","useModel","filterConfig","inject","FilterConfigKey","filterData","FilterDataKey","isUndefined","useI18n","useLogListActions","useFilterHelpers","logFilterStorageKey","useFilterClearHelpers","usePagination","DatatablePaginationKey","pagination","createDatatableColumnsConfig","LogType","datatableHiddenColumns","getList","useDebounceFn","fetchList","onRowClick","item","onMounted","clearAll","loadStoredFilters","isDevelopment","watch","onBeforeUnmount","cancel","resetFilter","submitFilter","key","type","sortBy","SortOrder","buildFilterHash","openBlock","createElementBlock","createElementVNode","createVNode","VSpacer","unref","columnsHidden","_cache","isRef","$event","columnsAll","VDataTableServer","columnsVisible","listItems","withCtx","toDisplayString","createTextVNode","isNull","createCommentVNode","createBlock","VBtn","t"],"sources":["../../../../src/domains/log/components/ALogDatatable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { inject, onMounted, onBeforeUnmount, provide, watch } from 'vue'\nimport type { RouteLocationRaw } from 'vue-router'\nimport { useI18n } from 'vue-i18n'\nimport { useDebounceFn } from '@vueuse/core'\nimport ACopyText from '@/domains/ui/components/ACopyText.vue'\nimport ADatatableConfigButton from '@/domains/filters/datatable/components/ADatatableConfigButton.vue'\nimport ADatetime from '@/domains/ui/datetime/components/ADatetime.vue'\nimport type { AxiosClientFn } from '@/domains/api/utils/client'\nimport ADatatablePagination from '@/domains/filters/datatable/components/ADatatablePagination.vue'\nimport { createDatatableColumnsConfig } from '@/domains/filters/datatable/composables/createDatatableColumnsConfig'\nimport { DatatablePaginationKey, FilterConfigKey, FilterDataKey } from '@/domains/filters/utils/filterInjectionKeys'\nimport { buildFilterHash, useFilterClearHelpers, useFilterHelpers } from '@/domains/filters/composables/filterFactory'\nimport { usePagination } from '@/domains/api/composables/pagination'\nimport { SortOrder } from '@/domains/api/types/SortOrder'\nimport { SORT_BY_ID } from '@/domains/filters/datatable/utils/datatableColumns'\nimport { useLogListActions } from '@/domains/log/composables/logActions'\nimport { LOG_ENTITY } from '@/domains/log/api/logApi'\nimport { LogType, type LogPaths, type LogTypeType } from '@/domains/log/composables/logType'\nimport { logFilterStorageKey } from '@/domains/log/filter/logFilter'\nimport type { Log } from '@/domains/log/types/Log'\nimport { isNull, isUndefined } from '@/shared/utils/common'\nimport { isDevelopment } from '@/shared/utils/development'\n\ntype DatatableItem = Log\n\nconst props = defineProps<{\n client: AxiosClientFn\n system: string\n type: LogTypeType\n logPaths: LogPaths\n /** Same mapper the view uses. Needed here so the actions cell stays a real link. */\n detailRoute: (log: Log) => RouteLocationRaw\n}>()\n\nconst emit = defineEmits<{\n (e: 'rowClick', log: Log): void\n}>()\n\n// The spinner belongs to the card above this table, so the flag is owned there.\nconst loading = defineModel<boolean>('loading', { default: false })\n\nconst filterConfig = inject(FilterConfigKey)\nconst filterData = inject(FilterDataKey)\nif (isUndefined(filterConfig) || isUndefined(filterData)) {\n throw new Error('[ALogDatatable] Incorrect provide/inject config.')\n}\n\n// Read once on purpose. These are fixed for this instance's lifetime.\n// The page remounts the view via `:key` on system or type change,\n// because `useApiFetchList` closes over its client and url.\n/* eslint-disable vue/no-setup-props-reactivity-loss */\nconst { t } = useI18n()\nconst { fetchList, listItems, datatableHiddenColumns, cancel } = useLogListActions({\n client: props.client,\n system: props.system,\n logPaths: props.logPaths,\n type: props.type,\n loading,\n})\n\n// In the url hash and local storage, as any other list, so a reload, a shared link or Back shows the same logs.\n// Keyed by system like the `logFilter` registry, and by type, so neither opens on the page of the other.\nconst { resetFilter, submitFilter, loadStoredFilters } = useFilterHelpers(filterData, filterConfig, {\n storeFiltersLocalStorage: logFilterStorageKey(props.system, props.type),\n})\nconst { clearAll } = useFilterClearHelpers()\n\nconst { pagination } = usePagination(SORT_BY_ID)\nprovide(DatatablePaginationKey, pagination)\n\n// Keyed by type, not by system. The column sets differ between app and audit.\n// A column hidden in audit must not disappear from the app table.\nconst { columnsVisible, columnsAll, columnsHidden } = createDatatableColumnsConfig(\n [\n { key: 'id' },\n { key: 'datetime' },\n { key: 'levelName' },\n { key: 'message' },\n { key: 'context.appVersion' },\n { key: 'context.contextId' },\n ...(props.type === LogType.Audit\n ? [{ key: 'context.resourceName' }, { key: 'context.resourceIds' }]\n : [{ key: 'context.httpStatus' }]),\n { key: 'context.userId' },\n { key: 'context.ip' },\n ],\n datatableHiddenColumns,\n 'common',\n LOG_ENTITY,\n { storeColumnsLocalStorage: `table_common_log_${props.type}` }\n)\n/* eslint-enable vue/no-setup-props-reactivity-loss */\n\nconst getList = useDebounceFn(async () => {\n await fetchList(pagination, filterData, filterConfig)\n})\n\nconst onRowClick = (_event: unknown, { item }: { item: DatatableItem }) => {\n if (item.id) emit('rowClick', item)\n}\n\nonMounted(() => {\n // The list shows exactly the view of the address, else the one its type saved. The registry may still hold the\n // filter of the other type, which neither a saved view (it leaves out fields at their default) nor a hash naming\n // no field would reset.\n clearAll(filterData, filterConfig)\n // Also restores the page a user was on after closing a detail,\n // which `AActionCloseButtonHistory` flags for the next list.\n loadStoredFilters(pagination, getList)\n})\n\n/** Saves the filter and sort shown, without the page, as the view of `type`, which the type switch opens next. */\nconst carryViewTo = (type: LogTypeType) => {\n if (!localStorage) return\n const key = logFilterStorageKey(props.system, type)\n const { sortBy } = pagination.value\n // Nothing but the default sort: the other type opens as unfiltered, without a hash, as the switch always did.\n const defaultSort = !sortBy || (sortBy.key === SORT_BY_ID && sortBy.order === SortOrder.Desc)\n if (defaultSort && buildFilterHash(filterConfig, filterData) === '') {\n localStorage.removeItem(key)\n return\n }\n localStorage.setItem(key, buildFilterHash(filterConfig, filterData, sortBy).slice(1))\n}\n\n// The code above reads props once, which is only correct while the page remounts this view via `:key`.\n// Otherwise the table would silently keep querying the old endpoint with the old columns.\nif (isDevelopment()) {\n watch(\n () => [props.system, props.type],\n () => {\n console.error(\n '[ALogDatatable] `system` or `type` changed in place. This view must be remounted -- ' +\n 'give it :key=\"`${system}/${type}`\". The endpoint and columns are bound at mount.'\n )\n }\n )\n}\n\nonBeforeUnmount(() => {\n // Both calls, in this order. `cancel()` only invalidates requests already in flight.\n // A pending debounce would fire after unmount, bump the generation past\n // that invalidation and start a request the token treats as current.\n getList.cancel()\n cancel()\n})\n\ndefineExpose({\n refresh: getList,\n resetFilter: () => resetFilter(pagination, getList),\n submitFilter: () => submitFilter(pagination, getList),\n carryViewTo,\n})\n</script>\n\n<template>\n <div>\n <div class=\"d-flex align-center\">\n <VSpacer />\n <ADatatableConfigButton\n v-model:columns-hidden=\"columnsHidden\"\n :columns-all=\"columnsAll\"\n />\n </div>\n <VDataTableServer\n class=\"a-datatable\"\n :headers=\"columnsVisible\"\n :items=\"listItems\"\n :items-length=\"listItems.length\"\n item-value=\"id\"\n @click:row=\"onRowClick\"\n >\n <template #item.datetime=\"{ item }: { item: DatatableItem }\">\n <ADatetime :date-time=\"item.datetime\" />\n </template>\n <template #item.message=\"{ item }: { item: DatatableItem }\">\n <div class=\"a-line-clamp-2\">\n {{ item.message }}\n </div>\n </template>\n <template #item.context.resourceIds=\"{ item }: { item: DatatableItem }\">\n {{ item.context.resourceIds.join(', ') }}\n </template>\n <template #item.context.contextId=\"{ item }: { item: DatatableItem }\">\n <ACopyText :value=\"item.context.contextId\" />\n </template>\n <template #item.context.userId=\"{ item }: { item: DatatableItem }\">\n <ACopyText\n v-if=\"!isNull(item.context.userId)\"\n :value=\"item.context.userId\"\n />\n </template>\n <template #item.actions=\"{ item }: { item: DatatableItem }\">\n <div class=\"d-flex justify-end\">\n <!--\n `:to`, not a click handler. An anchor makes middle-click and open-in-new-tab work.\n The smoke spec also scrapes it to find a row id.\n -->\n <VBtn\n :to=\"detailRoute(item)\"\n class=\"ml-1\"\n icon=\"mdi-information-outline\"\n :aria-label=\"t('common.button.detail')\"\n size=\"x-small\"\n variant=\"text\"\n />\n </div>\n </template>\n <template #bottom>\n <ADatatablePagination @change=\"getList\" />\n </template>\n </VDataTableServer>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0BA,IAAM8B,IAAQC,GASRC,IAAOH,GAKPI,IAAUjC,EAAoB+B,GAAC,SAA6B,GAE5DI,IAAeC,EAAOC,CAAe,GACrCC,IAAaF,EAAOG,EAAa;EACvC,IAAIC,EAAYL,CAAY,KAAKK,EAAYF,CAAU,GACrD,MAAU,MAAM,kDAAkD;EAOpE,IAAM,EAAE,SAAMG,EAAQ,GAChB,EAAE,cAAW,cAAW,4BAAwB,eAAWC,EAAkB;GACjF,QAAQZ,EAAM;GACd,QAAQA,EAAM;GACd,UAAUA,EAAM;GAChB,MAAMA,EAAM;GACZ;EACF,CAAC,GAIK,EAAE,iBAAa,kBAAc,0BAAsBa,EAAiBL,GAAYH,GAAc,EAClG,0BAA0BS,EAAoBd,EAAM,QAAQA,EAAM,IAAI,EACxE,C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B,EAOEY,GAAA;IANC,IAAIe,EAAA,YAAYyB,CAAI;IACrB,OAAM;IACN,MAAK;IACJ,cAAYjD,EAAAqF,CAAA,CAAC,CAAA,sBAAA;IACd,MAAK;IACL,SAAQ;;GAIH,QAAMlF,QAC2B,CAA1CN,EAA0Ca,GAAA,EAAnB,UAAQV,EAAA6C,CAAA,EAAO,GAAA,MAAA,GAAA,CAAA,UAAA,CAAA,C"}
|
|
@@ -25,7 +25,7 @@ var _ = /*@__PURE__*/ l({
|
|
|
25
25
|
let b = p("datatable"), x = f(!1), S = (e) => {
|
|
26
26
|
v.push(_.detailRoute(e));
|
|
27
27
|
}, C = (e) => {
|
|
28
|
-
e !== _.type && v.replace(_.typeRoute(e));
|
|
28
|
+
e !== _.type && (b.value?.carryViewTo(e), v.replace(_.typeRoute(e)));
|
|
29
29
|
};
|
|
30
30
|
return (t, n) => (u(), s(e, { loading: x.value }, {
|
|
31
31
|
default: m(() => [c(g, null, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ALogListView.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","ACard","_withCtx","_createVNode","_component_VCardText","ALogFilter","ALogDatatable","ACard_default","ALogDatatable_default","ALogFilter_default","ALogListView_vue_vue_type_script_setup_true_lang_default","props","__props","router","useRouter","filter","useLogFilter","applyLogTypeVisibility","provide","FilterConfigKey","FilterDataKey","datatable","useTemplateRef","listLoading","ref","onRowClick","log","onChangeType","type","openBlock","createBlock","withCtx","createVNode","VCardText","_cache","$event"],"sources":["../../../../src/domains/log/components/ALogListView.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { provide, ref, useTemplateRef } from 'vue'\nimport type { RouteLocationRaw } from 'vue-router'\nimport { useRouter } from 'vue-router'\nimport ACard from '@/domains/ui/components/ACard.vue'\nimport type { AxiosClientFn } from '@/domains/api/utils/client'\nimport { FilterConfigKey, FilterDataKey } from '@/domains/filters/utils/filterInjectionKeys'\nimport type { TimeIntervalToolsValue } from '@/domains/filters/composables/filterTimeIntervalTools'\nimport ALogDatatable from '@/domains/log/components/ALogDatatable.vue'\nimport ALogFilter from '@/domains/log/components/ALogFilter.vue'\nimport { applyLogTypeVisibility, type LogTimeWindow, useLogFilter } from '@/domains/log/filter/logFilter'\nimport type { LogPaths, LogTypeType } from '@/domains/log/composables/logType'\nimport type { Log } from '@/domains/log/types/Log'\n\nconst props = defineProps<{\n /** Which backend to ask. */\n client: AxiosClientFn\n /** Identity for api naming and error reporting. `coreDam`, not `dam`, where they differ. */\n system: string\n /** From the route, never component state: it picks the endpoint and has to survive a filter reset. */\n type: LogTypeType\n /** Whole paths per type. Comes from the route-side descriptor, which the guard reads too. */\n logPaths: LogPaths\n /** Where a row goes. The library cannot know an app's typed route names, so the app maps it. */\n detailRoute: (log: Log) => RouteLocationRaw\n /** Where the app/audit dropdown goes. Same reason. */\n typeRoute: (type: LogTypeType) => RouteLocationRaw\n /** Mandatory time bound, as admin-dam has today. Omitted means no bound at all. */\n defaultTimeWindow?: LogTimeWindow | undefined\n /** `allowed` for the interval filter. Omitted means the library's full preset list. */\n allowedTimeIntervals?: TimeIntervalToolsValue[] | undefined\n}>()\n\nconst router = useRouter()\n\n// Read once: keyed remount, as in the datatable below.\n// eslint-disable-next-line vue/no-setup-props-reactivity-loss\nconst filter = useLogFilter(props.system, props.defaultTimeWindow)\n// Every mount, not only on a type change: the registry returns the config the last visit left,\n// so the flags still describe that visit's type. See `applyLogTypeVisibility`.\n// eslint-disable-next-line vue/no-setup-props-reactivity-loss\napplyLogTypeVisibility(filter, props.type)\n\nprovide(FilterConfigKey, filter.filterConfig)\nprovide(FilterDataKey, filter.filterData)\n\nconst datatable = useTemplateRef<InstanceType<typeof ALogDatatable>>('datatable')\nconst listLoading = ref(false)\n\nconst onRowClick = (log: Log) => {\n router.push(props.detailRoute(log))\n}\n\nconst onChangeType = (type: LogTypeType) => {\n if (type === props.type) return\n router.replace(props.typeRoute(type))\n}\n</script>\n\n<template>\n <ACard :loading=\"listLoading\">\n <VCardText>\n <ALogFilter\n :type=\"type\"\n :allowed-time-intervals=\"allowedTimeIntervals\"\n @submit=\"datatable?.submitFilter()\"\n @reset=\"datatable?.resetFilter()\"\n @change-type=\"onChangeType\"\n />\n <ALogDatatable\n ref=\"datatable\"\n v-model:loading=\"listLoading\"\n :client=\"client\"\n :system=\"system\"\n :type=\"type\"\n :log-paths=\"logPaths\"\n :detail-route=\"detailRoute\"\n @row-click=\"onRowClick\"\n />\n </VCardText>\n </ACard>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;EAcA,IAAMY,IAAQC,GAmBRC,IAASC,EAAU,GAInBC,IAASC,EAAaL,EAAM,QAAQA,EAAM,iBAAiB;EAOjE,AAHAM,EAAuBF,GAAQJ,EAAM,IAAI,GAEzCO,EAAQC,GAAiBJ,EAAO,YAAY,GAC5CG,EAAQE,GAAeL,EAAO,UAAU;EAExC,IAAMM,IAAYC,EAAmD,WAAW,GAC1EC,IAAcC,EAAI,EAAK,GAEvBC,KAAc,MAAa;GAC/B,EAAO,KAAKd,EAAM,YAAYe,CAAG,CAAC;EACpC,GAEMC,KAAgB,MAAsB;GAC1C,AAAIC,MAASjB,EAAM,
|
|
1
|
+
{"version":3,"file":"ALogListView.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","ACard","_withCtx","_createVNode","_component_VCardText","ALogFilter","ALogDatatable","ACard_default","ALogDatatable_default","ALogFilter_default","ALogListView_vue_vue_type_script_setup_true_lang_default","props","__props","router","useRouter","filter","useLogFilter","applyLogTypeVisibility","provide","FilterConfigKey","FilterDataKey","datatable","useTemplateRef","listLoading","ref","onRowClick","log","onChangeType","type","openBlock","createBlock","withCtx","createVNode","VCardText","_cache","$event"],"sources":["../../../../src/domains/log/components/ALogListView.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { provide, ref, useTemplateRef } from 'vue'\nimport type { RouteLocationRaw } from 'vue-router'\nimport { useRouter } from 'vue-router'\nimport ACard from '@/domains/ui/components/ACard.vue'\nimport type { AxiosClientFn } from '@/domains/api/utils/client'\nimport { FilterConfigKey, FilterDataKey } from '@/domains/filters/utils/filterInjectionKeys'\nimport type { TimeIntervalToolsValue } from '@/domains/filters/composables/filterTimeIntervalTools'\nimport ALogDatatable from '@/domains/log/components/ALogDatatable.vue'\nimport ALogFilter from '@/domains/log/components/ALogFilter.vue'\nimport { applyLogTypeVisibility, type LogTimeWindow, useLogFilter } from '@/domains/log/filter/logFilter'\nimport type { LogPaths, LogTypeType } from '@/domains/log/composables/logType'\nimport type { Log } from '@/domains/log/types/Log'\n\nconst props = defineProps<{\n /** Which backend to ask. */\n client: AxiosClientFn\n /** Identity for api naming and error reporting. `coreDam`, not `dam`, where they differ. */\n system: string\n /** From the route, never component state: it picks the endpoint and has to survive a filter reset. */\n type: LogTypeType\n /** Whole paths per type. Comes from the route-side descriptor, which the guard reads too. */\n logPaths: LogPaths\n /** Where a row goes. The library cannot know an app's typed route names, so the app maps it. */\n detailRoute: (log: Log) => RouteLocationRaw\n /** Where the app/audit dropdown goes. Same reason. */\n typeRoute: (type: LogTypeType) => RouteLocationRaw\n /** Mandatory time bound, as admin-dam has today. Omitted means no bound at all. */\n defaultTimeWindow?: LogTimeWindow | undefined\n /** `allowed` for the interval filter. Omitted means the library's full preset list. */\n allowedTimeIntervals?: TimeIntervalToolsValue[] | undefined\n}>()\n\nconst router = useRouter()\n\n// Read once: keyed remount, as in the datatable below.\n// eslint-disable-next-line vue/no-setup-props-reactivity-loss\nconst filter = useLogFilter(props.system, props.defaultTimeWindow)\n// Every mount, not only on a type change: the registry returns the config the last visit left,\n// so the flags still describe that visit's type. See `applyLogTypeVisibility`.\n// eslint-disable-next-line vue/no-setup-props-reactivity-loss\napplyLogTypeVisibility(filter, props.type)\n\nprovide(FilterConfigKey, filter.filterConfig)\nprovide(FilterDataKey, filter.filterData)\n\nconst datatable = useTemplateRef<InstanceType<typeof ALogDatatable>>('datatable')\nconst listLoading = ref(false)\n\nconst onRowClick = (log: Log) => {\n router.push(props.detailRoute(log))\n}\n\nconst onChangeType = (type: LogTypeType) => {\n if (type === props.type) return\n // The other type opens with the filter shown here, on its first page, and puts it into the address: through\n // its saved view, as the route itself takes no hash (a value with `%` would not survive the push).\n datatable.value?.carryViewTo(type)\n router.replace(props.typeRoute(type))\n}\n</script>\n\n<template>\n <ACard :loading=\"listLoading\">\n <VCardText>\n <ALogFilter\n :type=\"type\"\n :allowed-time-intervals=\"allowedTimeIntervals\"\n @submit=\"datatable?.submitFilter()\"\n @reset=\"datatable?.resetFilter()\"\n @change-type=\"onChangeType\"\n />\n <ALogDatatable\n ref=\"datatable\"\n v-model:loading=\"listLoading\"\n :client=\"client\"\n :system=\"system\"\n :type=\"type\"\n :log-paths=\"logPaths\"\n :detail-route=\"detailRoute\"\n @row-click=\"onRowClick\"\n />\n </VCardText>\n </ACard>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;EAcA,IAAMY,IAAQC,GAmBRC,IAASC,EAAU,GAInBC,IAASC,EAAaL,EAAM,QAAQA,EAAM,iBAAiB;EAOjE,AAHAM,EAAuBF,GAAQJ,EAAM,IAAI,GAEzCO,EAAQC,GAAiBJ,EAAO,YAAY,GAC5CG,EAAQE,GAAeL,EAAO,UAAU;EAExC,IAAMM,IAAYC,EAAmD,WAAW,GAC1EC,IAAcC,EAAI,EAAK,GAEvBC,KAAc,MAAa;GAC/B,EAAO,KAAKd,EAAM,YAAYe,CAAG,CAAC;EACpC,GAEMC,KAAgB,MAAsB;GAC1C,AAAIC,MAASjB,EAAM,SAGnBU,EAAU,OAAO,YAAYO,CAAI,GACjCf,EAAO,QAAQF,EAAM,UAAUiB,CAAI,CAAC;EACtC;E,kBAIE7B,EAAA,GAAAC,EAoBQC,GAAA,EApBA,SAASsB,EAAA,MAAW,GAAA;GAC1B,SAAArB,QAkBY,CAlBZC,EAkBYC,GAAA,MAAA;IAjBV,SAAAF,QAME,CANFC,EAMEE,GAAA;KALC,MAAMO,EAAA;KACN,0BAAwBA,EAAA;KACxB,UAAM,AAAAsB,EAAA,QAAA,MAAEb,EAAA,OAAW,aAAY;KAC/B,SAAK,AAAAa,EAAA,QAAA,MAAEb,EAAA,OAAW,YAAW;KAChB;I,iDAEhBlB,EASEG,GAAA;KARI,SAAA;KAAJ,KAAIe;KACI,SAASE,EAAA;KAAA,oBAAA,AAAAW,EAAA,QAAA,MAAA,EAAW,QAAAC;KAC3B,QAAQvB,EAAA;KACR,QAAQA,EAAA;KACR,MAAMA,EAAA;KACN,aAAWA,EAAA;KACX,gBAAcA,EAAA;KACH"}
|
|
@@ -133,6 +133,11 @@ export declare function useLogFilter(system: string, window: LogTimeWindow | und
|
|
|
133
133
|
* bar shows an unapplied filter, and its close button would destroy the kept value.
|
|
134
134
|
*/
|
|
135
135
|
export declare const applyLogTypeVisibility: (filter: LogFilter, type: LogTypeType) => void;
|
|
136
|
+
/**
|
|
137
|
+
* Local storage key of the view of a log list (`ALogDatatable`). By system, like the registry, and by type: each type
|
|
138
|
+
* keeps its own page. The type switch carries the filter over (`carryViewTo` of the datatable).
|
|
139
|
+
*/
|
|
140
|
+
export declare const logFilterStorageKey: (system: string, type: LogTypeType) => string;
|
|
136
141
|
/** For tests and for anything that needs a clean slate; nothing in the views calls it. */
|
|
137
142
|
export declare const resetLogFilterRegistry: () => void;
|
|
138
143
|
export {};
|
|
@@ -93,7 +93,7 @@ var c = (e, t) => {
|
|
|
93
93
|
let n = e.filterConfig.fields[t];
|
|
94
94
|
n.exclude = r, n.render.skip = r, n.render.selected = !r;
|
|
95
95
|
});
|
|
96
|
-
}
|
|
97
|
-
export { c as applyLogTypeVisibility, s as useLogFilter };
|
|
96
|
+
}, l = (e, t) => `tableFilter_common_log_${e}_${t}`;
|
|
97
|
+
export { c as applyLogTypeVisibility, l as logFilterStorageKey, s as useLogFilter };
|
|
98
98
|
|
|
99
99
|
//# sourceMappingURL=logFilter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logFilter.js","names":["AUDIT_ONLY_FIELDS","logFilterFields","window","isDefined","registry","useLogFilter","existing","system","fields","created","createFilter","createFilterStore","applyLogTypeVisibility","hide","type","LogType","field","filter","name"],"sources":["../../../../src/domains/log/filter/logFilter.ts"],"sourcesContent":["import {\n createFilter,\n createFilterStore,\n type FilterConfig,\n type FilterData,\n type MakeFilterOption,\n} from '@/domains/filters/composables/filterFactory'\nimport { LOG_ENTITY } from '@/domains/log/api/logApi'\nimport { LogType, type LogTypeType } from '@/domains/log/composables/logType'\nimport type { DatetimeUTC } from '@/shared/types/common'\nimport { isDefined } from '@/shared/utils/common'\n\nexport interface LogTimeWindow {\n from: DatetimeUTC\n to: DatetimeUTC\n}\n\n/**\n * Fields that only apply to the audit store. Switching to `app` hides them and keeps them out of the query.\n * It never clears them, so a value survives a round trip through `app`.\n */\nconst AUDIT_ONLY_FIELDS = ['resourceName', 'resourceIds'] as const\n\n/**\n * A factory, not a constant: `defaultTimeWindow` cannot be a seeded value.\n * The window reaches the query via `mandatory` plus `default` on the\n * two interval fields, and `createFilter` reads both from this array.\n */\nconst logFilterFields = (window: LogTimeWindow | undefined) =>\n [\n { name: 'levelName' as const, variant: 'in', default: [] },\n { name: 'id' as const, default: null, type: 'string' },\n // Both are drawn by hand in the `#search` slot of `ALogFilter`.\n // Without `skip` they would appear again in the \"more\" panel.\n {\n name: 'contextId' as const,\n apiName: 'context.contextId',\n default: null,\n type: 'string',\n render: { skip: true },\n },\n { name: 'message' as const, variant: 'startsWith', default: null, type: 'string', render: { skip: true } },\n {\n name: 'appVersion' as const,\n variant: 'startsWith',\n apiName: 'context.appVersion',\n default: null,\n type: 'string',\n },\n { name: 'userId' as const, apiName: 'context.userId', default: null, type: 'integer' },\n { name: 'resourceName' as const, apiName: 'context.resourceName', default: null, type: 'string' },\n {\n name: 'resourceIds' as const,\n apiName: 'context.resourceIds',\n variant: 'in',\n default: [],\n type: 'string',\n },\n // Both are drawn by hand in the `#search` slot of `ALogFilter`.\n // Without `skip` they would appear again in the \"more\" panel.\n // There `FilterDetailItem` has no `timeInterval` case and falls\n // through to `AFilterEmpty`, which prints the bare field name.\n {\n name: 'datetimeFrom' as const,\n apiName: 'datetime',\n type: 'timeInterval',\n related: 'datetimeTo',\n default: window?.from ?? null,\n mandatory: isDefined(window),\n render: { skip: true },\n },\n {\n name: 'datetimeTo' as const,\n apiName: 'datetime',\n type: 'timeInterval',\n exclude: true,\n default: window?.to ?? null,\n mandatory: isDefined(window),\n render: { skip: true },\n },\n ] satisfies readonly MakeFilterOption[]\n\ntype LogFilterFields = ReturnType<typeof logFilterFields>\n\nexport interface LogFilter {\n filterConfig: FilterConfig<LogFilterFields>\n filterData: FilterData<LogFilterFields>\n}\n\n/**\n * Keyed by system, so `/weather/logs` and `/brick/logs` do not overwrite each other.\n * Not keyed by type, so shared fields (context id, level, time\n * range, user, message) survive a switch between app and audit.\n * Module level, so values outlive the component. `createFilterStore` is\n * only a factory, and one created in `setup()` would die with the instance.\n */\nconst registry = new Map<string, LogFilter>()\n\nexport function useLogFilter(system: string, window: LogTimeWindow | undefined): LogFilter {\n const existing = registry.get(system)\n if (existing) {\n if (window) {\n const { fields } = existing.filterConfig\n // A value still at the old default was never chosen by the user, so it moves with the window.\n if (existing.filterData.datetimeFrom === fields.datetimeFrom.default)\n existing.filterData.datetimeFrom = window.from\n if (existing.filterData.datetimeTo === fields.datetimeTo.default) existing.filterData.datetimeTo = window.to\n fields.datetimeFrom.default = window.from\n fields.datetimeTo.default = window.to\n }\n return existing\n }\n\n const fields = logFilterFields(window)\n const created = createFilter(fields, createFilterStore(fields), {\n system: 'common',\n subject: LOG_ENTITY,\n })\n registry.set(system, created)\n\n return created\n}\n\n/**\n * Called on every mount, not only on a type change. The registry returns the\n * `filterConfig` the last visit left, so the flags describe that visit's type.\n * Otherwise landing on an `app` url after an audit visit would send `resourceName` to the app endpoint.\n * Three flags: `FiltersSelected` hides a chip on `render.selected`. Without it the\n * bar shows an unapplied filter, and its close button would destroy the kept value.\n */\nexport const applyLogTypeVisibility = (filter: LogFilter, type: LogTypeType): void => {\n const hide = type !== LogType.Audit\n\n AUDIT_ONLY_FIELDS.forEach((name) => {\n const field = filter.filterConfig.fields[name]\n field.exclude = hide\n field.render.skip = hide\n field.render.selected = !hide\n })\n}\n\n/** For tests and for anything that needs a clean slate; nothing in the views calls it. */\nexport const resetLogFilterRegistry = (): void => {\n registry.clear()\n}\n"],"mappings":";;;;AAqBA,IAAMA,IAAoB,CAAC,gBAAgB,aAAa,GAOlDC,KAAmB,MACvB;CACE;EAAE,MAAM;EAAsB,SAAS;EAAM,SAAS,CAAC;CAAE;CACzD;EAAE,MAAM;EAAe,SAAS;EAAM,MAAM;CAAS;CAGrD;EACE,MAAM;EACN,SAAS;EACT,SAAS;EACT,MAAM;EACN,QAAQ,EAAE,MAAM,GAAK;CACvB;CACA;EAAE,MAAM;EAAoB,SAAS;EAAc,SAAS;EAAM,MAAM;EAAU,QAAQ,EAAE,MAAM,GAAK;CAAE;CACzG;EACE,MAAM;EACN,SAAS;EACT,SAAS;EACT,SAAS;EACT,MAAM;CACR;CACA;EAAE,MAAM;EAAmB,SAAS;EAAkB,SAAS;EAAM,MAAM;CAAU;CACrF;EAAE,MAAM;EAAyB,SAAS;EAAwB,SAAS;EAAM,MAAM;CAAS;CAChG;EACE,MAAM;EACN,SAAS;EACT,SAAS;EACT,SAAS,CAAC;EACV,MAAM;CACR;CAKA;EACE,MAAM;EACN,SAAS;EACT,MAAM;EACN,SAAS;EACT,SAASC,GAAQ,QAAQ;EACzB,WAAWC,EAAUD,CAAM;EAC3B,QAAQ,EAAE,MAAM,GAAK;CACvB;CACA;EACE,MAAM;EACN,SAAS;EACT,MAAM;EACN,SAAS;EACT,SAASA,GAAQ,MAAM;EACvB,WAAWC,EAAUD,CAAM;EAC3B,QAAQ,EAAE,MAAM,GAAK;CACvB;AACF,
|
|
1
|
+
{"version":3,"file":"logFilter.js","names":["AUDIT_ONLY_FIELDS","logFilterFields","window","isDefined","registry","useLogFilter","existing","system","fields","created","createFilter","createFilterStore","applyLogTypeVisibility","hide","type","LogType","field","filter","name","logFilterStorageKey"],"sources":["../../../../src/domains/log/filter/logFilter.ts"],"sourcesContent":["import {\n createFilter,\n createFilterStore,\n type FilterConfig,\n type FilterData,\n type MakeFilterOption,\n} from '@/domains/filters/composables/filterFactory'\nimport { LOG_ENTITY } from '@/domains/log/api/logApi'\nimport { LogType, type LogTypeType } from '@/domains/log/composables/logType'\nimport type { DatetimeUTC } from '@/shared/types/common'\nimport { isDefined } from '@/shared/utils/common'\n\nexport interface LogTimeWindow {\n from: DatetimeUTC\n to: DatetimeUTC\n}\n\n/**\n * Fields that only apply to the audit store. Switching to `app` hides them and keeps them out of the query.\n * It never clears them, so a value survives a round trip through `app`.\n */\nconst AUDIT_ONLY_FIELDS = ['resourceName', 'resourceIds'] as const\n\n/**\n * A factory, not a constant: `defaultTimeWindow` cannot be a seeded value.\n * The window reaches the query via `mandatory` plus `default` on the\n * two interval fields, and `createFilter` reads both from this array.\n */\nconst logFilterFields = (window: LogTimeWindow | undefined) =>\n [\n { name: 'levelName' as const, variant: 'in', default: [] },\n { name: 'id' as const, default: null, type: 'string' },\n // Both are drawn by hand in the `#search` slot of `ALogFilter`.\n // Without `skip` they would appear again in the \"more\" panel.\n {\n name: 'contextId' as const,\n apiName: 'context.contextId',\n default: null,\n type: 'string',\n render: { skip: true },\n },\n { name: 'message' as const, variant: 'startsWith', default: null, type: 'string', render: { skip: true } },\n {\n name: 'appVersion' as const,\n variant: 'startsWith',\n apiName: 'context.appVersion',\n default: null,\n type: 'string',\n },\n { name: 'userId' as const, apiName: 'context.userId', default: null, type: 'integer' },\n { name: 'resourceName' as const, apiName: 'context.resourceName', default: null, type: 'string' },\n {\n name: 'resourceIds' as const,\n apiName: 'context.resourceIds',\n variant: 'in',\n default: [],\n type: 'string',\n },\n // Both are drawn by hand in the `#search` slot of `ALogFilter`.\n // Without `skip` they would appear again in the \"more\" panel.\n // There `FilterDetailItem` has no `timeInterval` case and falls\n // through to `AFilterEmpty`, which prints the bare field name.\n {\n name: 'datetimeFrom' as const,\n apiName: 'datetime',\n type: 'timeInterval',\n related: 'datetimeTo',\n default: window?.from ?? null,\n mandatory: isDefined(window),\n render: { skip: true },\n },\n {\n name: 'datetimeTo' as const,\n apiName: 'datetime',\n type: 'timeInterval',\n exclude: true,\n default: window?.to ?? null,\n mandatory: isDefined(window),\n render: { skip: true },\n },\n ] satisfies readonly MakeFilterOption[]\n\ntype LogFilterFields = ReturnType<typeof logFilterFields>\n\nexport interface LogFilter {\n filterConfig: FilterConfig<LogFilterFields>\n filterData: FilterData<LogFilterFields>\n}\n\n/**\n * Keyed by system, so `/weather/logs` and `/brick/logs` do not overwrite each other.\n * Not keyed by type, so shared fields (context id, level, time\n * range, user, message) survive a switch between app and audit: the switch saves them as the view of the other type\n * (`carryViewTo` of `ALogDatatable`), which restores its view on mount.\n * Module level, so values outlive the component. `createFilterStore` is\n * only a factory, and one created in `setup()` would die with the instance.\n */\nconst registry = new Map<string, LogFilter>()\n\nexport function useLogFilter(system: string, window: LogTimeWindow | undefined): LogFilter {\n const existing = registry.get(system)\n if (existing) {\n if (window) {\n const { fields } = existing.filterConfig\n // A value still at the old default was never chosen by the user, so it moves with the window.\n if (existing.filterData.datetimeFrom === fields.datetimeFrom.default)\n existing.filterData.datetimeFrom = window.from\n if (existing.filterData.datetimeTo === fields.datetimeTo.default) existing.filterData.datetimeTo = window.to\n fields.datetimeFrom.default = window.from\n fields.datetimeTo.default = window.to\n }\n return existing\n }\n\n const fields = logFilterFields(window)\n const created = createFilter(fields, createFilterStore(fields), {\n system: 'common',\n subject: LOG_ENTITY,\n })\n registry.set(system, created)\n\n return created\n}\n\n/**\n * Called on every mount, not only on a type change. The registry returns the\n * `filterConfig` the last visit left, so the flags describe that visit's type.\n * Otherwise landing on an `app` url after an audit visit would send `resourceName` to the app endpoint.\n * Three flags: `FiltersSelected` hides a chip on `render.selected`. Without it the\n * bar shows an unapplied filter, and its close button would destroy the kept value.\n */\nexport const applyLogTypeVisibility = (filter: LogFilter, type: LogTypeType): void => {\n const hide = type !== LogType.Audit\n\n AUDIT_ONLY_FIELDS.forEach((name) => {\n const field = filter.filterConfig.fields[name]\n field.exclude = hide\n field.render.skip = hide\n field.render.selected = !hide\n })\n}\n\n/**\n * Local storage key of the view of a log list (`ALogDatatable`). By system, like the registry, and by type: each type\n * keeps its own page. The type switch carries the filter over (`carryViewTo` of the datatable).\n */\nexport const logFilterStorageKey = (system: string, type: LogTypeType): string =>\n `tableFilter_common_log_${system}_${type}`\n\n/** For tests and for anything that needs a clean slate; nothing in the views calls it. */\nexport const resetLogFilterRegistry = (): void => {\n registry.clear()\n}\n"],"mappings":";;;;AAqBA,IAAMA,IAAoB,CAAC,gBAAgB,aAAa,GAOlDC,KAAmB,MACvB;CACE;EAAE,MAAM;EAAsB,SAAS;EAAM,SAAS,CAAC;CAAE;CACzD;EAAE,MAAM;EAAe,SAAS;EAAM,MAAM;CAAS;CAGrD;EACE,MAAM;EACN,SAAS;EACT,SAAS;EACT,MAAM;EACN,QAAQ,EAAE,MAAM,GAAK;CACvB;CACA;EAAE,MAAM;EAAoB,SAAS;EAAc,SAAS;EAAM,MAAM;EAAU,QAAQ,EAAE,MAAM,GAAK;CAAE;CACzG;EACE,MAAM;EACN,SAAS;EACT,SAAS;EACT,SAAS;EACT,MAAM;CACR;CACA;EAAE,MAAM;EAAmB,SAAS;EAAkB,SAAS;EAAM,MAAM;CAAU;CACrF;EAAE,MAAM;EAAyB,SAAS;EAAwB,SAAS;EAAM,MAAM;CAAS;CAChG;EACE,MAAM;EACN,SAAS;EACT,SAAS;EACT,SAAS,CAAC;EACV,MAAM;CACR;CAKA;EACE,MAAM;EACN,SAAS;EACT,MAAM;EACN,SAAS;EACT,SAASC,GAAQ,QAAQ;EACzB,WAAWC,EAAUD,CAAM;EAC3B,QAAQ,EAAE,MAAM,GAAK;CACvB;CACA;EACE,MAAM;EACN,SAAS;EACT,MAAM;EACN,SA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