@antelopejs/dms 0.20.2 → 0.20.4

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 (367) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/README.md +1 -1
  3. package/dist/config/internal/state.d.ts +5 -3
  4. package/dist/config/internal/state.js +9 -1
  5. package/dist/config/internal/state.js.map +1 -1
  6. package/dist/implementations/dms-builder/engine/compose-page.js +3 -2
  7. package/dist/implementations/dms-builder/engine/compose-page.js.map +1 -1
  8. package/dist/implementations/dms-builder/engine/connection-targets.d.ts +2 -0
  9. package/dist/implementations/dms-builder/engine/connection-targets.js +276 -0
  10. package/dist/implementations/dms-builder/engine/connection-targets.js.map +1 -0
  11. package/dist/implementations/dms-builder/engine/dms-database.d.ts +1 -0
  12. package/dist/implementations/dms-builder/engine/dms-database.js +1 -0
  13. package/dist/implementations/dms-builder/engine/dms-database.js.map +1 -1
  14. package/dist/implementations/dms-builder/engine/driver-packages.js +16 -4
  15. package/dist/implementations/dms-builder/engine/driver-packages.js.map +1 -1
  16. package/dist/implementations/dms-builder/engine/index.d.ts +1 -0
  17. package/dist/implementations/dms-builder/engine/index.js +1 -0
  18. package/dist/implementations/dms-builder/engine/index.js.map +1 -1
  19. package/dist/implementations/dms-builder/engine/theme-scaffold.js +1 -1
  20. package/dist/implementations/dms-html-render/index.js +5 -2
  21. package/dist/implementations/dms-html-render/index.js.map +1 -1
  22. package/dist/mcp/page-verify/index.d.ts +1 -0
  23. package/dist/mcp/page-verify/index.js +1 -0
  24. package/dist/mcp/page-verify/index.js.map +1 -1
  25. package/dist/mcp/page-verify/redact-report.d.ts +2 -0
  26. package/dist/mcp/page-verify/redact-report.js +120 -0
  27. package/dist/mcp/page-verify/redact-report.js.map +1 -0
  28. package/dist/mcp/page-verify/render.js +4 -1
  29. package/dist/mcp/page-verify/render.js.map +1 -1
  30. package/dist/mcp/redact.d.ts +87 -0
  31. package/dist/mcp/redact.js +139 -0
  32. package/dist/mcp/redact.js.map +1 -0
  33. package/dist/mcp/tools/builder-compose.js +11 -2
  34. package/dist/mcp/tools/builder-compose.js.map +1 -1
  35. package/dist/mcp/tools/builder-project.js +59 -26
  36. package/dist/mcp/tools/builder-project.js.map +1 -1
  37. package/dist/mcp/tools/builder-queries.js +41 -4
  38. package/dist/mcp/tools/builder-queries.js.map +1 -1
  39. package/dist/mcp/tools/builder-shared.d.ts +3 -1
  40. package/dist/mcp/tools/builder-shared.js +5 -0
  41. package/dist/mcp/tools/builder-shared.js.map +1 -1
  42. package/dist/mcp/tools/database.js +3 -2
  43. package/dist/mcp/tools/database.js.map +1 -1
  44. package/dist/mcp/tools/page-verify.js +3 -2
  45. package/dist/mcp/tools/page-verify.js.map +1 -1
  46. package/frontend-vue/dms.frontend.ts +6 -2
  47. package/frontend-vue/eslint-globals.generated.mjs +259 -942
  48. package/frontend-vue/layers/dms-auth/app/build/composables/useAuthFormError.ts +5 -3
  49. package/frontend-vue/layers/dms-auth/app/composables/useOAuthErrorToast.ts +6 -4
  50. package/frontend-vue/layers/dms-auth/app/composables/usePostLoginRedirect.ts +3 -2
  51. package/frontend-vue/layers/dms-auth/app/custom-pages/auth/backup.vue +1 -1
  52. package/frontend-vue/layers/dms-auth/app/custom-pages/auth/forgot.vue +1 -1
  53. package/frontend-vue/layers/dms-auth/app/custom-pages/auth/login.vue +12 -4
  54. package/frontend-vue/layers/dms-auth/app/custom-pages/auth/recover.vue +1 -1
  55. package/frontend-vue/layers/dms-auth/app/custom-pages/auth/signup.vue +12 -6
  56. package/frontend-vue/layers/dms-auth/app/middleware/auth.ts +4 -2
  57. package/frontend-vue/layers/dms-auth/server/oauth.ts +13 -7
  58. package/frontend-vue/layers/dms-auth/server/session.ts +37 -6
  59. package/frontend-vue/layers/dms-core/app/build/composables/api-error.ts +46 -23
  60. package/frontend-vue/layers/dms-core/app/build/composables/auth/usePermissionPreview.ts +34 -23
  61. package/frontend-vue/layers/dms-core/app/build/composables/user/preferencesCookie.ts +8 -2
  62. package/frontend-vue/layers/dms-core/app/build/composables/user/tablePreferences.ts +11 -5
  63. package/frontend-vue/layers/dms-core/app/build/utils/crossTab.ts +4 -2
  64. package/frontend-vue/layers/dms-core/app/build/utils/json.ts +31 -0
  65. package/frontend-vue/layers/dms-core/app/build/utils/permission-preview.ts +6 -11
  66. package/frontend-vue/layers/dms-core/app/build/utils/record.ts +4 -0
  67. package/frontend-vue/layers/dms-core/app/build/utils/sharedRealtimeConnection.ts +56 -36
  68. package/frontend-vue/layers/dms-core/app/composables/auth/useApiData.ts +2 -2
  69. package/frontend-vue/layers/dms-core/app/composables/auth/useAuthFetch.ts +6 -1
  70. package/frontend-vue/layers/dms-core/app/composables/auth/useCurrentUser.ts +3 -2
  71. package/frontend-vue/layers/dms-core/app/composables/auth/useLogout.ts +3 -2
  72. package/frontend-vue/layers/dms-core/app/composables/auth/useMultiAccount.ts +15 -14
  73. package/frontend-vue/layers/dms-core/app/composables/auth/useSessionRecovery.ts +21 -8
  74. package/frontend-vue/layers/dms-core/app/composables/data-types/useDataType.ts +3 -3
  75. package/frontend-vue/layers/dms-core/app/composables/page/useSiteLayout.ts +11 -9
  76. package/frontend-vue/layers/dms-core/app/composables/period/periodLink.ts +3 -2
  77. package/frontend-vue/layers/dms-core/app/composables/period/usePeriod.ts +2 -2
  78. package/frontend-vue/layers/dms-core/app/composables/realtime/usePageRealtime.ts +10 -3
  79. package/frontend-vue/layers/dms-core/app/composables/realtime/useSseStream.ts +22 -16
  80. package/frontend-vue/layers/dms-core/app/composables/realtime/useUserRealtime.ts +68 -46
  81. package/frontend-vue/layers/dms-core/app/composables/useApiErrorPresenter.ts +22 -11
  82. package/frontend-vue/layers/dms-core/app/composables/useEventedAction.ts +4 -1
  83. package/frontend-vue/layers/dms-core/app/composables/useFieldErrors.ts +14 -6
  84. package/frontend-vue/layers/dms-core/app/composables/user/usePreferences.ts +8 -3
  85. package/frontend-vue/layers/dms-core/app/composables/watch/useWatch.ts +17 -8
  86. package/frontend-vue/layers/dms-core/app/types/module-store.ts +3 -1
  87. package/frontend-vue/layers/dms-core/app/types/page.ts +3 -1
  88. package/frontend-vue/layers/dms-core/app/utils/dedupedRefresh.ts +2 -2
  89. package/frontend-vue/layers/dms-core/app/utils/formatter.ts +5 -5
  90. package/frontend-vue/layers/dms-core/app/utils/menu.ts +12 -4
  91. package/frontend-vue/layers/dms-core/app/utils/pageQuery.ts +7 -4
  92. package/frontend-vue/layers/dms-core/app/utils/row-action-rule-evaluator.ts +7 -3
  93. package/frontend-vue/layers/dms-core/app/utils/stringTypeParser.ts +8 -10
  94. package/frontend-vue/layers/dms-core/app/utils/type-check.ts +25 -12
  95. package/frontend-vue/layers/dms-layout/app/build/branding/BrandingColorPair.vue +5 -2
  96. package/frontend-vue/layers/dms-layout/app/build/branding/device-draft.ts +2 -1
  97. package/frontend-vue/layers/dms-layout/app/build/branding/logos.ts +11 -13
  98. package/frontend-vue/layers/dms-layout/app/build/branding/model.ts +6 -2
  99. package/frontend-vue/layers/dms-layout/app/build/branding/preview-style.ts +12 -10
  100. package/frontend-vue/layers/dms-layout/app/build/branding/raster.ts +7 -4
  101. package/frontend-vue/layers/dms-layout/app/build/branding/useBrandingEditor.ts +59 -31
  102. package/frontend-vue/layers/dms-layout/app/build/branding/values.ts +2 -1
  103. package/frontend-vue/layers/dms-layout/app/build/components/layout/DashboardSidebar.vue +1 -1
  104. package/frontend-vue/layers/dms-layout/app/build/components/layout/PageHeaderActionBar.vue +37 -24
  105. package/frontend-vue/layers/dms-layout/app/build/components/notification/NotificationPopover.vue +2 -4
  106. package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/profile/ProfileSummaryRow.vue +2 -2
  107. package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/security/SecuritySessions.vue +35 -10
  108. package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/theme/CssVariablesList.vue +2 -2
  109. package/frontend-vue/layers/dms-layout/app/build/composables/dev-reload/useDevReloadHolder.ts +4 -4
  110. package/frontend-vue/layers/dms-layout/app/build/composables/navigation/useVisitNavBadges.ts +26 -4
  111. package/frontend-vue/layers/dms-layout/app/build/composables/security/useSessionHandoff.ts +3 -6
  112. package/frontend-vue/layers/dms-layout/app/build/composables/settings/profile/useAccountData.ts +16 -12
  113. package/frontend-vue/layers/dms-layout/app/build/composables/settings/security/useSecurityFormat.ts +12 -9
  114. package/frontend-vue/layers/dms-layout/app/build/mockup/header-action.ts +2 -2
  115. package/frontend-vue/layers/dms-layout/app/build/utils/modules-catalog.ts +13 -6
  116. package/frontend-vue/layers/dms-layout/app/build/utils/notificationPayload.ts +81 -0
  117. package/frontend-vue/layers/dms-layout/app/build/utils/submittedUrl.ts +14 -0
  118. package/frontend-vue/layers/dms-layout/app/components/AppWidgetsDock.vue +3 -1
  119. package/frontend-vue/layers/dms-layout/app/composables/general/useSystemState.ts +4 -5
  120. package/frontend-vue/layers/dms-layout/app/composables/layout/useServedHeaderActions.ts +7 -5
  121. package/frontend-vue/layers/dms-layout/app/composables/notification/useNotifications.ts +2 -2
  122. package/frontend-vue/layers/dms-layout/app/composables/page/useModuleHistory.ts +1 -1
  123. package/frontend-vue/layers/dms-layout/app/composables/page/useModuleStore.ts +3 -3
  124. package/frontend-vue/layers/dms-layout/app/composables/page/useModuleStoreActions.ts +2 -2
  125. package/frontend-vue/layers/dms-layout/app/composables/page/useModulesListing.ts +17 -4
  126. package/frontend-vue/layers/dms-layout/app/composables/page/usePageComponentPreload.ts +15 -7
  127. package/frontend-vue/layers/dms-layout/app/composables/page/usePageRecordDeletion.ts +2 -2
  128. package/frontend-vue/layers/dms-layout/app/composables/profile/useUserLanguage.ts +3 -2
  129. package/frontend-vue/layers/dms-layout/app/composables/useCommandPaletteSources.ts +20 -2
  130. package/frontend-vue/layers/dms-layout/app/custom-pages/settings/roles.vue +5 -1
  131. package/frontend-vue/layers/dms-layout/app/custom-pages/settings/shortcuts.vue +4 -1
  132. package/frontend-vue/layers/dms-layout/app/pages/[...slug].vue +13 -5
  133. package/frontend-vue/layers/dms-layout/app/plugins/command-palette-session.client.ts +8 -8
  134. package/frontend-vue/layers/dms-layout/app/plugins/dms-dev-reload.client.ts +1 -1
  135. package/frontend-vue/layers/dms-layout/app/plugins/dms-mcp-navigate.client.ts +4 -2
  136. package/frontend-vue/layers/dms-layout/app/plugins/dms-menu-sync.client.ts +3 -3
  137. package/frontend-vue/layers/dms-layout/app/plugins/notification-stream.client.ts +47 -40
  138. package/frontend-vue/layers/dms-layout/app/plugins/permission-preview.client.ts +2 -2
  139. package/frontend-vue/layers/dms-layout/app/plugins/profile-sync.client.ts +3 -10
  140. package/frontend-vue/layers/dms-layout/app/plugins/seo.ts +2 -2
  141. package/frontend-vue/layers/dms-layout/app/utils/breadcrumb.ts +3 -2
  142. package/frontend-vue/layers/dms-layout/server/html-render.ts +5 -1
  143. package/frontend-vue/layers/dms-layout/server/render-token.ts +3 -2
  144. package/frontend-vue/layers/dms-onboarding/app/build/components/onboarding/steps/StepPlatform.vue +1 -1
  145. package/frontend-vue/layers/dms-onboarding/app/components/onboarding/steps/StepRegister.vue +1 -1
  146. package/frontend-vue/layers/dms-onboarding/app/custom-pages/onboarding.vue +2 -1
  147. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupEditOverlay.vue +2 -2
  148. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupIndex.vue +1 -1
  149. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupInspector.vue +3 -2
  150. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupInspectorField.vue +5 -2
  151. package/frontend-vue/layers/dms-ui/app/build/components/containers/drawer/DynamicDrawer.vue +4 -3
  152. package/frontend-vue/layers/dms-ui/app/build/components/containers/modal/DynamicModal.vue +3 -2
  153. package/frontend-vue/layers/dms-ui/app/build/components/containers/row/RowHeader.vue +2 -1
  154. package/frontend-vue/layers/dms-ui/app/build/components/period/PeriodRangeCalendar.vue +10 -7
  155. package/frontend-vue/layers/dms-ui/app/build/components/sortable/SortableList.vue +2 -2
  156. package/frontend-vue/layers/dms-ui/app/build/components/table/FiltersRow.vue +20 -18
  157. package/frontend-vue/layers/dms-ui/app/build/components/table/MenuColumns.vue +2 -5
  158. package/frontend-vue/layers/dms-ui/app/build/components/table/MenuDensity.vue +3 -4
  159. package/frontend-vue/layers/dms-ui/app/build/components/table/MenuFilter.vue +3 -4
  160. package/frontend-vue/layers/dms-ui/app/build/components/table/MenuImport.vue +2 -5
  161. package/frontend-vue/layers/dms-ui/app/build/components/table/MenuPage.vue +2 -5
  162. package/frontend-vue/layers/dms-ui/app/build/components/table/MenuRoot.vue +3 -4
  163. package/frontend-vue/layers/dms-ui/app/build/components/table/MenuSort.vue +2 -5
  164. package/frontend-vue/layers/dms-ui/app/build/components/table/MenuViewMode.vue +21 -19
  165. package/frontend-vue/layers/dms-ui/app/build/components/table/RowSelection.vue +3 -4
  166. package/frontend-vue/layers/dms-ui/app/build/components/table/Table.types.ts +4 -4
  167. package/frontend-vue/layers/dms-ui/app/build/components/table/TableActions.vue +3 -4
  168. package/frontend-vue/layers/dms-ui/app/build/components/table/TableMenu.vue +3 -4
  169. package/frontend-vue/layers/dms-ui/app/build/components/table/TablePagination.vue +3 -4
  170. package/frontend-vue/layers/dms-ui/app/build/components/table/TableRoot.vue +3 -5
  171. package/frontend-vue/layers/dms-ui/app/build/components/table/TableTabs.vue +2 -5
  172. package/frontend-vue/layers/dms-ui/app/build/components/table/TableViews.vue +3 -4
  173. package/frontend-vue/layers/dms-ui/app/build/components/table/tableComponentFilters.ts +4 -4
  174. package/frontend-vue/layers/dms-ui/app/build/components/table/tableComponentPreferences.ts +4 -3
  175. package/frontend-vue/layers/dms-ui/app/build/components/table/tableComponentRows.ts +4 -3
  176. package/frontend-vue/layers/dms-ui/app/build/components/table/tableComponentTheme.ts +11 -0
  177. package/frontend-vue/layers/dms-ui/app/build/components/table-view/CardsDisplay.vue +35 -9
  178. package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetActions.ts +24 -17
  179. package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetConfirmation.ts +53 -30
  180. package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetHandlers.ts +2 -2
  181. package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetRequests.ts +2 -2
  182. package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetRows.ts +8 -4
  183. package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetTypes.ts +1 -1
  184. package/frontend-vue/layers/dms-ui/app/build/composables/actions/rowNavigation.ts +3 -2
  185. package/frontend-vue/layers/dms-ui/app/build/composables/actions/useActionTargets.ts +9 -2
  186. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupEditing.ts +156 -99
  187. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSession.ts +2 -2
  188. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSpec.ts +194 -161
  189. package/frontend-vue/layers/dms-ui/app/build/composables/blocks/blockDataState.ts +2 -1
  190. package/frontend-vue/layers/dms-ui/app/build/composables/blocks/useGuard.ts +38 -11
  191. package/frontend-vue/layers/dms-ui/app/build/composables/chart/apexRawOptions.ts +34 -5
  192. package/frontend-vue/layers/dms-ui/app/build/composables/chart/apexSeriesStyle.ts +32 -3
  193. package/frontend-vue/layers/dms-ui/app/build/composables/chart/apexTheme.ts +13 -6
  194. package/frontend-vue/layers/dms-ui/app/build/composables/confirm/useActionConfirm.ts +8 -3
  195. package/frontend-vue/layers/dms-ui/app/build/composables/containers/drawerSize.ts +4 -4
  196. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/cellHelpers.ts +23 -1
  197. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultChoiceTypes.ts +11 -11
  198. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultDateCells.ts +7 -1
  199. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultIdentityCells.ts +22 -8
  200. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultMediaTypes.ts +5 -5
  201. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultPrimitiveTypes.ts +10 -9
  202. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultRelationTypes.ts +8 -8
  203. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/metricCells.ts +12 -6
  204. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/numberSuffix.ts +4 -6
  205. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/relationRows.ts +2 -2
  206. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/relationValue.ts +10 -5
  207. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/twoLineCell.ts +21 -3
  208. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/useColumnValueRenderer.ts +6 -4
  209. package/frontend-vue/layers/dms-ui/app/build/composables/detach.ts +9 -0
  210. package/frontend-vue/layers/dms-ui/app/build/composables/files/useFileMetadata.ts +1 -1
  211. package/frontend-vue/layers/dms-ui/app/build/composables/form/fieldComponentProps.ts +38 -14
  212. package/frontend-vue/layers/dms-ui/app/build/composables/form/fieldSaved.ts +6 -8
  213. package/frontend-vue/layers/dms-ui/app/build/composables/form/fieldValueRule.ts +19 -2
  214. package/frontend-vue/layers/dms-ui/app/build/composables/form/formComponentCancel.ts +2 -1
  215. package/frontend-vue/layers/dms-ui/app/build/composables/form/formComponentErrors.ts +3 -2
  216. package/frontend-vue/layers/dms-ui/app/build/composables/form/formComponentRealtime.ts +28 -8
  217. package/frontend-vue/layers/dms-ui/app/build/composables/form/formComponentValidation.ts +5 -6
  218. package/frontend-vue/layers/dms-ui/app/build/composables/form/formState.ts +15 -7
  219. package/frontend-vue/layers/dms-ui/app/build/composables/form/formValidation.ts +12 -3
  220. package/frontend-vue/layers/dms-ui/app/build/composables/form/registerFormFunctions.ts +7 -8
  221. package/frontend-vue/layers/dms-ui/app/build/composables/form/stringSet.ts +6 -0
  222. package/frontend-vue/layers/dms-ui/app/build/composables/form/useFormModel.ts +60 -16
  223. package/frontend-vue/layers/dms-ui/app/build/composables/form/useInstantForm.ts +5 -4
  224. package/frontend-vue/layers/dms-ui/app/build/composables/instant-save/useInstantSave.ts +13 -9
  225. package/frontend-vue/layers/dms-ui/app/build/composables/layout/rowSidePanel.ts +2 -1
  226. package/frontend-vue/layers/dms-ui/app/build/composables/live/currentPageLive.ts +1 -1
  227. package/frontend-vue/layers/dms-ui/app/build/composables/live/liveCadence.ts +2 -2
  228. package/frontend-vue/layers/dms-ui/app/build/composables/live/missedTally.ts +8 -6
  229. package/frontend-vue/layers/dms-ui/app/build/composables/live/pageLiveController.ts +2 -2
  230. package/frontend-vue/layers/dms-ui/app/build/composables/live/usePageDataRefresh.ts +3 -3
  231. package/frontend-vue/layers/dms-ui/app/build/composables/navigation/useNavBadges.ts +1 -1
  232. package/frontend-vue/layers/dms-ui/app/build/composables/period/periodQuery.ts +42 -14
  233. package/frontend-vue/layers/dms-ui/app/build/composables/table/tableColumnActionDescriptors.ts +63 -46
  234. package/frontend-vue/layers/dms-ui/app/build/composables/table/tableColumnActionSizing.ts +2 -2
  235. package/frontend-vue/layers/dms-ui/app/build/composables/table/tableColumnStructure.ts +2 -2
  236. package/frontend-vue/layers/dms-ui/app/build/composables/table/useRelationFilterLabels.ts +4 -2
  237. package/frontend-vue/layers/dms-ui/app/build/composables/table/useTable.ts +4 -2
  238. package/frontend-vue/layers/dms-ui/app/build/composables/table/useTableConfigClipboard.ts +71 -9
  239. package/frontend-vue/layers/dms-ui/app/build/composables/table/useTableStates.ts +6 -4
  240. package/frontend-vue/layers/dms-ui/app/build/composables/table/utils/rowId.ts +15 -0
  241. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/registerDefaultFunctions.ts +21 -7
  242. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableRowActionBulkRequests.ts +3 -3
  243. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableRowActionContainers.ts +1 -17
  244. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableRowActionNavigation.ts +12 -7
  245. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableRowActionValues.ts +25 -4
  246. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewArrival.ts +8 -5
  247. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewCounts.ts +4 -5
  248. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewDisplayContext.ts +2 -1
  249. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewDisplays.ts +18 -14
  250. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewEvents.ts +4 -3
  251. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewGrouping.ts +2 -2
  252. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewListing.ts +4 -1
  253. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewLive.ts +4 -1
  254. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewQuickActions.ts +4 -3
  255. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewQuickFilters.ts +4 -2
  256. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewRealtime.ts +9 -7
  257. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewTabs.ts +4 -4
  258. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useCardFields.ts +1 -1
  259. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useExpandedRowDetails.ts +6 -3
  260. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useGroupedRows.ts +7 -7
  261. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/usePersistedPagination.ts +2 -1
  262. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useReorderHandles.ts +9 -2
  263. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableFooter.ts +4 -2
  264. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableLiveHold.ts +2 -6
  265. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTablePreferences.ts +19 -12
  266. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableRecordLink.ts +6 -3
  267. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableReorder.ts +7 -7
  268. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableRows.ts +4 -2
  269. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableViewRowActions.ts +6 -5
  270. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/bulkActions.ts +3 -1
  271. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/card.ts +14 -12
  272. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/displayOptions.ts +38 -0
  273. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/expandedRows.ts +4 -2
  274. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/groupedRows.ts +12 -10
  275. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/reorder.ts +6 -5
  276. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/sortableColumns.ts +38 -9
  277. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/tableCounts.ts +8 -3
  278. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/tableQuery.ts +14 -11
  279. package/frontend-vue/layers/dms-ui/app/build/composables/unsaved-changes/formValue.ts +22 -12
  280. package/frontend-vue/layers/dms-ui/app/build/composables/unsaved-changes/registry.ts +27 -6
  281. package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCards.vue +1 -1
  282. package/frontend-vue/layers/dms-ui/app/build/mockups/resync.ts +9 -1
  283. package/frontend-vue/layers/dms-ui/app/build/utils/blockPreview.ts +34 -25
  284. package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewMessages.ts +52 -26
  285. package/frontend-vue/layers/dms-ui/app/build/utils/calendarDay.ts +4 -1
  286. package/frontend-vue/layers/dms-ui/app/build/utils/characterCount.ts +1 -1
  287. package/frontend-vue/layers/dms-ui/app/build/utils/dispatchQuickActionTarget.ts +16 -11
  288. package/frontend-vue/layers/dms-ui/app/build/utils/fieldOptionsI18n.ts +23 -21
  289. package/frontend-vue/layers/dms-ui/app/build/utils/json.ts +74 -0
  290. package/frontend-vue/layers/dms-ui/app/build/utils/link.ts +2 -2
  291. package/frontend-vue/layers/dms-ui/app/build/utils/mockup.ts +4 -4
  292. package/frontend-vue/layers/dms-ui/app/build/utils/mockupCatalog.ts +59 -50
  293. package/frontend-vue/layers/dms-ui/app/build/utils/mockupDrop.ts +1 -1
  294. package/frontend-vue/layers/dms-ui/app/build/utils/mockupEdit.ts +8 -6
  295. package/frontend-vue/layers/dms-ui/app/build/utils/mockupSpec.ts +34 -28
  296. package/frontend-vue/layers/dms-ui/app/build/utils/mockupStamp.ts +11 -3
  297. package/frontend-vue/layers/dms-ui/app/build/utils/mockupStream.ts +5 -2
  298. package/frontend-vue/layers/dms-ui/app/build/utils/streamHighlight.ts +8 -6
  299. package/frontend-vue/layers/dms-ui/app/build/utils/urlVariables.ts +2 -1
  300. package/frontend-vue/layers/dms-ui/app/components/RecursiveComponent.vue +3 -6
  301. package/frontend-vue/layers/dms-ui/app/components/block-preview/BlockPreview.vue +5 -4
  302. package/frontend-vue/layers/dms-ui/app/components/blocks/BannerBlock.vue +1 -2
  303. package/frontend-vue/layers/dms-ui/app/components/card/NavCard.vue +4 -1
  304. package/frontend-vue/layers/dms-ui/app/components/chart/ApexChartHost.vue +62 -13
  305. package/frontend-vue/layers/dms-ui/app/components/chart/ChartBlock.vue +18 -6
  306. package/frontend-vue/layers/dms-ui/app/components/code-snippet/CodeSnippet.vue +9 -4
  307. package/frontend-vue/layers/dms-ui/app/components/confirm/ConfirmModal.vue +9 -6
  308. package/frontend-vue/layers/dms-ui/app/components/flow-canvas/FlowCanvas.vue +16 -18
  309. package/frontend-vue/layers/dms-ui/app/components/form/FormBlock.vue +4 -9
  310. package/frontend-vue/layers/dms-ui/app/components/form/LocalizedField.vue +2 -2
  311. package/frontend-vue/layers/dms-ui/app/components/form/components/InputAddress.vue +2 -2
  312. package/frontend-vue/layers/dms-ui/app/components/form/components/InputImage.vue +5 -8
  313. package/frontend-vue/layers/dms-ui/app/components/form/components/RichText.vue +3 -2
  314. package/frontend-vue/layers/dms-ui/app/components/master-detail/MasterDetail.vue +3 -1
  315. package/frontend-vue/layers/dms-ui/app/components/period/usePeriodSelectorInteraction.ts +9 -7
  316. package/frontend-vue/layers/dms-ui/app/components/table-view/KanbanBoard.vue +11 -6
  317. package/frontend-vue/layers/dms-ui/app/components/table-view/KanbanDisplay.vue +40 -3
  318. package/frontend-vue/layers/dms-ui/app/composables/chart/apexDatetimeBuckets.ts +9 -5
  319. package/frontend-vue/layers/dms-ui/app/composables/chart/events.ts +6 -3
  320. package/frontend-vue/layers/dms-ui/app/composables/chart/heatmapColors.ts +1 -1
  321. package/frontend-vue/layers/dms-ui/app/composables/chart/localizeSeries.ts +13 -2
  322. package/frontend-vue/layers/dms-ui/app/composables/chart/useApexChart.ts +27 -4
  323. package/frontend-vue/layers/dms-ui/app/composables/chart/useApexChart.types.ts +3 -2
  324. package/frontend-vue/layers/dms-ui/app/composables/chart/useChartFetch.ts +3 -4
  325. package/frontend-vue/layers/dms-ui/app/composables/confirm/types.ts +5 -1
  326. package/frontend-vue/layers/dms-ui/app/composables/containers/openDynamicContainer.ts +6 -6
  327. package/frontend-vue/layers/dms-ui/app/composables/containers/types.ts +1 -1
  328. package/frontend-vue/layers/dms-ui/app/composables/containers/useDrawer.ts +8 -5
  329. package/frontend-vue/layers/dms-ui/app/composables/containers/useModal.ts +1 -1
  330. package/frontend-vue/layers/dms-ui/app/composables/form/types/props.ts +5 -2
  331. package/frontend-vue/layers/dms-ui/app/composables/form/useForm.ts +80 -39
  332. package/frontend-vue/layers/dms-ui/app/composables/live/usePageLiveRefresh.ts +1 -1
  333. package/frontend-vue/layers/dms-ui/app/composables/resolveDmsComponent.ts +9 -2
  334. package/frontend-vue/layers/dms-ui/app/composables/tab/useTab.ts +2 -2
  335. package/frontend-vue/layers/dms-ui/app/composables/table-view/shortcuts/tableViewShiftA.ts +2 -2
  336. package/frontend-vue/layers/dms-ui/app/composables/table-view/types/action-target.ts +2 -1
  337. package/frontend-vue/layers/dms-ui/app/composables/table-view/types/column.ts +3 -1
  338. package/frontend-vue/layers/dms-ui/app/composables/table-view/types/display.ts +6 -2
  339. package/frontend-vue/layers/dms-ui/app/composables/table-view/useTableViewExport.ts +6 -5
  340. package/frontend-vue/layers/dms-ui/app/composables/unsaved-changes/useUnsavedChanges.ts +1 -1
  341. package/frontend-vue/layers/dms-ui/app/composables/useExportJob.ts +21 -9
  342. package/frontend-vue/layers/dms-ui/app/utils/blockRefresh.ts +8 -2
  343. package/frontend-vue/layers/dms-ui/app/utils/cascader.ts +18 -8
  344. package/frontend-vue/layers/dms-ui/app/utils/metadataRetry.ts +1 -1
  345. package/frontend-vue/lazy-plugin.ts +1 -1
  346. package/frontend-vue/package.json +5 -4
  347. package/frontend-vue/scripts/check-api-error-presentation.mjs +257 -117
  348. package/frontend-vue/scripts/check-autoimport-boundaries.mjs +143 -27
  349. package/frontend-vue/scripts/check-disable-blocks.mjs +26 -4
  350. package/frontend-vue/scripts/check-dms-components.mjs +152 -246
  351. package/frontend-vue/scripts/check-invariants.mjs +100 -42
  352. package/frontend-vue/scripts/check-page-invariants.mjs +103 -40
  353. package/frontend-vue/scripts/dms-components-dependencies.mjs +106 -13
  354. package/frontend-vue/scripts/dms-components-script.mjs +375 -0
  355. package/frontend-vue/scripts/eslint-test-quality.mjs +126 -0
  356. package/frontend-vue/scripts/jsconfig.json +10 -0
  357. package/frontend-vue/scripts/probes/capture-frontend-probe.cjs +4 -2
  358. package/frontend-vue/scripts/probes/frontend-behavior.cjs +217 -47
  359. package/frontend-vue/scripts/probes/frontend-legacy.cjs +159 -8
  360. package/frontend-vue/scripts/probes/frontend-probe-controls.cjs +89 -10
  361. package/frontend-vue/scripts/prove-comment-emit.mjs +33 -4
  362. package/frontend-vue/scripts/prove-component-registration.mjs +110 -24
  363. package/frontend-vue/scripts/test-autoimport-boundaries.mjs +37 -6
  364. package/frontend-vue/scripts/test-dms-components.mjs +70 -5
  365. package/frontend-vue/server/request-body.ts +29 -5
  366. package/package.json +5 -3
  367. package/frontend-vue/eslint-test-quality.mjs +0 -62
