@anzusystems/common-admin 2.0.0-rc.4 → 2.0.0-rc.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (680) hide show
  1. package/README.md +1 -1
  2. package/dist/AnzuSystemsCommonAdmin.d.ts +42 -32
  3. package/dist/AnzuSystemsCommonAdmin.js.map +1 -1
  4. package/dist/common-admin.css +1 -1
  5. package/dist/common-admin.js +282 -282
  6. package/dist/domains/anzuUser/api/anzuUserApi.d.ts +9 -12
  7. package/dist/domains/anzuUser/api/anzuUserApi.js.map +1 -1
  8. package/dist/domains/anzuUser/components/AAnzuUserDatatable.js.map +1 -1
  9. package/dist/domains/anzuUser/components/AAnzuUserDatatable.vue.d.ts +38 -44
  10. package/dist/domains/anzuUser/components/AAnzuUserDatatable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  11. package/dist/domains/anzuUser/components/AAnzuUserFilter.js.map +1 -1
  12. package/dist/domains/anzuUser/components/AAnzuUserFilter.vue.d.ts +12 -13
  13. package/dist/domains/anzuUser/components/AAnzuUserFilter.vue_vue_type_script_setup_true_lang.js.map +1 -1
  14. package/dist/domains/anzuUser/components/AAnzuUserForm.js.map +1 -1
  15. package/dist/domains/anzuUser/components/AAnzuUserForm.vue.d.ts +18 -20
  16. package/dist/domains/anzuUser/components/AAnzuUserForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
  17. package/dist/domains/anzuUser/components/AAnzuUserRoleAutocomplete.js.map +1 -1
  18. package/dist/domains/anzuUser/components/AAnzuUserRoleAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  19. package/dist/domains/anzuUser/components/AUserBulkActionDialog.js.map +1 -1
  20. package/dist/domains/anzuUser/components/AUserBulkActionDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  21. package/dist/domains/anzuUser/components/AUserCopyPermissionsDialog.js.map +1 -1
  22. package/dist/domains/anzuUser/components/AUserCopyPermissionsDialog.vue.d.ts +2 -3
  23. package/dist/domains/anzuUser/components/AUserCopyPermissionsDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  24. package/dist/domains/anzuUser/components/AUserCreateInSystemButton.js.map +1 -1
  25. package/dist/domains/anzuUser/components/AUserCreateInSystemButton.vue.d.ts +9 -15
  26. package/dist/domains/anzuUser/components/AUserCreateInSystemButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  27. package/dist/domains/anzuUser/components/AUserEnabledSwitch.js.map +1 -1
  28. package/dist/domains/anzuUser/components/AUserEnabledSwitch.vue.d.ts +8 -7
  29. package/dist/domains/anzuUser/components/AUserEnabledSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
  30. package/dist/domains/anzuUser/components/AUserManageButton.js.map +1 -1
  31. package/dist/domains/anzuUser/components/AUserManageButton.vue.d.ts +0 -1
  32. package/dist/domains/anzuUser/components/AUserManageButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  33. package/dist/domains/anzuUser/components/AUserMetadataForm.js.map +1 -1
  34. package/dist/domains/anzuUser/components/AUserMetadataForm.vue.d.ts +8 -9
  35. package/dist/domains/anzuUser/components/AUserMetadataForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
  36. package/dist/domains/anzuUser/components/AUserMetadataRepairDialog.js.map +1 -1
  37. package/dist/domains/anzuUser/components/AUserMetadataRepairDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  38. package/dist/domains/anzuUser/components/AUserOtherSystemsTable.js.map +1 -1
  39. package/dist/domains/anzuUser/components/AUserOtherSystemsTable.vue.d.ts +1 -2
  40. package/dist/domains/anzuUser/components/AUserOtherSystemsTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  41. package/dist/domains/anzuUser/components/AUserSystemOverview.js.map +1 -1
  42. package/dist/domains/anzuUser/components/AUserSystemOverview.vue_vue_type_script_setup_true_lang.js.map +1 -1
  43. package/dist/domains/anzuUser/components/AUserSystemPanel.js.map +1 -1
  44. package/dist/domains/anzuUser/components/AUserSystemPanel.vue.d.ts +2 -2
  45. package/dist/domains/anzuUser/components/AUserSystemPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  46. package/dist/domains/anzuUser/components/AUserSystemStatusChip.js.map +1 -1
  47. package/dist/domains/anzuUser/components/AUserSystemStatusChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  48. package/dist/domains/anzuUser/components/AUserTabsShell.js.map +1 -1
  49. package/dist/domains/anzuUser/components/AUserTabsShell.vue.d.ts +17 -22
  50. package/dist/domains/anzuUser/components/AUserTabsShell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  51. package/dist/domains/anzuUser/composables/anzuUserActions.d.ts +5 -9
  52. package/dist/domains/anzuUser/composables/anzuUserActions.js.map +1 -1
  53. package/dist/domains/anzuUser/composables/anzuUserValidations.d.ts +4 -6
  54. package/dist/domains/anzuUser/composables/anzuUserValidations.js.map +1 -1
  55. package/dist/domains/anzuUser/composables/cachedAnzuUsers.d.ts +3 -3
  56. package/dist/domains/anzuUser/composables/cachedAnzuUsers.js.map +1 -1
  57. package/dist/domains/anzuUser/composables/userCrossSystemSearch.d.ts +2 -4
  58. package/dist/domains/anzuUser/composables/userCrossSystemSearch.js.map +1 -1
  59. package/dist/domains/anzuUser/composables/userCrossSystemWrites.d.ts +5 -11
  60. package/dist/domains/anzuUser/composables/userCrossSystemWrites.js.map +1 -1
  61. package/dist/domains/anzuUser/composables/userSystemDescriptor.d.ts +33 -57
  62. package/dist/domains/anzuUser/composables/userSystemDescriptor.js.map +1 -1
  63. package/dist/domains/anzuUser/composables/userSystemProbe.d.ts +7 -27
  64. package/dist/domains/anzuUser/composables/userSystemProbe.js.map +1 -1
  65. package/dist/domains/anzuUser/filter/anzuUserFilter.d.ts +6 -16
  66. package/dist/domains/anzuUser/filter/anzuUserFilter.js.map +1 -1
  67. package/dist/domains/anzuUser/store/anzuUserStore.d.ts +1 -5
  68. package/dist/domains/anzuUser/store/anzuUserStore.js.map +1 -1
  69. package/dist/domains/anzuUser/store/userCrossSystemStore.d.ts +3 -14
  70. package/dist/domains/anzuUser/store/userCrossSystemStore.js.map +1 -1
  71. package/dist/domains/anzuUser/utils/userMetadataDiff.d.ts +7 -19
  72. package/dist/domains/anzuUser/utils/userMetadataDiff.js.map +1 -1
  73. package/dist/domains/anzuUser/utils/userSystemState.d.ts +12 -30
  74. package/dist/domains/anzuUser/utils/userSystemState.js.map +1 -1
  75. package/dist/domains/anzuUser/utils/userTabs.d.ts +1 -3
  76. package/dist/domains/anzuUser/utils/userTabs.js.map +1 -1
  77. package/dist/domains/api/composables/defineApiClient.d.ts +4 -8
  78. package/dist/domains/api/composables/defineApiClient.js.map +1 -1
  79. package/dist/domains/api/composables/request.d.ts +18 -48
  80. package/dist/domains/api/composables/request.js.map +1 -1
  81. package/dist/domains/api/composables/useApiFetchByIds.d.ts +7 -21
  82. package/dist/domains/api/composables/useApiFetchByIds.js.map +1 -1
  83. package/dist/domains/api/composables/useApiFetchItems.d.ts +18 -57
  84. package/dist/domains/api/composables/useApiFetchItems.js.map +1 -1
  85. package/dist/domains/api/composables/useApiFetchList.d.ts +7 -23
  86. package/dist/domains/api/composables/useApiFetchList.js.map +1 -1
  87. package/dist/domains/api/composables/useApiFetchListBatch.d.ts +5 -22
  88. package/dist/domains/api/composables/useApiFetchListBatch.js.map +1 -1
  89. package/dist/domains/api/composables/useApiQueryBuilder.js.map +1 -1
  90. package/dist/domains/api/composables/useApiRequest.d.ts +16 -39
  91. package/dist/domains/api/composables/useApiRequest.js.map +1 -1
  92. package/dist/domains/api/utils/apiErrors.d.ts +28 -55
  93. package/dist/domains/api/utils/apiErrors.js.map +1 -1
  94. package/dist/domains/api/utils/listBody.d.ts +22 -43
  95. package/dist/domains/api/utils/listBody.js.map +1 -1
  96. package/dist/domains/auth/components/Acl.js.map +1 -1
  97. package/dist/domains/auth/components/Acl.vue_vue_type_script_setup_true_lang.js.map +1 -1
  98. package/dist/domains/auth/composables/aclAllowed.d.ts +2 -3
  99. package/dist/domains/auth/composables/aclAllowed.js.map +1 -1
  100. package/dist/domains/auth/composables/defineAuth.js.map +1 -1
  101. package/dist/domains/auth/composables/refreshSession.d.ts +10 -13
  102. package/dist/domains/auth/composables/refreshSession.js.map +1 -1
  103. package/dist/domains/cached/components/ACachedChip.js.map +1 -1
  104. package/dist/domains/cached/components/ACachedChip.vue.d.ts +13 -11
  105. package/dist/domains/cached/components/ACachedChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  106. package/dist/domains/cached/components/ACachedUserChip.js +1 -1
  107. package/dist/domains/cached/components/ACachedUserChip.js.map +1 -1
  108. package/dist/domains/cached/components/ACachedUserChip.vue.d.ts +3 -3
  109. package/dist/domains/cached/components/ACachedUserChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  110. package/dist/domains/cached/composables/createUserAndTimeTrackingFields.d.ts +9 -9
  111. package/dist/domains/cached/composables/createUserAndTimeTrackingFields.js.map +1 -1
  112. package/dist/domains/cached/composables/defineCached.d.ts +13 -11
  113. package/dist/domains/cached/composables/defineCached.js.map +1 -1
  114. package/dist/domains/cached/composables/useCachedItem.d.ts +7 -8
  115. package/dist/domains/cached/composables/useCachedItem.js.map +1 -1
  116. package/dist/domains/collab/components/ACollabLockedByUser.js.map +1 -1
  117. package/dist/domains/collab/components/ACollabLockedByUser.vue_vue_type_script_setup_true_lang.js.map +1 -1
  118. package/dist/domains/collab/composables/collabAnyDataChange.js.map +1 -1
  119. package/dist/domains/collab/composables/collabField.d.ts +5 -3
  120. package/dist/domains/collab/composables/collabField.js.map +1 -1
  121. package/dist/domains/collab/composables/collabInit.js +58 -54
  122. package/dist/domains/collab/composables/collabInit.js.map +1 -1
  123. package/dist/domains/collab/composables/collabRecovery.d.ts +49 -0
  124. package/dist/domains/collab/composables/collabRecovery.js +99 -0
  125. package/dist/domains/collab/composables/collabRecovery.js.map +1 -0
  126. package/dist/domains/collab/composables/collabRoom.js +106 -106
  127. package/dist/domains/collab/composables/collabRoom.js.map +1 -1
  128. package/dist/domains/collab/composables/collabState.d.ts +11 -4
  129. package/dist/domains/collab/composables/collabState.js +34 -25
  130. package/dist/domains/collab/composables/collabState.js.map +1 -1
  131. package/dist/domains/collab/composables/commonAdminCollabOptions.d.ts +4 -2
  132. package/dist/domains/collab/types/Collab.d.ts +31 -5
  133. package/dist/domains/collab/types/Collab.js +23 -11
  134. package/dist/domains/collab/types/Collab.js.map +1 -1
  135. package/dist/domains/customDataForm/components/ACustomDataForm.js.map +1 -1
  136. package/dist/domains/customDataForm/components/ACustomDataForm.vue.d.ts +7 -5
  137. package/dist/domains/customDataForm/components/ACustomDataForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
  138. package/dist/domains/customDataForm/components/ACustomDataFormElement.js.map +1 -1
  139. package/dist/domains/customDataForm/components/ACustomDataFormElement.vue_vue_type_script_setup_true_lang.js.map +1 -1
  140. package/dist/domains/customDataForm/components/ACustomDataFormHiddenPart.js.map +1 -1
  141. package/dist/domains/customDataForm/components/ACustomDataFormHiddenPart.vue.d.ts +5 -3
  142. package/dist/domains/customDataForm/components/ACustomDataFormHiddenPart.vue_vue_type_script_setup_true_lang.js.map +1 -1
  143. package/dist/domains/customDataForm/composables/useCustomDataForm.js.map +1 -1
  144. package/dist/domains/customDataForm/types/CustomDataForm.d.ts +4 -1
  145. package/dist/domains/dam/api/damAssetApi.d.ts +7 -7
  146. package/dist/domains/dam/api/damAssetApi.js.map +1 -1
  147. package/dist/domains/dam/api/damAssetLicenceApi.d.ts +1 -1
  148. package/dist/domains/dam/api/damAssetLicenceApi.js.map +1 -1
  149. package/dist/domains/dam/api/damConstants.js.map +1 -1
  150. package/dist/domains/dam/api/damEndPoints.js.map +1 -1
  151. package/dist/domains/dam/api/damImageApi.js.map +1 -1
  152. package/dist/domains/dam/api/uploadApi.js.map +1 -1
  153. package/dist/domains/dam/assetDetail/components/AssetCustomMetadataForm.js.map +1 -1
  154. package/dist/domains/dam/assetDetail/components/AssetCustomMetadataForm.vue.d.ts +7 -5
  155. package/dist/domains/dam/assetDetail/components/AssetCustomMetadataForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
  156. package/dist/domains/dam/assetDetail/components/AssetDetailDialog.js.map +1 -1
  157. package/dist/domains/dam/assetDetail/components/AssetDetailDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  158. package/dist/domains/dam/assetDetail/components/AssetDetailDialogFrame.js.map +1 -1
  159. package/dist/domains/dam/assetDetail/components/AssetDetailDialogFrame.vue.d.ts +1 -1
  160. package/dist/domains/dam/assetDetail/components/AssetDetailDialogFrame.vue_vue_type_script_setup_true_lang.js.map +1 -1
  161. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarActionsWrapper.vue.d.ts +5 -3
  162. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarFrame.js.map +1 -1
  163. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarFrame.vue_vue_type_script_setup_true_lang.js.map +1 -1
  164. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarMetadata.js.map +1 -1
  165. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarMetadata.vue_vue_type_script_setup_true_lang.js.map +1 -1
  166. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarROI.js.map +1 -1
  167. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarROI.vue_vue_type_script_setup_true_lang.js.map +1 -1
  168. package/dist/domains/dam/assetDetail/components/AssetFileInfoPanel.js.map +1 -1
  169. package/dist/domains/dam/assetDetail/components/AssetFileInfoPanel.vue.d.ts +1 -1
  170. package/dist/domains/dam/assetDetail/components/AssetFileInfoPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  171. package/dist/domains/dam/assetDetail/components/AssetImage.js.map +1 -1
  172. package/dist/domains/dam/assetDetail/components/AssetImage.vue.d.ts +1 -1
  173. package/dist/domains/dam/assetDetail/components/AssetImage.vue_vue_type_script_setup_true_lang.js.map +1 -1
  174. package/dist/domains/dam/assetDetail/components/AssetImageMetaIcons.js.map +1 -1
  175. package/dist/domains/dam/assetDetail/components/AssetImageMetaIcons.vue.d.ts +2 -2
  176. package/dist/domains/dam/assetDetail/components/AssetImageMetaIcons.vue_vue_type_script_setup_true_lang.js.map +1 -1
  177. package/dist/domains/dam/assetDetail/components/AssetInfobox.js.map +1 -1
  178. package/dist/domains/dam/assetDetail/components/AssetInfobox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  179. package/dist/domains/dam/assetDetail/components/AssetMetadata.js.map +1 -1
  180. package/dist/domains/dam/assetDetail/components/AssetMetadata.vue_vue_type_script_setup_true_lang.js.map +1 -1
  181. package/dist/domains/dam/assetDetail/composables/assetDetailExtSystem.d.ts +5 -6
  182. package/dist/domains/dam/assetDetail/composables/assetDetailExtSystem.js.map +1 -1
  183. package/dist/domains/dam/assetDetail/composables/assetDetailView.d.ts +10 -10
  184. package/dist/domains/dam/assetDetail/composables/assetDetailView.js.map +1 -1
  185. package/dist/domains/dam/assetDetail/store/assetDetailStore.js.map +1 -1
  186. package/dist/domains/dam/assetDetail/utils/assetMetadataMayStillChange.d.ts +4 -3
  187. package/dist/domains/dam/assetDetail/utils/assetMetadataMayStillChange.js.map +1 -1
  188. package/dist/domains/dam/assetSelect/api/damPodcastApi.js.map +1 -1
  189. package/dist/domains/dam/assetSelect/components/AAssetListInner.js.map +1 -1
  190. package/dist/domains/dam/assetSelect/components/AAssetListInner.vue.d.ts +789 -787
  191. package/dist/domains/dam/assetSelect/components/AAssetListInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  192. package/dist/domains/dam/assetSelect/components/AAssetSelect.js.map +1 -1
  193. package/dist/domains/dam/assetSelect/components/AAssetSelect.vue.d.ts +395 -393
  194. package/dist/domains/dam/assetSelect/components/AAssetSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  195. package/dist/domains/dam/assetSelect/components/AAssetSelectMedia.js.map +1 -1
  196. package/dist/domains/dam/assetSelect/components/AAssetSelectMedia.vue.d.ts +14 -12
  197. package/dist/domains/dam/assetSelect/components/AAssetSelectMedia.vue_vue_type_script_setup_true_lang.js.map +1 -1
  198. package/dist/domains/dam/assetSelect/components/AssetDistributionServiceNameFilter.js.map +1 -1
  199. package/dist/domains/dam/assetSelect/components/AssetDistributionServiceNameFilter.vue_vue_type_script_setup_true_lang.js.map +1 -1
  200. package/dist/domains/dam/assetSelect/components/AssetSelectListBar.js.map +1 -1
  201. package/dist/domains/dam/assetSelect/components/AssetSelectListBar.vue.d.ts +9 -7
  202. package/dist/domains/dam/assetSelect/components/AssetSelectListBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  203. package/dist/domains/dam/assetSelect/components/AssetSelectTableRowItem.js.map +1 -1
  204. package/dist/domains/dam/assetSelect/components/AssetSelectTableRowItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  205. package/dist/domains/dam/assetSelect/composables/assetSelectListActions.js.map +1 -1
  206. package/dist/domains/dam/assetSelect/store/assetSelectStore.js.map +1 -1
  207. package/dist/domains/dam/author/api/authorApi.js.map +1 -1
  208. package/dist/domains/dam/author/components/AuthorCreateButton.js.map +1 -1
  209. package/dist/domains/dam/author/components/AuthorCreateButton.vue.d.ts +1 -1
  210. package/dist/domains/dam/author/components/AuthorCreateButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  211. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteCachedAuthorChip.js.map +1 -1
  212. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteCachedAuthorChip.vue.d.ts +9 -6
  213. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteCachedAuthorChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  214. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteCachedAuthorChipConflicts.js.map +1 -1
  215. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteCachedAuthorChipConflicts.vue_vue_type_script_setup_true_lang.js.map +1 -1
  216. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteWithCached.js +1 -1
  217. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteWithCached.js.map +1 -1
  218. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteWithCached.vue.d.ts +2 -2
  219. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteWithCached.vue_vue_type_script_setup_true_lang.js.map +1 -1
  220. package/dist/domains/dam/author/components/DamAuthorFilterRemoteAutocomplete.js.map +1 -1
  221. package/dist/domains/dam/author/components/DamAuthorFilterRemoteAutocomplete.vue.d.ts +1 -1
  222. package/dist/domains/dam/author/components/DamAuthorFilterRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  223. package/dist/domains/dam/author/composables/cachedAuthors.d.ts +5 -4
  224. package/dist/domains/dam/author/composables/cachedAuthors.js.map +1 -1
  225. package/dist/domains/dam/author/composables/cachedUsers.d.ts +5 -4
  226. package/dist/domains/dam/author/composables/cachedUsers.js.map +1 -1
  227. package/dist/domains/dam/author/composables/damAuthorConfig.d.ts +2 -2
  228. package/dist/domains/dam/author/composables/damAuthorConfig.js.map +1 -1
  229. package/dist/domains/dam/components/DamAdminAssetLink.js.map +1 -1
  230. package/dist/domains/dam/components/DamAdminAssetLink.vue_vue_type_script_setup_true_lang.js.map +1 -1
  231. package/dist/domains/dam/composables/commonAdminCoreDamOptions.d.ts +10 -8
  232. package/dist/domains/dam/composables/commonAdminCoreDamOptions.js.map +1 -1
  233. package/dist/domains/dam/composables/damConfigName.d.ts +8 -9
  234. package/dist/domains/dam/composables/damConfigName.js.map +1 -1
  235. package/dist/domains/dam/composables/damNotifications.d.ts +9 -9
  236. package/dist/domains/dam/composables/damNotifications.js.map +1 -1
  237. package/dist/domains/dam/composables/damNotificationsConnection.d.ts +4 -4
  238. package/dist/domains/dam/composables/damNotificationsConnection.js.map +1 -1
  239. package/dist/domains/dam/composables/damNotificationsEventBus.d.ts +2 -2
  240. package/dist/domains/dam/composables/damNotificationsEventBus.js.map +1 -1
  241. package/dist/domains/dam/composables/extSystemIdForCached.d.ts +5 -4
  242. package/dist/domains/dam/composables/extSystemIdForCached.js.map +1 -1
  243. package/dist/domains/dam/config/api/damAssetCustomFormApi.js.map +1 -1
  244. package/dist/domains/dam/config/api/damConfigApi.js.map +1 -1
  245. package/dist/domains/dam/config/composables/damConfigState.d.ts +5 -5
  246. package/dist/domains/dam/config/composables/damConfigState.js.map +1 -1
  247. package/dist/domains/dam/config/store/damConfigStore.d.ts +5 -4
  248. package/dist/domains/dam/config/store/damConfigStore.js.map +1 -1
  249. package/dist/domains/dam/config/utils/damFilterUserAllowedUploadConfigs.d.ts +3 -1
  250. package/dist/domains/dam/config/utils/damFilterUserAllowedUploadConfigs.js.map +1 -1
  251. package/dist/domains/dam/cropper/components/ACropper.js.map +1 -1
  252. package/dist/domains/dam/cropper/components/ACropper.vue.d.ts +8 -16
  253. package/dist/domains/dam/cropper/components/ACropper.vue_vue_type_script_setup_true_lang.js.map +1 -1
  254. package/dist/domains/dam/cropper/components/DamAssetImageRoiSelect.js.map +1 -1
  255. package/dist/domains/dam/cropper/components/DamAssetImageRoiSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  256. package/dist/domains/dam/cropper/store/imageRoiStore.d.ts +9 -12
  257. package/dist/domains/dam/cropper/store/imageRoiStore.js.map +1 -1
  258. package/dist/domains/dam/cropper/utils/cropperGeometry.d.ts +24 -38
  259. package/dist/domains/dam/cropper/utils/cropperGeometry.js.map +1 -1
  260. package/dist/domains/dam/cropper/utils/cropperJsService.d.ts +3 -7
  261. package/dist/domains/dam/cropper/utils/cropperJsService.js +10 -3
  262. package/dist/domains/dam/cropper/utils/cropperJsService.js.map +1 -1
  263. package/dist/domains/dam/cropper/utils/cropperTypes.d.ts +3 -6
  264. package/dist/domains/dam/cropper/utils/damAssetImageRoiSelectLoader.d.ts +5 -5
  265. package/dist/domains/dam/cropper/utils/damAssetImageRoiSelectLoader.js.map +1 -1
  266. package/dist/domains/dam/imageWidget/components/AImageMediaWidget.js.map +1 -1
  267. package/dist/domains/dam/imageWidget/components/AImageMediaWidget.vue_vue_type_script_setup_true_lang.js.map +1 -1
  268. package/dist/domains/dam/imageWidget/components/AImagePublicInput.js.map +1 -1
  269. package/dist/domains/dam/imageWidget/components/AImagePublicInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  270. package/dist/domains/dam/imageWidget/components/AImageWidget.js.map +1 -1
  271. package/dist/domains/dam/imageWidget/components/AImageWidget.vue_vue_type_script_setup_true_lang.js.map +1 -1
  272. package/dist/domains/dam/imageWidget/components/AImageWidgetMultiple.js.map +1 -1
  273. package/dist/domains/dam/imageWidget/components/AImageWidgetMultiple.vue_vue_type_script_setup_true_lang.js.map +1 -1
  274. package/dist/domains/dam/imageWidget/components/AImageWidgetSimple.vue.d.ts +43 -41
  275. package/dist/domains/dam/imageWidget/components/AMediaWidgetSimple.vue.d.ts +31 -29
  276. package/dist/domains/dam/imageWidget/components/ImageDetailDialogMetadata.js.map +1 -1
  277. package/dist/domains/dam/imageWidget/components/ImageDetailDialogMetadata.vue.d.ts +29 -27
  278. package/dist/domains/dam/imageWidget/components/ImageDetailDialogMetadata.vue_vue_type_script_setup_true_lang.js.map +1 -1
  279. package/dist/domains/dam/imageWidget/components/ImageMassOperations.js.map +1 -1
  280. package/dist/domains/dam/imageWidget/components/ImageMassOperations.vue.d.ts +1 -1
  281. package/dist/domains/dam/imageWidget/components/ImageMassOperations.vue_vue_type_script_setup_true_lang.js.map +1 -1
  282. package/dist/domains/dam/imageWidget/components/ImageMediaWidgetInner.js.map +1 -1
  283. package/dist/domains/dam/imageWidget/components/ImageMediaWidgetInner.vue.d.ts +68 -66
  284. package/dist/domains/dam/imageWidget/components/ImageMediaWidgetInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  285. package/dist/domains/dam/imageWidget/components/ImageWidgetInner.js.map +1 -1
  286. package/dist/domains/dam/imageWidget/components/ImageWidgetInner.vue.d.ts +402 -400
  287. package/dist/domains/dam/imageWidget/components/ImageWidgetInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  288. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleInner.js.map +1 -1
  289. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleInner.vue.d.ts +384 -382
  290. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  291. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleItem.js.map +1 -1
  292. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  293. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleLimitDialog.js.map +1 -1
  294. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleLimitDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  295. package/dist/domains/dam/imageWidget/components/MediaWidgetSimpleDialog.vue.d.ts +7 -5
  296. package/dist/domains/dam/imageWidget/composables/commonAdminImageOptions.js.map +1 -1
  297. package/dist/domains/dam/imageWidget/composables/imageApiCms.js.map +1 -1
  298. package/dist/domains/dam/imageWidget/composables/imageDialogDamAuthors.d.ts +11 -13
  299. package/dist/domains/dam/imageWidget/composables/imageDialogDamAuthors.js.map +1 -1
  300. package/dist/domains/dam/imageWidget/composables/useImageMassOperations.js.map +1 -1
  301. package/dist/domains/dam/imageWidget/store/imageMediaWidgetStore.js.map +1 -1
  302. package/dist/domains/dam/imageWidget/store/imageStore.js.map +1 -1
  303. package/dist/domains/dam/imageWidget/utils/damImage.d.ts +5 -6
  304. package/dist/domains/dam/imageWidget/utils/damImage.js.map +1 -1
  305. package/dist/domains/dam/imageWidget/utils/fieldLockTurns.d.ts +1 -2
  306. package/dist/domains/dam/imageWidget/utils/fieldLockTurns.js.map +1 -1
  307. package/dist/domains/dam/imageWidget/utils/imageSaves.d.ts +10 -14
  308. package/dist/domains/dam/imageWidget/utils/imageSaves.js.map +1 -1
  309. package/dist/domains/dam/imageWidget/utils/metadataToImageMap.js.map +1 -1
  310. package/dist/domains/dam/imageWidget/utils/waitLimit.d.ts +4 -6
  311. package/dist/domains/dam/imageWidget/utils/waitLimit.js.map +1 -1
  312. package/dist/domains/dam/keyword/api/keywordApi.js.map +1 -1
  313. package/dist/domains/dam/keyword/components/DamKeywordFilterRemoteAutocomplete.js.map +1 -1
  314. package/dist/domains/dam/keyword/components/DamKeywordFilterRemoteAutocomplete.vue.d.ts +1 -1
  315. package/dist/domains/dam/keyword/components/DamKeywordFilterRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  316. package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteCachedKeywordChip.js.map +1 -1
  317. package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteCachedKeywordChip.vue.d.ts +8 -5
  318. package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteCachedKeywordChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  319. package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteWithCached.js +1 -1
  320. package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteWithCached.js.map +1 -1
  321. package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteWithCached.vue.d.ts +2 -2
  322. package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteWithCached.vue_vue_type_script_setup_true_lang.js.map +1 -1
  323. package/dist/domains/dam/keyword/composables/cachedKeywords.d.ts +5 -4
  324. package/dist/domains/dam/keyword/composables/cachedKeywords.js.map +1 -1
  325. package/dist/domains/dam/keyword/composables/damKeywordConfig.d.ts +2 -2
  326. package/dist/domains/dam/keyword/composables/damKeywordConfig.js.map +1 -1
  327. package/dist/domains/dam/types/Asset.d.ts +1 -1
  328. package/dist/domains/dam/types/Asset.js.map +1 -1
  329. package/dist/domains/dam/types/UploadQueue.d.ts +5 -4
  330. package/dist/domains/dam/types/UploadQueue.js.map +1 -1
  331. package/dist/domains/dam/uploadQueue/components/AssetCustomMetadataFormMassOperations.js.map +1 -1
  332. package/dist/domains/dam/uploadQueue/components/AssetCustomMetadataFormMassOperations.vue_vue_type_script_setup_true_lang.js.map +1 -1
  333. package/dist/domains/dam/uploadQueue/components/AssetQueueSelectedSidebar.js.map +1 -1
  334. package/dist/domains/dam/uploadQueue/components/AssetQueueSelectedSidebar.vue.d.ts +2 -2
  335. package/dist/domains/dam/uploadQueue/components/AssetQueueSelectedSidebar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  336. package/dist/domains/dam/uploadQueue/components/UploadQueueDialog.js.map +1 -1
  337. package/dist/domains/dam/uploadQueue/components/UploadQueueDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  338. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingle.js.map +1 -1
  339. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingle.vue_vue_type_script_setup_true_lang.js.map +1 -1
  340. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebar.js.map +1 -1
  341. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebar.vue.d.ts +6 -4
  342. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  343. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebarMetadata.js.map +1 -1
  344. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebarMetadata.vue.d.ts +1 -1
  345. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebarMetadata.vue_vue_type_script_setup_true_lang.js.map +1 -1
  346. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebarMetadataContent.js.map +1 -1
  347. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebarMetadataContent.vue_vue_type_script_setup_true_lang.js.map +1 -1
  348. package/dist/domains/dam/uploadQueue/components/UploadQueueEditable.js.map +1 -1
  349. package/dist/domains/dam/uploadQueue/components/UploadQueueEditable.vue.d.ts +6 -6
  350. package/dist/domains/dam/uploadQueue/components/UploadQueueEditable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  351. package/dist/domains/dam/uploadQueue/components/UploadQueueItemEditable.js.map +1 -1
  352. package/dist/domains/dam/uploadQueue/components/UploadQueueItemEditable.vue.d.ts +13 -13
  353. package/dist/domains/dam/uploadQueue/components/UploadQueueItemEditable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  354. package/dist/domains/dam/uploadQueue/components/uploadQueueBindings.d.ts +13 -13
  355. package/dist/domains/dam/uploadQueue/components/uploadQueueBindings.js.map +1 -1
  356. package/dist/domains/dam/uploadQueue/composables/damUploadChunkSize.d.ts +2 -2
  357. package/dist/domains/dam/uploadQueue/composables/damUploadChunkSize.js.map +1 -1
  358. package/dist/domains/dam/uploadQueue/composables/uploadMeter.d.ts +12 -12
  359. package/dist/domains/dam/uploadQueue/composables/uploadMeter.js.map +1 -1
  360. package/dist/domains/dam/uploadQueue/composables/uploadQueueItemRefresh.d.ts +5 -5
  361. package/dist/domains/dam/uploadQueue/composables/uploadQueueItemRefresh.js.map +1 -1
  362. package/dist/domains/dam/uploadQueue/composables/uploadService.d.ts +2 -3
  363. package/dist/domains/dam/uploadQueue/composables/uploadService.js.map +1 -1
  364. package/dist/domains/dam/uploadQueue/composables/useUploadQueueDialog.d.ts +5 -4
  365. package/dist/domains/dam/uploadQueue/composables/useUploadQueueDialog.js.map +1 -1
  366. package/dist/domains/dam/uploadQueue/core/uploadQueueCore.d.ts +3 -2
  367. package/dist/domains/dam/uploadQueue/core/uploadQueueCore.js.map +1 -1
  368. package/dist/domains/dam/uploadQueue/core/uploadQueueCoreTypes.d.ts +8 -5
  369. package/dist/domains/dam/uploadQueue/core/uploadQueueCoreTypes.js.map +1 -1
  370. package/dist/domains/dam/uploadQueue/core/uploadQueueFill.d.ts +3 -3
  371. package/dist/domains/dam/uploadQueue/core/uploadQueueFill.js.map +1 -1
  372. package/dist/domains/dam/uploadQueue/presets/queuePresets.d.ts +8 -5
  373. package/dist/domains/dam/uploadQueue/presets/queuePresets.js.map +1 -1
  374. package/dist/domains/dam/uploadQueue/presets/uploadPresets.d.ts +15 -13
  375. package/dist/domains/dam/uploadQueue/presets/uploadPresets.js.map +1 -1
  376. package/dist/domains/dam/uploadQueue/settlement/uploadPollSchedule.d.ts +7 -7
  377. package/dist/domains/dam/uploadQueue/settlement/uploadPollSchedule.js.map +1 -1
  378. package/dist/domains/dam/uploadQueue/settlement/uploadPoller.d.ts +4 -4
  379. package/dist/domains/dam/uploadQueue/settlement/uploadPoller.js.map +1 -1
  380. package/dist/domains/dam/uploadQueue/settlement/uploadSettle.d.ts +28 -30
  381. package/dist/domains/dam/uploadQueue/settlement/uploadSettle.js.map +1 -1
  382. package/dist/domains/dam/uploadQueue/settlement/uploadSettlement.d.ts +2 -2
  383. package/dist/domains/dam/uploadQueue/settlement/uploadSettlement.js.map +1 -1
  384. package/dist/domains/dam/uploadQueue/settlement/uploadSettlementRuntime.d.ts +2 -2
  385. package/dist/domains/dam/uploadQueue/settlement/uploadSettlementRuntime.js.map +1 -1
  386. package/dist/domains/dam/uploadQueue/settlement/uploadSettlementTypes.d.ts +63 -73
  387. package/dist/domains/dam/uploadQueue/settlement/uploadSettlementTypes.js.map +1 -1
  388. package/dist/domains/dam/uploadQueue/store/uploadQueuesStore.d.ts +8 -9
  389. package/dist/domains/dam/uploadQueue/store/uploadQueuesStore.js.map +1 -1
  390. package/dist/domains/dam/user/api/userApi.d.ts +2 -2
  391. package/dist/domains/dam/user/api/userApi.js.map +1 -1
  392. package/dist/domains/dam/user/components/DamDistributionServiceSelect.js.map +1 -1
  393. package/dist/domains/dam/user/components/DamDistributionServiceSelect.vue.d.ts +1 -1
  394. package/dist/domains/dam/user/components/DamDistributionServiceSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  395. package/dist/domains/dam/user/components/DamExternalProviderAssetSelect.js.map +1 -1
  396. package/dist/domains/dam/user/components/DamExternalProviderAssetSelect.vue.d.ts +1 -1
  397. package/dist/domains/dam/user/components/DamExternalProviderAssetSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  398. package/dist/domains/dam/user/components/DamUserRemoteAutocomplete.js.map +1 -1
  399. package/dist/domains/dam/user/components/DamUserRemoteAutocomplete.vue.d.ts +1 -1
  400. package/dist/domains/dam/user/components/DamUserRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  401. package/dist/domains/dam/user/composables/damUserSelectActions.d.ts +1 -1
  402. package/dist/domains/dam/user/composables/damUserSelectActions.js.map +1 -1
  403. package/dist/domains/dam/user/types/DamDistributionServiceType.d.ts +2 -2
  404. package/dist/domains/dam/user/types/DamDistributionServiceType.js.map +1 -1
  405. package/dist/domains/dam/user/types/DamExternalProviderAssetType.d.ts +1 -1
  406. package/dist/domains/dam/user/types/DamExternalProviderAssetType.js.map +1 -1
  407. package/dist/domains/filters/bookmarks/components/FilterBookmarkDialog.js.map +1 -1
  408. package/dist/domains/filters/bookmarks/components/FilterBookmarkDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  409. package/dist/domains/filters/bookmarks/store/bookmarksStore.d.ts +3 -3
  410. package/dist/domains/filters/bookmarks/store/bookmarksStore.js.map +1 -1
  411. package/dist/domains/filters/components/AFilterDatetimePicker.js.map +1 -1
  412. package/dist/domains/filters/components/AFilterDatetimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  413. package/dist/domains/filters/components/AFilterInteger.js.map +1 -1
  414. package/dist/domains/filters/components/AFilterInteger.vue_vue_type_script_setup_true_lang.js.map +1 -1
  415. package/dist/domains/filters/components/AFilterString.js.map +1 -1
  416. package/dist/domains/filters/components/AFilterString.vue_vue_type_script_setup_true_lang.js.map +1 -1
  417. package/dist/domains/filters/components/AFilterTimeInterval.js +1 -1
  418. package/dist/domains/filters/components/AFilterTimeInterval.js.map +1 -1
  419. package/dist/domains/filters/components/AFilterTimeInterval.vue.d.ts +5 -3
  420. package/dist/domains/filters/components/AFilterTimeInterval.vue_vue_type_script_setup_true_lang.js.map +1 -1
  421. package/dist/domains/filters/components/AFilterValueObjectOptionsSelect.js.map +1 -1
  422. package/dist/domains/filters/components/AFilterValueObjectOptionsSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  423. package/dist/domains/filters/components/AFilterWrapper.vue.d.ts +17 -15
  424. package/dist/domains/filters/components/AFilterWrapperSidebar.vue.d.ts +5 -3
  425. package/dist/domains/filters/components/FiltersSelected.js.map +1 -1
  426. package/dist/domains/filters/components/FiltersSelected.vue_vue_type_script_setup_true_lang.js.map +1 -1
  427. package/dist/domains/filters/composables/filterFactory.d.ts +16 -26
  428. package/dist/domains/filters/composables/filterFactory.js +38 -31
  429. package/dist/domains/filters/composables/filterFactory.js.map +1 -1
  430. package/dist/domains/filters/datatable/components/ADatatableOrdering.js.map +1 -1
  431. package/dist/domains/filters/datatable/components/ADatatableOrdering.vue_vue_type_script_setup_true_lang.js +3 -1
  432. package/dist/domains/filters/datatable/components/ADatatableOrdering.vue_vue_type_script_setup_true_lang.js.map +1 -1
  433. package/dist/domains/filters/datatable/components/ADatatablePagination.js.map +1 -1
  434. package/dist/domains/filters/datatable/components/ADatatablePagination.vue_vue_type_script_setup_true_lang.js +2 -4
  435. package/dist/domains/filters/datatable/components/ADatatablePagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
  436. package/dist/domains/filters/utils/filterInjectionKeys.js.map +1 -1
  437. package/dist/domains/form/components/AFormDatetimePicker.js.map +1 -1
  438. package/dist/domains/form/components/AFormDatetimePicker.vue.d.ts +7 -5
  439. package/dist/domains/form/components/AFormDatetimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  440. package/dist/domains/form/components/AFormFlagDatetimePicker.js.map +1 -1
  441. package/dist/domains/form/components/AFormFlagDatetimePicker.vue.d.ts +7 -5
  442. package/dist/domains/form/components/AFormFlagDatetimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  443. package/dist/domains/form/components/AFormSwitch.vue.d.ts +7 -5
  444. package/dist/domains/form/components/AFormTextField.js.map +1 -1
  445. package/dist/domains/form/components/AFormTextField.vue.d.ts +9 -7
  446. package/dist/domains/form/components/AFormTextField.vue_vue_type_script_setup_true_lang.js.map +1 -1
  447. package/dist/domains/form/components/AFormTextarea.vue.d.ts +13 -11
  448. package/dist/domains/form/components/AFormValueObjectOptionsSelect.vue.d.ts +7 -5
  449. package/dist/domains/form/components/ASystemEntityScope.vue.d.ts +5 -3
  450. package/dist/domains/job/api/jobApi.js.map +1 -1
  451. package/dist/domains/job/components/AJobDetailCommon.vue.d.ts +5 -3
  452. package/dist/domains/listEditor/components/AListEditor.js.map +1 -1
  453. package/dist/domains/listEditor/components/AListEditor.vue_vue_type_script_setup_true_lang.js.map +1 -1
  454. package/dist/domains/listEditor/components/ANestedSortableListEditor.js.map +1 -1
  455. package/dist/domains/listEditor/components/ANestedSortableListEditor.vue.d.ts +2 -3
  456. package/dist/domains/listEditor/components/ANestedSortableListEditor.vue_vue_type_script_setup_true_lang.js.map +1 -1
  457. package/dist/domains/listEditor/components/ASortableListEditor.js.map +1 -1
  458. package/dist/domains/listEditor/components/ASortableListEditor.vue.d.ts +2 -3
  459. package/dist/domains/listEditor/components/ASortableListEditor.vue_vue_type_script_setup_true_lang.js.map +1 -1
  460. package/dist/domains/listEditor/composables/useListEditorController.d.ts +4 -5
  461. package/dist/domains/listEditor/composables/useListEditorController.js.map +1 -1
  462. package/dist/domains/listEditor/composables/useNestedListEditor.d.ts +3 -4
  463. package/dist/domains/listEditor/composables/useNestedListEditor.js.map +1 -1
  464. package/dist/domains/listEditor/composables/useNestedListEditorController.d.ts +5 -4
  465. package/dist/domains/listEditor/composables/useNestedListEditorController.js.map +1 -1
  466. package/dist/domains/listEditor/composables/useReorderMode.js.map +1 -1
  467. package/dist/domains/listEditor/types/listEditorTypes.d.ts +2 -2
  468. package/dist/domains/listEditor/utils/listEditorLoader.d.ts +5 -5
  469. package/dist/domains/listEditor/utils/listEditorLoader.js.map +1 -1
  470. package/dist/domains/listEditor/utils/resolveCompactText.js.map +1 -1
  471. package/dist/domains/log/api/logApi.d.ts +2 -3
  472. package/dist/domains/log/api/logApi.js.map +1 -1
  473. package/dist/domains/log/components/ALogDatatable.js.map +1 -1
  474. package/dist/domains/log/components/ALogDatatable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  475. package/dist/domains/log/components/ALogDetailView.js.map +1 -1
  476. package/dist/domains/log/components/ALogDetailView.vue.d.ts +1 -1
  477. package/dist/domains/log/components/ALogDetailView.vue_vue_type_script_setup_true_lang.js.map +1 -1
  478. package/dist/domains/log/components/ALogFilter.js.map +1 -1
  479. package/dist/domains/log/components/ALogFilter.vue_vue_type_script_setup_true_lang.js.map +1 -1
  480. package/dist/domains/log/components/ALogListView.js.map +1 -1
  481. package/dist/domains/log/components/ALogListView.vue.d.ts +1 -1
  482. package/dist/domains/log/components/ALogListView.vue_vue_type_script_setup_true_lang.js.map +1 -1
  483. package/dist/domains/log/composables/logActions.d.ts +4 -5
  484. package/dist/domains/log/composables/logActions.js.map +1 -1
  485. package/dist/domains/log/composables/logType.d.ts +6 -7
  486. package/dist/domains/log/composables/logType.js.map +1 -1
  487. package/dist/domains/log/filter/logFilter.d.ts +8 -11
  488. package/dist/domains/log/filter/logFilter.js.map +1 -1
  489. package/dist/domains/permission/components/APermissionEditor.js.map +1 -1
  490. package/dist/domains/permission/components/APermissionEditor.vue.d.ts +4 -4
  491. package/dist/domains/permission/components/APermissionEditor.vue_vue_type_script_setup_true_lang.js.map +1 -1
  492. package/dist/domains/permission/composables/permissionActions.d.ts +3 -6
  493. package/dist/domains/permission/composables/permissionActions.js.map +1 -1
  494. package/dist/domains/permission/config/api/permissionConfigApi.d.ts +2 -2
  495. package/dist/domains/permission/config/api/permissionConfigApi.js.map +1 -1
  496. package/dist/domains/permission/config/composables/permissionConfigActions.d.ts +3 -7
  497. package/dist/domains/permission/config/composables/permissionConfigActions.js.map +1 -1
  498. package/dist/domains/permission/config/store/permissionConfigStore.d.ts +2 -4
  499. package/dist/domains/permission/config/store/permissionConfigStore.js.map +1 -1
  500. package/dist/domains/permission/group/api/permissionGroupApi.d.ts +8 -10
  501. package/dist/domains/permission/group/api/permissionGroupApi.js.map +1 -1
  502. package/dist/domains/permission/group/components/APermissionGroupDatatable.js.map +1 -1
  503. package/dist/domains/permission/group/components/APermissionGroupDatatable.vue.d.ts +12 -10
  504. package/dist/domains/permission/group/components/APermissionGroupDatatable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  505. package/dist/domains/permission/group/components/APermissionGroupDetail.js.map +1 -1
  506. package/dist/domains/permission/group/components/APermissionGroupDetail.vue.d.ts +21 -22
  507. package/dist/domains/permission/group/components/APermissionGroupDetail.vue_vue_type_script_setup_true_lang.js.map +1 -1
  508. package/dist/domains/permission/group/components/APermissionGroupManage.js.map +1 -1
  509. package/dist/domains/permission/group/components/APermissionGroupManage.vue.d.ts +21 -22
  510. package/dist/domains/permission/group/components/APermissionGroupManage.vue_vue_type_script_setup_true_lang.js.map +1 -1
  511. package/dist/domains/permission/group/composables/cachedPermissionGroups.js.map +1 -1
  512. package/dist/domains/permission/group/composables/permissionGroupActions.d.ts +6 -8
  513. package/dist/domains/permission/group/composables/permissionGroupActions.js.map +1 -1
  514. package/dist/domains/permission/group/composables/permissionGroupValidations.d.ts +2 -3
  515. package/dist/domains/permission/group/composables/permissionGroupValidations.js.map +1 -1
  516. package/dist/domains/permission/group/filter/permissionGroupFilter.d.ts +2 -3
  517. package/dist/domains/permission/group/filter/permissionGroupFilter.js.map +1 -1
  518. package/dist/domains/permission/group/store/permissionGroupStore.d.ts +3 -6
  519. package/dist/domains/permission/group/store/permissionGroupStore.js.map +1 -1
  520. package/dist/domains/remoteAutocomplete/components/AFilterRemoteAutocomplete.js.map +1 -1
  521. package/dist/domains/remoteAutocomplete/components/AFilterRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  522. package/dist/domains/remoteAutocomplete/components/AFilterRemoteAutocompleteWithMinimal.js.map +1 -1
  523. package/dist/domains/remoteAutocomplete/components/AFilterRemoteAutocompleteWithMinimal.vue_vue_type_script_setup_true_lang.js.map +1 -1
  524. package/dist/domains/remoteAutocomplete/components/AFormRemoteAutocomplete.js.map +1 -1
  525. package/dist/domains/remoteAutocomplete/components/AFormRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  526. package/dist/domains/remoteAutocomplete/components/AFormRemoteAutocompleteWithCached.vue.d.ts +5 -3
  527. package/dist/domains/remoteAutocomplete/composables/createRemoteAutocomplete.d.ts +11 -13
  528. package/dist/domains/remoteAutocomplete/composables/createRemoteAutocomplete.js.map +1 -1
  529. package/dist/domains/subjectSelect/components/AFilterWrapperSubjectSelect.vue.d.ts +13 -11
  530. package/dist/domains/subjectSelect/components/ASubjectSelect.js.map +1 -1
  531. package/dist/domains/subjectSelect/components/ASubjectSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  532. package/dist/domains/subjectSelect/composables/useSubjectSelect.js +53 -51
  533. package/dist/domains/subjectSelect/composables/useSubjectSelect.js.map +1 -1
  534. package/dist/domains/system/appShell/components/AActionbar.vue.d.ts +7 -5
  535. package/dist/domains/system/appShell/components/ALayoutSwitch.js.map +1 -1
  536. package/dist/domains/system/appShell/components/ALayoutSwitch.vue.d.ts +7 -5
  537. package/dist/domains/system/appShell/components/ALayoutSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
  538. package/dist/domains/system/appShell/composables/teleportSlot.d.ts +0 -1
  539. package/dist/domains/system/appShell/composables/teleportSlot.js.map +1 -1
  540. package/dist/domains/system/components/AAlerts.js.map +1 -1
  541. package/dist/domains/system/components/AAlerts.vue_vue_type_script_setup_true_lang.js.map +1 -1
  542. package/dist/domains/system/composables/alerts.js.map +1 -1
  543. package/dist/domains/system/composables/breadcrumbs.d.ts +3 -3
  544. package/dist/domains/system/composables/breadcrumbs.js.map +1 -1
  545. package/dist/domains/system/composables/languageSettings.js.map +1 -1
  546. package/dist/domains/system/composables/loginStatus.js.map +1 -1
  547. package/dist/domains/system/composables/navigationError.d.ts +6 -8
  548. package/dist/domains/system/composables/navigationError.js.map +1 -1
  549. package/dist/domains/system/composables/pageNavigation.d.ts +9 -10
  550. package/dist/domains/system/composables/pageNavigation.js.map +1 -1
  551. package/dist/domains/system/composables/recordActions.d.ts +14 -22
  552. package/dist/domains/system/composables/recordActions.js.map +1 -1
  553. package/dist/domains/system/composables/recordPage.d.ts +23 -38
  554. package/dist/domains/system/composables/recordPage.js.map +1 -1
  555. package/dist/domains/system/composables/routeHistory.d.ts +4 -5
  556. package/dist/domains/system/composables/routeHistory.js.map +1 -1
  557. package/dist/domains/system/composables/sentry.js.map +1 -1
  558. package/dist/domains/system/composables/useDebugFeatures.d.ts +3 -6
  559. package/dist/domains/system/composables/useDebugFeatures.js.map +1 -1
  560. package/dist/domains/system/store/datatablePageStore.d.ts +8 -1
  561. package/dist/domains/system/store/datatablePageStore.js +10 -3
  562. package/dist/domains/system/store/datatablePageStore.js.map +1 -1
  563. package/dist/domains/system/systemBar/components/ASystemBar.js.map +1 -1
  564. package/dist/domains/system/systemBar/components/ASystemBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  565. package/dist/domains/system/systemBar/utils/appReload.d.ts +5 -5
  566. package/dist/domains/system/systemBar/utils/appReload.js.map +1 -1
  567. package/dist/domains/ui/buttons/action/components/AActionCloseButtonHistory.js.map +1 -1
  568. package/dist/domains/ui/buttons/action/components/AActionCloseButtonHistory.vue.d.ts +2 -3
  569. package/dist/domains/ui/buttons/action/components/AActionCloseButtonHistory.vue_vue_type_script_setup_true_lang.js.map +1 -1
  570. package/dist/domains/ui/buttons/action/components/AActionDeleteButton.js.map +1 -1
  571. package/dist/domains/ui/buttons/action/components/AActionDeleteButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  572. package/dist/domains/ui/buttons/components/ABtnSplit.vue.d.ts +9 -7
  573. package/dist/domains/ui/components/AAvatarColorPicker.js.map +1 -1
  574. package/dist/domains/ui/components/AAvatarColorPicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  575. package/dist/domains/ui/components/ACard.js.map +1 -1
  576. package/dist/domains/ui/components/ACard.vue.d.ts +7 -3
  577. package/dist/domains/ui/components/ACard.vue_vue_type_script_setup_true_lang.js +6 -2
  578. package/dist/domains/ui/components/ACard.vue_vue_type_script_setup_true_lang.js.map +1 -1
  579. package/dist/domains/ui/components/ACardLoader.js.map +1 -1
  580. package/dist/domains/ui/components/ACardLoader.vue.d.ts +1 -0
  581. package/dist/domains/ui/components/ACardLoader.vue_vue_type_script_setup_true_lang.js +13 -7
  582. package/dist/domains/ui/components/ACardLoader.vue_vue_type_script_setup_true_lang.js.map +1 -1
  583. package/dist/domains/ui/components/AChipNoLink.vue.d.ts +5 -3
  584. package/dist/domains/ui/components/ACopyText.vue.d.ts +9 -7
  585. package/dist/domains/ui/components/ACreateDialog.js.map +1 -1
  586. package/dist/domains/ui/components/ACreateDialog.vue.d.ts +11 -9
  587. package/dist/domains/ui/components/ACreateDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  588. package/dist/domains/ui/components/ADialogToolbar.vue.d.ts +5 -3
  589. package/dist/domains/ui/components/ARow.vue.d.ts +5 -3
  590. package/dist/domains/ui/components/ATimeTrackingFields.js.map +1 -1
  591. package/dist/domains/ui/components/ATimeTrackingFields.vue_vue_type_script_setup_true_lang.js.map +1 -1
  592. package/dist/domains/ui/components/AUserAndTimeTrackingFields.js.map +1 -1
  593. package/dist/domains/ui/components/AUserAndTimeTrackingFields.vue.d.ts +3 -5
  594. package/dist/domains/ui/components/AUserAndTimeTrackingFields.vue_vue_type_script_setup_true_lang.js.map +1 -1
  595. package/dist/domains/ui/datetime/components/ADatetimePicker.js +1 -1
  596. package/dist/domains/ui/datetime/components/ADatetimePicker.js.map +1 -1
  597. package/dist/domains/ui/datetime/components/ADatetimePicker.vue.d.ts +5 -3
  598. package/dist/domains/ui/datetime/components/ADatetimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  599. package/dist/domains/ui/file/components/AFileDropzone.js.map +1 -1
  600. package/dist/domains/ui/file/components/AFileDropzone.vue.d.ts +1 -1
  601. package/dist/domains/ui/file/components/AFileDropzone.vue_vue_type_script_setup_true_lang.js.map +1 -1
  602. package/dist/domains/ui/file/components/AFileInput.js.map +1 -1
  603. package/dist/domains/ui/file/components/AFileInput.vue.d.ts +9 -7
  604. package/dist/domains/ui/file/components/AFileInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  605. package/dist/domains/ui/file/components/AFileInputDialog.js.map +1 -1
  606. package/dist/domains/ui/file/components/AFileInputDialog.vue.d.ts +9 -7
  607. package/dist/domains/ui/file/components/AFileInputDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  608. package/dist/domains/ui/file/composables/dropzone.js.map +1 -1
  609. package/dist/domains/ui/file/composables/formatAndSizeCheck.js.map +1 -1
  610. package/dist/domains/ui/view/components/AGenericView.vue.d.ts +7 -5
  611. package/dist/domains/ui/view/components/ALoginView.js +1 -1
  612. package/dist/domains/ui/view/components/ALoginView.js.map +1 -1
  613. package/dist/domains/ui/view/components/ALoginView.vue.d.ts +5 -3
  614. package/dist/domains/ui/view/components/ALoginView.vue_vue_type_script_setup_true_lang.js.map +1 -1
  615. package/dist/domains/ui/view/components/ALogoutView.js.map +1 -1
  616. package/dist/domains/ui/view/components/ALogoutView.vue_vue_type_script_setup_true_lang.js.map +1 -1
  617. package/dist/domains/ui/view/components/ANotFoundView.js.map +1 -1
  618. package/dist/domains/ui/view/components/ANotFoundView.vue_vue_type_script_setup_true_lang.js.map +1 -1
  619. package/dist/domains/unsavedGuard/composables/useUnsavedChangesGuard.d.ts +6 -7
  620. package/dist/domains/unsavedGuard/composables/useUnsavedChangesGuard.js.map +1 -1
  621. package/dist/lib.d.ts +2 -2
  622. package/dist/plugins/commonVuetifyConfig.d.ts +3 -3
  623. package/dist/plugins/commonVuetifyConfig.js.map +1 -1
  624. package/dist/plugins/i18n.d.ts +4 -5
  625. package/dist/plugins/i18n.js.map +1 -1
  626. package/dist/plugins/pluginOptions.d.ts +4 -2
  627. package/dist/plugins/pluginOptions.js.map +1 -1
  628. package/dist/plugins/webfontloader.js.map +1 -1
  629. package/dist/shared/error/AnzuApiCancelledError.d.ts +5 -8
  630. package/dist/shared/error/AnzuApiCancelledError.js.map +1 -1
  631. package/dist/shared/error/AnzuError.d.ts +3 -5
  632. package/dist/shared/error/AnzuError.js.map +1 -1
  633. package/dist/shared/error/AuthUnavailableError.d.ts +3 -3
  634. package/dist/shared/error/AuthUnavailableError.js.map +1 -1
  635. package/dist/shared/error/isInCauseChain.d.ts +2 -2
  636. package/dist/shared/error/isInCauseChain.js.map +1 -1
  637. package/dist/shared/types/UserAndTimeTracking.d.ts +5 -5
  638. package/dist/shared/types/Validation.d.ts +4 -5
  639. package/dist/shared/types/common.d.ts +1 -3
  640. package/dist/shared/types/globalComponents.d.ts +5 -6
  641. package/dist/shared/utils/common.js.map +1 -1
  642. package/dist/shared/utils/datetime.d.ts +0 -1
  643. package/dist/shared/utils/datetime.js.map +1 -1
  644. package/dist/shared/utils/datetimePickerValue.d.ts +4 -7
  645. package/dist/shared/utils/datetimePickerValue.js.map +1 -1
  646. package/dist/shared/utils/development.d.ts +3 -3
  647. package/dist/shared/utils/development.js.map +1 -1
  648. package/dist/shared/utils/envConfig.d.ts +4 -4
  649. package/dist/shared/utils/envConfig.js.map +1 -1
  650. package/dist/shared/utils/json.d.ts +1 -1
  651. package/dist/shared/utils/json.js.map +1 -1
  652. package/dist/shared/utils/userAndTimeTracking.d.ts +5 -7
  653. package/dist/shared/utils/userAndTimeTracking.js.map +1 -1
  654. package/dist/shared/validators/vuelidate/common/useValidateHexColor.d.ts +3 -5
  655. package/dist/shared/validators/vuelidate/common/useValidateHexColor.js.map +1 -1
  656. package/dist/testing/appShell.d.ts +11 -11
  657. package/dist/testing/appShell.js.map +1 -1
  658. package/dist/testing/closeButtons.d.ts +9 -11
  659. package/dist/testing/closeButtons.js.map +1 -1
  660. package/dist/testing/declaredDependencies.d.ts +7 -7
  661. package/dist/testing/declaredDependencies.js.map +1 -1
  662. package/dist/testing/generatedRoutes.d.ts +6 -11
  663. package/dist/testing/generatedRoutes.js.map +1 -1
  664. package/dist/testing/routeHistory.d.ts +5 -12
  665. package/dist/testing/routeHistory.js.map +1 -1
  666. package/dist/testing/sortableLists.d.ts +16 -21
  667. package/dist/testing/sortableLists.js.map +1 -1
  668. package/dist/testing/typedRouter.d.ts +0 -1
  669. package/dist/testing/typedRouter.js.map +1 -1
  670. package/package.json +26 -26
  671. package/src/eslint/adminConfig.mjs +19 -27
  672. package/src/eslint/globalComponentNames.mjs +3 -4
  673. package/src/eslint/oxlint.mjs +7 -20
  674. package/src/eslint/plugin.d.mts +2 -4
  675. package/src/eslint/plugin.mjs +18 -34
  676. package/src/eslint/validRouteName.mjs +6 -7
  677. package/src/vite/devWatch.mjs +30 -43
  678. package/src/vite/index.d.mts +5 -5
  679. package/src/vite/sentry.mjs +7 -12
  680. package/src/vite/sourcemaps.mjs +4 -8
