@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.
- package/CHANGELOG.md +49 -0
- package/README.md +1 -1
- package/dist/config/internal/state.d.ts +5 -3
- package/dist/config/internal/state.js +9 -1
- package/dist/config/internal/state.js.map +1 -1
- package/dist/implementations/dms-builder/engine/compose-page.js +3 -2
- package/dist/implementations/dms-builder/engine/compose-page.js.map +1 -1
- package/dist/implementations/dms-builder/engine/connection-targets.d.ts +2 -0
- package/dist/implementations/dms-builder/engine/connection-targets.js +276 -0
- package/dist/implementations/dms-builder/engine/connection-targets.js.map +1 -0
- package/dist/implementations/dms-builder/engine/dms-database.d.ts +1 -0
- package/dist/implementations/dms-builder/engine/dms-database.js +1 -0
- package/dist/implementations/dms-builder/engine/dms-database.js.map +1 -1
- package/dist/implementations/dms-builder/engine/driver-packages.js +16 -4
- package/dist/implementations/dms-builder/engine/driver-packages.js.map +1 -1
- package/dist/implementations/dms-builder/engine/index.d.ts +1 -0
- package/dist/implementations/dms-builder/engine/index.js +1 -0
- package/dist/implementations/dms-builder/engine/index.js.map +1 -1
- package/dist/implementations/dms-builder/engine/theme-scaffold.js +1 -1
- package/dist/implementations/dms-html-render/index.js +5 -2
- package/dist/implementations/dms-html-render/index.js.map +1 -1
- package/dist/mcp/page-verify/index.d.ts +1 -0
- package/dist/mcp/page-verify/index.js +1 -0
- package/dist/mcp/page-verify/index.js.map +1 -1
- package/dist/mcp/page-verify/redact-report.d.ts +2 -0
- package/dist/mcp/page-verify/redact-report.js +120 -0
- package/dist/mcp/page-verify/redact-report.js.map +1 -0
- package/dist/mcp/page-verify/render.js +4 -1
- package/dist/mcp/page-verify/render.js.map +1 -1
- package/dist/mcp/redact.d.ts +87 -0
- package/dist/mcp/redact.js +139 -0
- package/dist/mcp/redact.js.map +1 -0
- package/dist/mcp/tools/builder-compose.js +11 -2
- package/dist/mcp/tools/builder-compose.js.map +1 -1
- package/dist/mcp/tools/builder-project.js +59 -26
- package/dist/mcp/tools/builder-project.js.map +1 -1
- package/dist/mcp/tools/builder-queries.js +41 -4
- package/dist/mcp/tools/builder-queries.js.map +1 -1
- package/dist/mcp/tools/builder-shared.d.ts +3 -1
- package/dist/mcp/tools/builder-shared.js +5 -0
- package/dist/mcp/tools/builder-shared.js.map +1 -1
- package/dist/mcp/tools/database.js +3 -2
- package/dist/mcp/tools/database.js.map +1 -1
- package/dist/mcp/tools/page-verify.js +3 -2
- package/dist/mcp/tools/page-verify.js.map +1 -1
- package/frontend-vue/dms.frontend.ts +6 -2
- package/frontend-vue/eslint-globals.generated.mjs +259 -942
- package/frontend-vue/layers/dms-auth/app/build/composables/useAuthFormError.ts +5 -3
- package/frontend-vue/layers/dms-auth/app/composables/useOAuthErrorToast.ts +6 -4
- package/frontend-vue/layers/dms-auth/app/composables/usePostLoginRedirect.ts +3 -2
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/backup.vue +1 -1
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/forgot.vue +1 -1
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/login.vue +12 -4
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/recover.vue +1 -1
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/signup.vue +12 -6
- package/frontend-vue/layers/dms-auth/app/middleware/auth.ts +4 -2
- package/frontend-vue/layers/dms-auth/server/oauth.ts +13 -7
- package/frontend-vue/layers/dms-auth/server/session.ts +37 -6
- package/frontend-vue/layers/dms-core/app/build/composables/api-error.ts +46 -23
- package/frontend-vue/layers/dms-core/app/build/composables/auth/usePermissionPreview.ts +34 -23
- package/frontend-vue/layers/dms-core/app/build/composables/user/preferencesCookie.ts +8 -2
- package/frontend-vue/layers/dms-core/app/build/composables/user/tablePreferences.ts +11 -5
- package/frontend-vue/layers/dms-core/app/build/utils/crossTab.ts +4 -2
- package/frontend-vue/layers/dms-core/app/build/utils/json.ts +31 -0
- package/frontend-vue/layers/dms-core/app/build/utils/permission-preview.ts +6 -11
- package/frontend-vue/layers/dms-core/app/build/utils/record.ts +4 -0
- package/frontend-vue/layers/dms-core/app/build/utils/sharedRealtimeConnection.ts +56 -36
- package/frontend-vue/layers/dms-core/app/composables/auth/useApiData.ts +2 -2
- package/frontend-vue/layers/dms-core/app/composables/auth/useAuthFetch.ts +6 -1
- package/frontend-vue/layers/dms-core/app/composables/auth/useCurrentUser.ts +3 -2
- package/frontend-vue/layers/dms-core/app/composables/auth/useLogout.ts +3 -2
- package/frontend-vue/layers/dms-core/app/composables/auth/useMultiAccount.ts +15 -14
- package/frontend-vue/layers/dms-core/app/composables/auth/useSessionRecovery.ts +21 -8
- package/frontend-vue/layers/dms-core/app/composables/data-types/useDataType.ts +3 -3
- package/frontend-vue/layers/dms-core/app/composables/page/useSiteLayout.ts +11 -9
- package/frontend-vue/layers/dms-core/app/composables/period/periodLink.ts +3 -2
- package/frontend-vue/layers/dms-core/app/composables/period/usePeriod.ts +2 -2
- package/frontend-vue/layers/dms-core/app/composables/realtime/usePageRealtime.ts +10 -3
- package/frontend-vue/layers/dms-core/app/composables/realtime/useSseStream.ts +22 -16
- package/frontend-vue/layers/dms-core/app/composables/realtime/useUserRealtime.ts +68 -46
- package/frontend-vue/layers/dms-core/app/composables/useApiErrorPresenter.ts +22 -11
- package/frontend-vue/layers/dms-core/app/composables/useEventedAction.ts +4 -1
- package/frontend-vue/layers/dms-core/app/composables/useFieldErrors.ts +14 -6
- package/frontend-vue/layers/dms-core/app/composables/user/usePreferences.ts +8 -3
- package/frontend-vue/layers/dms-core/app/composables/watch/useWatch.ts +17 -8
- package/frontend-vue/layers/dms-core/app/types/module-store.ts +3 -1
- package/frontend-vue/layers/dms-core/app/types/page.ts +3 -1
- package/frontend-vue/layers/dms-core/app/utils/dedupedRefresh.ts +2 -2
- package/frontend-vue/layers/dms-core/app/utils/formatter.ts +5 -5
- package/frontend-vue/layers/dms-core/app/utils/menu.ts +12 -4
- package/frontend-vue/layers/dms-core/app/utils/pageQuery.ts +7 -4
- package/frontend-vue/layers/dms-core/app/utils/row-action-rule-evaluator.ts +7 -3
- package/frontend-vue/layers/dms-core/app/utils/stringTypeParser.ts +8 -10
- package/frontend-vue/layers/dms-core/app/utils/type-check.ts +25 -12
- package/frontend-vue/layers/dms-layout/app/build/branding/BrandingColorPair.vue +5 -2
- package/frontend-vue/layers/dms-layout/app/build/branding/device-draft.ts +2 -1
- package/frontend-vue/layers/dms-layout/app/build/branding/logos.ts +11 -13
- package/frontend-vue/layers/dms-layout/app/build/branding/model.ts +6 -2
- package/frontend-vue/layers/dms-layout/app/build/branding/preview-style.ts +12 -10
- package/frontend-vue/layers/dms-layout/app/build/branding/raster.ts +7 -4
- package/frontend-vue/layers/dms-layout/app/build/branding/useBrandingEditor.ts +59 -31
- package/frontend-vue/layers/dms-layout/app/build/branding/values.ts +2 -1
- package/frontend-vue/layers/dms-layout/app/build/components/layout/DashboardSidebar.vue +1 -1
- package/frontend-vue/layers/dms-layout/app/build/components/layout/PageHeaderActionBar.vue +37 -24
- package/frontend-vue/layers/dms-layout/app/build/components/notification/NotificationPopover.vue +2 -4
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/profile/ProfileSummaryRow.vue +2 -2
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/security/SecuritySessions.vue +35 -10
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/theme/CssVariablesList.vue +2 -2
- package/frontend-vue/layers/dms-layout/app/build/composables/dev-reload/useDevReloadHolder.ts +4 -4
- package/frontend-vue/layers/dms-layout/app/build/composables/navigation/useVisitNavBadges.ts +26 -4
- package/frontend-vue/layers/dms-layout/app/build/composables/security/useSessionHandoff.ts +3 -6
- package/frontend-vue/layers/dms-layout/app/build/composables/settings/profile/useAccountData.ts +16 -12
- package/frontend-vue/layers/dms-layout/app/build/composables/settings/security/useSecurityFormat.ts +12 -9
- package/frontend-vue/layers/dms-layout/app/build/mockup/header-action.ts +2 -2
- package/frontend-vue/layers/dms-layout/app/build/utils/modules-catalog.ts +13 -6
- package/frontend-vue/layers/dms-layout/app/build/utils/notificationPayload.ts +81 -0
- package/frontend-vue/layers/dms-layout/app/build/utils/submittedUrl.ts +14 -0
- package/frontend-vue/layers/dms-layout/app/components/AppWidgetsDock.vue +3 -1
- package/frontend-vue/layers/dms-layout/app/composables/general/useSystemState.ts +4 -5
- package/frontend-vue/layers/dms-layout/app/composables/layout/useServedHeaderActions.ts +7 -5
- package/frontend-vue/layers/dms-layout/app/composables/notification/useNotifications.ts +2 -2
- package/frontend-vue/layers/dms-layout/app/composables/page/useModuleHistory.ts +1 -1
- package/frontend-vue/layers/dms-layout/app/composables/page/useModuleStore.ts +3 -3
- package/frontend-vue/layers/dms-layout/app/composables/page/useModuleStoreActions.ts +2 -2
- package/frontend-vue/layers/dms-layout/app/composables/page/useModulesListing.ts +17 -4
- package/frontend-vue/layers/dms-layout/app/composables/page/usePageComponentPreload.ts +15 -7
- package/frontend-vue/layers/dms-layout/app/composables/page/usePageRecordDeletion.ts +2 -2
- package/frontend-vue/layers/dms-layout/app/composables/profile/useUserLanguage.ts +3 -2
- package/frontend-vue/layers/dms-layout/app/composables/useCommandPaletteSources.ts +20 -2
- package/frontend-vue/layers/dms-layout/app/custom-pages/settings/roles.vue +5 -1
- package/frontend-vue/layers/dms-layout/app/custom-pages/settings/shortcuts.vue +4 -1
- package/frontend-vue/layers/dms-layout/app/pages/[...slug].vue +13 -5
- package/frontend-vue/layers/dms-layout/app/plugins/command-palette-session.client.ts +8 -8
- package/frontend-vue/layers/dms-layout/app/plugins/dms-dev-reload.client.ts +1 -1
- package/frontend-vue/layers/dms-layout/app/plugins/dms-mcp-navigate.client.ts +4 -2
- package/frontend-vue/layers/dms-layout/app/plugins/dms-menu-sync.client.ts +3 -3
- package/frontend-vue/layers/dms-layout/app/plugins/notification-stream.client.ts +47 -40
- package/frontend-vue/layers/dms-layout/app/plugins/permission-preview.client.ts +2 -2
- package/frontend-vue/layers/dms-layout/app/plugins/profile-sync.client.ts +3 -10
- package/frontend-vue/layers/dms-layout/app/plugins/seo.ts +2 -2
- package/frontend-vue/layers/dms-layout/app/utils/breadcrumb.ts +3 -2
- package/frontend-vue/layers/dms-layout/server/html-render.ts +5 -1
- package/frontend-vue/layers/dms-layout/server/render-token.ts +3 -2
- package/frontend-vue/layers/dms-onboarding/app/build/components/onboarding/steps/StepPlatform.vue +1 -1
- package/frontend-vue/layers/dms-onboarding/app/components/onboarding/steps/StepRegister.vue +1 -1
- package/frontend-vue/layers/dms-onboarding/app/custom-pages/onboarding.vue +2 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupEditOverlay.vue +2 -2
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupIndex.vue +1 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupInspector.vue +3 -2
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupInspectorField.vue +5 -2
- package/frontend-vue/layers/dms-ui/app/build/components/containers/drawer/DynamicDrawer.vue +4 -3
- package/frontend-vue/layers/dms-ui/app/build/components/containers/modal/DynamicModal.vue +3 -2
- package/frontend-vue/layers/dms-ui/app/build/components/containers/row/RowHeader.vue +2 -1
- package/frontend-vue/layers/dms-ui/app/build/components/period/PeriodRangeCalendar.vue +10 -7
- package/frontend-vue/layers/dms-ui/app/build/components/sortable/SortableList.vue +2 -2
- package/frontend-vue/layers/dms-ui/app/build/components/table/FiltersRow.vue +20 -18
- package/frontend-vue/layers/dms-ui/app/build/components/table/MenuColumns.vue +2 -5
- package/frontend-vue/layers/dms-ui/app/build/components/table/MenuDensity.vue +3 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/MenuFilter.vue +3 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/MenuImport.vue +2 -5
- package/frontend-vue/layers/dms-ui/app/build/components/table/MenuPage.vue +2 -5
- package/frontend-vue/layers/dms-ui/app/build/components/table/MenuRoot.vue +3 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/MenuSort.vue +2 -5
- package/frontend-vue/layers/dms-ui/app/build/components/table/MenuViewMode.vue +21 -19
- package/frontend-vue/layers/dms-ui/app/build/components/table/RowSelection.vue +3 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/Table.types.ts +4 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/TableActions.vue +3 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/TableMenu.vue +3 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/TablePagination.vue +3 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/TableRoot.vue +3 -5
- package/frontend-vue/layers/dms-ui/app/build/components/table/TableTabs.vue +2 -5
- package/frontend-vue/layers/dms-ui/app/build/components/table/TableViews.vue +3 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/tableComponentFilters.ts +4 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/tableComponentPreferences.ts +4 -3
- package/frontend-vue/layers/dms-ui/app/build/components/table/tableComponentRows.ts +4 -3
- package/frontend-vue/layers/dms-ui/app/build/components/table/tableComponentTheme.ts +11 -0
- package/frontend-vue/layers/dms-ui/app/build/components/table-view/CardsDisplay.vue +35 -9
- package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetActions.ts +24 -17
- package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetConfirmation.ts +53 -30
- package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetHandlers.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetRequests.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetRows.ts +8 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetTypes.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/actions/rowNavigation.ts +3 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/actions/useActionTargets.ts +9 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupEditing.ts +156 -99
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSession.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSpec.ts +194 -161
- package/frontend-vue/layers/dms-ui/app/build/composables/blocks/blockDataState.ts +2 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/blocks/useGuard.ts +38 -11
- package/frontend-vue/layers/dms-ui/app/build/composables/chart/apexRawOptions.ts +34 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/chart/apexSeriesStyle.ts +32 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/chart/apexTheme.ts +13 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/confirm/useActionConfirm.ts +8 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/containers/drawerSize.ts +4 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/cellHelpers.ts +23 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultChoiceTypes.ts +11 -11
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultDateCells.ts +7 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultIdentityCells.ts +22 -8
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultMediaTypes.ts +5 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultPrimitiveTypes.ts +10 -9
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultRelationTypes.ts +8 -8
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/metricCells.ts +12 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/numberSuffix.ts +4 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/relationRows.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/relationValue.ts +10 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/twoLineCell.ts +21 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/useColumnValueRenderer.ts +6 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/detach.ts +9 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/files/useFileMetadata.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/form/fieldComponentProps.ts +38 -14
- package/frontend-vue/layers/dms-ui/app/build/composables/form/fieldSaved.ts +6 -8
- package/frontend-vue/layers/dms-ui/app/build/composables/form/fieldValueRule.ts +19 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/form/formComponentCancel.ts +2 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/form/formComponentErrors.ts +3 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/form/formComponentRealtime.ts +28 -8
- package/frontend-vue/layers/dms-ui/app/build/composables/form/formComponentValidation.ts +5 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/form/formState.ts +15 -7
- package/frontend-vue/layers/dms-ui/app/build/composables/form/formValidation.ts +12 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/form/registerFormFunctions.ts +7 -8
- package/frontend-vue/layers/dms-ui/app/build/composables/form/stringSet.ts +6 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/form/useFormModel.ts +60 -16
- package/frontend-vue/layers/dms-ui/app/build/composables/form/useInstantForm.ts +5 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/instant-save/useInstantSave.ts +13 -9
- package/frontend-vue/layers/dms-ui/app/build/composables/layout/rowSidePanel.ts +2 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/live/currentPageLive.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/live/liveCadence.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/live/missedTally.ts +8 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/live/pageLiveController.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/live/usePageDataRefresh.ts +3 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/navigation/useNavBadges.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/period/periodQuery.ts +42 -14
- package/frontend-vue/layers/dms-ui/app/build/composables/table/tableColumnActionDescriptors.ts +63 -46
- package/frontend-vue/layers/dms-ui/app/build/composables/table/tableColumnActionSizing.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table/tableColumnStructure.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table/useRelationFilterLabels.ts +4 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table/useTable.ts +4 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table/useTableConfigClipboard.ts +71 -9
- package/frontend-vue/layers/dms-ui/app/build/composables/table/useTableStates.ts +6 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/table/utils/rowId.ts +15 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/registerDefaultFunctions.ts +21 -7
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableRowActionBulkRequests.ts +3 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableRowActionContainers.ts +1 -17
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableRowActionNavigation.ts +12 -7
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableRowActionValues.ts +25 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewArrival.ts +8 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewCounts.ts +4 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewDisplayContext.ts +2 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewDisplays.ts +18 -14
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewEvents.ts +4 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewGrouping.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewListing.ts +4 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewLive.ts +4 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewQuickActions.ts +4 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewQuickFilters.ts +4 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewRealtime.ts +9 -7
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewTabs.ts +4 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useCardFields.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useExpandedRowDetails.ts +6 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useGroupedRows.ts +7 -7
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/usePersistedPagination.ts +2 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useReorderHandles.ts +9 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableFooter.ts +4 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableLiveHold.ts +2 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTablePreferences.ts +19 -12
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableRecordLink.ts +6 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableReorder.ts +7 -7
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableRows.ts +4 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableViewRowActions.ts +6 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/bulkActions.ts +3 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/card.ts +14 -12
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/displayOptions.ts +38 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/expandedRows.ts +4 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/groupedRows.ts +12 -10
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/reorder.ts +6 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/sortableColumns.ts +38 -9
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/tableCounts.ts +8 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/tableQuery.ts +14 -11
- package/frontend-vue/layers/dms-ui/app/build/composables/unsaved-changes/formValue.ts +22 -12
- package/frontend-vue/layers/dms-ui/app/build/composables/unsaved-changes/registry.ts +27 -6
- package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCards.vue +1 -1
- package/frontend-vue/layers/dms-ui/app/build/mockups/resync.ts +9 -1
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreview.ts +34 -25
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewMessages.ts +52 -26
- package/frontend-vue/layers/dms-ui/app/build/utils/calendarDay.ts +4 -1
- package/frontend-vue/layers/dms-ui/app/build/utils/characterCount.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/utils/dispatchQuickActionTarget.ts +16 -11
- package/frontend-vue/layers/dms-ui/app/build/utils/fieldOptionsI18n.ts +23 -21
- package/frontend-vue/layers/dms-ui/app/build/utils/json.ts +74 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/link.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/utils/mockup.ts +4 -4
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupCatalog.ts +59 -50
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupDrop.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupEdit.ts +8 -6
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupSpec.ts +34 -28
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupStamp.ts +11 -3
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupStream.ts +5 -2
- package/frontend-vue/layers/dms-ui/app/build/utils/streamHighlight.ts +8 -6
- package/frontend-vue/layers/dms-ui/app/build/utils/urlVariables.ts +2 -1
- package/frontend-vue/layers/dms-ui/app/components/RecursiveComponent.vue +3 -6
- package/frontend-vue/layers/dms-ui/app/components/block-preview/BlockPreview.vue +5 -4
- package/frontend-vue/layers/dms-ui/app/components/blocks/BannerBlock.vue +1 -2
- package/frontend-vue/layers/dms-ui/app/components/card/NavCard.vue +4 -1
- package/frontend-vue/layers/dms-ui/app/components/chart/ApexChartHost.vue +62 -13
- package/frontend-vue/layers/dms-ui/app/components/chart/ChartBlock.vue +18 -6
- package/frontend-vue/layers/dms-ui/app/components/code-snippet/CodeSnippet.vue +9 -4
- package/frontend-vue/layers/dms-ui/app/components/confirm/ConfirmModal.vue +9 -6
- package/frontend-vue/layers/dms-ui/app/components/flow-canvas/FlowCanvas.vue +16 -18
- package/frontend-vue/layers/dms-ui/app/components/form/FormBlock.vue +4 -9
- package/frontend-vue/layers/dms-ui/app/components/form/LocalizedField.vue +2 -2
- package/frontend-vue/layers/dms-ui/app/components/form/components/InputAddress.vue +2 -2
- package/frontend-vue/layers/dms-ui/app/components/form/components/InputImage.vue +5 -8
- package/frontend-vue/layers/dms-ui/app/components/form/components/RichText.vue +3 -2
- package/frontend-vue/layers/dms-ui/app/components/master-detail/MasterDetail.vue +3 -1
- package/frontend-vue/layers/dms-ui/app/components/period/usePeriodSelectorInteraction.ts +9 -7
- package/frontend-vue/layers/dms-ui/app/components/table-view/KanbanBoard.vue +11 -6
- package/frontend-vue/layers/dms-ui/app/components/table-view/KanbanDisplay.vue +40 -3
- package/frontend-vue/layers/dms-ui/app/composables/chart/apexDatetimeBuckets.ts +9 -5
- package/frontend-vue/layers/dms-ui/app/composables/chart/events.ts +6 -3
- package/frontend-vue/layers/dms-ui/app/composables/chart/heatmapColors.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/composables/chart/localizeSeries.ts +13 -2
- package/frontend-vue/layers/dms-ui/app/composables/chart/useApexChart.ts +27 -4
- package/frontend-vue/layers/dms-ui/app/composables/chart/useApexChart.types.ts +3 -2
- package/frontend-vue/layers/dms-ui/app/composables/chart/useChartFetch.ts +3 -4
- package/frontend-vue/layers/dms-ui/app/composables/confirm/types.ts +5 -1
- package/frontend-vue/layers/dms-ui/app/composables/containers/openDynamicContainer.ts +6 -6
- package/frontend-vue/layers/dms-ui/app/composables/containers/types.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/composables/containers/useDrawer.ts +8 -5
- package/frontend-vue/layers/dms-ui/app/composables/containers/useModal.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/composables/form/types/props.ts +5 -2
- package/frontend-vue/layers/dms-ui/app/composables/form/useForm.ts +80 -39
- package/frontend-vue/layers/dms-ui/app/composables/live/usePageLiveRefresh.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/composables/resolveDmsComponent.ts +9 -2
- package/frontend-vue/layers/dms-ui/app/composables/tab/useTab.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/composables/table-view/shortcuts/tableViewShiftA.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/composables/table-view/types/action-target.ts +2 -1
- package/frontend-vue/layers/dms-ui/app/composables/table-view/types/column.ts +3 -1
- package/frontend-vue/layers/dms-ui/app/composables/table-view/types/display.ts +6 -2
- package/frontend-vue/layers/dms-ui/app/composables/table-view/useTableViewExport.ts +6 -5
- package/frontend-vue/layers/dms-ui/app/composables/unsaved-changes/useUnsavedChanges.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/composables/useExportJob.ts +21 -9
- package/frontend-vue/layers/dms-ui/app/utils/blockRefresh.ts +8 -2
- package/frontend-vue/layers/dms-ui/app/utils/cascader.ts +18 -8
- package/frontend-vue/layers/dms-ui/app/utils/metadataRetry.ts +1 -1
- package/frontend-vue/lazy-plugin.ts +1 -1
- package/frontend-vue/package.json +5 -4
- package/frontend-vue/scripts/check-api-error-presentation.mjs +257 -117
- package/frontend-vue/scripts/check-autoimport-boundaries.mjs +143 -27
- package/frontend-vue/scripts/check-disable-blocks.mjs +26 -4
- package/frontend-vue/scripts/check-dms-components.mjs +152 -246
- package/frontend-vue/scripts/check-invariants.mjs +100 -42
- package/frontend-vue/scripts/check-page-invariants.mjs +103 -40
- package/frontend-vue/scripts/dms-components-dependencies.mjs +106 -13
- package/frontend-vue/scripts/dms-components-script.mjs +375 -0
- package/frontend-vue/scripts/eslint-test-quality.mjs +126 -0
- package/frontend-vue/scripts/jsconfig.json +10 -0
- package/frontend-vue/scripts/probes/capture-frontend-probe.cjs +4 -2
- package/frontend-vue/scripts/probes/frontend-behavior.cjs +217 -47
- package/frontend-vue/scripts/probes/frontend-legacy.cjs +159 -8
- package/frontend-vue/scripts/probes/frontend-probe-controls.cjs +89 -10
- package/frontend-vue/scripts/prove-comment-emit.mjs +33 -4
- package/frontend-vue/scripts/prove-component-registration.mjs +110 -24
- package/frontend-vue/scripts/test-autoimport-boundaries.mjs +37 -6
- package/frontend-vue/scripts/test-dms-components.mjs +70 -5
- package/frontend-vue/server/request-body.ts +29 -5
- package/package.json +5 -3
- package/frontend-vue/eslint-test-quality.mjs +0 -62
|
@@ -123,6 +123,32 @@ function buildStrokeWidths(
|
|
|
123
123
|
);
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
+
type StrokeCurve = Extract<
|
|
127
|
+
NonNullable<NonNullable<ApexOptions["stroke"]>["curve"]>,
|
|
128
|
+
string
|
|
129
|
+
>;
|
|
130
|
+
|
|
131
|
+
const STROKE_CURVES: readonly StrokeCurve[] = [
|
|
132
|
+
"smooth",
|
|
133
|
+
"straight",
|
|
134
|
+
"stepline",
|
|
135
|
+
"linestep",
|
|
136
|
+
"monotoneCubic",
|
|
137
|
+
];
|
|
138
|
+
|
|
139
|
+
function isStrokeCurve(value: string): value is StrokeCurve {
|
|
140
|
+
return STROKE_CURVES.some((curve) => curve === value);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function defaultStroke(
|
|
144
|
+
defaults: ApexTypeConfig["defaultStroke"],
|
|
145
|
+
): NonNullable<ApexOptions["stroke"]> {
|
|
146
|
+
const { curve, ...rest } = defaults;
|
|
147
|
+
return curve !== undefined && isStrokeCurve(curve)
|
|
148
|
+
? { ...rest, curve }
|
|
149
|
+
: { ...rest };
|
|
150
|
+
}
|
|
151
|
+
|
|
126
152
|
export function buildStroke(
|
|
127
153
|
input: UseApexChartInput,
|
|
128
154
|
config: ApexTypeConfig,
|
|
@@ -130,11 +156,14 @@ export function buildStroke(
|
|
|
130
156
|
comparison: ComparisonContext,
|
|
131
157
|
surface: string,
|
|
132
158
|
): NonNullable<ApexOptions["stroke"]> {
|
|
133
|
-
const
|
|
134
|
-
const stroke = initialStroke as NonNullable<ApexOptions["stroke"]>;
|
|
159
|
+
const stroke = defaultStroke(config.defaultStroke);
|
|
135
160
|
if (input.smooth === false && stroke.curve) stroke.curve = "straight";
|
|
136
161
|
if (input.curve) stroke.curve = input.curve;
|
|
137
|
-
stroke.width = buildStrokeWidths(
|
|
162
|
+
stroke.width = buildStrokeWidths(
|
|
163
|
+
input,
|
|
164
|
+
comparison,
|
|
165
|
+
config.defaultStroke.width,
|
|
166
|
+
);
|
|
138
167
|
stroke.lineCap = "round";
|
|
139
168
|
if (comparisonDashArray) stroke.dashArray = comparisonDashArray;
|
|
140
169
|
applySegmentGap(stroke, input, config, surface);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ApexOptions } from "apexcharts";
|
|
2
|
+
import { isNumber } from "../../../../../dms-core/app/utils/type-check";
|
|
2
3
|
import type { ApexTypeConfig } from "../../../composables/chart/apexTypeConfigs";
|
|
3
4
|
import type { ChartSeries, ChartType } from "../../../composables/chart/types";
|
|
4
5
|
import type { UseApexChartInput } from "../../../composables/chart/useApexChart.types";
|
|
@@ -69,17 +70,18 @@ export function buildLegend(
|
|
|
69
70
|
isCircular: boolean,
|
|
70
71
|
theme: ApexThemeColors,
|
|
71
72
|
): NonNullable<ApexOptions["legend"]> {
|
|
73
|
+
const markers: NonNullable<NonNullable<ApexOptions["legend"]>["markers"]> = {
|
|
74
|
+
size: LEGEND_MARKER_SIZE,
|
|
75
|
+
strokeWidth: 0,
|
|
76
|
+
};
|
|
77
|
+
markers.shape = "square";
|
|
72
78
|
return {
|
|
73
79
|
show: input.showLegend ?? true,
|
|
74
80
|
position: input.legendPosition ?? (isCircular ? "bottom" : "top"),
|
|
75
81
|
horizontalAlign: "right",
|
|
76
82
|
fontSize: LEGEND_FONT_SIZE,
|
|
77
83
|
labels: { colors: theme.muted },
|
|
78
|
-
markers
|
|
79
|
-
size: LEGEND_MARKER_SIZE,
|
|
80
|
-
shape: "square",
|
|
81
|
-
strokeWidth: 0,
|
|
82
|
-
},
|
|
84
|
+
markers,
|
|
83
85
|
itemMargin: { horizontal: LEGEND_ITEM_GAP },
|
|
84
86
|
};
|
|
85
87
|
}
|
|
@@ -197,7 +199,12 @@ function pointLabel(
|
|
|
197
199
|
) {
|
|
198
200
|
const point =
|
|
199
201
|
context.w.config.series[context.seriesIndex]?.data[context.dataPointIndex];
|
|
200
|
-
if (
|
|
202
|
+
if (
|
|
203
|
+
point === undefined ||
|
|
204
|
+
point === null ||
|
|
205
|
+
isNumber(point) ||
|
|
206
|
+
!("label" in point)
|
|
207
|
+
) {
|
|
201
208
|
return value;
|
|
202
209
|
}
|
|
203
210
|
return point.label || value;
|
|
@@ -9,6 +9,7 @@ import type {
|
|
|
9
9
|
ConfirmValues,
|
|
10
10
|
} from "../../../composables/confirm/types";
|
|
11
11
|
import { resolveConfirmDialog } from "./confirmDialogTexts";
|
|
12
|
+
import type { DownloadFetch } from "../../utils/fileDownload";
|
|
12
13
|
import { secondaryTargetRunner } from "./secondaryTarget";
|
|
13
14
|
import { namesPageValue, resolveLinkVariables } from "../../utils/urlVariables";
|
|
14
15
|
import { currentPageUrlValues } from "../page/pageUrlValues";
|
|
@@ -41,9 +42,11 @@ export interface ActionConfirmRequest {
|
|
|
41
42
|
export function useActionConfirm() {
|
|
42
43
|
const { confirm } = useConfirm();
|
|
43
44
|
const { $authFetch } = useAuthFetch();
|
|
45
|
+
const fetchRaw: DownloadFetch = (url, options) =>
|
|
46
|
+
$authFetch.raw(url, options);
|
|
44
47
|
const { t } = useI18n();
|
|
45
|
-
const
|
|
46
|
-
const runSecondaryTarget = secondaryTargetRunner(
|
|
48
|
+
const errorPresenter = useApiErrorPresenter();
|
|
49
|
+
const runSecondaryTarget = secondaryTargetRunner(fetchRaw);
|
|
47
50
|
|
|
48
51
|
const loadDialog = async (
|
|
49
52
|
declared: ActionConfirm,
|
|
@@ -60,7 +63,9 @@ export function useActionConfirm() {
|
|
|
60
63
|
try {
|
|
61
64
|
return await $authFetch<ConfirmDialog>(url);
|
|
62
65
|
} catch (error) {
|
|
63
|
-
presentError(error, {
|
|
66
|
+
errorPresenter.presentError(error, {
|
|
67
|
+
fallbackKey: "dms.action_error.generic",
|
|
68
|
+
});
|
|
64
69
|
return undefined;
|
|
65
70
|
}
|
|
66
71
|
};
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
isObject,
|
|
3
3
|
isNumber,
|
|
4
4
|
} from "../../../../../dms-core/app/utils/type-check";
|
|
5
|
-
import { ref, type Component, type
|
|
5
|
+
import { ref, type Component, type Ref } from "vue";
|
|
6
6
|
import type { DrawerDirection } from "../../../composables/containers/types";
|
|
7
7
|
import type { ModalSize } from "../../../types/modal";
|
|
8
8
|
import type { ResizeBounds, ResizeStorage } from "./useResizableSize";
|
|
@@ -166,9 +166,9 @@ const ASYNC_WRAPPER_NAME = "AsyncComponentWrapper";
|
|
|
166
166
|
* @internal
|
|
167
167
|
*/
|
|
168
168
|
export function componentSizeKey(component: Component): string | undefined {
|
|
169
|
-
const
|
|
170
|
-
const
|
|
171
|
-
const componentName = [name,
|
|
169
|
+
const { name } = component;
|
|
170
|
+
const compiledName = "__name" in component ? component.__name : undefined;
|
|
171
|
+
const componentName = [name, compiledName].find(
|
|
172
172
|
(candidate) => candidate && candidate !== ASYNC_WRAPPER_NAME,
|
|
173
173
|
);
|
|
174
174
|
return componentName
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { get } from "@nuxt/ui/runtime/utils/index.js";
|
|
2
2
|
import type { DataTypeFormatter } from "#dms-core/app/composables/data-types/useDataType";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
isBoolean,
|
|
5
|
+
isNumber,
|
|
6
|
+
isObject,
|
|
7
|
+
isString,
|
|
8
|
+
} from "#dms-core/app/utils/type-check";
|
|
9
|
+
import { isVNode, type VNodeChild } from "vue";
|
|
4
10
|
import type { BlockText } from "../../../../../dms-core/app/types/composed-text";
|
|
5
11
|
import {
|
|
6
12
|
type ComposableText,
|
|
@@ -11,6 +17,22 @@ import { DMS_TONE_TEXT, isDmsTone } from "../../utils/tone";
|
|
|
11
17
|
|
|
12
18
|
export type Row = Parameters<DataTypeFormatter>[3];
|
|
13
19
|
|
|
20
|
+
/** What Vue draws for `value` as a child: text for anything but a node, a list or an atom. */
|
|
21
|
+
export function childOf(value: Parameters<DataTypeFormatter>[0]): VNodeChild {
|
|
22
|
+
if (Array.isArray(value)) return value.map(childOf);
|
|
23
|
+
if (
|
|
24
|
+
value === null ||
|
|
25
|
+
value === undefined ||
|
|
26
|
+
isString(value) ||
|
|
27
|
+
isNumber(value) ||
|
|
28
|
+
isBoolean(value) ||
|
|
29
|
+
isVNode(value)
|
|
30
|
+
) {
|
|
31
|
+
return value;
|
|
32
|
+
}
|
|
33
|
+
return String(value);
|
|
34
|
+
}
|
|
35
|
+
|
|
14
36
|
export const readRowField = (
|
|
15
37
|
row: Row,
|
|
16
38
|
field: string | undefined,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { type VNode } from "vue";
|
|
1
|
+
import { type VNode, type VNodeChild } from "vue";
|
|
2
2
|
import type {
|
|
3
3
|
DataType,
|
|
4
4
|
DataTypeFormatter,
|
|
5
5
|
} from "#dms-core/app/composables/data-types/useDataType";
|
|
6
6
|
import { isString } from "#dms-core/app/utils/type-check";
|
|
7
7
|
import UIcon from "@nuxt/ui/runtime/vue/components/Icon.vue";
|
|
8
|
-
import { isSet, toneClass } from "./cellHelpers";
|
|
8
|
+
import { childOf, isSet, toneClass } from "./cellHelpers";
|
|
9
9
|
import StatusPill from "../../../components/status-pill/StatusPill.vue";
|
|
10
10
|
import { getAppTranslation } from "../../../../../dms-core/app/composables/translation/useTranslation";
|
|
11
11
|
|
|
@@ -36,12 +36,12 @@ interface StatusOptions {
|
|
|
36
36
|
|
|
37
37
|
function renderStatus(value: CellValue, options: CellOptions) {
|
|
38
38
|
const { processI18n } = getAppTranslation();
|
|
39
|
-
const opts = options
|
|
39
|
+
const opts: StatusOptions = options ?? {};
|
|
40
40
|
const isOnline = Boolean(value);
|
|
41
|
-
const onlineLabel = opts
|
|
42
|
-
const offlineLabel = opts
|
|
43
|
-
const onlineColor = opts
|
|
44
|
-
const offlineColor = opts
|
|
41
|
+
const onlineLabel = opts.onlineLabel || "$common.status.online";
|
|
42
|
+
const offlineLabel = opts.offlineLabel || "$common.status.offline";
|
|
43
|
+
const onlineColor = opts.onlineColor || "primary";
|
|
44
|
+
const offlineColor = opts.offlineColor || "neutral";
|
|
45
45
|
|
|
46
46
|
return h(StatusPill, {
|
|
47
47
|
tone: isOnline ? onlineColor : offlineColor,
|
|
@@ -90,9 +90,9 @@ function renderSelectItem(item: SelectItem) {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
function renderSelect(value: CellValue, options?: CellOptions) {
|
|
93
|
-
const opts = options
|
|
93
|
+
const opts: SelectOptions = options ?? {};
|
|
94
94
|
const formatOne = (val: CellValue) => {
|
|
95
|
-
const item = opts
|
|
95
|
+
const item = opts.items?.find((opt) => opt.value === val);
|
|
96
96
|
return item ? renderSelectItem(item) : val;
|
|
97
97
|
};
|
|
98
98
|
|
|
@@ -102,10 +102,10 @@ function renderSelect(value: CellValue, options?: CellOptions) {
|
|
|
102
102
|
if (rendered.every((part) => isString(part))) {
|
|
103
103
|
return rendered.join(", ");
|
|
104
104
|
}
|
|
105
|
-
const children:
|
|
105
|
+
const children: VNodeChild[] = [];
|
|
106
106
|
rendered.forEach((part, index) => {
|
|
107
107
|
if (index > 0) children.push(", ");
|
|
108
|
-
children.push(part
|
|
108
|
+
children.push(childOf(part));
|
|
109
109
|
});
|
|
110
110
|
return h("span", { class: "inline-flex items-center gap-1" }, children);
|
|
111
111
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { DataTypeFormatter } from "#dms-core/app/composables/data-types/useDataType";
|
|
2
|
+
import { isNumber, isString } from "#dms-core/app/utils/type-check";
|
|
2
3
|
import { readRowField, type Row, toneClass } from "./cellHelpers";
|
|
3
4
|
import {
|
|
4
5
|
firstNameOf,
|
|
@@ -45,6 +46,11 @@ const RELATIVE_TITLE_FORMAT: Intl.DateTimeFormatOptions = {
|
|
|
45
46
|
const NOW_DOT_CLASS =
|
|
46
47
|
"inline-flex items-center gap-1.5 before:size-1.5 before:rounded-full before:bg-current";
|
|
47
48
|
|
|
49
|
+
const dateOf = (value: CellValue): Date =>
|
|
50
|
+
isString(value) || isNumber(value) || value instanceof Date
|
|
51
|
+
? new Date(value)
|
|
52
|
+
: new Date(String(value));
|
|
53
|
+
|
|
48
54
|
/**
|
|
49
55
|
* `relative_date`: a date as the distance to now, with an "active now"
|
|
50
56
|
* window, an amber "soon", a dimmed past and an optional "· by" author.
|
|
@@ -57,7 +63,7 @@ export function renderRelativeDate(
|
|
|
57
63
|
) {
|
|
58
64
|
const { processI18n } = getAppTranslation();
|
|
59
65
|
const opts: RelativeDateOptions = options ?? {};
|
|
60
|
-
const date =
|
|
66
|
+
const date = dateOf(value);
|
|
61
67
|
if (Number.isNaN(date.getTime())) return String(value);
|
|
62
68
|
|
|
63
69
|
const now = serverRenderNow() ?? Date.now();
|
|
@@ -56,6 +56,20 @@ const matchesBadge = (badge: IdentityBadgeOption, value: CellValue): boolean =>
|
|
|
56
56
|
? value !== badge.notEquals
|
|
57
57
|
: value === (badge.equals ?? true);
|
|
58
58
|
|
|
59
|
+
interface AvatarFile {
|
|
60
|
+
key: string;
|
|
61
|
+
alt?: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const isAvatarFile = (value: CellValue): value is AvatarFile =>
|
|
65
|
+
isObject(value) &&
|
|
66
|
+
value !== null &&
|
|
67
|
+
isString(value.key) &&
|
|
68
|
+
(value.alt === undefined || isString(value.alt));
|
|
69
|
+
|
|
70
|
+
const avatarOf = (value: CellValue): AvatarFile | string | null | undefined =>
|
|
71
|
+
value === null || isString(value) || isAvatarFile(value) ? value : undefined;
|
|
72
|
+
|
|
59
73
|
/**
|
|
60
74
|
* `identity`: avatar or icon tile, the value as the name, a "You" tag on the
|
|
61
75
|
* signed-in user's row, badges and a secondary line (an address as written,
|
|
@@ -84,10 +98,7 @@ export function renderIdentity(
|
|
|
84
98
|
subtitleClass: toneClass(subtitle?.tone ?? opts.subtitleTone, "dimmed"),
|
|
85
99
|
emptyLabel: opts.emptyLabel ? processI18n(opts.emptyLabel) : undefined,
|
|
86
100
|
emptyIcon: opts.emptyIcon,
|
|
87
|
-
avatar: readRowField(row, opts.avatarField)
|
|
88
|
-
| { key: string }
|
|
89
|
-
| string
|
|
90
|
-
| null,
|
|
101
|
+
avatar: avatarOf(readRowField(row, opts.avatarField)),
|
|
91
102
|
icon: stringOf(readRowField(row, opts.iconField)) ?? opts.icon,
|
|
92
103
|
selfId: stringOf(readRowField(row, opts.selfField)),
|
|
93
104
|
selfLabel: opts.selfLabel ? processI18n(opts.selfLabel) : undefined,
|
|
@@ -121,13 +132,13 @@ const PILL_FILLED_CLASS =
|
|
|
121
132
|
*/
|
|
122
133
|
interface PillItem {
|
|
123
134
|
label: string;
|
|
124
|
-
tone?:
|
|
125
|
-
variant?:
|
|
135
|
+
tone?: unknown;
|
|
136
|
+
variant?: unknown;
|
|
126
137
|
}
|
|
127
138
|
|
|
128
139
|
const DEFAULT_PILL_VARIANT: StatusPillVariant = "soft";
|
|
129
140
|
|
|
130
|
-
const pillVariantOf = (variant:
|
|
141
|
+
const pillVariantOf = (variant: PillItem["variant"]): StatusPillVariant =>
|
|
131
142
|
variant === "soft" || variant === "outline" ? variant : DEFAULT_PILL_VARIANT;
|
|
132
143
|
|
|
133
144
|
const DEFAULT_PILL_TONE = "neutral";
|
|
@@ -170,7 +181,10 @@ function renderPill(pill: PillItem) {
|
|
|
170
181
|
}
|
|
171
182
|
return h(StatusPill, {
|
|
172
183
|
label: pill.label,
|
|
173
|
-
tone:
|
|
184
|
+
tone:
|
|
185
|
+
isString(pill.tone) && isDmsTone(pill.tone)
|
|
186
|
+
? pill.tone
|
|
187
|
+
: DEFAULT_PILL_TONE,
|
|
174
188
|
variant: pillVariantOf(pill.variant),
|
|
175
189
|
dot: "none",
|
|
176
190
|
class: PILL_SHRINK_CLASS,
|
|
@@ -45,20 +45,20 @@ function renderImage(value: CellValue, options: CellOptions) {
|
|
|
45
45
|
const images = toImageList(value);
|
|
46
46
|
if (!images.length) return "";
|
|
47
47
|
|
|
48
|
-
const opts = options
|
|
49
|
-
return h(ImagePreview, { images, storage: opts
|
|
48
|
+
const opts: ImageOptions = options ?? {};
|
|
49
|
+
return h(ImagePreview, { images, storage: opts.storage });
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
function renderFile(value: CellValue, options: CellOptions) {
|
|
53
53
|
const { t } = getAppTranslation();
|
|
54
|
-
const opts = options
|
|
54
|
+
const opts: FileOptions = options ?? {};
|
|
55
55
|
|
|
56
|
-
if (opts
|
|
56
|
+
if (opts.multiple && Array.isArray(value)) {
|
|
57
57
|
return t("dms.form.file.count", { count: value.length });
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
if (isString(value)) {
|
|
61
|
-
return h(FilePreview, { resourceKey: value, storage: opts
|
|
61
|
+
return h(FilePreview, { resourceKey: value, storage: opts.storage });
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
return "";
|
package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultPrimitiveTypes.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { type VNodeChild } from "vue";
|
|
2
1
|
import type {
|
|
3
2
|
DataType,
|
|
4
3
|
DataTypeFormatter,
|
|
5
4
|
} from "#dms-core/app/composables/data-types/useDataType";
|
|
6
5
|
import { isObject } from "#dms-core/app/utils/type-check";
|
|
7
6
|
import UIcon from "@nuxt/ui/runtime/vue/components/Icon.vue";
|
|
8
|
-
import { readRowTone, type Row } from "./cellHelpers";
|
|
7
|
+
import { childOf, readRowTone, type Row } from "./cellHelpers";
|
|
9
8
|
import {
|
|
10
9
|
dateFilterEditorValue,
|
|
11
10
|
numberFilterEditorValue,
|
|
@@ -38,13 +37,17 @@ function renderBoolean(value: CellValue) {
|
|
|
38
37
|
}
|
|
39
38
|
|
|
40
39
|
function dateBoundsOf(value: CellValue): [unknown, unknown] {
|
|
40
|
+
if (Array.isArray(value)) {
|
|
41
|
+
const pair: unknown[] = value;
|
|
42
|
+
return [pair[0], pair[1]];
|
|
43
|
+
}
|
|
41
44
|
const bounds: { start?: unknown; end?: unknown } = value ?? {};
|
|
42
45
|
return [bounds.start, bounds.end];
|
|
43
46
|
}
|
|
44
47
|
|
|
45
48
|
function formatDateBetween(value: CellValue, locale: string): string {
|
|
46
49
|
const { t } = getAppTranslation();
|
|
47
|
-
const [rawStart, rawEnd] =
|
|
50
|
+
const [rawStart, rawEnd] = dateBoundsOf(value);
|
|
48
51
|
const start = formatDate(rawStart, locale) ?? t("dms.date.undefined");
|
|
49
52
|
const end = formatDate(rawEnd, locale) ?? t("dms.date.undefined");
|
|
50
53
|
return `${start} - ${end}`;
|
|
@@ -56,7 +59,7 @@ function formatAddress(value: CellValue): string {
|
|
|
56
59
|
const { processI18n } = getAppTranslation();
|
|
57
60
|
const addr = value;
|
|
58
61
|
const countryName = addr.countryCode
|
|
59
|
-
? processI18n(`$country.${addr.countryCode}`)
|
|
62
|
+
? processI18n(`$country.${String(addr.countryCode)}`)
|
|
60
63
|
: addr.countryCode;
|
|
61
64
|
const number = [addr.houseNumber, addr.boxNumber].filter(Boolean).join("/");
|
|
62
65
|
const street = [addr.streetName, number].filter(Boolean).join(" ");
|
|
@@ -90,13 +93,11 @@ function renderText(
|
|
|
90
93
|
row?: Row,
|
|
91
94
|
): ReturnType<DataTypeFormatter> {
|
|
92
95
|
if (value === "") return null;
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
(options as TextOptions | undefined)?.toneField,
|
|
96
|
-
);
|
|
96
|
+
const opts: TextOptions = options ?? {};
|
|
97
|
+
const tone = readRowTone(row, opts.toneField);
|
|
97
98
|
if (!tone) return value;
|
|
98
99
|
|
|
99
|
-
return h("span", { class: DMS_TONE_TEXT[tone] }, [value
|
|
100
|
+
return h("span", { class: DMS_TONE_TEXT[tone] }, [childOf(value)]);
|
|
100
101
|
}
|
|
101
102
|
|
|
102
103
|
export const registerPrimitiveTypes = (
|
|
@@ -94,11 +94,11 @@ function renderRelationBadges(
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
function renderRelation(value: CellValue, options: CellOptions) {
|
|
97
|
-
const opts = options
|
|
98
|
-
const labelKey = opts
|
|
99
|
-
const valueKey = opts
|
|
97
|
+
const opts: RelationOptions = options ?? {};
|
|
98
|
+
const labelKey = opts.keyMapping?.label || DEFAULT_RELATION_LABEL_KEY;
|
|
99
|
+
const valueKey = opts.keyMapping?.value || DEFAULT_RELATION_VALUE_KEY;
|
|
100
100
|
|
|
101
|
-
if (opts
|
|
101
|
+
if (opts.multiple && Array.isArray(value)) {
|
|
102
102
|
return renderRelationBadges(value, labelKey, valueKey);
|
|
103
103
|
}
|
|
104
104
|
|
|
@@ -106,7 +106,7 @@ function renderRelation(value: CellValue, options: CellOptions) {
|
|
|
106
106
|
if (!value || !isObject(value)) return value;
|
|
107
107
|
|
|
108
108
|
const valueObject = value;
|
|
109
|
-
const avatarKey = opts
|
|
109
|
+
const avatarKey = opts.keyMapping?.avatar;
|
|
110
110
|
const label = readRelationLabel(value, labelKey, valueKey);
|
|
111
111
|
|
|
112
112
|
if (!avatarKey || !valueObject[avatarKey]) return label;
|
|
@@ -122,14 +122,14 @@ function renderRelation(value: CellValue, options: CellOptions) {
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
function renderCascaderRelation(value: CellValue, options: CellOptions) {
|
|
125
|
-
const opts = options
|
|
125
|
+
const opts: CascaderRelationOptions = options ?? {};
|
|
126
126
|
|
|
127
127
|
if (!value) return value;
|
|
128
128
|
|
|
129
129
|
return h(CascaderPath, {
|
|
130
130
|
value,
|
|
131
|
-
searchUrl: opts
|
|
132
|
-
keyMapping: opts
|
|
131
|
+
searchUrl: opts.searchUrl,
|
|
132
|
+
keyMapping: opts.keyMapping,
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
135
|
|
|
@@ -125,7 +125,7 @@ export function progressShares(done: number, failed: number, total: number) {
|
|
|
125
125
|
* end, and "done / total"; green once every item is done.
|
|
126
126
|
*/
|
|
127
127
|
function renderProgress(options: Parameters<DataTypeFormatter>[2], row: Row) {
|
|
128
|
-
const opts =
|
|
128
|
+
const opts: Partial<ProgressOptions> = options ?? {};
|
|
129
129
|
const done = numberOf(readRowField(row, opts.doneField));
|
|
130
130
|
const total = numberOf(readRowField(row, opts.totalField));
|
|
131
131
|
const failed = numberOf(readRowField(row, opts.errorField));
|
|
@@ -165,7 +165,7 @@ interface SparklineOptions {
|
|
|
165
165
|
|
|
166
166
|
/** `sparkline`: a small line chart of a list of numbers. */
|
|
167
167
|
function renderSparkline(options: Parameters<DataTypeFormatter>[2], row: Row) {
|
|
168
|
-
const opts =
|
|
168
|
+
const opts: Partial<SparklineOptions> = options ?? {};
|
|
169
169
|
const series = readRowField(row, opts.field);
|
|
170
170
|
const values = Array.isArray(series)
|
|
171
171
|
? series.map(Number).filter(Number.isFinite)
|
|
@@ -270,6 +270,10 @@ function renderDuration(
|
|
|
270
270
|
* Cell data types a column picks through its `display` option to draw a
|
|
271
271
|
* metric: a status, a progress, a series, a duration, a size, an id.
|
|
272
272
|
*/
|
|
273
|
+
interface MonoOptions {
|
|
274
|
+
copy?: boolean;
|
|
275
|
+
}
|
|
276
|
+
|
|
273
277
|
export const registerMetricCellTypes = (
|
|
274
278
|
registerDataType: (dataType: DataType) => void,
|
|
275
279
|
) => {
|
|
@@ -310,12 +314,14 @@ export const registerMetricCellTypes = (
|
|
|
310
314
|
registerDataType({
|
|
311
315
|
id: "mono",
|
|
312
316
|
formatter: {
|
|
313
|
-
default: (value, _locale, options) =>
|
|
314
|
-
|
|
317
|
+
default: (value, _locale, options) => {
|
|
318
|
+
const opts: MonoOptions = options ?? {};
|
|
319
|
+
return h(MonoCell, {
|
|
315
320
|
value: String(value),
|
|
316
|
-
copy: !!
|
|
321
|
+
copy: !!opts.copy,
|
|
317
322
|
class: CELL_TEXT_CLASS,
|
|
318
|
-
})
|
|
323
|
+
});
|
|
324
|
+
},
|
|
319
325
|
},
|
|
320
326
|
});
|
|
321
327
|
};
|
|
@@ -30,12 +30,10 @@ const UNIT_SEPARATOR = " ";
|
|
|
30
30
|
*/
|
|
31
31
|
export function withNumberSuffix(format: NumberFormatter): DataTypeFormatter {
|
|
32
32
|
return (value, locale, options) => {
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
);
|
|
38
|
-
const suffix = (options as NumberSuffixOptions | undefined)?.suffix;
|
|
33
|
+
const opts: (Intl.NumberFormatOptions & NumberSuffixOptions) | undefined =
|
|
34
|
+
options ?? undefined;
|
|
35
|
+
const formatted = format(value, locale, opts);
|
|
36
|
+
const suffix = opts?.suffix;
|
|
39
37
|
if (!suffix || !isNumber(value) || !isString(formatted)) {
|
|
40
38
|
return formatted;
|
|
41
39
|
}
|
|
@@ -29,8 +29,8 @@ interface RelationSourceOptions {
|
|
|
29
29
|
export function relationSelectSource(
|
|
30
30
|
options: Parameters<NonNullable<DataType["selectSource"]>>[0],
|
|
31
31
|
): DataTypeSelectSource | undefined {
|
|
32
|
-
const opts = options
|
|
33
|
-
if (!isString(opts
|
|
32
|
+
const opts: RelationSourceOptions = options ?? {};
|
|
33
|
+
if (!isString(opts.searchUrl)) return undefined;
|
|
34
34
|
return { searchUrl: opts.searchUrl, keyMapping: opts.keyMapping };
|
|
35
35
|
}
|
|
36
36
|
|
|
@@ -17,6 +17,10 @@ interface RelationValueOptions {
|
|
|
17
17
|
keyMapping?: RelationKeyMapping;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
const relationOptionsOf = (
|
|
21
|
+
options: Parameters<BeforeStateMapper>[1],
|
|
22
|
+
): RelationValueOptions => options ?? {};
|
|
23
|
+
|
|
20
24
|
/**
|
|
21
25
|
* The form state of a relation value: the id of each row it references, as
|
|
22
26
|
* the picker holds it, whether the server sent the joined rows or their ids.
|
|
@@ -27,13 +31,14 @@ export function mapRelationBeforeState(
|
|
|
27
31
|
) {
|
|
28
32
|
if (!value) return value;
|
|
29
33
|
|
|
30
|
-
const opts = options
|
|
31
|
-
const valueKey = opts
|
|
34
|
+
const opts = relationOptionsOf(options);
|
|
35
|
+
const valueKey = opts.keyMapping?.value || DEFAULT_RELATION_VALUE_KEY;
|
|
32
36
|
|
|
33
37
|
if (isString(value) || isNumber(value)) return value;
|
|
34
38
|
|
|
35
|
-
if (opts
|
|
36
|
-
|
|
39
|
+
if (opts.multiple && Array.isArray(value)) {
|
|
40
|
+
const items: unknown[] = value;
|
|
41
|
+
return items.map((item) =>
|
|
37
42
|
isObject(item) && item !== null ? item[valueKey] : item,
|
|
38
43
|
);
|
|
39
44
|
}
|
|
@@ -70,7 +75,7 @@ export function sameRelationValue(
|
|
|
70
75
|
right: Parameters<DataTypeValueComparer>[1],
|
|
71
76
|
options: Parameters<DataTypeValueComparer>[2],
|
|
72
77
|
): boolean {
|
|
73
|
-
const isSet = !!(options
|
|
78
|
+
const isSet = !!relationOptionsOf(options).multiple;
|
|
74
79
|
const comparable = (value: Parameters<DataTypeValueComparer>[0]) => {
|
|
75
80
|
const ids = relationIds(value, options);
|
|
76
81
|
return isSet ? ids.sort(compareIdText) : ids;
|
|
@@ -3,12 +3,19 @@ import type {
|
|
|
3
3
|
DataType,
|
|
4
4
|
DataTypeFormatter,
|
|
5
5
|
} from "#dms-core/app/composables/data-types/useDataType";
|
|
6
|
+
import { isNumber, isString } from "#dms-core/app/utils/type-check";
|
|
6
7
|
import { getAppComposedText } from "../../../../../dms-core/app/composables/translation/useComposedText";
|
|
7
8
|
import {
|
|
8
9
|
type ComposableText,
|
|
9
10
|
isComposedText,
|
|
10
11
|
} from "../../../../../dms-core/app/utils/composedText";
|
|
11
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
childOf,
|
|
14
|
+
readRowField,
|
|
15
|
+
readSubline,
|
|
16
|
+
toneClass,
|
|
17
|
+
type Row,
|
|
18
|
+
} from "./cellHelpers";
|
|
12
19
|
|
|
13
20
|
const EMPTY = "—";
|
|
14
21
|
const PRIMARY_CLASS = "text-highlighted truncate text-[13px] font-medium";
|
|
@@ -30,6 +37,17 @@ interface TwoLineOptions {
|
|
|
30
37
|
typeOptions?: unknown;
|
|
31
38
|
}
|
|
32
39
|
|
|
40
|
+
const composableOf = (
|
|
41
|
+
value: Parameters<DataTypeFormatter>[0],
|
|
42
|
+
): ComposableText =>
|
|
43
|
+
value === null ||
|
|
44
|
+
value === undefined ||
|
|
45
|
+
isNumber(value) ||
|
|
46
|
+
isString(value) ||
|
|
47
|
+
isComposedText(value)
|
|
48
|
+
? value
|
|
49
|
+
: String(value);
|
|
50
|
+
|
|
33
51
|
const isBlank = (value: Parameters<DataTypeFormatter>[0]): boolean =>
|
|
34
52
|
value === null || value === undefined || value === "";
|
|
35
53
|
|
|
@@ -46,7 +64,7 @@ function formatColumnValue(
|
|
|
46
64
|
: undefined;
|
|
47
65
|
const format = formatter?.cell ?? formatter?.default;
|
|
48
66
|
if (!format) return String(value);
|
|
49
|
-
return format(value, locale, opts.typeOptions, row)
|
|
67
|
+
return childOf(format(value, locale, opts.typeOptions, row));
|
|
50
68
|
}
|
|
51
69
|
|
|
52
70
|
/** The primary line, or nothing when the row has none to show. */
|
|
@@ -59,7 +77,7 @@ function readPrimary(
|
|
|
59
77
|
const { processText } = getAppComposedText();
|
|
60
78
|
if (opts.primaryField) {
|
|
61
79
|
const text = processText(
|
|
62
|
-
readRowField(row, opts.primaryField)
|
|
80
|
+
composableOf(readRowField(row, opts.primaryField)),
|
|
63
81
|
);
|
|
64
82
|
return text || undefined;
|
|
65
83
|
}
|