@@ -1,8 +1,9 @@
1
1
  import { type ComputedRef, type Ref, watch } from "vue";
2
2
  import type { FormField } from "../../../composables/form/types/field";
3
- import type { FormFieldValue } from "../../../composables/form/types/value";
4
3
  import type { validateFormState } from "./formValidation";
5
4
  import { cloneFormValue } from "../../../composables/form/useForm";
5
+ import type { apiErrorStatus } from "#dms-core/app/composables/useFieldErrors";
6
+ import { detach } from "../detach";
6
7
  import { sameFormValue } from "../unsaved-changes/formValue";
7
8
  import {
8
9
  type InstantSave,
@@ -46,7 +47,7 @@ export interface InstantFormOptions {
46
47
  /** Sends the changed fields, alone (a partial submit). */
47
48
  submit: (changes: FormValues) => Promise<void>;
48
49
  /** Says why a save was refused, once its values are put back. */
49
- onRefused: (error: unknown) => void;
50
+ onRefused: (error: Parameters<typeof apiErrorStatus>[0]) => void;
50
51
  }
51
52
 
52
53
  export interface InstantForm extends InstantSave<FormValues> {
@@ -60,7 +61,7 @@ export interface InstantForm extends InstantSave<FormValues> {
60
61
  }
61
62
 
62
63
  const clone = (value: FormValues[string]): FormValues[string] =>
63
- cloneFormValue(value as FormFieldValue | undefined);
64
+ cloneFormValue(value);
64
65
 
65
66
  /**
66
67
  * The instant save of a `Form` (`saveMode: "instant"`): each field the user
@@ -125,7 +126,7 @@ export function useInstantForm(options: InstantFormOptions): InstantForm {
125
126
  instant.confirm({ [field.id]: value });
126
127
  continue;
127
128
  }
128
- void saveField(field, value);
129
+ detach(saveField(field, value));
129
130
  }
130
131
  },
131
132
  { deep: true },
@@ -30,7 +30,7 @@ export interface InstantSaveSource<V extends object> {
30
30
  /** Keeps the changed keys; rejects when they are refused. */
31
31
  save: (changes: Partial<V>) => Promise<void>;
32
32
  /** Called after a refused save is put back (field errors, a toast). */
33
- onError?: (error: unknown, changes: Partial<V>) => void;
33
+ onError?: (cause: unknown, changes: Partial<V>) => void;
34
34
  }
35
35
 
36
36
  export interface InstantChangeOptions {
@@ -72,7 +72,9 @@ export interface InstantSave<V extends object> {
72
72
  type Timer = ReturnType<typeof setTimeout>;
73
73
 
74
74
  function saveKeys<V extends object>(values: Partial<V>): InstantSaveKey<V>[] {
75
- return Object.keys(values) as InstantSaveKey<V>[];
75
+ return Object.keys(values).filter((key): key is InstantSaveKey<V> =>
76
+ Object.hasOwn(values, key),
77
+ );
76
78
  }
77
79
 
78
80
  /** The saves of one page: what waits, what runs, what the server holds. */
@@ -120,12 +122,14 @@ class InstantSaveQueue<V extends object> {
120
122
  ): void {
121
123
  this.put(key, value);
122
124
  if (!debounce) {
123
- void this.send([key]);
125
+ this.send([key]).catch(() => undefined);
124
126
  return;
125
127
  }
126
128
  this.debounceTimers.set(
127
129
  key,
128
- setTimeout(() => void this.send([key]), INSTANT_SAVE_DEBOUNCE_MS),
130
+ setTimeout(() => {
131
+ this.send([key]).catch(() => undefined);
132
+ }, INSTANT_SAVE_DEBOUNCE_MS),
129
133
  );
130
134
  }
131
135
 
@@ -157,7 +161,7 @@ class InstantSaveQueue<V extends object> {
157
161
  } finally {
158
162
  for (const key of ready) this.inFlight.delete(key);
159
163
  const followers = ready.filter((key) => this.pending.has(key));
160
- if (followers.length) void this.send(followers);
164
+ if (followers.length) this.send(followers).catch(() => undefined);
161
165
  }
162
166
  }
163
167
 
@@ -192,7 +196,7 @@ class InstantSaveQueue<V extends object> {
192
196
  !this.pending.has(key) &&
193
197
  sameFormValue(this.source.read(key), changes[key]);
194
198
  if (isShown) {
195
- this.source.write(key, this.confirmed.get(key) as V[typeof key]);
199
+ this.source.write(key, this.confirmed.get(key)!);
196
200
  }
197
201
  this.setState(key, "error");
198
202
  }
@@ -243,10 +247,10 @@ export function useInstantSave<V extends object>(
243
247
  const keys = saveKeys(changes);
244
248
  for (const key of keys) {
245
249
  saves.remember(key);
246
- source.write(key, changes[key] as V[typeof key]);
250
+ source.write(key, changes[key]!);
247
251
  saves.put(key, changes[key]);
248
252
  }
249
- void saves.send(keys);
253
+ saves.send(keys).catch(() => undefined);
250
254
  };
251
255
 
252
256
  const retry: InstantSave<V>["retry"] = () => {
@@ -257,7 +261,7 @@ export function useInstantSave<V extends object>(
257
261
 
258
262
  onScopeDispose(() => {
259
263
  saves.dispose();
260
- void saves.flush();
264
+ saves.flush().catch(() => undefined);
261
265
  });
262
266
 
263
267
  return {
@@ -1,4 +1,5 @@
1
1
  import { type Component, type ShallowRef, shallowRef } from "vue";
2
+ import type { ContainerOptions } from "../../../composables/containers/types";
2
3
  import type { RowNavigationSource } from "#dms-ui/app/build/composables/actions/rowNavigation";
3
4
  import {
4
5
  registerSidePanel,
@@ -53,7 +54,7 @@ export interface RowSidePanelContent {
53
54
  positionLabel?: string;
54
55
  component: Component;
55
56
  /** Props of the component besides `rowData` and `navigation`. */
56
- componentOptions: Record<string, unknown>;
57
+ componentOptions: NonNullable<ContainerOptions["componentOptions"]>;
57
58
  row?: Data;
58
59
  /** Id of `row`: the key the component is mounted under, the row the table highlights. */
59
60
  rowKey?: string;
@@ -65,7 +65,7 @@ export function isServerPageLive(): boolean {
65
65
  /** @internal */
66
66
  export interface LiveGate {
67
67
  /** An event behind the block arrived: refetch, now or later, or count it. */
68
- trigger(...args: Parameters<LiveSubscription["trigger"]>): void;
68
+ trigger: (...args: Parameters<LiveSubscription["trigger"]>) => void;
69
69
  /** Events the block missed while the page is paused. */
70
70
  missed: ComputedRef<number>;
71
71
  /** When the block last read through the gate (ms), 0 before or without `live`. */
@@ -1,4 +1,4 @@
1
- import type { PageLiveOptions, PageLivePeriod } from "#dms-core/app/types/live";
1
+ import type { PageLiveOptions } from "#dms-core/app/types/live";
2
2
 
3
3
  const MS_PER_SECOND = 1000;
4
4
  const MS_PER_UNIT = {
@@ -14,7 +14,7 @@ const PERIOD_PATTERN = /^(\d+)([mhd])$/;
14
14
  *
15
15
  * @internal
16
16
  */
17
- export function livePeriodMs(period: PageLivePeriod | string): number | null {
17
+ export function livePeriodMs(period: string): number | null {
18
18
  const match = PERIOD_PATTERN.exec(period);
19
19
  if (!match) return null;
20
20
  const [, amount, unit] = match;
@@ -4,12 +4,14 @@ import {
4
4
  } from "../../../../../dms-core/app/utils/type-check";
5
5
  import { readonly, ref, type Ref } from "vue";
6
6
 
7
- interface PublishedEvent {
7
+ /** What a block's gate counts: a realtime message, or the browser event of a page refresh. */
8
+ export interface LiveEvent {
8
9
  topic?: unknown;
10
+ type?: string;
9
11
  payload?: { ids?: unknown; count?: unknown };
10
12
  }
11
13
 
12
- function rowKeysOf(event: PublishedEvent): string[] {
14
+ function rowKeysOf(event: LiveEvent): string[] {
13
15
  const ids = event.payload?.ids;
14
16
  if (!Array.isArray(ids)) return [];
15
17
  const topic = isString(event.topic) ? event.topic : "";
@@ -18,7 +20,7 @@ function rowKeysOf(event: PublishedEvent): string[] {
18
20
  .map((id) => JSON.stringify([topic, id]));
19
21
  }
20
22
 
21
- function batchCountOf(event: PublishedEvent): number | null {
23
+ function batchCountOf(event: LiveEvent): number | null {
22
24
  const count = event.payload?.count;
23
25
  return isNumber(count) && Number.isInteger(count) && count > 0 ? count : null;
24
26
  }
@@ -35,12 +37,12 @@ function batchCountOf(event: PublishedEvent): number | null {
35
37
  */
36
38
  export class MissedTally {
37
39
  private readonly count = ref(0);
38
- private events = new WeakSet<object>();
40
+ private events = new WeakSet<LiveEvent>();
39
41
  private rows = new Set<string>();
40
42
  /** The rows and events counted since the last reset. */
41
43
  readonly total: Readonly<Ref<number>> = readonly(this.count);
42
44
 
43
- add(event: object | undefined): void {
45
+ add(event: LiveEvent | undefined): void {
44
46
  if (event) {
45
47
  if (this.events.has(event)) return;
46
48
  this.events.add(event);
@@ -54,7 +56,7 @@ export class MissedTally {
54
56
  this.rows = new Set();
55
57
  }
56
58
 
57
- private weightOf(event: PublishedEvent | undefined): number {
59
+ private weightOf(event: LiveEvent | undefined): number {
58
60
  if (!event) return 1;
59
61
  const rowKeys = rowKeysOf(event);
60
62
  if (rowKeys.length > 0) {
@@ -16,7 +16,7 @@ import { liveIntervalMs } from "./liveCadence";
16
16
  import { LiveHolds, toLiveNote } from "./liveHolds";
17
17
  import { LivePoller } from "./livePoller";
18
18
  import { liveStorageKey, readStoredPause, storePause } from "./liveStorage";
19
- import { MissedTally } from "./missedTally";
19
+ import { MissedTally, type LiveEvent } from "./missedTally";
20
20
 
21
21
  /**
22
22
  * Why a page hidden in a background tab is paused.
@@ -39,7 +39,7 @@ export interface LiveSubscription {
39
39
  * reaching several blocks counts once in the page's `missedCount`; its
40
40
  * `payload.ids` or `payload.count` say how many rows it stands for.
41
41
  */
42
- trigger(event?: object): void;
42
+ trigger: (event?: LiveEvent) => void;
43
43
  /** Rows and events the block received while paused or held, not read yet. */
44
44
  readonly missed: Readonly<Ref<number>>;
45
45
  /** When the block last read through the gate (ms since the epoch), 0 before. */
@@ -60,13 +60,13 @@ export function usePageDataRefresh(source: PageDataRefreshSource): void {
60
60
 
61
61
  interface BurstRefresh {
62
62
  /** Joins the burst under way, or starts one; resolves once it is read. */
63
- refresh(): Promise<void>;
64
- cancel(): void;
63
+ refresh: () => Promise<void>;
64
+ cancel: () => void;
65
65
  }
66
66
 
67
67
  interface Burst {
68
68
  promise: Promise<void>;
69
- done(): void;
69
+ done: () => void;
70
70
  }
71
71
 
72
72
  function startBurst(): Burst {
@@ -80,7 +80,7 @@ export const useNavBadges = () => {
80
80
  ): void {
81
81
  if (!counted) return;
82
82
  for (const fullId of servedIds.value) {
83
- if (!(fullId in counted)) setNavBadge(fullId, "");
83
+ if (!Object.hasOwn(counted, fullId)) setNavBadge(fullId, "");
84
84
  }
85
85
  for (const [fullId, { badge, tone }] of Object.entries(counted)) {
86
86
  setNavBadge(fullId, badge, tone);
@@ -12,6 +12,7 @@ import {
12
12
  type PeriodRange,
13
13
  } from "#dms-core/app/composables/period/types";
14
14
  import type { PeriodQueryKeys } from "#dms-core/app/composables/period/periodLink";
15
+ import type { ValidationRouteContext } from "#dms-core/app/utils/query-validation";
15
16
  import {
16
17
  readerClock,
17
18
  type WallTime,
@@ -46,7 +47,7 @@ export interface PeriodChoices {
46
47
  }
47
48
 
48
49
  /** A page URL query, or a selection kept in the preferences. */
49
- export type PeriodQuery = Record<string, unknown>;
50
+ export type PeriodQuery = ValidationRouteContext["query"];
50
51
 
51
52
  /** A source the halves of a selection are read from, in order. */
52
53
  export interface PeriodSource {
@@ -67,9 +68,17 @@ const MONTH_OFFSET = 1;
67
68
  const DATE_PART_LENGTH = 2;
68
69
  const YEAR_PART_LENGTH = 4;
69
70
 
71
+ function isList(value: unknown): value is unknown[] {
72
+ return Array.isArray(value);
73
+ }
74
+
75
+ function keyNames(keys: PeriodQueryKeys): string[] {
76
+ return Object.values<string>({ ...keys });
77
+ }
78
+
70
79
  function readText(query: PeriodQuery, key: string): string | undefined {
71
- const raw = query[key];
72
- const value = Array.isArray(raw) ? raw[0] : raw;
80
+ const raw = Object.hasOwn(query, key) ? query[key] : undefined;
81
+ const value = isList(raw) ? raw[0] : raw;
73
82
  return isString(value) && value ? value : undefined;
74
83
  }
75
84
 
@@ -262,10 +271,10 @@ export function writePeriodQuery(
262
271
  ): Record<string, string> {
263
272
  const isCustom = selection.preset === CUSTOM_PRESET;
264
273
  const isCustomCompare = selection.comparison === CUSTOM_COMPARISON;
265
- return Object.fromEntries([
274
+ const entries: Array<[string, string]> = [
266
275
  ...(isCustom
267
276
  ? rangeEntries(selection.customRange, keys.from, keys.to)
268
- : [[keys.period, selection.preset]]),
277
+ : [[keys.period, selection.preset] satisfies [string, string]]),
269
278
  [keys.compare, selection.comparison],
270
279
  ...(isCustomCompare
271
280
  ? rangeEntries(
@@ -274,7 +283,8 @@ export function writePeriodQuery(
274
283
  keys.compareTo,
275
284
  )
276
285
  : []),
277
- ]);
286
+ ];
287
+ return Object.fromEntries(entries);
278
288
  }
279
289
 
280
290
  /** Whether `query` already holds what `keys` would write for `selection`. */
@@ -284,9 +294,7 @@ export function isPeriodQueryCurrent(
284
294
  selection: PeriodSelection,
285
295
  ): boolean {
286
296
  const written = writePeriodQuery(selection, keys);
287
- return Object.values(keys).every(
288
- (key) => readText(query, key) === written[key],
289
- );
297
+ return keyNames(keys).every((key) => readText(query, key) === written[key]);
290
298
  }
291
299
 
292
300
  /**
@@ -302,7 +310,7 @@ export function mergePeriodSearch(
302
310
  ): string {
303
311
  const params = new URLSearchParams(search);
304
312
  const written = writePeriodQuery(selection, keys);
305
- for (const key of Object.values(keys)) {
313
+ for (const key of keyNames(keys)) {
306
314
  const value = written[key];
307
315
  if (value === undefined) params.delete(key);
308
316
  else params.set(key, value);
@@ -348,6 +356,24 @@ export function isRangeOffered(
348
356
  return choices.presets.includes(selection.preset);
349
357
  }
350
358
 
359
+ function isStringRecord(value: unknown): value is Record<string, string> {
360
+ return (
361
+ isObject(value) && value !== null && Object.values(value).every(isString)
362
+ );
363
+ }
364
+
365
+ function isRememberedPeriods(store: unknown): store is RememberedPeriods {
366
+ return (
367
+ isObject(store) &&
368
+ store !== null &&
369
+ Object.values(store).every(isStringRecord)
370
+ );
371
+ }
372
+
373
+ function storedPeriods(store: unknown): RememberedPeriods {
374
+ return isRememberedPeriods(store) ? store : {};
375
+ }
376
+
351
377
  /**
352
378
  * The last choices with `key`'s set to `query`, moved last as the most
353
379
  * recent, and only the `limit` most recent kept: the store lives in a
@@ -359,8 +385,10 @@ export function rememberPeriod(
359
385
  query: Record<string, string>,
360
386
  limit = REMEMBERED_PERIODS_LIMIT,
361
387
  ): RememberedPeriods {
362
- const entries = Object.entries(store && isObject(store) ? store : {}).filter(
363
- ([entry]) => entry !== key,
364
- );
365
- return Object.fromEntries([...entries, [key, query]].slice(-limit));
388
+ const kept = storedPeriods(store);
389
+ const entries: Array<[string, Record<string, string>]> = Object.entries(
390
+ kept,
391
+ ).filter(([entry]) => entry !== key);
392
+ entries.push([key, query]);
393
+ return Object.fromEntries(entries.slice(-limit));
366
394
  }
@@ -2,6 +2,7 @@ import type { Data } from "../../components/table/TableRoot.vue";
2
2
  import { isObject, isNumber } from "#dms-core/app/utils/type-check";
3
3
  import type { DropdownMenuItem } from "@nuxt/ui/components/DropdownMenu.vue";
4
4
  import { get } from "@nuxt/ui/runtime/utils/index.js";
5
+ import { rowIdOf } from "./utils/rowId";
5
6
  import { createMenuItem } from "./utils/menuItemFactory";
6
7
  import {
7
8
  FormContainerType,
@@ -60,29 +61,37 @@ export const isOffMode = <T extends Data>(
60
61
  : descriptor.key === "restore";
61
62
  };
62
63
 
63
- const isActionDisabled = <T extends Data>(
64
+ /** Whether a rule keeps an action off a row: the listed row with the same raw id fails it, or no listed row has that id. */
65
+ const isRuleBlocked = <T extends Data>(
64
66
  context: TableColumnContext<T>,
65
- actionConfig: boolean | RowActionConfig | undefined,
66
- rowData: T,
67
+ rule: Parameters<typeof evaluateRowActionRule>[0],
68
+ rowData: Data,
67
69
  ): boolean => {
68
70
  const { config } = context;
71
+ const id: unknown = get(rowData, config.rowIdKey);
72
+ const listed = config.data.value.find((row) => {
73
+ const listedId: unknown = get(row, config.rowIdKey);
74
+ return listedId === id;
75
+ });
76
+ return listed === undefined || !evaluateRowActionRule(rule, listed);
77
+ };
69
78
 
79
+ const isActionDisabled = <T extends Data>(
80
+ context: TableColumnContext<T>,
81
+ actionConfig: boolean | RowActionConfig | undefined,
82
+ rowData: Data,
83
+ ): boolean => {
70
84
  const actionConfigNormalized = normalizeActionConfig(actionConfig);
71
85
  if (!actionConfigNormalized.isEnabled) return true;
72
86
  if (!actionConfigNormalized.rule) return false;
73
87
 
74
- const validator = createActionValidator(
75
- actionConfigNormalized,
76
- config.data.value,
77
- config.rowIdKey,
78
- );
79
- return !validator.canPerformAction(get(rowData, config.rowIdKey));
88
+ return isRuleBlocked(context, actionConfigNormalized.rule, rowData);
80
89
  };
81
90
 
82
91
  const rowText = <T extends Data>(
83
92
  context: TableColumnContext<T>,
84
93
  text: string,
85
- rowData: T,
94
+ rowData: Data,
86
95
  ): string => {
87
96
  const { t } = context;
88
97
  return resolveConfirmText(text, rowData, t);
@@ -96,7 +105,9 @@ export const menuLabel = <T extends Data>(
96
105
 
97
106
  const declared = config.rowActions?.menuLabel;
98
107
  if (declared) return rowText(context, declared, rowData);
99
- const label = config.labelKey ? get(rowData, config.labelKey) : undefined;
108
+ const label: unknown = config.labelKey
109
+ ? get(rowData, config.labelKey)
110
+ : undefined;
100
111
  return isString(label) || isNumber(label)
101
112
  ? t("dms.table.row_actions_for", { label })
102
113
  : t("dms.table.row_actions");
@@ -105,18 +116,11 @@ export const menuLabel = <T extends Data>(
105
116
  const isCustomActionDisabled = <T extends Data>(
106
117
  context: TableColumnContext<T>,
107
118
  action: CustomRowAction,
108
- rowData: T,
119
+ rowData: Data,
109
120
  ): boolean => {
110
- const { config } = context;
111
-
112
121
  if (!action.rule) return false;
113
122
 
114
- const validator = createActionValidator(
115
- { isEnabled: true, rule: action.rule },
116
- config.data.value,
117
- config.rowIdKey,
118
- );
119
- return !validator.canPerformAction(get(rowData, config.rowIdKey));
123
+ return isRuleBlocked(context, action.rule, rowData);
120
124
  };
121
125
 
122
126
  const buildCopyLinkOnSelect = <T extends Data>(
@@ -135,12 +139,12 @@ const buildCopyLinkOnSelect = <T extends Data>(
135
139
  ? config.formPages?.view
136
140
  : undefined;
137
141
  if (viewPageUrl) {
138
- const itemId = get(rowData, config.rowIdKey);
142
+ const itemId = rowIdOf(rowData, config.rowIdKey);
139
143
  itemUrl = `${window.location.origin}${fillFormPageUrl(viewPageUrl, config.routeParams, itemId)}`;
140
144
  } else {
141
145
  const updatedQuery = {
142
146
  ...currentRoute.query,
143
- [`${config.componentId}:id`]: get(rowData, config.rowIdKey),
147
+ [`${config.componentId}:id`]: rowIdOf(rowData, config.rowIdKey),
144
148
  };
145
149
  itemUrl = `${window.location.origin}${currentRoute.path}?${new URLSearchParams(updatedQuery).toString()}`;
146
150
  }
@@ -164,24 +168,32 @@ const copyLinkAfterConfirm = async <T extends Data>(
164
168
  if (declared) {
165
169
  const isConfirmed = await confirmAction(declared, {
166
170
  row: rowData,
167
- urlParams: { id: get(rowData, config.rowIdKey) },
171
+ urlParams: { id: rowIdOf(rowData, config.rowIdKey) },
168
172
  });
169
173
  if (!isConfirmed) return;
170
174
  }
171
175
  await buildCopyLinkOnSelect(context, rowData)();
172
176
  };
173
177
 
178
+ /** Runs an action on the row a descriptor stands for; a descriptor built for no row selects nothing. */
179
+ const onRow =
180
+ <T extends Data>(rowData: T | undefined, act: (row: T) => void) =>
181
+ (): void => {
182
+ if (rowData !== undefined) act(rowData);
183
+ };
184
+
174
185
  const buildCustomActionDescriptors = <T extends Data>(
175
186
  context: TableColumnContext<T>,
176
- rowData: T,
187
+ rowData: T | undefined,
177
188
  ): RowActionDescriptor[] => {
178
189
  const { config } = context;
190
+ const shown: Data = rowData ?? {};
179
191
  return (config.rowActions?.custom || []).map((action) => ({
180
- label: rowText(context, action.label, rowData),
192
+ label: rowText(context, action.label, shown),
181
193
 
182
194
  icon: action.icon || (action.showLabel ? "" : "i-ph-lightning"),
183
- onSelect: () => config.onCustomRowAction?.(action, rowData),
184
- disabled: isCustomActionDisabled(context, action, rowData),
195
+ onSelect: onRow(rowData, (row) => config.onCustomRowAction?.(action, row)),
196
+ disabled: isCustomActionDisabled(context, action, shown),
185
197
  visible: isCustomActionInline(action),
186
198
  color: action.color,
187
199
  variant: action.variant,
@@ -210,52 +222,53 @@ const builtInIcon = <T extends Data>(
210
222
 
211
223
  const buildBuiltInActionDescriptors = <T extends Data>(
212
224
  context: TableColumnContext<T>,
213
- rowData: T,
225
+ rowData: T | undefined,
214
226
  ): RowActionDescriptor[] => {
215
227
  const { config, t } = context;
228
+ const shown: Data = rowData ?? {};
216
229
  return [
217
230
  {
218
231
  key: "copyLink",
219
232
  label: builtInLabel(context, "copyLink", t("dms.button.copy_link")),
220
233
  icon: builtInIcon(context, "copyLink", "i-ph-link"),
221
- onSelect: () => copyLinkAfterConfirm(context, rowData),
222
- disabled: isActionDisabled(context, config.rowActions?.copyLink, rowData),
234
+ onSelect: onRow(rowData, (row) => copyLinkAfterConfirm(context, row)),
235
+ disabled: isActionDisabled(context, config.rowActions?.copyLink, shown),
223
236
  visible: isActionVisible(config.rowActions?.copyLink),
224
237
  },
225
238
  {
226
239
  key: "details",
227
240
  label: builtInLabel(context, "details", t("dms.button.details")),
228
241
  icon: builtInIcon(context, "details", "i-ph-info"),
229
- onSelect: () => config.emits("details", rowData),
230
- disabled: isActionDisabled(context, config.rowActions?.details, rowData),
242
+ onSelect: onRow(rowData, (row) => config.emits("details", row)),
243
+ disabled: isActionDisabled(context, config.rowActions?.details, shown),
231
244
  visible: isActionVisible(config.rowActions?.details),
232
245
  },
233
246
  {
234
247
  key: "edit",
235
248
  label: builtInLabel(context, "edit", t("dms.button.edit")),
236
249
  icon: builtInIcon(context, "edit", "i-ph-pencil"),
237
- onSelect: () => config.emits("edit", rowData),
238
- disabled: isActionDisabled(context, config.rowActions?.edit, rowData),
250
+ onSelect: onRow(rowData, (row) => config.emits("edit", row)),
251
+ disabled: isActionDisabled(context, config.rowActions?.edit, shown),
239
252
  visible: isActionVisible(config.rowActions?.edit),
240
253
  },
241
254
  {
242
255
  key: "duplicate",
243
256
  label: builtInLabel(context, "duplicate", t("dms.button.duplicate")),
244
257
  icon: builtInIcon(context, "duplicate", "i-ph-copy"),
245
- onSelect: () => config.emits("duplicate", get(rowData, config.rowIdKey)),
246
- disabled: isActionDisabled(
247
- context,
248
- config.rowActions?.duplicate,
249
- rowData,
258
+ onSelect: onRow(rowData, (row) =>
259
+ config.emits("duplicate", rowIdOf(row, config.rowIdKey)),
250
260
  ),
261
+ disabled: isActionDisabled(context, config.rowActions?.duplicate, shown),
251
262
  visible: isActionVisible(config.rowActions?.duplicate),
252
263
  },
253
264
  {
254
265
  key: "delete",
255
266
  label: builtInLabel(context, "delete", t("dms.button.delete")),
256
267
  icon: builtInIcon(context, "delete", "i-ph-trash"),
257
- onSelect: () => config.emits("delete", [get(rowData, config.rowIdKey)]),
258
- disabled: isActionDisabled(context, config.rowActions?.delete, rowData),
268
+ onSelect: onRow(rowData, (row) =>
269
+ config.emits("delete", [rowIdOf(row, config.rowIdKey)]),
270
+ ),
271
+ disabled: isActionDisabled(context, config.rowActions?.delete, shown),
259
272
  visible: isActionVisible(config.rowActions?.delete),
260
273
  color: Color.error,
261
274
  },
@@ -263,16 +276,20 @@ const buildBuiltInActionDescriptors = <T extends Data>(
263
276
  key: "archive",
264
277
  label: builtInLabel(context, "archive", t("dms.button.archive")),
265
278
  icon: builtInIcon(context, "archive", "i-ph-archive"),
266
- onSelect: () => config.emits("archive", [get(rowData, config.rowIdKey)]),
267
- disabled: isActionDisabled(context, config.rowActions?.archive, rowData),
279
+ onSelect: onRow(rowData, (row) =>
280
+ config.emits("archive", [rowIdOf(row, config.rowIdKey)]),
281
+ ),
282
+ disabled: isActionDisabled(context, config.rowActions?.archive, shown),
268
283
  visible: isActionVisible(config.rowActions?.archive),
269
284
  },
270
285
  {
271
286
  key: "restore",
272
287
  label: builtInLabel(context, "restore", t("dms.button.restore")),
273
288
  icon: builtInIcon(context, "restore", "i-ph-arrow-counter-clockwise"),
274
- onSelect: () => config.emits("restore", [get(rowData, config.rowIdKey)]),
275
- disabled: isActionDisabled(context, config.rowActions?.restore, rowData),
289
+ onSelect: onRow(rowData, (row) =>
290
+ config.emits("restore", [rowIdOf(row, config.rowIdKey)]),
291
+ ),
292
+ disabled: isActionDisabled(context, config.rowActions?.restore, shown),
276
293
  visible: isActionVisible(config.rowActions?.restore),
277
294
  },
278
295
  ];
@@ -280,7 +297,7 @@ const buildBuiltInActionDescriptors = <T extends Data>(
280
297
 
281
298
  export const buildRowActionDescriptors = <T extends Data>(
282
299
  context: TableColumnContext<T>,
283
- rowData: T,
300
+ rowData: T | undefined,
284
301
  ): RowActionDescriptor[] => {
285
302
  const builtIns = buildBuiltInActionDescriptors(context, rowData);
286
303
  return [
@@ -77,7 +77,7 @@ const actionsCellWidth = (descriptors: RowActionDescriptor[]): number => {
77
77
 
78
78
  const shownActionsWidth = <T extends Data>(
79
79
  context: TableColumnContext<T>,
80
- row: T,
80
+ row: T | undefined,
81
81
  ): number => {
82
82
  return actionsCellWidth(
83
83
  buildRowActionDescriptors(context, row).filter(
@@ -92,7 +92,7 @@ const labelledActionsColumnSize = <T extends Data>(
92
92
  const { config } = context;
93
93
 
94
94
  const rows = config.data.value;
95
- if (rows.length === 0) return shownActionsWidth(context, {} as T);
95
+ if (rows.length === 0) return shownActionsWidth(context, undefined);
96
96
  return Math.max(...rows.map((value) => shownActionsWidth(context, value)));
97
97
  };
98
98
 
@@ -36,8 +36,8 @@ export const processColumn = <T extends Data>(
36
36
  ): TableColumn<T> => {
37
37
  const { isNumericColumn } = context;
38
38
 
39
- if (!col.id && "accessorKey" in col) {
40
- col.id = col.accessorKey as string;
39
+ if (!col.id && "accessorKey" in col && isString(col.accessorKey)) {
40
+ col.id = col.accessorKey;
41
41
  }
42
42
 
43
43
  if (!isString(col.header) || col.id === ACTIONS_COLUMN_ID) {
@@ -72,8 +72,10 @@ export function useRelationFilterLabels(sources: () => RelationFilterSource[]) {
72
72
  onMounted(() => {
73
73
  watch(
74
74
  pending,
75
- (batches) => {
76
- for (const { source, ids } of batches) void loadLabels(source, ids);
75
+ async (batches) => {
76
+ await Promise.all(
77
+ batches.map(({ source, ids }) => loadLabels(source, ids)),
78
+ );
77
79
  },
78
80
  { immediate: true },
79
81
  );