@@ -1 +1 @@
1
- {"version":3,"file":"FilterBookmarkDialog.js","names":["_sfc_main","FilterBookmarkDialog_vue_vue_type_script_setup_true_lang_default","FilterBookmarkDialog_default"],"sources":["../../../../../src/domains/filters/bookmarks/components/FilterBookmarkDialog.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport ADialogToolbar from '@/domains/ui/components/ADialogToolbar.vue'\nimport { useI18n } from 'vue-i18n'\nimport { type Component, inject, ref, shallowRef, useTemplateRef, watch } from 'vue'\nimport AFormTextField from '@/domains/form/components/AFormTextField.vue'\nimport ARow from '@/domains/ui/components/ARow.vue'\nimport AFormSwitch from '@/domains/form/components/AFormSwitch.vue'\nimport { loadListEditor } from '@/domains/listEditor/utils/listEditorLoader'\nimport type { ExposedListEditorHandle } from '@/domains/listEditor/composables/useListEditorController'\nimport type { AxiosInstance } from 'axios'\nimport type { IntegerId } from '@/shared/types/common'\nimport { MAX_BOOKMARK_ITEMS, useFilterBookmarkStore } from '@/domains/filters/bookmarks/store/bookmarksStore'\nimport { useUserAdminConfigApi } from '@/domains/filters/bookmarks/api/userAdminConfigApi'\nimport { useAlerts } from '@/domains/system/composables/alerts'\nimport { useUserAdminConfigFactory } from '@/domains/filters/bookmarks/factory/UserAdminConfigFactory'\nimport {\n type UserAdminConfig,\n UserAdminConfigLayoutType,\n UserAdminConfigType,\n} from '@/domains/filters/bookmarks/types/UserAdminConfig'\nimport useVuelidate from '@vuelidate/core'\nimport { useValidate } from '@/shared/validators/vuelidate/useValidate'\nimport { cloneDeep, isUndefined } from '@/shared/utils/common'\nimport { DatatablePaginationKey, FilterConfigKey, FilterDataKey } from '@/domains/filters/utils/filterInjectionKeys'\nimport { useFilterHelpers } from '@/domains/filters/composables/filterFactory'\nimport AUnsavedConfirmDialog from '@/domains/unsavedGuard/components/AUnsavedConfirmDialog.vue'\nimport { useUnsavedChangesGuard } from '@/domains/unsavedGuard/composables/useUnsavedChangesGuard'\nimport { hasAnzuApiValidationErrorSpecific, isAnzuApiValidationError } from '@/shared/error/AnzuApiValidationError'\nimport { isAnzuApiAxiosError } from '@/shared/error/AnzuApiAxiosError'\nimport { HTTP_STATUS_NOT_FOUND } from '@/shared/statusCodes'\n\nconst props = withDefaults(\n defineProps<{\n client: () => AxiosInstance\n system: string\n subject: string\n user: IntegerId\n datatableHiddenColumns?: string[] | undefined\n }>(),\n {\n datatableHiddenColumns: undefined,\n }\n)\n\nconst emit = defineEmits<{\n (e: 'close'): void\n}>()\n\nconst filterConfig = inject(FilterConfigKey)\nconst filterData = inject(FilterDataKey)\nconst pagination = inject(DatatablePaginationKey)\n\nif (isUndefined(pagination) || isUndefined(filterConfig) || isUndefined(filterData)) {\n throw new Error('Incorrect provide/inject config.')\n}\n\n// The dialog is mounted behind the parent's `v-if`, so it had no model of its own -- and the guard\n// needs one to watch. Closing now runs through here: `requestClose` lets the guard ask first,\n// `forceClose` is for the paths that already are the confirmation.\nconst isOpen = ref(true)\n\n// The editor takes its clean baseline when it is created, so it waits for the first fetch. After\n// that it stays mounted whatever happens -- it is the only thing registering this tab's pending\n// work with the guard, and a reload that swapped it out would disarm the guard mid-edit.\nconst manageLoaded = ref(false)\nconst loadFailed = ref(false)\n\n// The editor component itself arrives with the first visit to the manage tab (see `loadListEditor`),\n// on its own track: the bookmark fetch above can succeed while the chunk fails, and the other way round.\nconst listEditor = shallowRef<Component>()\nconst editorLoadFailed = ref(false)\nlet editorLoading = false\n\nconst loadEditor = async () => {\n if (listEditor.value || editorLoading) return\n editorLoading = true\n editorLoadFailed.value = false\n try {\n listEditor.value = await loadListEditor()\n } catch {\n editorLoadFailed.value = true\n } finally {\n editorLoading = false\n }\n}\n\nconst guard = useUnsavedChangesGuard({\n sources: [],\n guardDialogModel: isOpen,\n guardRoute: false,\n guardWindowUnload: false,\n})\n\nwatch(isOpen, (open) => {\n if (!open) emit('close')\n})\n\nconst requestClose = () => {\n // Not while a write is out. The toolbar's X and the escape key reach this without going past\n // anything the write phase disables, and closing here would ask the user whether to discard work\n // that is already on its way to the server -- then write it anyway, whatever they answered.\n if (saveButtonLoading.value) return\n isOpen.value = false\n}\n\nconst forceClose = () => {\n guard.acknowledge()\n isOpen.value = false\n}\n\nconst activeTab = ref<'add' | 'manage'>('add')\nconst customName = ref('')\nconst storeDatatableHiddenColumns = ref(false)\nconst storeDatatableOrder = ref(false)\nconst saveButtonLoading = ref(false)\nconst listLoading = ref(false)\nconst errorCount = ref(false)\nconst itemsManage = ref<Array<UserAdminConfig>>([])\n\ninterface RowUpdate {\n update: (next: UserAdminConfig) => void\n}\n\nconst MAX_BOOKMARK_NAME_LENGTH = 100\n\n// The editor owns opening a row, saving it and cancelling out of it, so the rename no longer needs\n// its own held copy, its own vuelidate instance or its own confirm/cancel buttons. What is left is\n// the rule itself, which drives the editor's red rail and blocks its save.\nconst validateBookmarkName = (item: UserAdminConfig): boolean =>\n !!item.customName && item.customName.length <= MAX_BOOKMARK_NAME_LENGTH\n\nconst { required, maxLength } = useValidate()\nconst rulesCreate = {\n customName: {\n required,\n maxLength: maxLength(MAX_BOOKMARK_NAME_LENGTH),\n },\n}\nconst vCreate$ = useVuelidate(rulesCreate, { customName }, { $stopPropagation: true })\nconst filterBookmarkStore = useFilterBookmarkStore()\n\nconst {\n createUserAdminConfig,\n useFetchUserAdminConfigList,\n updateUserAdminConfigPositions,\n deleteUserAdminConfig,\n updateUserAdminConfig,\n} =\n // eslint-disable-next-line vue/no-setup-props-reactivity-loss\n useUserAdminConfigApi(props.client, props.system)\nconst { t } = useI18n()\nconst { showErrorsDefault, showUnknownError, showValidationError, showWarningT } = useAlerts()\nconst { createDefaultUserAdminConfig } = useUserAdminConfigFactory()\n\nconst editor = useTemplateRef<ExposedListEditorHandle<UserAdminConfig>>('editor')\n\n// One save for the whole tab, which is how every other list editor in this codebase is used: the\n// editor holds the data and the form's button persists it. A per-row PUT looked tidier and was not\n// -- re-baselining the one saved row meant reloading the list, and the reload took the pending\n// reorder and any other open row's typed text with it.\n// A delete answered with \"not found\" says the row is already gone, which is what this was asking\n// for. That is how an attempt whose answer never made it back looks the second time around: without\n// reading it this way, every retry would stop on the same row and the dialog could never finish.\nconst isAlreadyGone = (e: unknown) => isAnzuApiAxiosError(e) && e.cause.response?.status === HTTP_STATUS_NOT_FOUND\n\nconst saveManage = async () => {\n // Not while the list is being refreshed: the order this would send is the one on screen, and the\n // answer already on its way is about to replace it. The button is disabled for the same reason --\n // this is the half of it that does not depend on anyone looking at the button.\n if (listLoading.value) return\n if (!editor.value?.validateAll()) return\n saveButtonLoading.value = true\n try {\n const changes = editor.value.getChanges()\n // Deletes first, then renames, then the order -- which is taken from `itemsManage`, and the\n // deleted rows have already left it.\n for (const item of changes.deleted) {\n try {\n await deleteUserAdminConfig(item.id)\n } catch (e) {\n if (!isAlreadyGone(e)) throw e\n }\n // Out of the cache in the same breath: the filter bar is already on screen reading it, and a\n // save that fails further down never gets to the refresh that would have done this.\n filterBookmarkStore.removeOne(bookmarkCacheKey(), item.id)\n // That row is gone for good. Dropping its pending deletion here is what makes a second press\n // of the save button safe after a later call in this batch failed: the renames it resends are\n // the same PUT with the same result, but a DELETE resent against a row that is already gone\n // would fail and stop the batch at the same place every time.\n editor.value.restoreDeleted(item.id)\n }\n for (const item of changes.updated) {\n await updateUserAdminConfig(item.id, cloneDeep(item))\n }\n // Deleting every row leaves nothing to order, and an empty list is not an order to send.\n if (itemsManage.value.length > 0) {\n await updateUserAdminConfigPositions(itemsManage.value.map((item) => item.id))\n }\n // Once, at the end: this is also what refreshes the store the filter bar reads its names from,\n // and what the editor re-baselines against.\n applyItems(await fetchItems())\n forceClose()\n } catch (e) {\n showErrorsDefault(e)\n // Nothing is refetched here and nothing is rolled back. What was written already looks the way\n // it looks on the server -- a deleted row is gone from both, a renamed one carries the new name\n // in both -- and what was not written is still the user's to correct and send again. Refetching\n // would take that unsent work with it without asking, which is the one thing this dialog must\n // not do. The store is told its copy is behind instead.\n filterBookmarkStore.markStale(bookmarkCacheKey())\n } finally {\n saveButtonLoading.value = false\n }\n}\n\nconst { serializeFilters } = useFilterHelpers(filterData, filterConfig)\n\nconst systemResource = props.system + '_' + props.subject\nconst bookmarkCacheKey = () => filterBookmarkStore.generateKey(UserAdminConfigLayoutType.Desktop, systemResource)\n\nconst addBookmark = async () => {\n saveButtonLoading.value = true\n errorCount.value = false\n const config = createDefaultUserAdminConfig(props.system)\n config.user = props.user\n config.configType = UserAdminConfigType.FilterBookmark\n config.layoutType = UserAdminConfigLayoutType.Desktop\n config.systemResource = systemResource\n config.customName = customName.value\n config.data = {\n filter: serializeFilters(filterData, pagination, false),\n datatableHiddenColumns:\n storeDatatableHiddenColumns.value && props.datatableHiddenColumns ? props.datatableHiddenColumns : undefined,\n sortBy: storeDatatableOrder.value && pagination.value.sortBy ? pagination.value.sortBy : undefined,\n }\n try {\n const { count, maxPosition } = await filterBookmarkStore.fetchBookmarkStats(\n {\n user: props.user,\n layoutType: UserAdminConfigLayoutType.Desktop,\n systemResource: systemResource,\n },\n useFetchUserAdminConfigList\n )\n if (count >= MAX_BOOKMARK_ITEMS) {\n errorCount.value = true\n saveButtonLoading.value = false\n return\n }\n // After the highest position in use, not after the number of rows. The manage tab renumbers\n // only the rows it sends, so a deletion saved there leaves a gap, and counting rows from then\n // on would put this bookmark on a position another one already holds.\n config.position = maxPosition + 1\n const res = await createUserAdminConfig(config)\n filterBookmarkStore.addOne(bookmarkCacheKey(), res)\n // Cleared because `requestClose` may not close: with work pending on the other tab the guard\n // asks, and \"stay\" would otherwise leave this bookmark's name in the field for a second click\n // to create it again. Empty, the `required` rule blocks that.\n customName.value = ''\n vCreate$.value.$reset()\n // The write is done, and `requestClose` refuses while one is out. The `finally` sets it again.\n saveButtonLoading.value = false\n // `requestClose`, not `forceClose`: adding a bookmark is a decision about THIS tab. It says\n // nothing about a reorder left pending on the other one, so the guard still gets to ask.\n requestClose()\n } catch (e) {\n if (\n isAnzuApiValidationError(e) &&\n hasAnzuApiValidationErrorSpecific(e, 'error_field_not_unique', 'cms.userAdminConfig.model.systemResource')\n ) {\n showWarningT('common.filter.bookmark.nameUniqueError')\n return\n }\n showErrorsDefault(e)\n } finally {\n saveButtonLoading.value = false\n }\n}\n\nconst onConfirm = () => {\n if (activeTab.value === 'add') {\n vCreate$.value.$touch()\n if (vCreate$.value.$invalid) {\n showValidationError()\n return\n }\n addBookmark()\n } else if (activeTab.value === 'manage') {\n // Not gated on the list being non-empty: deleting every row empties it while leaving the\n // deletions themselves pending, and this button is the only thing that sends them.\n saveManage()\n }\n}\n\n// Entering the manage tab starts a fetch, and the tabs can be switched faster than one comes back,\n// so two can be in flight at once. Only the newest one is allowed to land: without this an older\n// answer could overtake a newer one and put the list back to what it was two switches ago.\nlet fetchGeneration = 0\nlet fetchesInFlight = 0\n\nconst fetchItems = async (): Promise<UserAdminConfig[] | null> => {\n const generation = ++fetchGeneration\n // Counted, not a flag: an older fetch answering must not report the tab as settled while a newer\n // one is still out, or the editor takes edits again in the gap between the two.\n fetchesInFlight++\n listLoading.value = true\n loadFailed.value = false\n try {\n const items = await filterBookmarkStore.getBookmarks(\n {\n user: props.user,\n layoutType: UserAdminConfigLayoutType.Desktop,\n systemResource: systemResource,\n },\n useFetchUserAdminConfigList,\n true\n )\n if (generation !== fetchGeneration) return null\n // `null` is this request's own answer that it failed; the store's `error` flag is shared with\n // every other fetch it serves, this dialog's bookmark count among them.\n if (items === null) {\n loadFailed.value = true\n showUnknownError()\n return null\n }\n return items\n } catch (e) {\n // The same question as on the way out of the try: an answer that a newer one has overtaken does\n // not get to put the tab into an error state or raise an alert over it.\n if (generation !== fetchGeneration) return null\n loadFailed.value = true\n showErrorsDefault(e)\n return null\n } finally {\n fetchesInFlight--\n listLoading.value = fetchesInFlight > 0\n }\n}\n\n// The fetched rows are handed to the editor rather than left to reach it through `v-model`: that\n// way round is a render away, and a commit that ran before the rows arrived would pin the baseline\n// to the list from before the fetch -- every difference the fetch brought would then read as the\n// user's own unsaved edit. The editor is still to mount on the first load; it takes its own\n// baseline from `itemsManage` when it does.\nconst applyItems = (items: UserAdminConfig[] | null) => {\n if (!items) return\n itemsManage.value = items\n manageLoaded.value = true\n editor.value?.commit(items)\n}\n\nwatch(activeTab, async () => {\n errorCount.value = false\n if (activeTab.value !== 'manage') return\n void loadEditor()\n // Entering the tab refreshes it -- a bookmark just added on the other tab is the near case -- but\n // never over work the user has not saved: the fetched order would replace the dragged one.\n if (editor.value?.hasUnsaved) return\n const items = await fetchItems()\n // Asked again on the way back: the fetch takes long enough for the user to have started dragging\n // in the meantime, and applying it then would be the same loss, just later.\n if (editor.value?.hasUnsaved) return\n applyItems(items)\n})\n</script>\n\n<template>\n <!-- `persistent` while a write is out: the escape key and a click outside go straight to the\n model, past everything the write phase disables. -->\n <VDialog\n v-model=\"isOpen\"\n :persistent=\"saveButtonLoading\"\n :width=\"500\"\n >\n <VCard>\n <ADialogToolbar @cancel=\"requestClose\">\n {{ t('common.filter.bookmark.title') }}\n </ADialogToolbar>\n <VCardText class=\"pt-0\">\n <VTabs\n v-model=\"activeTab\"\n fixed-tabs\n >\n <VTab\n value=\"add\"\n :disabled=\"saveButtonLoading\"\n >\n {{ t('common.filter.bookmark.add') }}\n </VTab>\n <VTab\n value=\"manage\"\n :disabled=\"saveButtonLoading\"\n >\n {{ t('common.filter.bookmark.manage') }}\n </VTab>\n </VTabs>\n <div\n v-if=\"activeTab === 'add'\"\n class=\"w-100 pt-4\"\n >\n <ARow :title=\"t('common.filter.bookmark.infoSave')\" />\n <ARow\n v-if=\"errorCount\"\n class=\"text-error\"\n :title=\"t('common.filter.bookmark.errorMax')\"\n />\n <ARow>\n <AFormTextField\n v-model=\"customName\"\n :label=\"t('common.filter.bookmark.name')\"\n required\n :disabled=\"saveButtonLoading\"\n :v=\"vCreate$.customName\"\n />\n </ARow>\n <ARow>\n <AFormSwitch\n v-model=\"storeDatatableHiddenColumns\"\n :disabled=\"saveButtonLoading\"\n :label=\"t('common.filter.bookmark.storeTableColumns')\"\n />\n </ARow>\n <ARow>\n <AFormSwitch\n v-model=\"storeDatatableOrder\"\n :disabled=\"saveButtonLoading\"\n :label=\"t('common.filter.bookmark.storeTableOrder')\"\n />\n </ARow>\n </div>\n <!-- `v-show`, not `v-if`: the guard sees this tab's pending work only through the section\n the editor registers, so unmounting it on a glance at the other tab would leave the\n dialog able to close on a dragged order without asking. The spinner is the editor's own\n `loading` for the same reason -- swapping it out on every reload would do the same. -->\n <div\n v-show=\"activeTab === 'manage'\"\n class=\"w-100 pt-4\"\n >\n <div\n v-if=\"!manageLoaded && !loadFailed\"\n class=\"d-flex w-100 align-center justify-center\"\n >\n <VProgressCircular indeterminate />\n </div>\n <!-- Nothing ever loaded: the editor's own empty state would claim there are no bookmarks,\n which is not what a failed fetch found out. -->\n <ARow\n v-else-if=\"!manageLoaded\"\n class=\"text-error\"\n :title=\"t('common.alert.unknownError')\"\n />\n <div\n v-else-if=\"editorLoadFailed\"\n class=\"d-flex w-100 align-center justify-space-between\"\n >\n <span class=\"text-error\">{{ t('common.alert.unknownError') }}</span>\n <ABtnTertiary\n data-cy=\"button-retry-editor\"\n @click.stop=\"loadEditor\"\n >\n {{ t('common.button.retry') }}\n </ABtnTertiary>\n </div>\n <div\n v-else-if=\"!listEditor\"\n class=\"d-flex w-100 align-center justify-center\"\n >\n <VProgressCircular indeterminate />\n </div>\n <!-- Mounted once the first fetch has settled -- empty or not, so an empty list gets the\n editor's own empty state rather than a blank tab -- and never unmounted after that. -->\n <component\n :is=\"listEditor\"\n v-else\n ref=\"editor\"\n v-model=\"itemsManage\"\n :position=\"false\"\n :loading=\"listLoading || saveButtonLoading\"\n compact-field=\"customName\"\n :validate=\"validateBookmarkName\"\n :show-add-button=\"false\"\n :unsaved-section-label=\"t('common.filter.bookmark.unsavedSection')\"\n >\n <template #item=\"{ raw, actions }: { raw: UserAdminConfig; actions: RowUpdate }\">\n <AFormTextField\n :model-value=\"raw.customName\"\n hide-details=\"auto\"\n @update:model-value=\"actions.update({ ...raw, customName: String($event ?? '') })\"\n />\n </template>\n </component>\n </div>\n </VCardText>\n <VCardActions>\n <VSpacer />\n <!-- Nothing in here takes input while a write is out: the change set was read when the\n button was pressed, so anything typed after that would not be in it, and the close that\n follows a successful save would take it with it. -->\n <ABtnTertiary\n data-cy=\"button-cancel\"\n :disabled=\"saveButtonLoading\"\n @click.stop=\"requestClose\"\n >\n {{ t('common.button.cancel') }}\n </ABtnTertiary>\n <!-- Not while the list is being refreshed: the order this would send is the one on screen,\n which the answer on its way is about to replace. -->\n <ABtnPrimary\n data-cy=\"button-confirm\"\n :disabled=\"activeTab === 'manage' && (listLoading || !listEditor)\"\n :loading=\"saveButtonLoading\"\n @click.stop=\"onConfirm\"\n >\n {{ activeTab === 'add' ? t('common.button.add') : t('common.filter.bookmark.saveBookmarkOrder') }}\n </ABtnPrimary>\n </VCardActions>\n </VCard>\n </VDialog>\n\n <AUnsavedConfirmDialog\n v-model=\"guard.promptOpen.value\"\n :dirty-labels=\"guard.dirtyLabels.value\"\n @resolve=\"guard.resolvePrompt\"\n />\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"FilterBookmarkDialog.js","names":["_sfc_main","FilterBookmarkDialog_vue_vue_type_script_setup_true_lang_default","FilterBookmarkDialog_default"],"sources":["../../../../../src/domains/filters/bookmarks/components/FilterBookmarkDialog.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport ADialogToolbar from '@/domains/ui/components/ADialogToolbar.vue'\nimport { useI18n } from 'vue-i18n'\nimport { type Component, inject, ref, shallowRef, useTemplateRef, watch } from 'vue'\nimport AFormTextField from '@/domains/form/components/AFormTextField.vue'\nimport ARow from '@/domains/ui/components/ARow.vue'\nimport AFormSwitch from '@/domains/form/components/AFormSwitch.vue'\nimport { loadListEditor } from '@/domains/listEditor/utils/listEditorLoader'\nimport type { ExposedListEditorHandle } from '@/domains/listEditor/composables/useListEditorController'\nimport type { AxiosInstance } from 'axios'\nimport type { IntegerId } from '@/shared/types/common'\nimport { MAX_BOOKMARK_ITEMS, useFilterBookmarkStore } from '@/domains/filters/bookmarks/store/bookmarksStore'\nimport { useUserAdminConfigApi } from '@/domains/filters/bookmarks/api/userAdminConfigApi'\nimport { useAlerts } from '@/domains/system/composables/alerts'\nimport { useUserAdminConfigFactory } from '@/domains/filters/bookmarks/factory/UserAdminConfigFactory'\nimport {\n type UserAdminConfig,\n UserAdminConfigLayoutType,\n UserAdminConfigType,\n} from '@/domains/filters/bookmarks/types/UserAdminConfig'\nimport useVuelidate from '@vuelidate/core'\nimport { useValidate } from '@/shared/validators/vuelidate/useValidate'\nimport { cloneDeep, isUndefined } from '@/shared/utils/common'\nimport { DatatablePaginationKey, FilterConfigKey, FilterDataKey } from '@/domains/filters/utils/filterInjectionKeys'\nimport { useFilterHelpers } from '@/domains/filters/composables/filterFactory'\nimport AUnsavedConfirmDialog from '@/domains/unsavedGuard/components/AUnsavedConfirmDialog.vue'\nimport { useUnsavedChangesGuard } from '@/domains/unsavedGuard/composables/useUnsavedChangesGuard'\nimport { hasAnzuApiValidationErrorSpecific, isAnzuApiValidationError } from '@/shared/error/AnzuApiValidationError'\nimport { isAnzuApiAxiosError } from '@/shared/error/AnzuApiAxiosError'\nimport { HTTP_STATUS_NOT_FOUND } from '@/shared/statusCodes'\n\nconst props = withDefaults(\n defineProps<{\n client: () => AxiosInstance\n system: string\n subject: string\n user: IntegerId\n datatableHiddenColumns?: string[] | undefined\n }>(),\n {\n datatableHiddenColumns: undefined,\n }\n)\n\nconst emit = defineEmits<{\n (e: 'close'): void\n}>()\n\nconst filterConfig = inject(FilterConfigKey)\nconst filterData = inject(FilterDataKey)\nconst pagination = inject(DatatablePaginationKey)\n\nif (isUndefined(pagination) || isUndefined(filterConfig) || isUndefined(filterData)) {\n throw new Error('Incorrect provide/inject config.')\n}\n\n// The dialog is mounted behind the parent's `v-if`, but the guard needs a model to watch.\n// All closing goes through here. `requestClose` lets the guard ask\n// first. `forceClose` is for paths that already are the confirmation.\nconst isOpen = ref(true)\n\n// The editor takes its clean baseline on creation, so it waits for the first fetch.\n// After that it stays mounted. It alone registers this tab's pending work\n// with the guard, and swapping it out would disarm the guard mid-edit.\nconst manageLoaded = ref(false)\nconst loadFailed = ref(false)\n\n// The editor component loads on the first visit to the manage tab (see\n// `loadListEditor`). Its chunk load can fail independently of the bookmark fetch.\nconst listEditor = shallowRef<Component>()\nconst editorLoadFailed = ref(false)\nlet editorLoading = false\n\nconst loadEditor = async () => {\n if (listEditor.value || editorLoading) return\n editorLoading = true\n editorLoadFailed.value = false\n try {\n listEditor.value = await loadListEditor()\n } catch {\n editorLoadFailed.value = true\n } finally {\n editorLoading = false\n }\n}\n\nconst guard = useUnsavedChangesGuard({\n sources: [],\n guardDialogModel: isOpen,\n guardRoute: false,\n guardWindowUnload: false,\n})\n\nwatch(isOpen, (open) => {\n if (!open) emit('close')\n})\n\nconst requestClose = () => {\n // Not while a write is out. The toolbar X and Escape bypass the write-phase disabling.\n // Closing here would ask whether to discard work already sent to the server, and it would be written anyway.\n if (saveButtonLoading.value) return\n isOpen.value = false\n}\n\nconst forceClose = () => {\n guard.acknowledge()\n isOpen.value = false\n}\n\nconst activeTab = ref<'add' | 'manage'>('add')\nconst customName = ref('')\nconst storeDatatableHiddenColumns = ref(false)\nconst storeDatatableOrder = ref(false)\nconst saveButtonLoading = ref(false)\nconst listLoading = ref(false)\nconst errorCount = ref(false)\nconst itemsManage = ref<Array<UserAdminConfig>>([])\n\ninterface RowUpdate {\n update: (next: UserAdminConfig) => void\n}\n\nconst MAX_BOOKMARK_NAME_LENGTH = 100\n\n// The editor handles opening, saving and cancelling a row. Only the rule\n// remains here. It drives the editor's red rail and blocks its save.\nconst validateBookmarkName = (item: UserAdminConfig): boolean =>\n !!item.customName && item.customName.length <= MAX_BOOKMARK_NAME_LENGTH\n\nconst { required, maxLength } = useValidate()\nconst rulesCreate = {\n customName: {\n required,\n maxLength: maxLength(MAX_BOOKMARK_NAME_LENGTH),\n },\n}\nconst vCreate$ = useVuelidate(rulesCreate, { customName }, { $stopPropagation: true })\nconst filterBookmarkStore = useFilterBookmarkStore()\n\nconst {\n createUserAdminConfig,\n useFetchUserAdminConfigList,\n updateUserAdminConfigPositions,\n deleteUserAdminConfig,\n updateUserAdminConfig,\n} =\n // eslint-disable-next-line vue/no-setup-props-reactivity-loss\n useUserAdminConfigApi(props.client, props.system)\nconst { t } = useI18n()\nconst { showErrorsDefault, showUnknownError, showValidationError, showWarningT } = useAlerts()\nconst { createDefaultUserAdminConfig } = useUserAdminConfigFactory()\n\nconst editor = useTemplateRef<ExposedListEditorHandle<UserAdminConfig>>('editor')\n\n// One save for the whole tab, like other list editors here. A per-row PUT required reloading\n// the list to re-baseline, which lost the pending reorder and other rows' typed text.\n// A DELETE answered with \"not found\" means the row is already gone. A retry after a\n// lost response looks like this. Otherwise every retry would stop on the same row.\nconst isAlreadyGone = (e: unknown) => isAnzuApiAxiosError(e) && e.cause.response?.status === HTTP_STATUS_NOT_FOUND\n\nconst saveManage = async () => {\n // Not while the list is refreshing: the on-screen order is about to be replaced by the incoming answer.\n // The button is also disabled. This check does not depend on the button.\n if (listLoading.value) return\n if (!editor.value?.validateAll()) return\n saveButtonLoading.value = true\n try {\n const changes = editor.value.getChanges()\n // Deletes first, then renames, then the order. The order comes\n // from `itemsManage`, which the deleted rows have already left.\n for (const item of changes.deleted) {\n try {\n await deleteUserAdminConfig(item.id)\n } catch (e) {\n if (!isAlreadyGone(e)) throw e\n }\n // Removed from the cache right away. The filter bar is reading\n // it, and a later failure in this save would skip the refresh.\n filterBookmarkStore.removeOne(bookmarkCacheKey(), item.id)\n // Dropping the pending deletion makes a retry safe after a later call failed.\n // Resent renames are the same idempotent PUT. A resent DELETE on a\n // gone row would fail and stop the batch at the same place every time.\n editor.value.restoreDeleted(item.id)\n }\n for (const item of changes.updated) {\n await updateUserAdminConfig(item.id, cloneDeep(item))\n }\n // An empty list is not a valid order to send.\n if (itemsManage.value.length > 0) {\n await updateUserAdminConfigPositions(itemsManage.value.map((item) => item.id))\n }\n // Once, at the end. This also refreshes the store the filter\n // bar reads names from, and the editor re-baselines against it.\n applyItems(await fetchItems())\n forceClose()\n } catch (e) {\n showErrorsDefault(e)\n // No refetch and no rollback. Written changes already match the\n // server, and unwritten ones stay for the user to fix and resend.\n // A refetch would discard that unsent work without asking. The store is marked stale instead.\n filterBookmarkStore.markStale(bookmarkCacheKey())\n } finally {\n saveButtonLoading.value = false\n }\n}\n\nconst { serializeFilters } = useFilterHelpers(filterData, filterConfig)\n\nconst systemResource = props.system + '_' + props.subject\nconst bookmarkCacheKey = () => filterBookmarkStore.generateKey(UserAdminConfigLayoutType.Desktop, systemResource)\n\nconst addBookmark = async () => {\n saveButtonLoading.value = true\n errorCount.value = false\n const config = createDefaultUserAdminConfig(props.system)\n config.user = props.user\n config.configType = UserAdminConfigType.FilterBookmark\n config.layoutType = UserAdminConfigLayoutType.Desktop\n config.systemResource = systemResource\n config.customName = customName.value\n config.data = {\n filter: serializeFilters(filterData, pagination, false),\n datatableHiddenColumns:\n storeDatatableHiddenColumns.value && props.datatableHiddenColumns ? props.datatableHiddenColumns : undefined,\n sortBy: storeDatatableOrder.value && pagination.value.sortBy ? pagination.value.sortBy : undefined,\n }\n try {\n const { count, maxPosition } = await filterBookmarkStore.fetchBookmarkStats(\n {\n user: props.user,\n layoutType: UserAdminConfigLayoutType.Desktop,\n systemResource: systemResource,\n },\n useFetchUserAdminConfigList\n )\n if (count >= MAX_BOOKMARK_ITEMS) {\n errorCount.value = true\n saveButtonLoading.value = false\n return\n }\n // After the highest used position, not the row count. The manage tab renumbers only the\n // rows it sends, so deletions leave gaps and a row count could reuse a taken position.\n config.position = maxPosition + 1\n const res = await createUserAdminConfig(config)\n filterBookmarkStore.addOne(bookmarkCacheKey(), res)\n // Cleared because `requestClose` may not close. If the guard asks and the user stays, a\n // second click would create the bookmark again. Empty, the `required` rule blocks that.\n customName.value = ''\n vCreate$.value.$reset()\n // The write is done, and `requestClose` refuses while one is out. The `finally` sets it again.\n saveButtonLoading.value = false\n // `requestClose`, not `forceClose`: adding a bookmark says nothing\n // about a reorder pending on the other tab, so the guard still asks.\n requestClose()\n } catch (e) {\n if (\n isAnzuApiValidationError(e) &&\n hasAnzuApiValidationErrorSpecific(e, 'error_field_not_unique', 'cms.userAdminConfig.model.systemResource')\n ) {\n showWarningT('common.filter.bookmark.nameUniqueError')\n return\n }\n showErrorsDefault(e)\n } finally {\n saveButtonLoading.value = false\n }\n}\n\nconst onConfirm = () => {\n if (activeTab.value === 'add') {\n vCreate$.value.$touch()\n if (vCreate$.value.$invalid) {\n showValidationError()\n return\n }\n addBookmark()\n } else if (activeTab.value === 'manage') {\n // Not gated on a non-empty list. Deleting every row empties it while\n // the deletions are still pending, and only this button sends them.\n saveManage()\n }\n}\n\n// Tab switches can start fetches faster than they return. Only the\n// newest may apply, or an older answer could restore an outdated list.\nlet fetchGeneration = 0\nlet fetchesInFlight = 0\n\nconst fetchItems = async (): Promise<UserAdminConfig[] | null> => {\n const generation = ++fetchGeneration\n // A counter, not a flag. An older fetch finishing must not mark the tab\n // settled while a newer one is out, or the editor accepts edits in between.\n fetchesInFlight++\n listLoading.value = true\n loadFailed.value = false\n try {\n const items = await filterBookmarkStore.getBookmarks(\n {\n user: props.user,\n layoutType: UserAdminConfigLayoutType.Desktop,\n systemResource: systemResource,\n },\n useFetchUserAdminConfigList,\n true\n )\n if (generation !== fetchGeneration) return null\n // `null` means this request failed. The store's `error` flag is\n // shared with other fetches, including this dialog's bookmark count.\n if (items === null) {\n loadFailed.value = true\n showUnknownError()\n return null\n }\n return items\n } catch (e) {\n // An overtaken answer must not set the error state or raise an alert.\n if (generation !== fetchGeneration) return null\n loadFailed.value = true\n showErrorsDefault(e)\n return null\n } finally {\n fetchesInFlight--\n listLoading.value = fetchesInFlight > 0\n }\n}\n\n// Rows are handed to the editor directly, not via `v-model`, which lags a render.\n// A commit before the rows arrived would pin the baseline to the old list,\n// and every fetched difference would look like an unsaved user edit.\n// On first load the editor mounts later and takes its baseline from `itemsManage`.\nconst applyItems = (items: UserAdminConfig[] | null) => {\n if (!items) return\n itemsManage.value = items\n manageLoaded.value = true\n editor.value?.commit(items)\n}\n\nwatch(activeTab, async () => {\n errorCount.value = false\n if (activeTab.value !== 'manage') return\n void loadEditor()\n // Entering the tab refreshes it, for example after adding a bookmark on the other\n // tab. Never over unsaved work: the fetched order would replace the dragged one.\n if (editor.value?.hasUnsaved) return\n const items = await fetchItems()\n // Checked again after the fetch: the user may have started dragging while it ran.\n if (editor.value?.hasUnsaved) return\n applyItems(items)\n})\n</script>\n\n<template>\n <!--\n `persistent` while a write is out: Escape and outside clicks\n change the model directly, bypassing the write-phase disabling.\n -->\n <VDialog\n v-model=\"isOpen\"\n :persistent=\"saveButtonLoading\"\n :width=\"500\"\n >\n <VCard>\n <ADialogToolbar @cancel=\"requestClose\">\n {{ t('common.filter.bookmark.title') }}\n </ADialogToolbar>\n <VCardText class=\"pt-0\">\n <VTabs\n v-model=\"activeTab\"\n fixed-tabs\n >\n <VTab\n value=\"add\"\n :disabled=\"saveButtonLoading\"\n >\n {{ t('common.filter.bookmark.add') }}\n </VTab>\n <VTab\n value=\"manage\"\n :disabled=\"saveButtonLoading\"\n >\n {{ t('common.filter.bookmark.manage') }}\n </VTab>\n </VTabs>\n <div\n v-if=\"activeTab === 'add'\"\n class=\"w-100 pt-4\"\n >\n <ARow :title=\"t('common.filter.bookmark.infoSave')\" />\n <ARow\n v-if=\"errorCount\"\n class=\"text-error\"\n :title=\"t('common.filter.bookmark.errorMax')\"\n />\n <ARow>\n <AFormTextField\n v-model=\"customName\"\n :label=\"t('common.filter.bookmark.name')\"\n required\n :disabled=\"saveButtonLoading\"\n :v=\"vCreate$.customName\"\n />\n </ARow>\n <ARow>\n <AFormSwitch\n v-model=\"storeDatatableHiddenColumns\"\n :disabled=\"saveButtonLoading\"\n :label=\"t('common.filter.bookmark.storeTableColumns')\"\n />\n </ARow>\n <ARow>\n <AFormSwitch\n v-model=\"storeDatatableOrder\"\n :disabled=\"saveButtonLoading\"\n :label=\"t('common.filter.bookmark.storeTableOrder')\"\n />\n </ARow>\n </div>\n <!--\n `v-show`, not `v-if`: the guard sees pending work only through the section the editor registers.\n Unmounting on a tab switch would let the dialog close on a dragged order without asking.\n The spinner is the editor's own `loading` for the same reason.\n -->\n <div\n v-show=\"activeTab === 'manage'\"\n class=\"w-100 pt-4\"\n >\n <div\n v-if=\"!manageLoaded && !loadFailed\"\n class=\"d-flex w-100 align-center justify-center\"\n >\n <VProgressCircular indeterminate />\n </div>\n <!--\n Nothing loaded yet: the editor's empty state would wrongly\n claim there are no bookmarks after a failed fetch.\n -->\n <ARow\n v-else-if=\"!manageLoaded\"\n class=\"text-error\"\n :title=\"t('common.alert.unknownError')\"\n />\n <div\n v-else-if=\"editorLoadFailed\"\n class=\"d-flex w-100 align-center justify-space-between\"\n >\n <span class=\"text-error\">{{ t('common.alert.unknownError') }}</span>\n <ABtnTertiary\n data-cy=\"button-retry-editor\"\n @click.stop=\"loadEditor\"\n >\n {{ t('common.button.retry') }}\n </ABtnTertiary>\n </div>\n <div\n v-else-if=\"!listEditor\"\n class=\"d-flex w-100 align-center justify-center\"\n >\n <VProgressCircular indeterminate />\n </div>\n <!--\n Mounted once the first fetch settles, even if empty, so an empty\n list shows the editor's empty state. Never unmounted after that.\n -->\n <component\n :is=\"listEditor\"\n v-else\n ref=\"editor\"\n v-model=\"itemsManage\"\n :position=\"false\"\n :loading=\"listLoading || saveButtonLoading\"\n compact-field=\"customName\"\n :validate=\"validateBookmarkName\"\n :show-add-button=\"false\"\n :unsaved-section-label=\"t('common.filter.bookmark.unsavedSection')\"\n >\n <template #item=\"{ raw, actions }: { raw: UserAdminConfig; actions: RowUpdate }\">\n <AFormTextField\n :model-value=\"raw.customName\"\n hide-details=\"auto\"\n @update:model-value=\"actions.update({ ...raw, customName: String($event ?? '') })\"\n />\n </template>\n </component>\n </div>\n </VCardText>\n <VCardActions>\n <VSpacer />\n <!--\n Inputs are disabled while a write is out. The change set was read when the button\n was pressed, so later typing would be lost on the close after a successful save.\n -->\n <ABtnTertiary\n data-cy=\"button-cancel\"\n :disabled=\"saveButtonLoading\"\n @click.stop=\"requestClose\"\n >\n {{ t('common.button.cancel') }}\n </ABtnTertiary>\n <!-- Disabled while the list refreshes: the on-screen order is about to be replaced by the incoming answer. -->\n <ABtnPrimary\n data-cy=\"button-confirm\"\n :disabled=\"activeTab === 'manage' && (listLoading || !listEditor)\"\n :loading=\"saveButtonLoading\"\n @click.stop=\"onConfirm\"\n >\n {{ activeTab === 'add' ? t('common.button.add') : t('common.filter.bookmark.saveBookmarkOrder') }}\n </ABtnPrimary>\n </VCardActions>\n </VCard>\n </VDialog>\n\n <AUnsavedConfirmDialog\n v-model=\"guard.promptOpen.value\"\n :dirty-labels=\"guard.dirtyLabels.value\"\n @resolve=\"guard.resolvePrompt\"\n />\n</template>\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"FilterBookmarkDialog.vue_vue_type_script_setup_true_lang.js","names":["_resolveComponent","_openBlock","_createElementBlock","_Fragment","_createVNode","_component_VDialog","_withCtx","_component_VCard","ADialogToolbar","_createTextVNode","_toDisplayString","_unref","_component_VCardText","_component_VTabs","_component_VTab","ARow","_createBlock","_createCommentVNode","AFormTextField","AFormSwitch","_withDirectives","_createElementVNode","_component_VProgressCircular","_withModifiers","_resolveDynamicComponent","_vShow","_component_VCardActions","_component_VSpacer","AUnsavedConfirmDialog","ARow_default","AFormTextField_default","ADialogToolbar_default","AFormSwitch_default","AUnsavedConfirmDialog_default","useVuelidate","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","MAX_BOOKMARK_NAME_LENGTH","FilterBookmarkDialog_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emit","filterConfig","inject","FilterConfigKey","filterData","FilterDataKey","pagination","DatatablePaginationKey","isUndefined","isOpen","ref","manageLoaded","loadFailed","listEditor","shallowRef","editorLoadFailed","editorLoading","loadEditor","loadListEditor","guard","useUnsavedChangesGuard","open","requestClose","saveButtonLoading","forceClose","activeTab","customName","storeDatatableHiddenColumns","storeDatatableOrder","listLoading","errorCount","itemsManage","validateBookmarkName","item","useValidate","rulesCreate","maxLength","vCreate$","filterBookmarkStore","useFilterBookmarkStore","useUserAdminConfigApi","useI18n","useAlerts","useUserAdminConfigFactory","editor","useTemplateRef","isAlreadyGone","isAnzuApiAxiosError","saveManage","changes","deleteUserAdminConfig","bookmarkCacheKey","updateUserAdminConfig","cloneDeep","updateUserAdminConfigPositions","applyItems","fetchItems","showErrorsDefault","useFilterHelpers","systemResource","UserAdminConfigLayoutType","addBookmark","config","createDefaultUserAdminConfig","UserAdminConfigType","serializeFilters","useFetchUserAdminConfigList","count","maxPosition","res","createUserAdminConfig","isAnzuApiValidationError","hasAnzuApiValidationErrorSpecific","onConfirm","fetchGeneration","fetchesInFlight","generation","items","showUnknownError","e","watch","_component_ABtnTertiary","resolveComponent","_component_ABtnPrimary","openBlock","createElementBlock","Fragment","createVNode","VDialog","_cache","$event","withCtx","VCard","createTextVNode","toDisplayString","unref","t","VCardText","VTabs","VTab","createBlock","createCommentVNode","withDirectives","createElementVNode","VProgressCircular","withModifiers","resolveDynamicComponent","raw","actions","vShow","VCardActions","VSpacer"],"sources":["../../../../../src/domains/filters/bookmarks/components/FilterBookmarkDialog.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport ADialogToolbar from '@/domains/ui/components/ADialogToolbar.vue'\nimport { useI18n } from 'vue-i18n'\nimport { type Component, inject, ref, shallowRef, useTemplateRef, watch } from 'vue'\nimport AFormTextField from '@/domains/form/components/AFormTextField.vue'\nimport ARow from '@/domains/ui/components/ARow.vue'\nimport AFormSwitch from '@/domains/form/components/AFormSwitch.vue'\nimport { loadListEditor } from '@/domains/listEditor/utils/listEditorLoader'\nimport type { ExposedListEditorHandle } from '@/domains/listEditor/composables/useListEditorController'\nimport type { AxiosInstance } from 'axios'\nimport type { IntegerId } from '@/shared/types/common'\nimport { MAX_BOOKMARK_ITEMS, useFilterBookmarkStore } from '@/domains/filters/bookmarks/store/bookmarksStore'\nimport { useUserAdminConfigApi } from '@/domains/filters/bookmarks/api/userAdminConfigApi'\nimport { useAlerts } from '@/domains/system/composables/alerts'\nimport { useUserAdminConfigFactory } from '@/domains/filters/bookmarks/factory/UserAdminConfigFactory'\nimport {\n type UserAdminConfig,\n UserAdminConfigLayoutType,\n UserAdminConfigType,\n} from '@/domains/filters/bookmarks/types/UserAdminConfig'\nimport useVuelidate from '@vuelidate/core'\nimport { useValidate } from '@/shared/validators/vuelidate/useValidate'\nimport { cloneDeep, isUndefined } from '@/shared/utils/common'\nimport { DatatablePaginationKey, FilterConfigKey, FilterDataKey } from '@/domains/filters/utils/filterInjectionKeys'\nimport { useFilterHelpers } from '@/domains/filters/composables/filterFactory'\nimport AUnsavedConfirmDialog from '@/domains/unsavedGuard/components/AUnsavedConfirmDialog.vue'\nimport { useUnsavedChangesGuard } from '@/domains/unsavedGuard/composables/useUnsavedChangesGuard'\nimport { hasAnzuApiValidationErrorSpecific, isAnzuApiValidationError } from '@/shared/error/AnzuApiValidationError'\nimport { isAnzuApiAxiosError } from '@/shared/error/AnzuApiAxiosError'\nimport { HTTP_STATUS_NOT_FOUND } from '@/shared/statusCodes'\n\nconst props = withDefaults(\n defineProps<{\n client: () => AxiosInstance\n system: string\n subject: string\n user: IntegerId\n datatableHiddenColumns?: string[] | undefined\n }>(),\n {\n datatableHiddenColumns: undefined,\n }\n)\n\nconst emit = defineEmits<{\n (e: 'close'): void\n}>()\n\nconst filterConfig = inject(FilterConfigKey)\nconst filterData = inject(FilterDataKey)\nconst pagination = inject(DatatablePaginationKey)\n\nif (isUndefined(pagination) || isUndefined(filterConfig) || isUndefined(filterData)) {\n throw new Error('Incorrect provide/inject config.')\n}\n\n// The dialog is mounted behind the parent's `v-if`, so it had no model of its own -- and the guard\n// needs one to watch. Closing now runs through here: `requestClose` lets the guard ask first,\n// `forceClose` is for the paths that already are the confirmation.\nconst isOpen = ref(true)\n\n// The editor takes its clean baseline when it is created, so it waits for the first fetch. After\n// that it stays mounted whatever happens -- it is the only thing registering this tab's pending\n// work with the guard, and a reload that swapped it out would disarm the guard mid-edit.\nconst manageLoaded = ref(false)\nconst loadFailed = ref(false)\n\n// The editor component itself arrives with the first visit to the manage tab (see `loadListEditor`),\n// on its own track: the bookmark fetch above can succeed while the chunk fails, and the other way round.\nconst listEditor = shallowRef<Component>()\nconst editorLoadFailed = ref(false)\nlet editorLoading = false\n\nconst loadEditor = async () => {\n if (listEditor.value || editorLoading) return\n editorLoading = true\n editorLoadFailed.value = false\n try {\n listEditor.value = await loadListEditor()\n } catch {\n editorLoadFailed.value = true\n } finally {\n editorLoading = false\n }\n}\n\nconst guard = useUnsavedChangesGuard({\n sources: [],\n guardDialogModel: isOpen,\n guardRoute: false,\n guardWindowUnload: false,\n})\n\nwatch(isOpen, (open) => {\n if (!open) emit('close')\n})\n\nconst requestClose = () => {\n // Not while a write is out. The toolbar's X and the escape key reach this without going past\n // anything the write phase disables, and closing here would ask the user whether to discard work\n // that is already on its way to the server -- then write it anyway, whatever they answered.\n if (saveButtonLoading.value) return\n isOpen.value = false\n}\n\nconst forceClose = () => {\n guard.acknowledge()\n isOpen.value = false\n}\n\nconst activeTab = ref<'add' | 'manage'>('add')\nconst customName = ref('')\nconst storeDatatableHiddenColumns = ref(false)\nconst storeDatatableOrder = ref(false)\nconst saveButtonLoading = ref(false)\nconst listLoading = ref(false)\nconst errorCount = ref(false)\nconst itemsManage = ref<Array<UserAdminConfig>>([])\n\ninterface RowUpdate {\n update: (next: UserAdminConfig) => void\n}\n\nconst MAX_BOOKMARK_NAME_LENGTH = 100\n\n// The editor owns opening a row, saving it and cancelling out of it, so the rename no longer needs\n// its own held copy, its own vuelidate instance or its own confirm/cancel buttons. What is left is\n// the rule itself, which drives the editor's red rail and blocks its save.\nconst validateBookmarkName = (item: UserAdminConfig): boolean =>\n !!item.customName && item.customName.length <= MAX_BOOKMARK_NAME_LENGTH\n\nconst { required, maxLength } = useValidate()\nconst rulesCreate = {\n customName: {\n required,\n maxLength: maxLength(MAX_BOOKMARK_NAME_LENGTH),\n },\n}\nconst vCreate$ = useVuelidate(rulesCreate, { customName }, { $stopPropagation: true })\nconst filterBookmarkStore = useFilterBookmarkStore()\n\nconst {\n createUserAdminConfig,\n useFetchUserAdminConfigList,\n updateUserAdminConfigPositions,\n deleteUserAdminConfig,\n updateUserAdminConfig,\n} =\n // eslint-disable-next-line vue/no-setup-props-reactivity-loss\n useUserAdminConfigApi(props.client, props.system)\nconst { t } = useI18n()\nconst { showErrorsDefault, showUnknownError, showValidationError, showWarningT } = useAlerts()\nconst { createDefaultUserAdminConfig } = useUserAdminConfigFactory()\n\nconst editor = useTemplateRef<ExposedListEditorHandle<UserAdminConfig>>('editor')\n\n// One save for the whole tab, which is how every other list editor in this codebase is used: the\n// editor holds the data and the form's button persists it. A per-row PUT looked tidier and was not\n// -- re-baselining the one saved row meant reloading the list, and the reload took the pending\n// reorder and any other open row's typed text with it.\n// A delete answered with \"not found\" says the row is already gone, which is what this was asking\n// for. That is how an attempt whose answer never made it back looks the second time around: without\n// reading it this way, every retry would stop on the same row and the dialog could never finish.\nconst isAlreadyGone = (e: unknown) => isAnzuApiAxiosError(e) && e.cause.response?.status === HTTP_STATUS_NOT_FOUND\n\nconst saveManage = async () => {\n // Not while the list is being refreshed: the order this would send is the one on screen, and the\n // answer already on its way is about to replace it. The button is disabled for the same reason --\n // this is the half of it that does not depend on anyone looking at the button.\n if (listLoading.value) return\n if (!editor.value?.validateAll()) return\n saveButtonLoading.value = true\n try {\n const changes = editor.value.getChanges()\n // Deletes first, then renames, then the order -- which is taken from `itemsManage`, and the\n // deleted rows have already left it.\n for (const item of changes.deleted) {\n try {\n await deleteUserAdminConfig(item.id)\n } catch (e) {\n if (!isAlreadyGone(e)) throw e\n }\n // Out of the cache in the same breath: the filter bar is already on screen reading it, and a\n // save that fails further down never gets to the refresh that would have done this.\n filterBookmarkStore.removeOne(bookmarkCacheKey(), item.id)\n // That row is gone for good. Dropping its pending deletion here is what makes a second press\n // of the save button safe after a later call in this batch failed: the renames it resends are\n // the same PUT with the same result, but a DELETE resent against a row that is already gone\n // would fail and stop the batch at the same place every time.\n editor.value.restoreDeleted(item.id)\n }\n for (const item of changes.updated) {\n await updateUserAdminConfig(item.id, cloneDeep(item))\n }\n // Deleting every row leaves nothing to order, and an empty list is not an order to send.\n if (itemsManage.value.length > 0) {\n await updateUserAdminConfigPositions(itemsManage.value.map((item) => item.id))\n }\n // Once, at the end: this is also what refreshes the store the filter bar reads its names from,\n // and what the editor re-baselines against.\n applyItems(await fetchItems())\n forceClose()\n } catch (e) {\n showErrorsDefault(e)\n // Nothing is refetched here and nothing is rolled back. What was written already looks the way\n // it looks on the server -- a deleted row is gone from both, a renamed one carries the new name\n // in both -- and what was not written is still the user's to correct and send again. Refetching\n // would take that unsent work with it without asking, which is the one thing this dialog must\n // not do. The store is told its copy is behind instead.\n filterBookmarkStore.markStale(bookmarkCacheKey())\n } finally {\n saveButtonLoading.value = false\n }\n}\n\nconst { serializeFilters } = useFilterHelpers(filterData, filterConfig)\n\nconst systemResource = props.system + '_' + props.subject\nconst bookmarkCacheKey = () => filterBookmarkStore.generateKey(UserAdminConfigLayoutType.Desktop, systemResource)\n\nconst addBookmark = async () => {\n saveButtonLoading.value = true\n errorCount.value = false\n const config = createDefaultUserAdminConfig(props.system)\n config.user = props.user\n config.configType = UserAdminConfigType.FilterBookmark\n config.layoutType = UserAdminConfigLayoutType.Desktop\n config.systemResource = systemResource\n config.customName = customName.value\n config.data = {\n filter: serializeFilters(filterData, pagination, false),\n datatableHiddenColumns:\n storeDatatableHiddenColumns.value && props.datatableHiddenColumns ? props.datatableHiddenColumns : undefined,\n sortBy: storeDatatableOrder.value && pagination.value.sortBy ? pagination.value.sortBy : undefined,\n }\n try {\n const { count, maxPosition } = await filterBookmarkStore.fetchBookmarkStats(\n {\n user: props.user,\n layoutType: UserAdminConfigLayoutType.Desktop,\n systemResource: systemResource,\n },\n useFetchUserAdminConfigList\n )\n if (count >= MAX_BOOKMARK_ITEMS) {\n errorCount.value = true\n saveButtonLoading.value = false\n return\n }\n // After the highest position in use, not after the number of rows. The manage tab renumbers\n // only the rows it sends, so a deletion saved there leaves a gap, and counting rows from then\n // on would put this bookmark on a position another one already holds.\n config.position = maxPosition + 1\n const res = await createUserAdminConfig(config)\n filterBookmarkStore.addOne(bookmarkCacheKey(), res)\n // Cleared because `requestClose` may not close: with work pending on the other tab the guard\n // asks, and \"stay\" would otherwise leave this bookmark's name in the field for a second click\n // to create it again. Empty, the `required` rule blocks that.\n customName.value = ''\n vCreate$.value.$reset()\n // The write is done, and `requestClose` refuses while one is out. The `finally` sets it again.\n saveButtonLoading.value = false\n // `requestClose`, not `forceClose`: adding a bookmark is a decision about THIS tab. It says\n // nothing about a reorder left pending on the other one, so the guard still gets to ask.\n requestClose()\n } catch (e) {\n if (\n isAnzuApiValidationError(e) &&\n hasAnzuApiValidationErrorSpecific(e, 'error_field_not_unique', 'cms.userAdminConfig.model.systemResource')\n ) {\n showWarningT('common.filter.bookmark.nameUniqueError')\n return\n }\n showErrorsDefault(e)\n } finally {\n saveButtonLoading.value = false\n }\n}\n\nconst onConfirm = () => {\n if (activeTab.value === 'add') {\n vCreate$.value.$touch()\n if (vCreate$.value.$invalid) {\n showValidationError()\n return\n }\n addBookmark()\n } else if (activeTab.value === 'manage') {\n // Not gated on the list being non-empty: deleting every row empties it while leaving the\n // deletions themselves pending, and this button is the only thing that sends them.\n saveManage()\n }\n}\n\n// Entering the manage tab starts a fetch, and the tabs can be switched faster than one comes back,\n// so two can be in flight at once. Only the newest one is allowed to land: without this an older\n// answer could overtake a newer one and put the list back to what it was two switches ago.\nlet fetchGeneration = 0\nlet fetchesInFlight = 0\n\nconst fetchItems = async (): Promise<UserAdminConfig[] | null> => {\n const generation = ++fetchGeneration\n // Counted, not a flag: an older fetch answering must not report the tab as settled while a newer\n // one is still out, or the editor takes edits again in the gap between the two.\n fetchesInFlight++\n listLoading.value = true\n loadFailed.value = false\n try {\n const items = await filterBookmarkStore.getBookmarks(\n {\n user: props.user,\n layoutType: UserAdminConfigLayoutType.Desktop,\n systemResource: systemResource,\n },\n useFetchUserAdminConfigList,\n true\n )\n if (generation !== fetchGeneration) return null\n // `null` is this request's own answer that it failed; the store's `error` flag is shared with\n // every other fetch it serves, this dialog's bookmark count among them.\n if (items === null) {\n loadFailed.value = true\n showUnknownError()\n return null\n }\n return items\n } catch (e) {\n // The same question as on the way out of the try: an answer that a newer one has overtaken does\n // not get to put the tab into an error state or raise an alert over it.\n if (generation !== fetchGeneration) return null\n loadFailed.value = true\n showErrorsDefault(e)\n return null\n } finally {\n fetchesInFlight--\n listLoading.value = fetchesInFlight > 0\n }\n}\n\n// The fetched rows are handed to the editor rather than left to reach it through `v-model`: that\n// way round is a render away, and a commit that ran before the rows arrived would pin the baseline\n// to the list from before the fetch -- every difference the fetch brought would then read as the\n// user's own unsaved edit. The editor is still to mount on the first load; it takes its own\n// baseline from `itemsManage` when it does.\nconst applyItems = (items: UserAdminConfig[] | null) => {\n if (!items) return\n itemsManage.value = items\n manageLoaded.value = true\n editor.value?.commit(items)\n}\n\nwatch(activeTab, async () => {\n errorCount.value = false\n if (activeTab.value !== 'manage') return\n void loadEditor()\n // Entering the tab refreshes it -- a bookmark just added on the other tab is the near case -- but\n // never over work the user has not saved: the fetched order would replace the dragged one.\n if (editor.value?.hasUnsaved) return\n const items = await fetchItems()\n // Asked again on the way back: the fetch takes long enough for the user to have started dragging\n // in the meantime, and applying it then would be the same loss, just later.\n if (editor.value?.hasUnsaved) return\n applyItems(items)\n})\n</script>\n\n<template>\n <!-- `persistent` while a write is out: the escape key and a click outside go straight to the\n model, past everything the write phase disables. -->\n <VDialog\n v-model=\"isOpen\"\n :persistent=\"saveButtonLoading\"\n :width=\"500\"\n >\n <VCard>\n <ADialogToolbar @cancel=\"requestClose\">\n {{ t('common.filter.bookmark.title') }}\n </ADialogToolbar>\n <VCardText class=\"pt-0\">\n <VTabs\n v-model=\"activeTab\"\n fixed-tabs\n >\n <VTab\n value=\"add\"\n :disabled=\"saveButtonLoading\"\n >\n {{ t('common.filter.bookmark.add') }}\n </VTab>\n <VTab\n value=\"manage\"\n :disabled=\"saveButtonLoading\"\n >\n {{ t('common.filter.bookmark.manage') }}\n </VTab>\n </VTabs>\n <div\n v-if=\"activeTab === 'add'\"\n class=\"w-100 pt-4\"\n >\n <ARow :title=\"t('common.filter.bookmark.infoSave')\" />\n <ARow\n v-if=\"errorCount\"\n class=\"text-error\"\n :title=\"t('common.filter.bookmark.errorMax')\"\n />\n <ARow>\n <AFormTextField\n v-model=\"customName\"\n :label=\"t('common.filter.bookmark.name')\"\n required\n :disabled=\"saveButtonLoading\"\n :v=\"vCreate$.customName\"\n />\n </ARow>\n <ARow>\n <AFormSwitch\n v-model=\"storeDatatableHiddenColumns\"\n :disabled=\"saveButtonLoading\"\n :label=\"t('common.filter.bookmark.storeTableColumns')\"\n />\n </ARow>\n <ARow>\n <AFormSwitch\n v-model=\"storeDatatableOrder\"\n :disabled=\"saveButtonLoading\"\n :label=\"t('common.filter.bookmark.storeTableOrder')\"\n />\n </ARow>\n </div>\n <!-- `v-show`, not `v-if`: the guard sees this tab's pending work only through the section\n the editor registers, so unmounting it on a glance at the other tab would leave the\n dialog able to close on a dragged order without asking. The spinner is the editor's own\n `loading` for the same reason -- swapping it out on every reload would do the same. -->\n <div\n v-show=\"activeTab === 'manage'\"\n class=\"w-100 pt-4\"\n >\n <div\n v-if=\"!manageLoaded && !loadFailed\"\n class=\"d-flex w-100 align-center justify-center\"\n >\n <VProgressCircular indeterminate />\n </div>\n <!-- Nothing ever loaded: the editor's own empty state would claim there are no bookmarks,\n which is not what a failed fetch found out. -->\n <ARow\n v-else-if=\"!manageLoaded\"\n class=\"text-error\"\n :title=\"t('common.alert.unknownError')\"\n />\n <div\n v-else-if=\"editorLoadFailed\"\n class=\"d-flex w-100 align-center justify-space-between\"\n >\n <span class=\"text-error\">{{ t('common.alert.unknownError') }}</span>\n <ABtnTertiary\n data-cy=\"button-retry-editor\"\n @click.stop=\"loadEditor\"\n >\n {{ t('common.button.retry') }}\n </ABtnTertiary>\n </div>\n <div\n v-else-if=\"!listEditor\"\n class=\"d-flex w-100 align-center justify-center\"\n >\n <VProgressCircular indeterminate />\n </div>\n <!-- Mounted once the first fetch has settled -- empty or not, so an empty list gets the\n editor's own empty state rather than a blank tab -- and never unmounted after that. -->\n <component\n :is=\"listEditor\"\n v-else\n ref=\"editor\"\n v-model=\"itemsManage\"\n :position=\"false\"\n :loading=\"listLoading || saveButtonLoading\"\n compact-field=\"customName\"\n :validate=\"validateBookmarkName\"\n :show-add-button=\"false\"\n :unsaved-section-label=\"t('common.filter.bookmark.unsavedSection')\"\n >\n <template #item=\"{ raw, actions }: { raw: UserAdminConfig; actions: RowUpdate }\">\n <AFormTextField\n :model-value=\"raw.customName\"\n hide-details=\"auto\"\n @update:model-value=\"actions.update({ ...raw, customName: String($event ?? '') })\"\n />\n </template>\n </component>\n </div>\n </VCardText>\n <VCardActions>\n <VSpacer />\n <!-- Nothing in here takes input while a write is out: the change set was read when the\n button was pressed, so anything typed after that would not be in it, and the close that\n follows a successful save would take it with it. -->\n <ABtnTertiary\n data-cy=\"button-cancel\"\n :disabled=\"saveButtonLoading\"\n @click.stop=\"requestClose\"\n >\n {{ t('common.button.cancel') }}\n </ABtnTertiary>\n <!-- Not while the list is being refreshed: the order this would send is the one on screen,\n which the answer on its way is about to replace. -->\n <ABtnPrimary\n data-cy=\"button-confirm\"\n :disabled=\"activeTab === 'manage' && (listLoading || !listEditor)\"\n :loading=\"saveButtonLoading\"\n @click.stop=\"onConfirm\"\n >\n {{ activeTab === 'add' ? t('common.button.add') : t('common.filter.bookmark.saveBookmarkOrder') }}\n </ABtnPrimary>\n </VCardActions>\n </VCard>\n </VDialog>\n\n <AUnsavedConfirmDialog\n v-model=\"guard.promptOpen.value\"\n :dirty-labels=\"guard.dirtyLabels.value\"\n @resolve=\"guard.resolvePrompt\"\n />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A,GA2HMyC,IAA2B,K;;;;;;;;;;;EA5FjC,IAAMG,IAAQC,GAaRC,KAAOH,IAIPI,KAAeC,EAAOC,EAAe,GACrCC,IAAaF,EAAOG,EAAa,GACjCC,IAAaJ,EAAOK,EAAsB;EAEhD,IAAIC,EAAYF,CAAU,KAAKE,EAAYP,EAAY,KAAKO,EAAYJ,CAAU,GAChF,MAAU,MAAM,kCAAkC;EAMpD,IAAMK,IAASC,EAAI,EAAI,GAKjBC,IAAeD,EAAI,EAAK,GACxBE,IAAaF,EAAI,EAAK,GAItBG,IAAaC,GAAsB,GACnCC,IAAmBL,EAAI,EAAK,GAC9BM,IAAgB,IAEdC,IAAa,YAAY;GAC7B,IAAI,IAAW,SAASD,IACxB;IACA,AADA,IAAgB,IAChB,EAAiB,QAAQ;IACzB,IAAI;KACF,EAAW,QAAQ,MAAME,GAAe;IAC1C,QAAQ;KACN,EAAiB,QAAQ;IAC3B,UAAU;KACR,IAAgB;IAClB;GARgB;EASlB,GAEMC,IAAQC,GAAuB;GACnC,SAAS,CAAC;GACV,kBAAkBX;GAClB,YAAY;GACZ,mBAAmB;EACrB,CAAC;EAED,EAA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,SAAW,CAAKhB,EAAA;SACrD,SAASU,EAAA;SACT,SAAK9C,EAAOgG,IAAS,CAAA,MAAA,CAAA;;SAEtB,SAAAjH,QAAkG,CAA/FG,EAAAC,EAAA6D,EAAA,UAAS,QAAa5D,EAAAmI,CAAA,CAAC,CAAA,mBAAA,IAAwBnI,EAAAmI,CAAA,CAAC,CAAA,0CAAA,CAAA,GAAA,CAAA,C;;;;;;;;;;G,qCAM3D1I,EAIEwB,IAAA;IAHS,YAAAjB,EAAAsD,CAAA,CAAK,CAAC,WAAW;IAAjB,uBAAA,AAAAsE,EAAA,QAAA,MAAA,EAAAtE,CAAA,CAAK,CAAC,WAAW,QAAKuE;IAC9B,gBAAc7H,EAAAsD,CAAA,CAAK,CAAC,YAAY;IAChC,WAAStD,EAAAsD,CAAA,CAAK,CAAC"}
1
+ {"version":3,"file":"FilterBookmarkDialog.vue_vue_type_script_setup_true_lang.js","names":["_resolveComponent","_openBlock","_createElementBlock","_Fragment","_createVNode","_component_VDialog","_withCtx","_component_VCard","ADialogToolbar","_createTextVNode","_toDisplayString","_unref","_component_VCardText","_component_VTabs","_component_VTab","ARow","_createBlock","_createCommentVNode","AFormTextField","AFormSwitch","_withDirectives","_createElementVNode","_component_VProgressCircular","_withModifiers","_resolveDynamicComponent","_vShow","_component_VCardActions","_component_VSpacer","AUnsavedConfirmDialog","ARow_default","AFormTextField_default","ADialogToolbar_default","AFormSwitch_default","AUnsavedConfirmDialog_default","useVuelidate","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","MAX_BOOKMARK_NAME_LENGTH","FilterBookmarkDialog_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emit","filterConfig","inject","FilterConfigKey","filterData","FilterDataKey","pagination","DatatablePaginationKey","isUndefined","isOpen","ref","manageLoaded","loadFailed","listEditor","shallowRef","editorLoadFailed","editorLoading","loadEditor","loadListEditor","guard","useUnsavedChangesGuard","open","requestClose","saveButtonLoading","forceClose","activeTab","customName","storeDatatableHiddenColumns","storeDatatableOrder","listLoading","errorCount","itemsManage","validateBookmarkName","item","useValidate","rulesCreate","maxLength","vCreate$","filterBookmarkStore","useFilterBookmarkStore","useUserAdminConfigApi","useI18n","useAlerts","useUserAdminConfigFactory","editor","useTemplateRef","isAlreadyGone","isAnzuApiAxiosError","saveManage","changes","deleteUserAdminConfig","bookmarkCacheKey","updateUserAdminConfig","cloneDeep","updateUserAdminConfigPositions","applyItems","fetchItems","showErrorsDefault","useFilterHelpers","systemResource","UserAdminConfigLayoutType","addBookmark","config","createDefaultUserAdminConfig","UserAdminConfigType","serializeFilters","useFetchUserAdminConfigList","count","maxPosition","res","createUserAdminConfig","isAnzuApiValidationError","hasAnzuApiValidationErrorSpecific","onConfirm","fetchGeneration","fetchesInFlight","generation","items","showUnknownError","e","watch","_component_ABtnTertiary","resolveComponent","_component_ABtnPrimary","openBlock","createElementBlock","Fragment","createVNode","VDialog","_cache","$event","withCtx","VCard","createTextVNode","toDisplayString","unref","t","VCardText","VTabs","VTab","createBlock","createCommentVNode","withDirectives","createElementVNode","VProgressCircular","withModifiers","resolveDynamicComponent","raw","actions","vShow","VCardActions","VSpacer"],"sources":["../../../../../src/domains/filters/bookmarks/components/FilterBookmarkDialog.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport ADialogToolbar from '@/domains/ui/components/ADialogToolbar.vue'\nimport { useI18n } from 'vue-i18n'\nimport { type Component, inject, ref, shallowRef, useTemplateRef, watch } from 'vue'\nimport AFormTextField from '@/domains/form/components/AFormTextField.vue'\nimport ARow from '@/domains/ui/components/ARow.vue'\nimport AFormSwitch from '@/domains/form/components/AFormSwitch.vue'\nimport { loadListEditor } from '@/domains/listEditor/utils/listEditorLoader'\nimport type { ExposedListEditorHandle } from '@/domains/listEditor/composables/useListEditorController'\nimport type { AxiosInstance } from 'axios'\nimport type { IntegerId } from '@/shared/types/common'\nimport { MAX_BOOKMARK_ITEMS, useFilterBookmarkStore } from '@/domains/filters/bookmarks/store/bookmarksStore'\nimport { useUserAdminConfigApi } from '@/domains/filters/bookmarks/api/userAdminConfigApi'\nimport { useAlerts } from '@/domains/system/composables/alerts'\nimport { useUserAdminConfigFactory } from '@/domains/filters/bookmarks/factory/UserAdminConfigFactory'\nimport {\n type UserAdminConfig,\n UserAdminConfigLayoutType,\n UserAdminConfigType,\n} from '@/domains/filters/bookmarks/types/UserAdminConfig'\nimport useVuelidate from '@vuelidate/core'\nimport { useValidate } from '@/shared/validators/vuelidate/useValidate'\nimport { cloneDeep, isUndefined } from '@/shared/utils/common'\nimport { DatatablePaginationKey, FilterConfigKey, FilterDataKey } from '@/domains/filters/utils/filterInjectionKeys'\nimport { useFilterHelpers } from '@/domains/filters/composables/filterFactory'\nimport AUnsavedConfirmDialog from '@/domains/unsavedGuard/components/AUnsavedConfirmDialog.vue'\nimport { useUnsavedChangesGuard } from '@/domains/unsavedGuard/composables/useUnsavedChangesGuard'\nimport { hasAnzuApiValidationErrorSpecific, isAnzuApiValidationError } from '@/shared/error/AnzuApiValidationError'\nimport { isAnzuApiAxiosError } from '@/shared/error/AnzuApiAxiosError'\nimport { HTTP_STATUS_NOT_FOUND } from '@/shared/statusCodes'\n\nconst props = withDefaults(\n defineProps<{\n client: () => AxiosInstance\n system: string\n subject: string\n user: IntegerId\n datatableHiddenColumns?: string[] | undefined\n }>(),\n {\n datatableHiddenColumns: undefined,\n }\n)\n\nconst emit = defineEmits<{\n (e: 'close'): void\n}>()\n\nconst filterConfig = inject(FilterConfigKey)\nconst filterData = inject(FilterDataKey)\nconst pagination = inject(DatatablePaginationKey)\n\nif (isUndefined(pagination) || isUndefined(filterConfig) || isUndefined(filterData)) {\n throw new Error('Incorrect provide/inject config.')\n}\n\n// The dialog is mounted behind the parent's `v-if`, but the guard needs a model to watch.\n// All closing goes through here. `requestClose` lets the guard ask\n// first. `forceClose` is for paths that already are the confirmation.\nconst isOpen = ref(true)\n\n// The editor takes its clean baseline on creation, so it waits for the first fetch.\n// After that it stays mounted. It alone registers this tab's pending work\n// with the guard, and swapping it out would disarm the guard mid-edit.\nconst manageLoaded = ref(false)\nconst loadFailed = ref(false)\n\n// The editor component loads on the first visit to the manage tab (see\n// `loadListEditor`). Its chunk load can fail independently of the bookmark fetch.\nconst listEditor = shallowRef<Component>()\nconst editorLoadFailed = ref(false)\nlet editorLoading = false\n\nconst loadEditor = async () => {\n if (listEditor.value || editorLoading) return\n editorLoading = true\n editorLoadFailed.value = false\n try {\n listEditor.value = await loadListEditor()\n } catch {\n editorLoadFailed.value = true\n } finally {\n editorLoading = false\n }\n}\n\nconst guard = useUnsavedChangesGuard({\n sources: [],\n guardDialogModel: isOpen,\n guardRoute: false,\n guardWindowUnload: false,\n})\n\nwatch(isOpen, (open) => {\n if (!open) emit('close')\n})\n\nconst requestClose = () => {\n // Not while a write is out. The toolbar X and Escape bypass the write-phase disabling.\n // Closing here would ask whether to discard work already sent to the server, and it would be written anyway.\n if (saveButtonLoading.value) return\n isOpen.value = false\n}\n\nconst forceClose = () => {\n guard.acknowledge()\n isOpen.value = false\n}\n\nconst activeTab = ref<'add' | 'manage'>('add')\nconst customName = ref('')\nconst storeDatatableHiddenColumns = ref(false)\nconst storeDatatableOrder = ref(false)\nconst saveButtonLoading = ref(false)\nconst listLoading = ref(false)\nconst errorCount = ref(false)\nconst itemsManage = ref<Array<UserAdminConfig>>([])\n\ninterface RowUpdate {\n update: (next: UserAdminConfig) => void\n}\n\nconst MAX_BOOKMARK_NAME_LENGTH = 100\n\n// The editor handles opening, saving and cancelling a row. Only the rule\n// remains here. It drives the editor's red rail and blocks its save.\nconst validateBookmarkName = (item: UserAdminConfig): boolean =>\n !!item.customName && item.customName.length <= MAX_BOOKMARK_NAME_LENGTH\n\nconst { required, maxLength } = useValidate()\nconst rulesCreate = {\n customName: {\n required,\n maxLength: maxLength(MAX_BOOKMARK_NAME_LENGTH),\n },\n}\nconst vCreate$ = useVuelidate(rulesCreate, { customName }, { $stopPropagation: true })\nconst filterBookmarkStore = useFilterBookmarkStore()\n\nconst {\n createUserAdminConfig,\n useFetchUserAdminConfigList,\n updateUserAdminConfigPositions,\n deleteUserAdminConfig,\n updateUserAdminConfig,\n} =\n // eslint-disable-next-line vue/no-setup-props-reactivity-loss\n useUserAdminConfigApi(props.client, props.system)\nconst { t } = useI18n()\nconst { showErrorsDefault, showUnknownError, showValidationError, showWarningT } = useAlerts()\nconst { createDefaultUserAdminConfig } = useUserAdminConfigFactory()\n\nconst editor = useTemplateRef<ExposedListEditorHandle<UserAdminConfig>>('editor')\n\n// One save for the whole tab, like other list editors here. A per-row PUT required reloading\n// the list to re-baseline, which lost the pending reorder and other rows' typed text.\n// A DELETE answered with \"not found\" means the row is already gone. A retry after a\n// lost response looks like this. Otherwise every retry would stop on the same row.\nconst isAlreadyGone = (e: unknown) => isAnzuApiAxiosError(e) && e.cause.response?.status === HTTP_STATUS_NOT_FOUND\n\nconst saveManage = async () => {\n // Not while the list is refreshing: the on-screen order is about to be replaced by the incoming answer.\n // The button is also disabled. This check does not depend on the button.\n if (listLoading.value) return\n if (!editor.value?.validateAll()) return\n saveButtonLoading.value = true\n try {\n const changes = editor.value.getChanges()\n // Deletes first, then renames, then the order. The order comes\n // from `itemsManage`, which the deleted rows have already left.\n for (const item of changes.deleted) {\n try {\n await deleteUserAdminConfig(item.id)\n } catch (e) {\n if (!isAlreadyGone(e)) throw e\n }\n // Removed from the cache right away. The filter bar is reading\n // it, and a later failure in this save would skip the refresh.\n filterBookmarkStore.removeOne(bookmarkCacheKey(), item.id)\n // Dropping the pending deletion makes a retry safe after a later call failed.\n // Resent renames are the same idempotent PUT. A resent DELETE on a\n // gone row would fail and stop the batch at the same place every time.\n editor.value.restoreDeleted(item.id)\n }\n for (const item of changes.updated) {\n await updateUserAdminConfig(item.id, cloneDeep(item))\n }\n // An empty list is not a valid order to send.\n if (itemsManage.value.length > 0) {\n await updateUserAdminConfigPositions(itemsManage.value.map((item) => item.id))\n }\n // Once, at the end. This also refreshes the store the filter\n // bar reads names from, and the editor re-baselines against it.\n applyItems(await fetchItems())\n forceClose()\n } catch (e) {\n showErrorsDefault(e)\n // No refetch and no rollback. Written changes already match the\n // server, and unwritten ones stay for the user to fix and resend.\n // A refetch would discard that unsent work without asking. The store is marked stale instead.\n filterBookmarkStore.markStale(bookmarkCacheKey())\n } finally {\n saveButtonLoading.value = false\n }\n}\n\nconst { serializeFilters } = useFilterHelpers(filterData, filterConfig)\n\nconst systemResource = props.system + '_' + props.subject\nconst bookmarkCacheKey = () => filterBookmarkStore.generateKey(UserAdminConfigLayoutType.Desktop, systemResource)\n\nconst addBookmark = async () => {\n saveButtonLoading.value = true\n errorCount.value = false\n const config = createDefaultUserAdminConfig(props.system)\n config.user = props.user\n config.configType = UserAdminConfigType.FilterBookmark\n config.layoutType = UserAdminConfigLayoutType.Desktop\n config.systemResource = systemResource\n config.customName = customName.value\n config.data = {\n filter: serializeFilters(filterData, pagination, false),\n datatableHiddenColumns:\n storeDatatableHiddenColumns.value && props.datatableHiddenColumns ? props.datatableHiddenColumns : undefined,\n sortBy: storeDatatableOrder.value && pagination.value.sortBy ? pagination.value.sortBy : undefined,\n }\n try {\n const { count, maxPosition } = await filterBookmarkStore.fetchBookmarkStats(\n {\n user: props.user,\n layoutType: UserAdminConfigLayoutType.Desktop,\n systemResource: systemResource,\n },\n useFetchUserAdminConfigList\n )\n if (count >= MAX_BOOKMARK_ITEMS) {\n errorCount.value = true\n saveButtonLoading.value = false\n return\n }\n // After the highest used position, not the row count. The manage tab renumbers only the\n // rows it sends, so deletions leave gaps and a row count could reuse a taken position.\n config.position = maxPosition + 1\n const res = await createUserAdminConfig(config)\n filterBookmarkStore.addOne(bookmarkCacheKey(), res)\n // Cleared because `requestClose` may not close. If the guard asks and the user stays, a\n // second click would create the bookmark again. Empty, the `required` rule blocks that.\n customName.value = ''\n vCreate$.value.$reset()\n // The write is done, and `requestClose` refuses while one is out. The `finally` sets it again.\n saveButtonLoading.value = false\n // `requestClose`, not `forceClose`: adding a bookmark says nothing\n // about a reorder pending on the other tab, so the guard still asks.\n requestClose()\n } catch (e) {\n if (\n isAnzuApiValidationError(e) &&\n hasAnzuApiValidationErrorSpecific(e, 'error_field_not_unique', 'cms.userAdminConfig.model.systemResource')\n ) {\n showWarningT('common.filter.bookmark.nameUniqueError')\n return\n }\n showErrorsDefault(e)\n } finally {\n saveButtonLoading.value = false\n }\n}\n\nconst onConfirm = () => {\n if (activeTab.value === 'add') {\n vCreate$.value.$touch()\n if (vCreate$.value.$invalid) {\n showValidationError()\n return\n }\n addBookmark()\n } else if (activeTab.value === 'manage') {\n // Not gated on a non-empty list. Deleting every row empties it while\n // the deletions are still pending, and only this button sends them.\n saveManage()\n }\n}\n\n// Tab switches can start fetches faster than they return. Only the\n// newest may apply, or an older answer could restore an outdated list.\nlet fetchGeneration = 0\nlet fetchesInFlight = 0\n\nconst fetchItems = async (): Promise<UserAdminConfig[] | null> => {\n const generation = ++fetchGeneration\n // A counter, not a flag. An older fetch finishing must not mark the tab\n // settled while a newer one is out, or the editor accepts edits in between.\n fetchesInFlight++\n listLoading.value = true\n loadFailed.value = false\n try {\n const items = await filterBookmarkStore.getBookmarks(\n {\n user: props.user,\n layoutType: UserAdminConfigLayoutType.Desktop,\n systemResource: systemResource,\n },\n useFetchUserAdminConfigList,\n true\n )\n if (generation !== fetchGeneration) return null\n // `null` means this request failed. The store's `error` flag is\n // shared with other fetches, including this dialog's bookmark count.\n if (items === null) {\n loadFailed.value = true\n showUnknownError()\n return null\n }\n return items\n } catch (e) {\n // An overtaken answer must not set the error state or raise an alert.\n if (generation !== fetchGeneration) return null\n loadFailed.value = true\n showErrorsDefault(e)\n return null\n } finally {\n fetchesInFlight--\n listLoading.value = fetchesInFlight > 0\n }\n}\n\n// Rows are handed to the editor directly, not via `v-model`, which lags a render.\n// A commit before the rows arrived would pin the baseline to the old list,\n// and every fetched difference would look like an unsaved user edit.\n// On first load the editor mounts later and takes its baseline from `itemsManage`.\nconst applyItems = (items: UserAdminConfig[] | null) => {\n if (!items) return\n itemsManage.value = items\n manageLoaded.value = true\n editor.value?.commit(items)\n}\n\nwatch(activeTab, async () => {\n errorCount.value = false\n if (activeTab.value !== 'manage') return\n void loadEditor()\n // Entering the tab refreshes it, for example after adding a bookmark on the other\n // tab. Never over unsaved work: the fetched order would replace the dragged one.\n if (editor.value?.hasUnsaved) return\n const items = await fetchItems()\n // Checked again after the fetch: the user may have started dragging while it ran.\n if (editor.value?.hasUnsaved) return\n applyItems(items)\n})\n</script>\n\n<template>\n <!--\n `persistent` while a write is out: Escape and outside clicks\n change the model directly, bypassing the write-phase disabling.\n -->\n <VDialog\n v-model=\"isOpen\"\n :persistent=\"saveButtonLoading\"\n :width=\"500\"\n >\n <VCard>\n <ADialogToolbar @cancel=\"requestClose\">\n {{ t('common.filter.bookmark.title') }}\n </ADialogToolbar>\n <VCardText class=\"pt-0\">\n <VTabs\n v-model=\"activeTab\"\n fixed-tabs\n >\n <VTab\n value=\"add\"\n :disabled=\"saveButtonLoading\"\n >\n {{ t('common.filter.bookmark.add') }}\n </VTab>\n <VTab\n value=\"manage\"\n :disabled=\"saveButtonLoading\"\n >\n {{ t('common.filter.bookmark.manage') }}\n </VTab>\n </VTabs>\n <div\n v-if=\"activeTab === 'add'\"\n class=\"w-100 pt-4\"\n >\n <ARow :title=\"t('common.filter.bookmark.infoSave')\" />\n <ARow\n v-if=\"errorCount\"\n class=\"text-error\"\n :title=\"t('common.filter.bookmark.errorMax')\"\n />\n <ARow>\n <AFormTextField\n v-model=\"customName\"\n :label=\"t('common.filter.bookmark.name')\"\n required\n :disabled=\"saveButtonLoading\"\n :v=\"vCreate$.customName\"\n />\n </ARow>\n <ARow>\n <AFormSwitch\n v-model=\"storeDatatableHiddenColumns\"\n :disabled=\"saveButtonLoading\"\n :label=\"t('common.filter.bookmark.storeTableColumns')\"\n />\n </ARow>\n <ARow>\n <AFormSwitch\n v-model=\"storeDatatableOrder\"\n :disabled=\"saveButtonLoading\"\n :label=\"t('common.filter.bookmark.storeTableOrder')\"\n />\n </ARow>\n </div>\n <!--\n `v-show`, not `v-if`: the guard sees pending work only through the section the editor registers.\n Unmounting on a tab switch would let the dialog close on a dragged order without asking.\n The spinner is the editor's own `loading` for the same reason.\n -->\n <div\n v-show=\"activeTab === 'manage'\"\n class=\"w-100 pt-4\"\n >\n <div\n v-if=\"!manageLoaded && !loadFailed\"\n class=\"d-flex w-100 align-center justify-center\"\n >\n <VProgressCircular indeterminate />\n </div>\n <!--\n Nothing loaded yet: the editor's empty state would wrongly\n claim there are no bookmarks after a failed fetch.\n -->\n <ARow\n v-else-if=\"!manageLoaded\"\n class=\"text-error\"\n :title=\"t('common.alert.unknownError')\"\n />\n <div\n v-else-if=\"editorLoadFailed\"\n class=\"d-flex w-100 align-center justify-space-between\"\n >\n <span class=\"text-error\">{{ t('common.alert.unknownError') }}</span>\n <ABtnTertiary\n data-cy=\"button-retry-editor\"\n @click.stop=\"loadEditor\"\n >\n {{ t('common.button.retry') }}\n </ABtnTertiary>\n </div>\n <div\n v-else-if=\"!listEditor\"\n class=\"d-flex w-100 align-center justify-center\"\n >\n <VProgressCircular indeterminate />\n </div>\n <!--\n Mounted once the first fetch settles, even if empty, so an empty\n list shows the editor's empty state. Never unmounted after that.\n -->\n <component\n :is=\"listEditor\"\n v-else\n ref=\"editor\"\n v-model=\"itemsManage\"\n :position=\"false\"\n :loading=\"listLoading || saveButtonLoading\"\n compact-field=\"customName\"\n :validate=\"validateBookmarkName\"\n :show-add-button=\"false\"\n :unsaved-section-label=\"t('common.filter.bookmark.unsavedSection')\"\n >\n <template #item=\"{ raw, actions }: { raw: UserAdminConfig; actions: RowUpdate }\">\n <AFormTextField\n :model-value=\"raw.customName\"\n hide-details=\"auto\"\n @update:model-value=\"actions.update({ ...raw, customName: String($event ?? '') })\"\n />\n </template>\n </component>\n </div>\n </VCardText>\n <VCardActions>\n <VSpacer />\n <!--\n Inputs are disabled while a write is out. The change set was read when the button\n was pressed, so later typing would be lost on the close after a successful save.\n -->\n <ABtnTertiary\n data-cy=\"button-cancel\"\n :disabled=\"saveButtonLoading\"\n @click.stop=\"requestClose\"\n >\n {{ t('common.button.cancel') }}\n </ABtnTertiary>\n <!-- Disabled while the list refreshes: the on-screen order is about to be replaced by the incoming answer. -->\n <ABtnPrimary\n data-cy=\"button-confirm\"\n :disabled=\"activeTab === 'manage' && (listLoading || !listEditor)\"\n :loading=\"saveButtonLoading\"\n @click.stop=\"onConfirm\"\n >\n {{ activeTab === 'add' ? t('common.button.add') : t('common.filter.bookmark.saveBookmarkOrder') }}\n </ABtnPrimary>\n </VCardActions>\n </VCard>\n </VDialog>\n\n <AUnsavedConfirmDialog\n v-model=\"guard.promptOpen.value\"\n :dirty-labels=\"guard.dirtyLabels.value\"\n @resolve=\"guard.resolvePrompt\"\n />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A,GA0HMyC,IAA2B,K;;;;;;;;;;;EA3FjC,IAAMG,IAAQC,GAaRC,KAAOH,IAIPI,KAAeC,EAAOC,EAAe,GACrCC,IAAaF,EAAOG,EAAa,GACjCC,IAAaJ,EAAOK,EAAsB;EAEhD,IAAIC,EAAYF,CAAU,KAAKE,EAAYP,EAAY,KAAKO,EAAYJ,CAAU,GAChF,MAAU,MAAM,kCAAkC;EAMpD,IAAMK,IAASC,EAAI,EAAI,GAKjBC,IAAeD,EAAI,EAAK,GACxBE,IAAaF,EAAI,EAAK,GAItBG,IAAaC,GAAsB,GACnCC,IAAmBL,EAAI,EAAK,GAC9BM,IAAgB,IAEdC,IAAa,YAAY;GAC7B,IAAI,IAAW,SAASD,IACxB;IACA,AADA,IAAgB,IAChB,EAAiB,QAAQ;IACzB,IAAI;KACF,EAAW,QAAQ,MAAME,GAAe;IAC1C,QAAQ;KACN,EAAiB,QAAQ;IAC3B,UAAU;KACR,IAAgB;IAClB;GARgB;EASlB,GAEMC,IAAQC,GAAuB;GACnC,SAAS,CAAC;GACV,kBAAkBX;GAClB,YAAY;GACZ,mBAAmB;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UAAS,aAAkBI,EAAA,SAAW,CAAKhB,EAAA;SACrD,SAASU,EAAA;SACT,SAAK9C,EAAOgG,IAAS,CAAA,MAAA,CAAA;;SAEtB,SAAAjH,QAAkG,CAA/FG,EAAAC,EAAA6D,EAAA,UAAS,QAAa5D,EAAAmI,CAAA,CAAC,CAAA,mBAAA,IAAwBnI,EAAAmI,CAAA,CAAC,CAAA,0CAAA,CAAA,GAAA,CAAA,C;;;;;;;;;;G,qCAM3D1I,EAIEwB,IAAA;IAHS,YAAAjB,EAAAsD,CAAA,CAAK,CAAC,WAAW;IAAjB,uBAAA,AAAAsE,EAAA,QAAA,MAAA,EAAAtE,CAAA,CAAK,CAAC,WAAW,QAAKuE;IAC9B,gBAAc7H,EAAAsD,CAAA,CAAK,CAAC,YAAY;IAChC,WAAStD,EAAAsD,CAAA,CAAK,CAAC"}
@@ -5,9 +5,9 @@ interface CacheItem<T = UserAdminConfig> {
5
5
  lastUsed: number;
6
6
  items: T[];
7
7
  /**
8
- * The entry is known to be behind the server. It keeps its rows -- the filter bar reads them
9
- * straight out of this map and dropping them would blank it on screen -- but the next reader is
10
- * sent to the server instead of being handed them as current.
8
+ * The entry is known to be behind the server. It keeps its rows because
9
+ * the filter bar reads them directly and dropping them would blank it.
10
+ * The next reader is sent to the server instead.
11
11
  */
12
12
  stale?: boolean;
13
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"bookmarksStore.js","names":["MAX_BOOKMARKS","useFilterBookmarkStore","defineStore","bookmarks","ref","error","fetchSequence","generateKey","systemResource","layoutType","removeOldestBookmark","oldestKey","oldestTime","value","bookmarkKey","getBookmarks","key","identifier","now","forceFetch","cached","usePagination","SortOrder","system","resource","stringSplitOnFirstOccurrence","useUserAdminConfigInnerFilter","UserAdminConfigType","sequence","items","useApiFetch","execute","pagination","filterData","filterConfig","markStale","fetchBookmarkStats","res","item","supersedeInFlight","addOne","data","removeOne","id"],"sources":["../../../../../src/domains/filters/bookmarks/store/bookmarksStore.ts"],"sourcesContent":["import { acceptHMRUpdate, defineStore } from 'pinia'\nimport { ref } from 'vue'\nimport { useUserAdminConfigInnerFilter } from '@/domains/filters/bookmarks/filter/UserAdminConfigFilter'\nimport {\n type UserAdminConfig,\n type UserAdminConfigLayoutTypeType,\n UserAdminConfigType,\n} from '@/domains/filters/bookmarks/types/UserAdminConfig'\nimport type { IntegerId } from '@/shared/types/common'\nimport type { UseApiFetchListReturnType } from '@/domains/api/composables/useApiFetchList'\nimport { usePagination } from '@/domains/api/composables/pagination'\nimport { SortOrder } from '@/domains/api/types/SortOrder'\nimport { stringSplitOnFirstOccurrence } from '@/shared/utils/string'\n\ninterface CacheItem<T = UserAdminConfig> {\n lastUsed: number\n items: T[]\n /**\n * The entry is known to be behind the server. It keeps its rows -- the filter bar reads them\n * straight out of this map and dropping them would blank it on screen -- but the next reader is\n * sent to the server instead of being handed them as current.\n */\n stale?: boolean\n}\n\nconst MAX_BOOKMARKS = 3\nexport const MAX_BOOKMARK_ITEMS = 8\n\nexport const useFilterBookmarkStore = defineStore('commonAdminFilterBookmarkStore', () => {\n const bookmarks = ref(new Map<string, CacheItem>())\n const error = ref(false)\n // A forced refetch can be asked for again before the first one has answered -- the bookmark\n // dialog does exactly that on every entry to its manage tab. Only the newest answer per key is\n // allowed to become the cache; an older one landing after it would put the filter bar back to\n // what it showed two refreshes ago.\n const fetchSequence = new Map<string, number>()\n\n function generateKey(layoutType: UserAdminConfigLayoutTypeType, systemResource: string) {\n return `userAdminConfig/${systemResource}/${layoutType}/`\n }\n\n function removeOldestBookmark() {\n let oldestKey: string | null = null\n let oldestTime = Infinity\n bookmarks.value.forEach((value, bookmarkKey) => {\n if (value.lastUsed < oldestTime) {\n oldestTime = value.lastUsed\n oldestKey = bookmarkKey\n }\n })\n if (oldestKey !== null) {\n bookmarks.value.delete(oldestKey)\n }\n }\n\n async function getBookmarks(\n identifier: {\n user: IntegerId\n layoutType: UserAdminConfigLayoutTypeType\n systemResource: string\n },\n useApiFetch: () => UseApiFetchListReturnType<UserAdminConfig>,\n forceFetch: boolean = false\n ): Promise<UserAdminConfig[] | null> {\n error.value = false\n const key = generateKey(identifier.layoutType, identifier.systemResource)\n const now = Date.now()\n\n if (!forceFetch) {\n const cached = bookmarks.value.get(key)\n if (cached && !cached.stale) {\n cached.lastUsed = now\n return [...cached.items]\n }\n }\n\n const { pagination } = usePagination('position', SortOrder.Asc, {\n rowsPerPage: MAX_BOOKMARK_ITEMS,\n })\n const { start: system, end: resource } = stringSplitOnFirstOccurrence(identifier.systemResource, '_')\n const { filterConfig, filterData } = useUserAdminConfigInnerFilter(system, resource)\n filterData.configType = UserAdminConfigType.FilterBookmark\n filterData.layoutType = identifier.layoutType\n filterData.systemResource = identifier.systemResource\n filterData.user = identifier.user\n\n const sequence = (fetchSequence.get(key) ?? 0) + 1\n fetchSequence.set(key, sequence)\n\n let items: UserAdminConfig[]\n try {\n const { execute } = useApiFetch()\n items = await execute(pagination, filterData, filterConfig)\n if (fetchSequence.get(key) === sequence) {\n bookmarks.value.set(key, { lastUsed: now, items })\n }\n } catch (e) {\n // An overtaken answer says nothing about the newer one that replaced it, failure included.\n if (fetchSequence.get(key) === sequence) {\n error.value = true\n // A forced refetch is asked for because something is known to have changed, so a failed one\n // leaves nothing to trust in the cache either.\n markStale(key)\n }\n // `null`, not an empty array: \"there are no bookmarks\" and \"this request died\" are different\n // answers, and the caller can only tell them apart if they look different. The `error` flag is\n // one per store, so it cannot say which request it belongs to.\n return null\n }\n\n if (bookmarks.value.size > MAX_BOOKMARKS) {\n removeOldestBookmark()\n }\n\n // A copy, never the array the cache holds. `addOne` pushes into that one so the filter bar\n // picks the new bookmark up on the spot, and a caller that keeps what it was handed -- the\n // manage dialog keeps it as its editor's model -- would otherwise get that row pushed into its\n // list from the outside, where it reads as something the user added and never saved.\n return [...items]\n }\n\n /**\n * What a new bookmark needs to know: how many there are, which is what the cap is checked\n * against, and the highest position in use, which is what it has to sort after.\n *\n * The two are not the same number. Positions go dense only when the manage dialog saves an\n * order -- it renumbers exactly the rows it sends -- so a row created while another was pending\n * deletion leaves a gap behind, and from then on the count is lower than the highest position.\n * Deriving a new position from the count would then hand it one already in use: two rows on the\n * same position, which the list has no second key to order by, or with more than one deletion a\n * position below a row created earlier.\n */\n async function fetchBookmarkStats(\n identifier: {\n user: IntegerId\n layoutType: UserAdminConfigLayoutTypeType\n systemResource: string\n },\n useApiFetch: () => UseApiFetchListReturnType<UserAdminConfig>\n ): Promise<{ count: number; maxPosition: number }> {\n error.value = false\n const { pagination } = usePagination('position', SortOrder.Asc, {\n rowsPerPage: MAX_BOOKMARK_ITEMS + 1,\n })\n const { start: system, end: resource } = stringSplitOnFirstOccurrence(identifier.systemResource, '_')\n const { filterConfig, filterData } = useUserAdminConfigInnerFilter(system, resource)\n filterData.configType = UserAdminConfigType.FilterBookmark\n filterData.layoutType = identifier.layoutType\n filterData.systemResource = identifier.systemResource\n filterData.user = identifier.user\n\n try {\n const { execute } = useApiFetch()\n // The page is capped one above the maximum a user may have, so a list long enough to hide the\n // real highest position is also one the count refuses to add to. Read across the rows rather\n // than off the last one: taking the last would tie this to the sort order asked for above,\n // and flipping that would quietly turn the highest position into the lowest -- with nothing\n // to show for it, since the order the bar draws comes from a different call.\n const res = await execute(pagination, filterData, filterConfig)\n return {\n count: res.length,\n maxPosition: res.length > 0 ? Math.max(...res.map((item) => item.position)) : 0,\n }\n } catch (e) {\n error.value = true\n // `Infinity` keeps what a failed count has always done: refuse the add rather than create a\n // bookmark past a cap nobody could check.\n return { count: Infinity, maxPosition: 0 }\n }\n }\n\n /**\n * A write straight into what is cached is newer than any answer already on its way, so it counts\n * as an answer of its own. Without this an in-flight fetch -- issued before the write, so its\n * rows know nothing about it -- would come back and overwrite the cache, taking the write with\n * it, and only the next forced fetch would bring it back.\n */\n function supersedeInFlight(key: string) {\n fetchSequence.set(key, (fetchSequence.get(key) ?? 0) + 1)\n }\n\n function addOne(key: string, data: UserAdminConfig) {\n const cached = bookmarks.value.get(key)\n // Nothing cached means nothing to add to and nothing to protect: superseding here would throw\n // away the answer of a fetch already on its way and leave the bar with no bookmarks at all,\n // which is worse than it missing the one just created until the next refresh brings it.\n if (!cached) return\n cached.items.push(data)\n supersedeInFlight(key)\n }\n\n /**\n * Drop one bookmark from what is cached, in place, the way `addOne` adds one -- so a delete that\n * went through stops being offered by a filter bar that is already on screen. It reads this map\n * straight and does not fetch again for itself.\n */\n function removeOne(key: string, id: IntegerId) {\n const cached = bookmarks.value.get(key)\n if (!cached) return\n cached.items = cached.items.filter((item) => item.id !== id)\n supersedeInFlight(key)\n }\n\n /**\n * Say that what is cached under this key is behind the server -- after a write whose refresh did\n * not happen, or one that failed. The rows stay readable for whoever is already showing them; the\n * next read goes to the server.\n */\n function markStale(key: string) {\n const cached = bookmarks.value.get(key)\n if (cached) cached.stale = true\n }\n\n return {\n bookmarks,\n error,\n getBookmarks,\n generateKey,\n addOne,\n removeOne,\n markStale,\n fetchBookmarkStats,\n }\n})\n\nif (import.meta.hot) {\n import.meta.hot.accept(acceptHMRUpdate(useFilterBookmarkStore, import.meta.hot))\n}\n"],"mappings":";;;;;;;;AAyBA,IAAMA,IAAgB,GAGTC,IAAyBC,EAAY,wCAAwC;CACxF,IAAMC,IAAYC,kBAAI,IAAI,IAAuB,CAAC,GAC5CC,IAAQD,EAAI,EAAK,GAKjBE,oBAAgB,IAAI,IAAoB;CAE9C,SAASC,EAAY,GAA2C,GAAwB;EACtF,OAAO,mBAAmBC,EAAe,GAAGC,EAAW;CACzD;CAEA,SAASC,IAAuB;EAC9B,IAAIC,IAA2B,MAC3BC,IAAa;EAOjB,AANAT,EAAU,MAAM,SAAS,GAAO,MAAgB;GAC9C,AAAIU,EAAM,WAAWD,MACnB,IAAaC,EAAM,UACnB,IAAYC;EAEhB,CAAC,GACGH,MAAc,QAChBR,EAAU,MAAM,OAAOQ,CAAS;CAEpC;CAEA,eAAeI,EACb,GAKA,GACA,IAAsB,IACa;EACnC,EAAM,QAAQ;EACd,IAAMC,IAAMT,EAA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A8BH,GAAQC,CAAQ;EAInF,AAHA,EAAW,aAAaG,EAAoB,gBAC5C,EAAW,aAAaV,EAAW,YACnC,EAAW,iBAAiBA,EAAW,gBACvC,EAAW,OAAOA,EAAW;EAE7B,IAAI;GACF,IAAM,EAAE,eAAYa,EAAY,GAM1BO,IAAM,MAAMN,EAAQC,GAAYC,GAAYC,CAAY;GAC9D,OAAO;IACL,OAAOG,EAAI;IACX,aAAaA,EAAI,SAAS,IAAI,KAAK,IAAI,GAAGA,EAAI,KAAK,MAASC,EAAK,QAAQ,CAAC,IAAI;GAChF;EACF,QAAY;GAIV,OAHA,EAAM,QAAQ,IAGP;IAAE,OAAO;IAAU,aAAa;GAAE;EAC3C;CACF;CAQA,SAASC,EAAkB,GAAa;EACtC,EAAc,IAAIvB,IAAMV,EAAc,IAAIU,CAAG,KAAK,KAAK,CAAC;CAC1D;CAEA,SAASwB,EAAO,GAAa,GAAuB;EAClD,IAAMpB,IAASjB,EAAU,MAAM,IAAIa,CAAG;EAItC,AAAKI,MACLA,EAAO,MAAM,KAAKqB,CAAI,GACtBF,EAAkBvB,CAAG;CACvB;CAOA,SAAS0B,EAAU,GAAa,GAAe;EAC7C,IAAMtB,IAASjB,EAAU,MAAM,IAAIa,CAAG;EACtC,AAAKI,MACL,EAAO,QAAQA,EAAO,MAAM,QAAQ,MAASkB,EAAK,OAAOK,CAAE,GAC3DJ,EAAkBvB,CAAG;CACvB;CAOA,SAASmB,EAAU,GAAa;EAC9B,IAAMf,IAASjB,EAAU,MAAM,IAAIa,CAAG;EACtC,AAAII,MAAQ,EAAO,QAAQ;CAC7B;CAEA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF,CAAC"}
1
+ {"version":3,"file":"bookmarksStore.js","names":["MAX_BOOKMARKS","useFilterBookmarkStore","defineStore","bookmarks","ref","error","fetchSequence","generateKey","systemResource","layoutType","removeOldestBookmark","oldestKey","oldestTime","value","bookmarkKey","getBookmarks","key","identifier","now","forceFetch","cached","usePagination","SortOrder","system","resource","stringSplitOnFirstOccurrence","useUserAdminConfigInnerFilter","UserAdminConfigType","sequence","items","useApiFetch","execute","pagination","filterData","filterConfig","markStale","fetchBookmarkStats","res","item","supersedeInFlight","addOne","data","removeOne","id"],"sources":["../../../../../src/domains/filters/bookmarks/store/bookmarksStore.ts"],"sourcesContent":["import { acceptHMRUpdate, defineStore } from 'pinia'\nimport { ref } from 'vue'\nimport { useUserAdminConfigInnerFilter } from '@/domains/filters/bookmarks/filter/UserAdminConfigFilter'\nimport {\n type UserAdminConfig,\n type UserAdminConfigLayoutTypeType,\n UserAdminConfigType,\n} from '@/domains/filters/bookmarks/types/UserAdminConfig'\nimport type { IntegerId } from '@/shared/types/common'\nimport type { UseApiFetchListReturnType } from '@/domains/api/composables/useApiFetchList'\nimport { usePagination } from '@/domains/api/composables/pagination'\nimport { SortOrder } from '@/domains/api/types/SortOrder'\nimport { stringSplitOnFirstOccurrence } from '@/shared/utils/string'\n\ninterface CacheItem<T = UserAdminConfig> {\n lastUsed: number\n items: T[]\n /**\n * The entry is known to be behind the server. It keeps its rows because\n * the filter bar reads them directly and dropping them would blank it.\n * The next reader is sent to the server instead.\n */\n stale?: boolean\n}\n\nconst MAX_BOOKMARKS = 3\nexport const MAX_BOOKMARK_ITEMS = 8\n\nexport const useFilterBookmarkStore = defineStore('commonAdminFilterBookmarkStore', () => {\n const bookmarks = ref(new Map<string, CacheItem>())\n const error = ref(false)\n // A forced refetch can be requested again before the first\n // answers, as the bookmark dialog does on every manage tab entry.\n // Only the newest answer per key becomes the cache, or an older one could restore an outdated filter bar.\n const fetchSequence = new Map<string, number>()\n\n function generateKey(layoutType: UserAdminConfigLayoutTypeType, systemResource: string) {\n return `userAdminConfig/${systemResource}/${layoutType}/`\n }\n\n function removeOldestBookmark() {\n let oldestKey: string | null = null\n let oldestTime = Infinity\n bookmarks.value.forEach((value, bookmarkKey) => {\n if (value.lastUsed < oldestTime) {\n oldestTime = value.lastUsed\n oldestKey = bookmarkKey\n }\n })\n if (oldestKey !== null) {\n bookmarks.value.delete(oldestKey)\n }\n }\n\n async function getBookmarks(\n identifier: {\n user: IntegerId\n layoutType: UserAdminConfigLayoutTypeType\n systemResource: string\n },\n useApiFetch: () => UseApiFetchListReturnType<UserAdminConfig>,\n forceFetch: boolean = false\n ): Promise<UserAdminConfig[] | null> {\n error.value = false\n const key = generateKey(identifier.layoutType, identifier.systemResource)\n const now = Date.now()\n\n if (!forceFetch) {\n const cached = bookmarks.value.get(key)\n if (cached && !cached.stale) {\n cached.lastUsed = now\n return [...cached.items]\n }\n }\n\n const { pagination } = usePagination('position', SortOrder.Asc, {\n rowsPerPage: MAX_BOOKMARK_ITEMS,\n })\n const { start: system, end: resource } = stringSplitOnFirstOccurrence(identifier.systemResource, '_')\n const { filterConfig, filterData } = useUserAdminConfigInnerFilter(system, resource)\n filterData.configType = UserAdminConfigType.FilterBookmark\n filterData.layoutType = identifier.layoutType\n filterData.systemResource = identifier.systemResource\n filterData.user = identifier.user\n\n const sequence = (fetchSequence.get(key) ?? 0) + 1\n fetchSequence.set(key, sequence)\n\n let items: UserAdminConfig[]\n try {\n const { execute } = useApiFetch()\n items = await execute(pagination, filterData, filterConfig)\n if (fetchSequence.get(key) === sequence) {\n bookmarks.value.set(key, { lastUsed: now, items })\n }\n } catch (e) {\n // An overtaken answer, including a failure, says nothing about the newer request.\n if (fetchSequence.get(key) === sequence) {\n error.value = true\n // A forced refetch means something changed, so after a failed one the cache cannot be trusted either.\n markStale(key)\n }\n // `null`, not an empty array, so the caller can tell \"no bookmarks\" from \"request failed\".\n // The store has one `error` flag, so it cannot say which request failed.\n return null\n }\n\n if (bookmarks.value.size > MAX_BOOKMARKS) {\n removeOldestBookmark()\n }\n\n // Return a copy, never the cached array. `addOne` pushes into the cached array so the filter bar updates at once.\n // A caller that keeps the array, like the manage dialog's editor\n // model, would otherwise get an unsaved row pushed into it.\n return [...items]\n }\n\n /**\n * Returns the bookmark count, which the cap is checked against, and\n * the highest position in use, which a new bookmark sorts after.\n * These differ. Positions are renumbered only when the manage dialog saves\n * an order, so a row created while another is pending deletion leaves a gap.\n * Deriving the position from the count would then reuse a taken position. The list has no second sort key for ties.\n */\n async function fetchBookmarkStats(\n identifier: {\n user: IntegerId\n layoutType: UserAdminConfigLayoutTypeType\n systemResource: string\n },\n useApiFetch: () => UseApiFetchListReturnType<UserAdminConfig>\n ): Promise<{ count: number; maxPosition: number }> {\n error.value = false\n const { pagination } = usePagination('position', SortOrder.Asc, {\n rowsPerPage: MAX_BOOKMARK_ITEMS + 1,\n })\n const { start: system, end: resource } = stringSplitOnFirstOccurrence(identifier.systemResource, '_')\n const { filterConfig, filterData } = useUserAdminConfigInnerFilter(system, resource)\n filterData.configType = UserAdminConfigType.FilterBookmark\n filterData.layoutType = identifier.layoutType\n filterData.systemResource = identifier.systemResource\n filterData.user = identifier.user\n\n try {\n const { execute } = useApiFetch()\n // The page is capped one above the user's maximum, so a list long enough\n // to hide the highest position is also one the count refuses to add to.\n // Take the max across rows, not the last row, so this does not depend on the sort order requested above.\n const res = await execute(pagination, filterData, filterConfig)\n return {\n count: res.length,\n maxPosition: res.length > 0 ? Math.max(...res.map((item) => item.position)) : 0,\n }\n } catch (e) {\n error.value = true\n // `Infinity` refuses the add when the count fails, rather than creating a bookmark past an unchecked cap.\n return { count: Infinity, maxPosition: 0 }\n }\n }\n\n /**\n * A direct write to the cache is newer than any in-flight fetch, so it counts as an answer.\n * Otherwise a fetch issued before the write would return and overwrite the cache, losing the write.\n */\n function supersedeInFlight(key: string) {\n fetchSequence.set(key, (fetchSequence.get(key) ?? 0) + 1)\n }\n\n function addOne(key: string, data: UserAdminConfig) {\n const cached = bookmarks.value.get(key)\n // Nothing cached means nothing to update. Superseding here\n // would discard an in-flight fetch and leave the bar empty.\n // Missing the new bookmark until the next refresh is the lesser problem.\n if (!cached) return\n cached.items.push(data)\n supersedeInFlight(key)\n }\n\n /**\n * Removes one bookmark from the cache in place, like `addOne`, so a\n * filter bar already on screen stops offering it. It does not refetch.\n */\n function removeOne(key: string, id: IntegerId) {\n const cached = bookmarks.value.get(key)\n if (!cached) return\n cached.items = cached.items.filter((item) => item.id !== id)\n supersedeInFlight(key)\n }\n\n /**\n * Marks the cache under this key as behind the server, after a write whose refresh did not happen or failed.\n * Cached rows stay readable. The next read goes to the server.\n */\n function markStale(key: string) {\n const cached = bookmarks.value.get(key)\n if (cached) cached.stale = true\n }\n\n return {\n bookmarks,\n error,\n getBookmarks,\n generateKey,\n addOne,\n removeOne,\n markStale,\n fetchBookmarkStats,\n }\n})\n\nif (import.meta.hot) {\n import.meta.hot.accept(acceptHMRUpdate(useFilterBookmarkStore, import.meta.hot))\n}\n"],"mappings":";;;;;;;;AAyBA,IAAMA,IAAgB,GAGTC,IAAyBC,EAAY,wCAAwC;CACxF,IAAMC,IAAYC,kBAAI,IAAI,IAAuB,CAAC,GAC5CC,IAAQD,EAAI,EAAK,GAIjBE,oBAAgB,IAAI,IAAoB;CAE9C,SAASC,EAAY,GAA2C,GAAwB;EACtF,OAAO,mBAAmBC,EAAe,GAAGC,EAAW;CACzD;CAEA,SAASC,IAAuB;EAC9B,IAAIC,IAA2B,MAC3BC,IAAa;EAOjB,AANAT,EAAU,MAAM,SAAS,GAAO,MAAgB;GAC9C,AAAIU,EAAM,WAAWD,MACnB,IAAaC,EAAM,UACnB,IAAYC;EAEhB,CAAC,GACGH,MAAc,QAChBR,EAAU,MAAM,OAAOQ,CAAS;CAEpC;CAEA,eAAeI,EACb,GAKA,GACA,IAAsB,IACa;EACnC,EAAM,QAAQ;EACd,IAAMC,IAAMT,EAAYU,EAAW,YAAYA,EAAW,cAAc,GAClEC,IAAM,KAAK,IAAI;EAErB,IAAI,CAACC,GAAY;GACf,IAAMC,IAASjB,EAAU,MAAM,IAAIa,CAAG;GACtC,IAAII,KAAU,CAACA,EAAO,OAEpB,OADA,EAAO,WAAWF,GACX,CAAC,GAAGE,EAAO,KAAK;EAE3B;EAEA,IAAM,EAAE,kBAA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;IACL,OAAOG,EAAI;IACX,aAAaA,EAAI,SAAS,IAAI,KAAK,IAAI,GAAGA,EAAI,KAAK,MAASC,EAAK,QAAQ,CAAC,IAAI;GAChF;EACF,QAAY;GAGV,OAFA,EAAM,QAAQ,IAEP;IAAE,OAAO;IAAU,aAAa;GAAE;EAC3C;CACF;CAMA,SAASC,EAAkB,GAAa;EACtC,EAAc,IAAIvB,IAAMV,EAAc,IAAIU,CAAG,KAAK,KAAK,CAAC;CAC1D;CAEA,SAASwB,EAAO,GAAa,GAAuB;EAClD,IAAMpB,IAASjB,EAAU,MAAM,IAAIa,CAAG;EAItC,AAAKI,MACLA,EAAO,MAAM,KAAKqB,CAAI,GACtBF,EAAkBvB,CAAG;CACvB;CAMA,SAAS0B,EAAU,GAAa,GAAe;EAC7C,IAAMtB,IAASjB,EAAU,MAAM,IAAIa,CAAG;EACtC,AAAKI,MACL,EAAO,QAAQA,EAAO,MAAM,QAAQ,MAASkB,EAAK,OAAOK,CAAE,GAC3DJ,EAAkBvB,CAAG;CACvB;CAMA,SAASmB,EAAU,GAAa;EAC9B,IAAMf,IAASjB,EAAU,MAAM,IAAIa,CAAG;EACtC,AAAII,MAAQ,EAAO,QAAQ;CAC7B;CAEA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"AFilterDatetimePicker.js","names":["_sfc_main","AFilterDatetimePicker_vue_vue_type_script_setup_true_lang_default","AFilterDatetimePicker_default"],"sources":["../../../../src/domains/filters/components/AFilterDatetimePicker.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { computed, inject } from 'vue'\nimport { useI18n } from 'vue-i18n'\nimport ADatetimePicker from '@/domains/ui/datetime/components/ADatetimePicker.vue'\nimport {\n FilterConfigKey,\n FilterDataKey,\n FilterSelectedKey,\n FilterSubmitResetCounterKey,\n} from '@/domains/filters/utils/filterInjectionKeys'\nimport { isString, isUndefined } from '@/shared/utils/common'\nimport { useFilterClearHelpers } from '@/domains/filters/composables/filterFactory'\nimport type { DatetimeUTCNullable } from '@/shared/types/common'\nimport { dateTimePretty } from '@/shared/utils/datetime'\n\nconst props = withDefaults(\n defineProps<{\n name: string\n dataCy?: string\n }>(),\n {\n dataCy: 'filter-datepicker',\n }\n)\nconst emit = defineEmits<{\n (e: 'change'): void\n}>()\n\nconst submitResetCounter = inject(FilterSubmitResetCounterKey)\nconst filterSelected = inject(FilterSelectedKey)\nconst filterConfig = inject(FilterConfigKey)\nconst filterData = inject(FilterDataKey)\n\nif (\n isUndefined(submitResetCounter) ||\n isUndefined(filterSelected) ||\n isUndefined(filterConfig) ||\n // eslint-disable-next-line vue/no-setup-props-reactivity-loss\n isUndefined(filterConfig.fields[props.name]) ||\n isUndefined(filterData) ||\n // eslint-disable-next-line vue/no-setup-props-reactivity-loss\n isUndefined(filterData[props.name])\n) {\n throw new Error('Incorrect provide/inject config.')\n}\n\nconst modelValue = computed({\n get() {\n return filterData[props.name] as DatetimeUTCNullable\n },\n set(newValue: DatetimeUTCNullable) {\n filterData[props.name] = newValue\n updateSelected()\n filterConfig.touched = true\n emit('change')\n },\n})\n\nconst { t } = useI18n()\n\n// The setup above throws unless the field is configured.\nconst filterConfigCurrent = computed(() => filterConfig.fields[props.name]!)\n\nconst label = computed(() => {\n return filterConfigCurrent.value.titleT ? t(filterConfigCurrent.value.titleT) : undefined\n})\n\nconst { clearOne } = useFilterClearHelpers()\n\nconst clearField = () => {\n clearOne(props.name, filterData, filterConfig)\n filterSelected.value.delete(props.name)\n // `clearOne` writes the value the picker was about to emit, so its own emit is skipped as\n // unchanged and the model setter below never runs - the bookkeeping has to happen here.\n filterConfig.touched = true\n emit('change')\n}\n\nconst updateSelected = () => {\n // Unlike its siblings this component has no watcher on `filterData`, so `updateSelected` only\n // ever runs from the model setter - which `ADatetimePicker` suppresses for a programmatic\n // change. Deleting the chip here would be dead code. The gap that does exist is the opposite\n // one: a datetime restored from a hash or local storage never shows a chip at all. Adding the\n // watcher is not mechanical - it makes `clearField` recreate the chip for a non-empty default,\n // and starts showing datetime chips on eight lists that have none today.\n if (!isString(modelValue.value) || modelValue.value.length === 0) return\n filterSelected.value.set(props.name, [{ title: dateTimePretty(modelValue.value), value: modelValue.value }])\n}\n</script>\n\n<template>\n <ADatetimePicker\n v-model=\"modelValue\"\n :data-cy=\"dataCy\"\n :clearable=\"!filterConfigCurrent.mandatory\"\n :default-value=\"filterConfigCurrent.default as DatetimeUTCNullable\"\n :label=\"label\"\n v-bind=\"$attrs\"\n @after-clear=\"clearField\"\n />\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"AFilterDatetimePicker.js","names":["_sfc_main","AFilterDatetimePicker_vue_vue_type_script_setup_true_lang_default","AFilterDatetimePicker_default"],"sources":["../../../../src/domains/filters/components/AFilterDatetimePicker.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { computed, inject } from 'vue'\nimport { useI18n } from 'vue-i18n'\nimport ADatetimePicker from '@/domains/ui/datetime/components/ADatetimePicker.vue'\nimport {\n FilterConfigKey,\n FilterDataKey,\n FilterSelectedKey,\n FilterSubmitResetCounterKey,\n} from '@/domains/filters/utils/filterInjectionKeys'\nimport { isString, isUndefined } from '@/shared/utils/common'\nimport { useFilterClearHelpers } from '@/domains/filters/composables/filterFactory'\nimport type { DatetimeUTCNullable } from '@/shared/types/common'\nimport { dateTimePretty } from '@/shared/utils/datetime'\n\nconst props = withDefaults(\n defineProps<{\n name: string\n dataCy?: string\n }>(),\n {\n dataCy: 'filter-datepicker',\n }\n)\nconst emit = defineEmits<{\n (e: 'change'): void\n}>()\n\nconst submitResetCounter = inject(FilterSubmitResetCounterKey)\nconst filterSelected = inject(FilterSelectedKey)\nconst filterConfig = inject(FilterConfigKey)\nconst filterData = inject(FilterDataKey)\n\nif (\n isUndefined(submitResetCounter) ||\n isUndefined(filterSelected) ||\n isUndefined(filterConfig) ||\n // eslint-disable-next-line vue/no-setup-props-reactivity-loss\n isUndefined(filterConfig.fields[props.name]) ||\n isUndefined(filterData) ||\n // eslint-disable-next-line vue/no-setup-props-reactivity-loss\n isUndefined(filterData[props.name])\n) {\n throw new Error('Incorrect provide/inject config.')\n}\n\nconst modelValue = computed({\n get() {\n return filterData[props.name] as DatetimeUTCNullable\n },\n set(newValue: DatetimeUTCNullable) {\n filterData[props.name] = newValue\n updateSelected()\n filterConfig.touched = true\n emit('change')\n },\n})\n\nconst { t } = useI18n()\n\n// The setup above throws unless the field is configured.\nconst filterConfigCurrent = computed(() => filterConfig.fields[props.name]!)\n\nconst label = computed(() => {\n return filterConfigCurrent.value.titleT ? t(filterConfigCurrent.value.titleT) : undefined\n})\n\nconst { clearOne } = useFilterClearHelpers()\n\nconst clearField = () => {\n clearOne(props.name, filterData, filterConfig)\n filterSelected.value.delete(props.name)\n // `clearOne` writes the value the picker was about to emit, so the picker skips its emit as unchanged.\n // The model setter never runs, so the bookkeeping happens here.\n filterConfig.touched = true\n emit('change')\n}\n\nconst updateSelected = () => {\n // This component has no watcher on `filterData`, so `updateSelected` runs only from the model setter.\n // `ADatetimePicker` suppresses that for programmatic changes, so deleting the chip here would be dead code.\n // Known gap: a datetime restored from a hash or local storage shows no chip.\n // Adding the watcher makes `clearField` recreate the chip for a non-empty\n // default and adds datetime chips to eight lists that have none.\n if (!isString(modelValue.value) || modelValue.value.length === 0) return\n filterSelected.value.set(props.name, [{ title: dateTimePretty(modelValue.value), value: modelValue.value }])\n}\n</script>\n\n<template>\n <ADatetimePicker\n v-model=\"modelValue\"\n :data-cy=\"dataCy\"\n :clearable=\"!filterConfigCurrent.mandatory\"\n :default-value=\"filterConfigCurrent.default as DatetimeUTCNullable\"\n :label=\"label\"\n v-bind=\"$attrs\"\n @after-clear=\"clearField\"\n />\n</template>\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"AFilterDatetimePicker.vue_vue_type_script_setup_true_lang.js","names":["$attrs","_openBlock","_createBlock","ADatetimePicker","_mergeProps","ADatetimePicker_default","AFilterDatetimePicker_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emit","submitResetCounter","inject","FilterSubmitResetCounterKey","filterSelected","FilterSelectedKey","filterConfig","FilterConfigKey","filterData","FilterDataKey","isUndefined","modelValue","computed","newValue","updateSelected","useI18n","filterConfigCurrent","label","t","useFilterClearHelpers","clearField","clearOne","isString","dateTimePretty","openBlock","createBlock","mergeProps","_cache","$event","_ctx"],"sources":["../../../../src/domains/filters/components/AFilterDatetimePicker.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { computed, inject } from 'vue'\nimport { useI18n } from 'vue-i18n'\nimport ADatetimePicker from '@/domains/ui/datetime/components/ADatetimePicker.vue'\nimport {\n FilterConfigKey,\n FilterDataKey,\n FilterSelectedKey,\n FilterSubmitResetCounterKey,\n} from '@/domains/filters/utils/filterInjectionKeys'\nimport { isString, isUndefined } from '@/shared/utils/common'\nimport { useFilterClearHelpers } from '@/domains/filters/composables/filterFactory'\nimport type { DatetimeUTCNullable } from '@/shared/types/common'\nimport { dateTimePretty } from '@/shared/utils/datetime'\n\nconst props = withDefaults(\n defineProps<{\n name: string\n dataCy?: string\n }>(),\n {\n dataCy: 'filter-datepicker',\n }\n)\nconst emit = defineEmits<{\n (e: 'change'): void\n}>()\n\nconst submitResetCounter = inject(FilterSubmitResetCounterKey)\nconst filterSelected = inject(FilterSelectedKey)\nconst filterConfig = inject(FilterConfigKey)\nconst filterData = inject(FilterDataKey)\n\nif (\n isUndefined(submitResetCounter) ||\n isUndefined(filterSelected) ||\n isUndefined(filterConfig) ||\n // eslint-disable-next-line vue/no-setup-props-reactivity-loss\n isUndefined(filterConfig.fields[props.name]) ||\n isUndefined(filterData) ||\n // eslint-disable-next-line vue/no-setup-props-reactivity-loss\n isUndefined(filterData[props.name])\n) {\n throw new Error('Incorrect provide/inject config.')\n}\n\nconst modelValue = computed({\n get() {\n return filterData[props.name] as DatetimeUTCNullable\n },\n set(newValue: DatetimeUTCNullable) {\n filterData[props.name] = newValue\n updateSelected()\n filterConfig.touched = true\n emit('change')\n },\n})\n\nconst { t } = useI18n()\n\n// The setup above throws unless the field is configured.\nconst filterConfigCurrent = computed(() => filterConfig.fields[props.name]!)\n\nconst label = computed(() => {\n return filterConfigCurrent.value.titleT ? t(filterConfigCurrent.value.titleT) : undefined\n})\n\nconst { clearOne } = useFilterClearHelpers()\n\nconst clearField = () => {\n clearOne(props.name, filterData, filterConfig)\n filterSelected.value.delete(props.name)\n // `clearOne` writes the value the picker was about to emit, so its own emit is skipped as\n // unchanged and the model setter below never runs - the bookkeeping has to happen here.\n filterConfig.touched = true\n emit('change')\n}\n\nconst updateSelected = () => {\n // Unlike its siblings this component has no watcher on `filterData`, so `updateSelected` only\n // ever runs from the model setter - which `ADatetimePicker` suppresses for a programmatic\n // change. Deleting the chip here would be dead code. The gap that does exist is the opposite\n // one: a datetime restored from a hash or local storage never shows a chip at all. Adding the\n // watcher is not mechanical - it makes `clearField` recreate the chip for a non-empty default,\n // and starts showing datetime chips on eight lists that have none today.\n if (!isString(modelValue.value) || modelValue.value.length === 0) return\n filterSelected.value.set(props.name, [{ title: dateTimePretty(modelValue.value), value: modelValue.value }])\n}\n</script>\n\n<template>\n <ADatetimePicker\n v-model=\"modelValue\"\n :data-cy=\"dataCy\"\n :clearable=\"!filterConfigCurrent.mandatory\"\n :default-value=\"filterConfigCurrent.default as DatetimeUTCNullable\"\n :label=\"label\"\n v-bind=\"$attrs\"\n @after-clear=\"clearField\"\n />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;EAeA,IAAMQ,IAAQC,GASRC,IAAOH,GAIPI,IAAqBC,EAAOC,CAA2B,GACvDC,IAAiBF,EAAOG,CAAiB,GACzCC,IAAeJ,EAAOK,CAAe,GACrCC,IAAaN,EAAOO,CAAa;EAEvC,IACEC,EAAYT,CAAkB,KAC9BS,EAAYN,CAAc,KAC1BM,EAAYJ,CAAY,KAExBI,EAAYJ,EAAa,OAAOR,EAAM,KAAK,KAC3CY,EAAYF,CAAU,KAEtBE,EAAYF,EAAWV,EAAM,KAAK,GAElC,MAAU,MAAM,kCAAkC;EAGpD,IAAMa,IAAaC,EAAS;GAC1B,MAAM;IACJ,OAAOJ,EAAWV,EAAM;GAC1B;GACA,IAAI,GAA+B;IAIjC,AAHA,EAAWA,EAAM,QAAQe,GACzBC,EAAe,GACf,EAAa,UAAU,IACvBd,EAAK,QAAQ;GACf;EACF,CAAC,GAEK,EAAE,SAAMe,EAAQ,GAGhBC,IAAsBJ,QAAeN,EAAa,OAAOR,EAAM,KAAM,GAErEmB,IAAQL,QACLI,EAAoB,MAAM,SAASE,EAAEF,EAAoB,MAAM,MAAM,IAAI,KAAA,CACjF,GAEK,EAAE,gBAAaG,EAAsB,GAErCC,UAAmB;GAMvB,AALAC,EAASvB,EAAM,MAAMU,GAAYF,CAAY,GAC7CF,EAAe,MAAM,OAAON,EAAM,IAAI,GAGtC,EAAa,UAAU,IACvBE,EAAK,QAAQ;EACf,GAEMc,UAAuB;GAO3B,AAAKQ,EAASX,EAAW,KAAK,KAAKA,EAAW,MAAM,WAAW,KAC/DP,EAAe,MAAM,IAAIN,EAAM,MAAM,CAAC;IAAE,OAAOyB,EAAeZ,EAAW,KAAK;IAAG,OAAOA,EAAW;GAAM,CAAC,CAAC;EAC7G;E,kBAIEpB,EAAA,GAAAC,EAQEC,GARFC,EAQE;GAPS,YAAAiB,EAAA;GAAA,uBAAA,AAAAgB,EAAA,QAAA,MAAA,EAAU,QAAAC;GAClB,WAAS7B,EAAA;GACT,WAAS,CAAGiB,EAAA,MAAoB;GAChC,iBAAeA,EAAA,MAAoB;GACnC,OAAOC,EAAA;EACA3B,GAAAA,EAAAA,QAAM,EACb,cAAa8B,EAAU,CAAA,GAAA,MAAA,IAAA;GAAA;GAAA;GAAA;GAAA;GAAA;EAAA,CAAA"}
1
+ {"version":3,"file":"AFilterDatetimePicker.vue_vue_type_script_setup_true_lang.js","names":["$attrs","_openBlock","_createBlock","ADatetimePicker","_mergeProps","ADatetimePicker_default","AFilterDatetimePicker_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emit","submitResetCounter","inject","FilterSubmitResetCounterKey","filterSelected","FilterSelectedKey","filterConfig","FilterConfigKey","filterData","FilterDataKey","isUndefined","modelValue","computed","newValue","updateSelected","useI18n","filterConfigCurrent","label","t","useFilterClearHelpers","clearField","clearOne","isString","dateTimePretty","openBlock","createBlock","mergeProps","_cache","$event","_ctx"],"sources":["../../../../src/domains/filters/components/AFilterDatetimePicker.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { computed, inject } from 'vue'\nimport { useI18n } from 'vue-i18n'\nimport ADatetimePicker from '@/domains/ui/datetime/components/ADatetimePicker.vue'\nimport {\n FilterConfigKey,\n FilterDataKey,\n FilterSelectedKey,\n FilterSubmitResetCounterKey,\n} from '@/domains/filters/utils/filterInjectionKeys'\nimport { isString, isUndefined } from '@/shared/utils/common'\nimport { useFilterClearHelpers } from '@/domains/filters/composables/filterFactory'\nimport type { DatetimeUTCNullable } from '@/shared/types/common'\nimport { dateTimePretty } from '@/shared/utils/datetime'\n\nconst props = withDefaults(\n defineProps<{\n name: string\n dataCy?: string\n }>(),\n {\n dataCy: 'filter-datepicker',\n }\n)\nconst emit = defineEmits<{\n (e: 'change'): void\n}>()\n\nconst submitResetCounter = inject(FilterSubmitResetCounterKey)\nconst filterSelected = inject(FilterSelectedKey)\nconst filterConfig = inject(FilterConfigKey)\nconst filterData = inject(FilterDataKey)\n\nif (\n isUndefined(submitResetCounter) ||\n isUndefined(filterSelected) ||\n isUndefined(filterConfig) ||\n // eslint-disable-next-line vue/no-setup-props-reactivity-loss\n isUndefined(filterConfig.fields[props.name]) ||\n isUndefined(filterData) ||\n // eslint-disable-next-line vue/no-setup-props-reactivity-loss\n isUndefined(filterData[props.name])\n) {\n throw new Error('Incorrect provide/inject config.')\n}\n\nconst modelValue = computed({\n get() {\n return filterData[props.name] as DatetimeUTCNullable\n },\n set(newValue: DatetimeUTCNullable) {\n filterData[props.name] = newValue\n updateSelected()\n filterConfig.touched = true\n emit('change')\n },\n})\n\nconst { t } = useI18n()\n\n// The setup above throws unless the field is configured.\nconst filterConfigCurrent = computed(() => filterConfig.fields[props.name]!)\n\nconst label = computed(() => {\n return filterConfigCurrent.value.titleT ? t(filterConfigCurrent.value.titleT) : undefined\n})\n\nconst { clearOne } = useFilterClearHelpers()\n\nconst clearField = () => {\n clearOne(props.name, filterData, filterConfig)\n filterSelected.value.delete(props.name)\n // `clearOne` writes the value the picker was about to emit, so the picker skips its emit as unchanged.\n // The model setter never runs, so the bookkeeping happens here.\n filterConfig.touched = true\n emit('change')\n}\n\nconst updateSelected = () => {\n // This component has no watcher on `filterData`, so `updateSelected` runs only from the model setter.\n // `ADatetimePicker` suppresses that for programmatic changes, so deleting the chip here would be dead code.\n // Known gap: a datetime restored from a hash or local storage shows no chip.\n // Adding the watcher makes `clearField` recreate the chip for a non-empty\n // default and adds datetime chips to eight lists that have none.\n if (!isString(modelValue.value) || modelValue.value.length === 0) return\n filterSelected.value.set(props.name, [{ title: dateTimePretty(modelValue.value), value: modelValue.value }])\n}\n</script>\n\n<template>\n <ADatetimePicker\n v-model=\"modelValue\"\n :data-cy=\"dataCy\"\n :clearable=\"!filterConfigCurrent.mandatory\"\n :default-value=\"filterConfigCurrent.default as DatetimeUTCNullable\"\n :label=\"label\"\n v-bind=\"$attrs\"\n @after-clear=\"clearField\"\n />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;EAeA,IAAMQ,IAAQC,GASRC,IAAOH,GAIPI,IAAqBC,EAAOC,CAA2B,GACvDC,IAAiBF,EAAOG,CAAiB,GACzCC,IAAeJ,EAAOK,CAAe,GACrCC,IAAaN,EAAOO,CAAa;EAEvC,IACEC,EAAYT,CAAkB,KAC9BS,EAAYN,CAAc,KAC1BM,EAAYJ,CAAY,KAExBI,EAAYJ,EAAa,OAAOR,EAAM,KAAK,KAC3CY,EAAYF,CAAU,KAEtBE,EAAYF,EAAWV,EAAM,KAAK,GAElC,MAAU,MAAM,kCAAkC;EAGpD,IAAMa,IAAaC,EAAS;GAC1B,MAAM;IACJ,OAAOJ,EAAWV,EAAM;GAC1B;GACA,IAAI,GAA+B;IAIjC,AAHA,EAAWA,EAAM,QAAQe,GACzBC,EAAe,GACf,EAAa,UAAU,IACvBd,EAAK,QAAQ;GACf;EACF,CAAC,GAEK,EAAE,SAAMe,EAAQ,GAGhBC,IAAsBJ,QAAeN,EAAa,OAAOR,EAAM,KAAM,GAErEmB,IAAQL,QACLI,EAAoB,MAAM,SAASE,EAAEF,EAAoB,MAAM,MAAM,IAAI,KAAA,CACjF,GAEK,EAAE,gBAAaG,EAAsB,GAErCC,UAAmB;GAMvB,AALAC,EAASvB,EAAM,MAAMU,GAAYF,CAAY,GAC7CF,EAAe,MAAM,OAAON,EAAM,IAAI,GAGtC,EAAa,UAAU,IACvBE,EAAK,QAAQ;EACf,GAEMc,UAAuB;GAM3B,AAAKQ,EAASX,EAAW,KAAK,KAAKA,EAAW,MAAM,WAAW,KAC/DP,EAAe,MAAM,IAAIN,EAAM,MAAM,CAAC;IAAE,OAAOyB,EAAeZ,EAAW,KAAK;IAAG,OAAOA,EAAW;GAAM,CAAC,CAAC;EAC7G;E,kBAIEpB,EAAA,GAAAC,EAQEC,GARFC,EAQE;GAPS,YAAAiB,EAAA;GAAA,uBAAA,AAAAgB,EAAA,QAAA,MAAA,EAAU,QAAAC;GAClB,WAAS7B,EAAA;GACT,WAAS,CAAGiB,EAAA,MAAoB;GAChC,iBAAeA,EAAA,MAAoB;GACnC,OAAOC,EAAA;EACA3B,GAAAA,EAAAA,QAAM,EACb,cAAa8B,EAAU,CAAA,GAAA,MAAA,IAAA;GAAA;GAAA;GAAA;GAAA;GAAA;EAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"AFilterInteger.js","names":["_sfc_main","AFilterInteger_vue_vue_type_script_setup_true_lang_default","AFilterInteger_default"],"sources":["../../../../src/domains/filters/components/AFilterInteger.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { useFilterClearHelpers } from '@/domains/filters/composables/filterFactory'\nimport { computed, inject, watch } from 'vue'\nimport { useI18n } from 'vue-i18n'\nimport { isBoolean, isNumber, isString, isUndefined } from '@/shared/utils/common'\nimport {\n FilterConfigKey,\n FilterDataKey,\n FilterSelectedKey,\n FilterSubmitResetCounterKey,\n} from '@/domains/filters/utils/filterInjectionKeys'\n\nconst props = withDefaults(\n defineProps<{\n name: string\n placeholder?: string | undefined\n dataCy?: string\n }>(),\n {\n placeholder: undefined,\n dataCy: 'filter-integer',\n }\n)\nconst emit = defineEmits<{\n (e: 'change'): void\n}>()\n\nconst submitResetCounter = inject(FilterSubmitResetCounterKey)\nconst filterSelected = inject(FilterSelectedKey)\nconst filterConfig = inject(FilterConfigKey)\nconst filterData = inject(FilterDataKey)\n\nif (\n isUndefined(submitResetCounter) ||\n isUndefined(filterSelected) ||\n isUndefined(filterConfig) ||\n // eslint-disable-next-line vue/no-setup-props-reactivity-loss\n isUndefined(filterConfig.fields[props.name]) ||\n isUndefined(filterData) ||\n // eslint-disable-next-line vue/no-setup-props-reactivity-loss\n isUndefined(filterData[props.name])\n) {\n throw new Error('Incorrect provide/inject config.')\n}\n\nconst modelValue = computed({\n get() {\n return filterData[props.name]\n },\n set(newValue) {\n filterData[props.name] = newValue\n filterConfig.touched = true\n emit('change')\n },\n})\n\n// The setup above throws unless the field is configured.\nconst filterConfigCurrent = computed(() => filterConfig.fields[props.name]!)\n\nconst { t } = useI18n()\n\nconst label = computed(() => {\n return filterConfigCurrent.value.titleT ? t(filterConfigCurrent.value.titleT) : undefined\n})\n\nconst placeholderComputed = computed(() => {\n if (!isUndefined(props.placeholder)) return props.placeholder\n if (filterConfigCurrent.value.variant === 'startsWith') return t('common.model.filterPlaceholder.startsWith')\n if (filterConfigCurrent.value.variant === 'eq') return t('common.model.filterPlaceholder.eq')\n if (filterConfigCurrent.value.variant === 'search') return t('common.model.filterPlaceholder.contains')\n return ''\n})\n\nconst { clearOne } = useFilterClearHelpers()\n\nconst clearField = () => {\n clearOne(props.name, filterData, filterConfig)\n filterSelected.value.delete(props.name)\n}\n\nconst updateSelected = () => {\n if (isNumber(modelValue.value)) {\n filterSelected.value.set(props.name, [{ title: modelValue.value + '', value: modelValue.value }])\n return\n }\n // `null` reaches here when the filter is reset from outside - loading a hash clears every field\n // before applying it, and the chip has to go with the value. Falling through would leave the\n // chip naming a value the query no longer carries.\n if (!isString(modelValue.value) || modelValue.value.length === 0) {\n filterSelected.value.delete(props.name)\n return\n }\n filterSelected.value.set(props.name, [{ title: modelValue.value, value: modelValue.value }])\n}\n\nwatch(\n () => filterData[props.name],\n (newValue, oldValue) => {\n if (newValue === oldValue || isBoolean(newValue)) return\n updateSelected()\n },\n { immediate: true }\n)\n</script>\n\n<template>\n <VTextField\n v-model=\"modelValue\"\n :label=\"label\"\n :placeholder=\"placeholderComputed\"\n :clearable=\"!filterConfigCurrent.mandatory\"\n :data-cy=\"dataCy\"\n hide-details\n autocomplete=\"off\"\n @blur=\"updateSelected\"\n @click:clear.stop=\"clearField\"\n />\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"AFilterInteger.js","names":["_sfc_main","AFilterInteger_vue_vue_type_script_setup_true_lang_default","AFilterInteger_default"],"sources":["../../../../src/domains/filters/components/AFilterInteger.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { useFilterClearHelpers } from '@/domains/filters/composables/filterFactory'\nimport { computed, inject, watch } from 'vue'\nimport { useI18n } from 'vue-i18n'\nimport { isBoolean, isNumber, isString, isUndefined } from '@/shared/utils/common'\nimport {\n FilterConfigKey,\n FilterDataKey,\n FilterSelectedKey,\n FilterSubmitResetCounterKey,\n} from '@/domains/filters/utils/filterInjectionKeys'\n\nconst props = withDefaults(\n defineProps<{\n name: string\n placeholder?: string | undefined\n dataCy?: string\n }>(),\n {\n placeholder: undefined,\n dataCy: 'filter-integer',\n }\n)\nconst emit = defineEmits<{\n (e: 'change'): void\n}>()\n\nconst submitResetCounter = inject(FilterSubmitResetCounterKey)\nconst filterSelected = inject(FilterSelectedKey)\nconst filterConfig = inject(FilterConfigKey)\nconst filterData = inject(FilterDataKey)\n\nif (\n isUndefined(submitResetCounter) ||\n isUndefined(filterSelected) ||\n isUndefined(filterConfig) ||\n // eslint-disable-next-line vue/no-setup-props-reactivity-loss\n isUndefined(filterConfig.fields[props.name]) ||\n isUndefined(filterData) ||\n // eslint-disable-next-line vue/no-setup-props-reactivity-loss\n isUndefined(filterData[props.name])\n) {\n throw new Error('Incorrect provide/inject config.')\n}\n\nconst modelValue = computed({\n get() {\n return filterData[props.name]\n },\n set(newValue) {\n filterData[props.name] = newValue\n filterConfig.touched = true\n emit('change')\n },\n})\n\n// The setup above throws unless the field is configured.\nconst filterConfigCurrent = computed(() => filterConfig.fields[props.name]!)\n\nconst { t } = useI18n()\n\nconst label = computed(() => {\n return filterConfigCurrent.value.titleT ? t(filterConfigCurrent.value.titleT) : undefined\n})\n\nconst placeholderComputed = computed(() => {\n if (!isUndefined(props.placeholder)) return props.placeholder\n if (filterConfigCurrent.value.variant === 'startsWith') return t('common.model.filterPlaceholder.startsWith')\n if (filterConfigCurrent.value.variant === 'eq') return t('common.model.filterPlaceholder.eq')\n if (filterConfigCurrent.value.variant === 'search') return t('common.model.filterPlaceholder.contains')\n return ''\n})\n\nconst { clearOne } = useFilterClearHelpers()\n\nconst clearField = () => {\n clearOne(props.name, filterData, filterConfig)\n filterSelected.value.delete(props.name)\n}\n\nconst updateSelected = () => {\n if (isNumber(modelValue.value)) {\n filterSelected.value.set(props.name, [{ title: modelValue.value + '', value: modelValue.value }])\n return\n }\n // `null` arrives when the filter is reset from outside. Loading a hash clears every field first.\n // The chip must be removed too, or it names a value the query no longer has.\n if (!isString(modelValue.value) || modelValue.value.length === 0) {\n filterSelected.value.delete(props.name)\n return\n }\n filterSelected.value.set(props.name, [{ title: modelValue.value, value: modelValue.value }])\n}\n\nwatch(\n () => filterData[props.name],\n (newValue, oldValue) => {\n if (newValue === oldValue || isBoolean(newValue)) return\n updateSelected()\n },\n { immediate: true }\n)\n</script>\n\n<template>\n <VTextField\n v-model=\"modelValue\"\n :label=\"label\"\n :placeholder=\"placeholderComputed\"\n :clearable=\"!filterConfigCurrent.mandatory\"\n :data-cy=\"dataCy\"\n hide-details\n autocomplete=\"off\"\n @blur=\"updateSelected\"\n @click:clear.stop=\"clearField\"\n />\n</template>\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"AFilterInteger.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_component_VTextField","_withModifiers","AFilterInteger_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emit","submitResetCounter","inject","FilterSubmitResetCounterKey","filterSelected","FilterSelectedKey","filterConfig","FilterConfigKey","filterData","FilterDataKey","isUndefined","modelValue","computed","newValue","filterConfigCurrent","useI18n","label","t","placeholderComputed","useFilterClearHelpers","clearField","clearOne","updateSelected","isNumber","isString","watch","oldValue","isBoolean","openBlock","createBlock","VTextField","_cache","$event","withModifiers"],"sources":["../../../../src/domains/filters/components/AFilterInteger.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { useFilterClearHelpers } from '@/domains/filters/composables/filterFactory'\nimport { computed, inject, watch } from 'vue'\nimport { useI18n } from 'vue-i18n'\nimport { isBoolean, isNumber, isString, isUndefined } from '@/shared/utils/common'\nimport {\n FilterConfigKey,\n FilterDataKey,\n FilterSelectedKey,\n FilterSubmitResetCounterKey,\n} from '@/domains/filters/utils/filterInjectionKeys'\n\nconst props = withDefaults(\n defineProps<{\n name: string\n placeholder?: string | undefined\n dataCy?: string\n }>(),\n {\n placeholder: undefined,\n dataCy: 'filter-integer',\n }\n)\nconst emit = defineEmits<{\n (e: 'change'): void\n}>()\n\nconst submitResetCounter = inject(FilterSubmitResetCounterKey)\nconst filterSelected = inject(FilterSelectedKey)\nconst filterConfig = inject(FilterConfigKey)\nconst filterData = inject(FilterDataKey)\n\nif (\n isUndefined(submitResetCounter) ||\n isUndefined(filterSelected) ||\n isUndefined(filterConfig) ||\n // eslint-disable-next-line vue/no-setup-props-reactivity-loss\n isUndefined(filterConfig.fields[props.name]) ||\n isUndefined(filterData) ||\n // eslint-disable-next-line vue/no-setup-props-reactivity-loss\n isUndefined(filterData[props.name])\n) {\n throw new Error('Incorrect provide/inject config.')\n}\n\nconst modelValue = computed({\n get() {\n return filterData[props.name]\n },\n set(newValue) {\n filterData[props.name] = newValue\n filterConfig.touched = true\n emit('change')\n },\n})\n\n// The setup above throws unless the field is configured.\nconst filterConfigCurrent = computed(() => filterConfig.fields[props.name]!)\n\nconst { t } = useI18n()\n\nconst label = computed(() => {\n return filterConfigCurrent.value.titleT ? t(filterConfigCurrent.value.titleT) : undefined\n})\n\nconst placeholderComputed = computed(() => {\n if (!isUndefined(props.placeholder)) return props.placeholder\n if (filterConfigCurrent.value.variant === 'startsWith') return t('common.model.filterPlaceholder.startsWith')\n if (filterConfigCurrent.value.variant === 'eq') return t('common.model.filterPlaceholder.eq')\n if (filterConfigCurrent.value.variant === 'search') return t('common.model.filterPlaceholder.contains')\n return ''\n})\n\nconst { clearOne } = useFilterClearHelpers()\n\nconst clearField = () => {\n clearOne(props.name, filterData, filterConfig)\n filterSelected.value.delete(props.name)\n}\n\nconst updateSelected = () => {\n if (isNumber(modelValue.value)) {\n filterSelected.value.set(props.name, [{ title: modelValue.value + '', value: modelValue.value }])\n return\n }\n // `null` reaches here when the filter is reset from outside - loading a hash clears every field\n // before applying it, and the chip has to go with the value. Falling through would leave the\n // chip naming a value the query no longer carries.\n if (!isString(modelValue.value) || modelValue.value.length === 0) {\n filterSelected.value.delete(props.name)\n return\n }\n filterSelected.value.set(props.name, [{ title: modelValue.value, value: modelValue.value }])\n}\n\nwatch(\n () => filterData[props.name],\n (newValue, oldValue) => {\n if (newValue === oldValue || isBoolean(newValue)) return\n updateSelected()\n },\n { immediate: true }\n)\n</script>\n\n<template>\n <VTextField\n v-model=\"modelValue\"\n :label=\"label\"\n :placeholder=\"placeholderComputed\"\n :clearable=\"!filter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AK,IAC3BP,EAAe,MAAM,IAAIN,EAAM,MAAM,CAAC;IAAE,OAAOa,EAAW,QAAQ;IAAI,OAAOA,EAAW;GAAM,CAAC,CAAC,IAM9F,CAACa,EAASb,EAAW,KAAK,KAAKA,EAAW,MAAM,WAAW,IAC7DP,EAAe,MAAM,OAAON,EAAM,IAAI,IAGxCM,EAAe,MAAM,IAAIN,EAAM,MAAM,CAAC;IAAE,OAAOa,EAAW;IAAO,OAAOA,EAAW;GAAM,CAAC,CAAC;EAC7F;E,OAEAc,QACQjB,EAAWV,EAAM,QACtB,GAAU,MAAa;GACtB,AAAIe,MAAaa,KAAYC,EAAUd,CAAQ,KAC/CS,EAAe;EACjB,GACA,EAAE,WAAW,GAAK,CACpB,I,UAIE9B,EAAA,GAAAC,EAUEC,GAAA;GATS,YAAAiB,EAAA;GAAA,uBAAA,AAAAoB,EAAA,QAAA,MAAA,EAAU,QAAAC;GAClB,OAAOhB,EAAA;GACP,aAAaE,EAAA;GACb,WAAS,CAAGJ,EAAA,MAAoB;GAChC,WAASf,EAAA;GACV,gBAAA;GACA,cAAa;GACZ,QAAMuB;GACN,iBAAW3B,EAAOyB,GAAU,CAAA,MAAA,CAAA"}
1
+ {"version":3,"file":"AFilterInteger.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_component_VTextField","_withModifiers","AFilterInteger_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emit","submitResetCounter","inject","FilterSubmitResetCounterKey","filterSelected","FilterSelectedKey","filterConfig","FilterConfigKey","filterData","FilterDataKey","isUndefined","modelValue","computed","newValue","filterConfigCurrent","useI18n","label","t","placeholderComputed","useFilterClearHelpers","clearField","clearOne","updateSelected","isNumber","isString","watch","oldValue","isBoolean","openBlock","createBlock","VTextField","_cache","$event","withModifiers"],"sources":["../../../../src/domains/filters/components/AFilterInteger.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { useFilterClearHelpers } from '@/domains/filters/composables/filterFactory'\nimport { computed, inject, watch } from 'vue'\nimport { useI18n } from 'vue-i18n'\nimport { isBoolean, isNumber, isString, isUndefined } from '@/shared/utils/common'\nimport {\n FilterConfigKey,\n FilterDataKey,\n FilterSelectedKey,\n FilterSubmitResetCounterKey,\n} from '@/domains/filters/utils/filterInjectionKeys'\n\nconst props = withDefaults(\n defineProps<{\n name: string\n placeholder?: string | undefined\n dataCy?: string\n }>(),\n {\n placeholder: undefined,\n dataCy: 'filter-integer',\n }\n)\nconst emit = defineEmits<{\n (e: 'change'): void\n}>()\n\nconst submitResetCounter = inject(FilterSubmitResetCounterKey)\nconst filterSelected = inject(FilterSelectedKey)\nconst filterConfig = inject(FilterConfigKey)\nconst filterData = inject(FilterDataKey)\n\nif (\n isUndefined(submitResetCounter) ||\n isUndefined(filterSelected) ||\n isUndefined(filterConfig) ||\n // eslint-disable-next-line vue/no-setup-props-reactivity-loss\n isUndefined(filterConfig.fields[props.name]) ||\n isUndefined(filterData) ||\n // eslint-disable-next-line vue/no-setup-props-reactivity-loss\n isUndefined(filterData[props.name])\n) {\n throw new Error('Incorrect provide/inject config.')\n}\n\nconst modelValue = computed({\n get() {\n return filterData[props.name]\n },\n set(newValue) {\n filterData[props.name] = newValue\n filterConfig.touched = true\n emit('change')\n },\n})\n\n// The setup above throws unless the field is configured.\nconst filterConfigCurrent = computed(() => filterConfig.fields[props.name]!)\n\nconst { t } = useI18n()\n\nconst label = computed(() => {\n return filterConfigCurrent.value.titleT ? t(filterConfigCurrent.value.titleT) : undefined\n})\n\nconst placeholderComputed = computed(() => {\n if (!isUndefined(props.placeholder)) return props.placeholder\n if (filterConfigCurrent.value.variant === 'startsWith') return t('common.model.filterPlaceholder.startsWith')\n if (filterConfigCurrent.value.variant === 'eq') return t('common.model.filterPlaceholder.eq')\n if (filterConfigCurrent.value.variant === 'search') return t('common.model.filterPlaceholder.contains')\n return ''\n})\n\nconst { clearOne } = useFilterClearHelpers()\n\nconst clearField = () => {\n clearOne(props.name, filterData, filterConfig)\n filterSelected.value.delete(props.name)\n}\n\nconst updateSelected = () => {\n if (isNumber(modelValue.value)) {\n filterSelected.value.set(props.name, [{ title: modelValue.value + '', value: modelValue.value }])\n return\n }\n // `null` arrives when the filter is reset from outside. Loading a hash clears every field first.\n // The chip must be removed too, or it names a value the query no longer has.\n if (!isString(modelValue.value) || modelValue.value.length === 0) {\n filterSelected.value.delete(props.name)\n return\n }\n filterSelected.value.set(props.name, [{ title: modelValue.value, value: modelValue.value }])\n}\n\nwatch(\n () => filterData[props.name],\n (newValue, oldValue) => {\n if (newValue === oldValue || isBoolean(newValue)) return\n updateSelected()\n },\n { immediate: true }\n)\n</script>\n\n<template>\n <VTextField\n v-model=\"modelValue\"\n :label=\"label\"\n :placeholder=\"placeholderComputed\"\n :clearable=\"!filterConfigCurrent.mandatory\"\n :data-cy=\"dataCy\"\n hide-details\n autocomplete=\"off\"\n @blur=\"updateSelected\"\n @click:clear.stop=\"clearField\"\n />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;EAYA,IAAMM,IAAQC,GAWRC,IAAOH,GAIPI,IAAqBC,EAAOC,CAA2B,GACvDC,IAAiBF,EAAOG,CAAiB,GACzCC,IAAeJ,EAAOK,CAAe,GACrCC,IAAaN,EAAOO,CAAa;EAEvC,IACEC,EAAYT,CAAkB,KAC9BS,EAAYN,CAAc,KAC1BM,EAAYJ,CAAY,KAExBI,EAAYJ,EAAa,OAAOR,EAAM,KAAK,KAC3CY,EAAYF,CAAU,KAEtBE,EAAYF,EAAWV,EAAM,KAAK,GAElC,MAAU,MAAM,kCAAkC;EAGpD,IAAMa,IAAaC,EAAS;GAC1B,MAAM;IACJ,OAAOJ,EAAWV,EAAM;GAC1B;GACA,IAAI,GAAU;IAGZ,AAFA,EAAWA,EAAM,QAAQe,GACzB,EAAa,UAAU,IACvBb,EAAK,QAAQ;GACf;EACF,CAAC,GAGKc,IAAsBF,QAAeN,EAAa,OAAOR,EAAM,KAAM,GAErE,EAAE,SAAMiB,EAAQ,GAEhBC,IAAQJ,QACLE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":3,"file":"AFilterString.js","names":["_sfc_main","AFilterString_vue_vue_type_script_setup_true_lang_default","AFilterString_default"],"sources":["../../../../src/domains/filters/components/AFilterString.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { computed, inject, watch } from 'vue'\nimport { useI18n } from 'vue-i18n'\nimport { isBoolean, isNumber, isString, isUndefined } from '@/shared/utils/common'\nimport { useFilterClearHelpers } from '@/domains/filters/composables/filterFactory'\nimport {\n FilterConfigKey,\n FilterDataKey,\n FilterSelectedKey,\n FilterSubmitResetCounterKey,\n} from '@/domains/filters/utils/filterInjectionKeys'\n\nconst props = withDefaults(\n defineProps<{\n name: string\n placeholder?: string | undefined\n dataCy?: string\n }>(),\n {\n placeholder: undefined,\n dataCy: 'filter-string',\n }\n)\nconst emit = defineEmits<{\n (e: 'change'): void\n}>()\n\nconst submitResetCounter = inject(FilterSubmitResetCounterKey)\nconst filterSelected = inject(FilterSelectedKey)\nconst filterConfig = inject(FilterConfigKey)\nconst filterData = inject(FilterDataKey)\n\nif (\n isUndefined(submitResetCounter) ||\n isUndefined(filterSelected) ||\n isUndefined(filterConfig) ||\n // eslint-disable-next-line vue/no-setup-props-reactivity-loss\n isUndefined(filterConfig.fields[props.name]) ||\n isUndefined(filterData) ||\n // eslint-disable-next-line vue/no-setup-props-reactivity-loss\n isUndefined(filterData[props.name])\n) {\n throw new Error('Incorrect provide/inject config.')\n}\n\nconst modelValue = computed({\n get() {\n return filterData[props.name]\n },\n set(newValue) {\n filterData[props.name] = newValue\n filterConfig.touched = true\n emit('change')\n },\n})\n\n// The setup above throws unless the field is configured.\nconst filterConfigCurrent = computed(() => filterConfig.fields[props.name]!)\n\nconst { t } = useI18n()\n\nconst label = computed(() => {\n return filterConfigCurrent.value.titleT ? t(filterConfigCurrent.value.titleT) : undefined\n})\n\nconst placeholderComputed = computed(() => {\n if (!isUndefined(props.placeholder)) return props.placeholder\n if (filterConfigCurrent.value.variant === 'startsWith') return t('common.model.filterPlaceholder.startsWith')\n if (filterConfigCurrent.value.variant === 'eq') return t('common.model.filterPlaceholder.eq')\n if (filterConfigCurrent.value.variant === 'search') return t('common.model.filterPlaceholder.contains')\n return ''\n})\n\nconst { clearOne } = useFilterClearHelpers()\n\nconst clearField = () => {\n clearOne(props.name, filterData, filterConfig)\n filterSelected.value.delete(props.name)\n}\n\nconst updateSelected = () => {\n if (isNumber(modelValue.value)) {\n filterSelected.value.set(props.name, [{ title: modelValue.value + '', value: modelValue.value }])\n return\n }\n // `null` reaches here when the filter is reset from outside - loading a hash clears every field\n // before applying it, and the chip has to go with the value. Falling through would leave the\n // chip naming a value the query no longer carries.\n if (!isString(modelValue.value) || modelValue.value.length === 0) {\n filterSelected.value.delete(props.name)\n return\n }\n filterSelected.value.set(props.name, [{ title: modelValue.value, value: modelValue.value }])\n}\n\nwatch(\n () => filterData[props.name],\n (newValue, oldValue) => {\n if (newValue === oldValue || isBoolean(newValue)) return\n updateSelected()\n },\n { immediate: true }\n)\n</script>\n\n<template>\n <VTextField\n v-model=\"modelValue\"\n :label=\"label\"\n :placeholder=\"placeholderComputed\"\n :clearable=\"!filterConfigCurrent.mandatory\"\n :data-cy=\"dataCy\"\n hide-details\n autocomplete=\"off\"\n @blur=\"updateSelected\"\n @click:clear.stop=\"clearField\"\n />\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"AFilterString.js","names":["_sfc_main","AFilterString_vue_vue_type_script_setup_true_lang_default","AFilterString_default"],"sources":["../../../../src/domains/filters/components/AFilterString.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { computed, inject, watch } from 'vue'\nimport { useI18n } from 'vue-i18n'\nimport { isBoolean, isNumber, isString, isUndefined } from '@/shared/utils/common'\nimport { useFilterClearHelpers } from '@/domains/filters/composables/filterFactory'\nimport {\n FilterConfigKey,\n FilterDataKey,\n FilterSelectedKey,\n FilterSubmitResetCounterKey,\n} from '@/domains/filters/utils/filterInjectionKeys'\n\nconst props = withDefaults(\n defineProps<{\n name: string\n placeholder?: string | undefined\n dataCy?: string\n }>(),\n {\n placeholder: undefined,\n dataCy: 'filter-string',\n }\n)\nconst emit = defineEmits<{\n (e: 'change'): void\n}>()\n\nconst submitResetCounter = inject(FilterSubmitResetCounterKey)\nconst filterSelected = inject(FilterSelectedKey)\nconst filterConfig = inject(FilterConfigKey)\nconst filterData = inject(FilterDataKey)\n\nif (\n isUndefined(submitResetCounter) ||\n isUndefined(filterSelected) ||\n isUndefined(filterConfig) ||\n // eslint-disable-next-line vue/no-setup-props-reactivity-loss\n isUndefined(filterConfig.fields[props.name]) ||\n isUndefined(filterData) ||\n // eslint-disable-next-line vue/no-setup-props-reactivity-loss\n isUndefined(filterData[props.name])\n) {\n throw new Error('Incorrect provide/inject config.')\n}\n\nconst modelValue = computed({\n get() {\n return filterData[props.name]\n },\n set(newValue) {\n filterData[props.name] = newValue\n filterConfig.touched = true\n emit('change')\n },\n})\n\n// The setup above throws unless the field is configured.\nconst filterConfigCurrent = computed(() => filterConfig.fields[props.name]!)\n\nconst { t } = useI18n()\n\nconst label = computed(() => {\n return filterConfigCurrent.value.titleT ? t(filterConfigCurrent.value.titleT) : undefined\n})\n\nconst placeholderComputed = computed(() => {\n if (!isUndefined(props.placeholder)) return props.placeholder\n if (filterConfigCurrent.value.variant === 'startsWith') return t('common.model.filterPlaceholder.startsWith')\n if (filterConfigCurrent.value.variant === 'eq') return t('common.model.filterPlaceholder.eq')\n if (filterConfigCurrent.value.variant === 'search') return t('common.model.filterPlaceholder.contains')\n return ''\n})\n\nconst { clearOne } = useFilterClearHelpers()\n\nconst clearField = () => {\n clearOne(props.name, filterData, filterConfig)\n filterSelected.value.delete(props.name)\n}\n\nconst updateSelected = () => {\n if (isNumber(modelValue.value)) {\n filterSelected.value.set(props.name, [{ title: modelValue.value + '', value: modelValue.value }])\n return\n }\n // `null` arrives when the filter is reset from outside. Loading a hash clears every field first.\n // The chip must be removed too, or it names a value the query no longer has.\n if (!isString(modelValue.value) || modelValue.value.length === 0) {\n filterSelected.value.delete(props.name)\n return\n }\n filterSelected.value.set(props.name, [{ title: modelValue.value, value: modelValue.value }])\n}\n\nwatch(\n () => filterData[props.name],\n (newValue, oldValue) => {\n if (newValue === oldValue || isBoolean(newValue)) return\n updateSelected()\n },\n { immediate: true }\n)\n</script>\n\n<template>\n <VTextField\n v-model=\"modelValue\"\n :label=\"label\"\n :placeholder=\"placeholderComputed\"\n :clearable=\"!filterConfigCurrent.mandatory\"\n :data-cy=\"dataCy\"\n hide-details\n autocomplete=\"off\"\n @blur=\"updateSelected\"\n @click:clear.stop=\"clearField\"\n />\n</template>\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"AFilterString.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_component_VTextField","_withModifiers","AFilterString_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emit","submitResetCounter","inject","FilterSubmitResetCounterKey","filterSelected","FilterSelectedKey","filterConfig","FilterConfigKey","filterData","FilterDataKey","isUndefined","modelValue","computed","newValue","filterConfigCurrent","useI18n","label","t","placeholderComputed","useFilterClearHelpers","clearField","clearOne","updateSelected","isNumber","isString","watch","oldValue","isBoolean","openBlock","createBlock","VTextField","_cache","$event","withModifiers"],"sources":["../../../../src/domains/filters/components/AFilterString.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { computed, inject, watch } from 'vue'\nimport { useI18n } from 'vue-i18n'\nimport { isBoolean, isNumber, isString, isUndefined } from '@/shared/utils/common'\nimport { useFilterClearHelpers } from '@/domains/filters/composables/filterFactory'\nimport {\n FilterConfigKey,\n FilterDataKey,\n FilterSelectedKey,\n FilterSubmitResetCounterKey,\n} from '@/domains/filters/utils/filterInjectionKeys'\n\nconst props = withDefaults(\n defineProps<{\n name: string\n placeholder?: string | undefined\n dataCy?: string\n }>(),\n {\n placeholder: undefined,\n dataCy: 'filter-string',\n }\n)\nconst emit = defineEmits<{\n (e: 'change'): void\n}>()\n\nconst submitResetCounter = inject(FilterSubmitResetCounterKey)\nconst filterSelected = inject(FilterSelectedKey)\nconst filterConfig = inject(FilterConfigKey)\nconst filterData = inject(FilterDataKey)\n\nif (\n isUndefined(submitResetCounter) ||\n isUndefined(filterSelected) ||\n isUndefined(filterConfig) ||\n // eslint-disable-next-line vue/no-setup-props-reactivity-loss\n isUndefined(filterConfig.fields[props.name]) ||\n isUndefined(filterData) ||\n // eslint-disable-next-line vue/no-setup-props-reactivity-loss\n isUndefined(filterData[props.name])\n) {\n throw new Error('Incorrect provide/inject config.')\n}\n\nconst modelValue = computed({\n get() {\n return filterData[props.name]\n },\n set(newValue) {\n filterData[props.name] = newValue\n filterConfig.touched = true\n emit('change')\n },\n})\n\n// The setup above throws unless the field is configured.\nconst filterConfigCurrent = computed(() => filterConfig.fields[props.name]!)\n\nconst { t } = useI18n()\n\nconst label = computed(() => {\n return filterConfigCurrent.value.titleT ? t(filterConfigCurrent.value.titleT) : undefined\n})\n\nconst placeholderComputed = computed(() => {\n if (!isUndefined(props.placeholder)) return props.placeholder\n if (filterConfigCurrent.value.variant === 'startsWith') return t('common.model.filterPlaceholder.startsWith')\n if (filterConfigCurrent.value.variant === 'eq') return t('common.model.filterPlaceholder.eq')\n if (filterConfigCurrent.value.variant === 'search') return t('common.model.filterPlaceholder.contains')\n return ''\n})\n\nconst { clearOne } = useFilterClearHelpers()\n\nconst clearField = () => {\n clearOne(props.name, filterData, filterConfig)\n filterSelected.value.delete(props.name)\n}\n\nconst updateSelected = () => {\n if (isNumber(modelValue.value)) {\n filterSelected.value.set(props.name, [{ title: modelValue.value + '', value: modelValue.value }])\n return\n }\n // `null` reaches here when the filter is reset from outside - loading a hash clears every field\n // before applying it, and the chip has to go with the value. Falling through would leave the\n // chip naming a value the query no longer carries.\n if (!isString(modelValue.value) || modelValue.value.length === 0) {\n filterSelected.value.delete(props.name)\n return\n }\n filterSelected.value.set(props.name, [{ title: modelValue.value, value: modelValue.value }])\n}\n\nwatch(\n () => filterData[props.name],\n (newValue, oldValue) => {\n if (newValue === oldValue || isBoolean(newValue)) return\n updateSelected()\n },\n { immediate: true }\n)\n</script>\n\n<template>\n <VTextField\n v-model=\"modelValue\"\n :label=\"label\"\n :placeholder=\"placeholderComputed\"\n :clearable=\"!filterConfigCurrent.mandatory\"\n :data-cy=\"dataCy\"\n hide-details\n autocomplete=\"off\"\n @blur=\"updateSelected\"\n @click:clear.stop=\"clearField\"\n />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;EAYA,IAAMM,IAAQC,GAWRC,IAAOH,GAIPI,IAAqBC,EAAOC,CAA2B,GACvDC,IAAiBF,EAAOG,CAAiB,GACzCC,IAAeJ,EAAOK,CAAe,GACrCC,IAAaN,EAAOO,CAAa;EAEvC,IACEC,EAAYT,CAAkB,KAC9BS,EAAYN,CAAc,KAC1BM,EAAYJ,CAAY,KAExBI,EAAYJ,EAAa,OAAOR,EAAM,KAAK,KAC3CY,EAAYF,CAAU,KAEtBE,EAAYF,EAAWV,EAAM,KAAK,GAElC,MAAU,MAAM,kCAAkC;EAGpD,IAAMa,IAAaC,EAAS;GAC1B,MAAM;IACJ,OAAOJ,EAAWV,EAAM;GAC1B;GACA,IAAI,GAAU;IAGZ,AAFA,EAAWA,EAAM,QAAQe,GACzB,EAAa,UAAU,IACvBb,EAAK,QAAQ;GACf;EACF,CAAC,GAGKc,IAAsBF,QAAeN,EAAa,OAAOR,EAAM,KAAM,GAErE,EAAE,SAAMiB,EAAQ,GAEhBC,IAAQJ,QACLE,EAAoB,MAAM,SAASG,EAAEH,EAAoB,MAAM,MAAM,IAAI,KAAA,CACjF,GAEKI,IAAsBN,QACrBF,EAAYZ,EAAM,WAAW,IAC9BgB,EAAoB,MAAM,YAAY,eAAqBG,EAAE,2CAA2C,IACxGH,EAAoB,MAAM,YAAY,OAAaG,EAAE,mCAAmC,IACxFH,EAAoB,MAAM,YAAY,WAAiBG,EAAE,yCAAyC,IAC/F,KAJqCnB,EAAM,WAKnD,GAEK,EAAE,gBAAaqB,EAAsB,GAErCC,UAAmB;GAEvB,AADAC,EAASvB,EAAM,MAAMU,GAAYF,CAAY,GAC7CF,EAAe,MAAM,OAAON,EAAM,IAAI;EACxC,GAEMwB,UAAuB;GAC3B,AAAIC,EAASZ,EAAW,KAAK,IAC3BP,EAAe,MAAM,IAAIN,EAAM,MAAM,CAAC;IAAE,OAAOa,EAAW,QAAQ;IAAI,OAAOA,EAAW;GAAM,CAAC,CAAC,IAM9F,CAACa,EAASb,EAAW,KAAK,KAAKA,EAAW,MAAM,WAAW,IAC7DP,EAAe,MAAM,OAAON,EAAM,IAAI,IAGxCM,EAAe,MAAM,IAAIN,EAAM,MAAM,CAAC;IAAE,OAAOa,EAAW;IAAO,OAAOA,EAAW;GAAM,CAAC,CAAC;EAC7F;E,OAEAc,QACQjB,EAAWV,EAAM,QACtB,GAAU,MAAa;GACtB,AAAIe,MAAaa,KAAYC,EAAUd,CAAQ,KAC/CS,EAAe;EACjB,GACA,EAAE,WAAW,GAAK,CACpB,I,UAIE9B,EAAA,GAAAC,EAUEC,GAAA;GATS,YAAAiB,EAAA;GAAA,uBAAA,AAAAoB,EAAA,QAAA,MAAA,EAAU,QAAAC;GAClB,OAAOhB,EAAA;GACP,aAAaE,EAAA;GACb,WAAS,CAAGJ,EAAA,MAAoB;GAChC,WAASf,EAAA;GACV,gBAAA;GACA,cAAa;GACZ,QAAMuB;GACN,iBAAW3B,EAAOyB,GAAU,CAAA,MAAA,CAAA"}
1
+ {"version":3,"file":"AFilterString.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_component_VTextField","_withModifiers","AFilterString_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emit","submitResetCounter","inject","FilterSubmitResetCounterKey","filterSelected","FilterSelectedKey","filterConfig","FilterConfigKey","filterData","FilterDataKey","isUndefined","modelValue","computed","newValue","filterConfigCurrent","useI18n","label","t","placeholderComputed","useFilterClearHelpers","clearField","clearOne","updateSelected","isNumber","isString","watch","oldValue","isBoolean","openBlock","createBlock","VTextField","_cache","$event","withModifiers"],"sources":["../../../../src/domains/filters/components/AFilterString.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { computed, inject, watch } from 'vue'\nimport { useI18n } from 'vue-i18n'\nimport { isBoolean, isNumber, isString, isUndefined } from '@/shared/utils/common'\nimport { useFilterClearHelpers } from '@/domains/filters/composables/filterFactory'\nimport {\n FilterConfigKey,\n FilterDataKey,\n FilterSelectedKey,\n FilterSubmitResetCounterKey,\n} from '@/domains/filters/utils/filterInjectionKeys'\n\nconst props = withDefaults(\n defineProps<{\n name: string\n placeholder?: string | undefined\n dataCy?: string\n }>(),\n {\n placeholder: undefined,\n dataCy: 'filter-string',\n }\n)\nconst emit = defineEmits<{\n (e: 'change'): void\n}>()\n\nconst submitResetCounter = inject(FilterSubmitResetCounterKey)\nconst filterSelected = inject(FilterSelectedKey)\nconst filterConfig = inject(FilterConfigKey)\nconst filterData = inject(FilterDataKey)\n\nif (\n isUndefined(submitResetCounter) ||\n isUndefined(filterSelected) ||\n isUndefined(filterConfig) ||\n // eslint-disable-next-line vue/no-setup-props-reactivity-loss\n isUndefined(filterConfig.fields[props.name]) ||\n isUndefined(filterData) ||\n // eslint-disable-next-line vue/no-setup-props-reactivity-loss\n isUndefined(filterData[props.name])\n) {\n throw new Error('Incorrect provide/inject config.')\n}\n\nconst modelValue = computed({\n get() {\n return filterData[props.name]\n },\n set(newValue) {\n filterData[props.name] = newValue\n filterConfig.touched = true\n emit('change')\n },\n})\n\n// The setup above throws unless the field is configured.\nconst filterConfigCurrent = computed(() => filterConfig.fields[props.name]!)\n\nconst { t } = useI18n()\n\nconst label = computed(() => {\n return filterConfigCurrent.value.titleT ? t(filterConfigCurrent.value.titleT) : undefined\n})\n\nconst placeholderComputed = computed(() => {\n if (!isUndefined(props.placeholder)) return props.placeholder\n if (filterConfigCurrent.value.variant === 'startsWith') return t('common.model.filterPlaceholder.startsWith')\n if (filterConfigCurrent.value.variant === 'eq') return t('common.model.filterPlaceholder.eq')\n if (filterConfigCurrent.value.variant === 'search') return t('common.model.filterPlaceholder.contains')\n return ''\n})\n\nconst { clearOne } = useFilterClearHelpers()\n\nconst clearField = () => {\n clearOne(props.name, filterData, filterConfig)\n filterSelected.value.delete(props.name)\n}\n\nconst updateSelected = () => {\n if (isNumber(modelValue.value)) {\n filterSelected.value.set(props.name, [{ title: modelValue.value + '', value: modelValue.value }])\n return\n }\n // `null` arrives when the filter is reset from outside. Loading a hash clears every field first.\n // The chip must be removed too, or it names a value the query no longer has.\n if (!isString(modelValue.value) || modelValue.value.length === 0) {\n filterSelected.value.delete(props.name)\n return\n }\n filterSelected.value.set(props.name, [{ title: modelValue.value, value: modelValue.value }])\n}\n\nwatch(\n () => filterData[props.name],\n (newValue, oldValue) => {\n if (newValue === oldValue || isBoolean(newValue)) return\n updateSelected()\n },\n { immediate: true }\n)\n</script>\n\n<template>\n <VTextField\n v-model=\"modelValue\"\n :label=\"label\"\n :placeholder=\"placeholderComputed\"\n :clearable=\"!filterConfigCurrent.mandatory\"\n :data-cy=\"dataCy\"\n hide-details\n autocomplete=\"off\"\n @blur=\"updateSelected\"\n @click:clear.stop=\"clearField\"\n />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;EAYA,IAAMM,IAAQC,GAWRC,IAAOH,GAIPI,IAAqBC,EAAOC,CAA2B,GACvDC,IAAiBF,EAAOG,CAAiB,GACzCC,IAAeJ,EAAOK,CAAe,GACrCC,IAAaN,EAAOO,CAAa;EAEvC,IACEC,EAAYT,CAAkB,KAC9BS,EAAYN,CAAc,KAC1BM,EAAYJ,CAAY,KAExBI,EAAYJ,EAAa,OAAOR,EAAM,KAAK,KAC3CY,EAAYF,CAAU,KAEtBE,EAAYF,EAAWV,EAAM,KAAK,GAElC,MAAU,MAAM,kCAAkC;EAGpD,IAAMa,IAAaC,EAAS;GAC1B,MAAM;IACJ,OAAOJ,EAAWV,EAAM;GAC1B;GACA,IAAI,GAAU;IAGZ,AAFA,EAAWA,EAAM,QAAQe,GACzB,EAAa,UAAU,IACvBb,EAAK,QAAQ;GAC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A;GACV,gBAAA;GACA,cAAa;GACZ,QAAMuB;GACN,iBAAW3B,EAAOyB,GAAU,CAAA,MAAA,CAAA"}
@@ -2,7 +2,7 @@ import e from "../../../_virtual/_plugin-vue_export-helper.js";
2
2
  import t from "./AFilterTimeInterval.vue_vue_type_script_setup_true_lang.js";
3
3
  /* empty css */
4
4
  // src/domains/filters/components/AFilterTimeInterval.vue
5
- var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-0426d641"]]);
5
+ var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-5a252715"]]);
6
6
  export { n as default };
7
7
 
8
8
  //# sourceMappingURL=AFilterTimeInterval.js.map