@conduction/nextcloud-vue 2.56.0-beta.37 → 2.56.0-beta.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/components/CnAdvancedFormDialog/CnMetadataTab.vue.js +1 -1
- package/dist/esm/components/CnAdvancedFormDialog/CnMetadataTab.vue2.js +3 -2
- package/dist/esm/components/CnAdvancedFormDialog/CnMetadataTab.vue2.js.map +1 -1
- package/dist/esm/components/CnAdvancedFormDialog/CnMetadataTab.vue3.js.map +1 -1
- package/dist/esm/components/CnAdvancedFormDialog/CnPropertyValueCell.vue.js +1 -1
- package/dist/esm/components/CnAdvancedFormDialog/CnPropertyValueCell.vue2.js +5 -4
- package/dist/esm/components/CnAdvancedFormDialog/CnPropertyValueCell.vue2.js.map +1 -1
- package/dist/esm/components/CnAdvancedFormDialog/CnPropertyValueCell.vue3.js.map +1 -1
- package/dist/esm/components/CnAnalyticsReportPicker/CnAnalyticsReportPicker.vue.js +1 -1
- package/dist/esm/components/CnAnalyticsReportPicker/CnAnalyticsReportPicker.vue2.js +2 -1
- package/dist/esm/components/CnAnalyticsReportPicker/CnAnalyticsReportPicker.vue2.js.map +1 -1
- package/dist/esm/components/CnAnalyticsReportPicker/CnAnalyticsReportPicker.vue3.js.map +1 -1
- package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue.js +1 -1
- package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue2.js +2 -1
- package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue2.js.map +1 -1
- package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue3.js.map +1 -1
- package/dist/esm/components/CnBoardView/CnBoardView.vue.js +1 -1
- package/dist/esm/components/CnBoardView/CnBoardView.vue2.js +156 -14
- package/dist/esm/components/CnBoardView/CnBoardView.vue2.js.map +1 -1
- package/dist/esm/components/CnBoardView/CnBoardView.vue3.js +105 -74
- package/dist/esm/components/CnBoardView/CnBoardView.vue3.js.map +1 -1
- package/dist/esm/components/CnCalendarEventPicker/CnCalendarEventPicker.vue.js +1 -1
- package/dist/esm/components/CnCalendarEventPicker/CnCalendarEventPicker.vue2.js +2 -1
- package/dist/esm/components/CnCalendarEventPicker/CnCalendarEventPicker.vue2.js.map +1 -1
- package/dist/esm/components/CnCalendarEventPicker/CnCalendarEventPicker.vue3.js.map +1 -1
- package/dist/esm/components/CnCalendarWidget/CnCalendarWidget.vue.js +1 -1
- package/dist/esm/components/CnCalendarWidget/CnCalendarWidget.vue2.js +2 -1
- package/dist/esm/components/CnCalendarWidget/CnCalendarWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnCalendarWidget/CnCalendarWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnChartWidget/CnChartWidget.vue.js +1 -1
- package/dist/esm/components/CnChartWidget/CnChartWidget.vue2.js +6 -5
- package/dist/esm/components/CnChartWidget/CnChartWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnChartWidget/CnChartWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnCollectivePagePicker/CnCollectivePagePicker.vue.js +1 -1
- package/dist/esm/components/CnCollectivePagePicker/CnCollectivePagePicker.vue2.js +2 -1
- package/dist/esm/components/CnCollectivePagePicker/CnCollectivePagePicker.vue2.js.map +1 -1
- package/dist/esm/components/CnCollectivePagePicker/CnCollectivePagePicker.vue3.js.map +1 -1
- package/dist/esm/components/CnConversationThread/CnConversationThread.vue.js +1 -1
- package/dist/esm/components/CnConversationThread/CnConversationThread.vue2.js +2 -1
- package/dist/esm/components/CnConversationThread/CnConversationThread.vue2.js.map +1 -1
- package/dist/esm/components/CnConversationThread/CnConversationThread.vue3.js.map +1 -1
- package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue.js +1 -1
- package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue2.js +2 -1
- package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue.js +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js +2 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js.map +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js.map +1 -1
- package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue.js +1 -1
- package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue2.js +3 -1
- package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue2.js.map +1 -1
- package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue3.js.map +1 -1
- package/dist/esm/components/CnDetailPage/CnDetailHeaderChips.vue2.js +2 -1
- package/dist/esm/components/CnDetailPage/CnDetailHeaderChips.vue2.js.map +1 -1
- package/dist/esm/components/CnDetailPage/CnDetailHeaderChips.vue3.js.map +1 -1
- package/dist/esm/components/CnEmailPicker/CnEmailPicker.vue.js +1 -1
- package/dist/esm/components/CnEmailPicker/CnEmailPicker.vue2.js +2 -1
- package/dist/esm/components/CnEmailPicker/CnEmailPicker.vue2.js.map +1 -1
- package/dist/esm/components/CnEmailPicker/CnEmailPicker.vue3.js.map +1 -1
- package/dist/esm/components/CnFederationStatus/CnFederationStatus.vue.js +1 -1
- package/dist/esm/components/CnFederationStatus/CnFederationStatus.vue2.js +3 -1
- package/dist/esm/components/CnFederationStatus/CnFederationStatus.vue2.js.map +1 -1
- package/dist/esm/components/CnFederationStatus/CnFederationStatus.vue3.js.map +1 -1
- package/dist/esm/components/CnFileManager/CnFileManager.vue.js +1 -1
- package/dist/esm/components/CnFileManager/CnFileManager.vue2.js +3 -1
- package/dist/esm/components/CnFileManager/CnFileManager.vue2.js.map +1 -1
- package/dist/esm/components/CnFileManager/CnFileManager.vue3.js.map +1 -1
- package/dist/esm/components/CnFilePreview/CnFilePreview.vue.js +1 -1
- package/dist/esm/components/CnFilePreview/CnFilePreview.vue2.js +2 -1
- package/dist/esm/components/CnFilePreview/CnFilePreview.vue2.js.map +1 -1
- package/dist/esm/components/CnFilePreview/CnFilePreview.vue3.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue.js +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js +49 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js +3 -3
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js.map +1 -1
- package/dist/esm/components/CnFollowToggle/CnFollowToggle.vue.js +1 -1
- package/dist/esm/components/CnFollowToggle/CnFollowToggle.vue2.js +2 -1
- package/dist/esm/components/CnFollowToggle/CnFollowToggle.vue2.js.map +1 -1
- package/dist/esm/components/CnFollowToggle/CnFollowToggle.vue3.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +30 -5
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
- package/dist/esm/components/CnNotesCard/CnNotesCard.vue.js +1 -1
- package/dist/esm/components/CnNotesCard/CnNotesCard.vue2.js +2 -1
- package/dist/esm/components/CnNotesCard/CnNotesCard.vue2.js.map +1 -1
- package/dist/esm/components/CnNotesCard/CnNotesCard.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectCalendar/CnObjectCalendar.vue.js +1 -1
- package/dist/esm/components/CnObjectCalendar/CnObjectCalendar.vue2.js +3 -2
- package/dist/esm/components/CnObjectCalendar/CnObjectCalendar.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectCalendar/CnObjectCalendar.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue.js +1 -1
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue2.js +28 -0
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue3.js +82 -75
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectMetadataWidget/CnObjectMetadataWidget.vue.js +1 -1
- package/dist/esm/components/CnObjectMetadataWidget/CnObjectMetadataWidget.vue2.js +5 -4
- package/dist/esm/components/CnObjectMetadataWidget/CnObjectMetadataWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectMetadataWidget/CnObjectMetadataWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectSidebar/CnAuditTrailTab.vue.js +1 -1
- package/dist/esm/components/CnObjectSidebar/CnAuditTrailTab.vue2.js +2 -1
- package/dist/esm/components/CnObjectSidebar/CnAuditTrailTab.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectSidebar/CnAuditTrailTab.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectSidebar/CnFlowTasksPanel.vue.js +1 -1
- package/dist/esm/components/CnObjectSidebar/CnFlowTasksPanel.vue2.js +2 -1
- package/dist/esm/components/CnObjectSidebar/CnFlowTasksPanel.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectSidebar/CnFlowTasksPanel.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue.js +1 -1
- package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue2.js +2 -1
- package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectSidebar/CnTasksTab.vue.js +1 -1
- package/dist/esm/components/CnObjectSidebar/CnTasksTab.vue2.js +2 -1
- package/dist/esm/components/CnObjectSidebar/CnTasksTab.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectSidebar/CnTasksTab.vue3.js.map +1 -1
- package/dist/esm/components/CnPropertySourceField/CnPropertySourceField.vue.js +1 -1
- package/dist/esm/components/CnPropertySourceField/CnPropertySourceField.vue2.js +2 -1
- package/dist/esm/components/CnPropertySourceField/CnPropertySourceField.vue2.js.map +1 -1
- package/dist/esm/components/CnPropertySourceField/CnPropertySourceField.vue3.js.map +1 -1
- package/dist/esm/components/CnRoadmapItem/CnRoadmapItem.vue.js +1 -1
- package/dist/esm/components/CnRoadmapItem/CnRoadmapItem.vue2.js +2 -1
- package/dist/esm/components/CnRoadmapItem/CnRoadmapItem.vue2.js.map +1 -1
- package/dist/esm/components/CnRoadmapItem/CnRoadmapItem.vue3.js.map +1 -1
- package/dist/esm/components/CnSchemaFormDialog/CnSchemaFormDialog.vue2.js +2 -0
- package/dist/esm/components/CnSchemaFormDialog/CnSchemaFormDialog.vue2.js.map +1 -1
- package/dist/esm/components/CnSchemaFormDialog/CnSchemaFormDialog.vue3.js +2 -2
- package/dist/esm/components/CnSchemaFormDialog/CnSchemaFormDialog.vue3.js.map +1 -1
- package/dist/esm/components/CnStatsBlock/CnStatsBlock.vue.js +1 -1
- package/dist/esm/components/CnStatsBlock/CnStatsBlock.vue2.js +2 -1
- package/dist/esm/components/CnStatsBlock/CnStatsBlock.vue2.js.map +1 -1
- package/dist/esm/components/CnStatsBlock/CnStatsBlock.vue3.js.map +1 -1
- package/dist/esm/components/CnSummaryAggregates/CnSummaryAggregates.vue.js +1 -1
- package/dist/esm/components/CnSummaryAggregates/CnSummaryAggregates.vue2.js +2 -1
- package/dist/esm/components/CnSummaryAggregates/CnSummaryAggregates.vue2.js.map +1 -1
- package/dist/esm/components/CnSummaryAggregates/CnSummaryAggregates.vue3.js.map +1 -1
- package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue.js +1 -1
- package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue2.js +36 -0
- package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue3.js +55 -40
- package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnTasksCard/CnTasksCard.vue.js +1 -1
- package/dist/esm/components/CnTasksCard/CnTasksCard.vue2.js +2 -1
- package/dist/esm/components/CnTasksCard/CnTasksCard.vue2.js.map +1 -1
- package/dist/esm/components/CnTasksCard/CnTasksCard.vue3.js.map +1 -1
- package/dist/esm/components/CnTimelineWidget/CnTimelineWidget.vue.js +1 -1
- package/dist/esm/components/CnTimelineWidget/CnTimelineWidget.vue2.js +2 -1
- package/dist/esm/components/CnTimelineWidget/CnTimelineWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnTimelineWidget/CnTimelineWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnTranslatedBadge/CnTranslatedBadge.vue.js +1 -1
- package/dist/esm/components/CnTranslatedBadge/CnTranslatedBadge.vue2.js +2 -1
- package/dist/esm/components/CnTranslatedBadge/CnTranslatedBadge.vue2.js.map +1 -1
- package/dist/esm/components/CnVersionHistory/CnVersionHistory.vue.js +1 -1
- package/dist/esm/components/CnVersionHistory/CnVersionHistory.vue2.js +2 -1
- package/dist/esm/components/CnVersionHistory/CnVersionHistory.vue2.js.map +1 -1
- package/dist/esm/components/CnVersionHistory/CnVersionHistory.vue3.js.map +1 -1
- package/dist/esm/components/CnWidgetWrapper/CnWidgetWrapper.vue.js +1 -1
- package/dist/esm/components/CnWidgetWrapper/CnWidgetWrapper.vue2.js +3 -26
- package/dist/esm/components/CnWidgetWrapper/CnWidgetWrapper.vue2.js.map +1 -1
- package/dist/esm/components/CnWidgetWrapper/CnWidgetWrapper.vue3.js.map +1 -1
- package/dist/esm/dialogs/CnNoteHistoryDialog.vue.js +1 -1
- package/dist/esm/dialogs/CnNoteHistoryDialog.vue2.js +2 -1
- package/dist/esm/dialogs/CnNoteHistoryDialog.vue2.js.map +1 -1
- package/dist/esm/dialogs/CnNoteHistoryDialog.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/activity/CnActivityCard.vue.js +1 -1
- package/dist/esm/integrations/builtin/activity/CnActivityCard.vue2.js +3 -2
- package/dist/esm/integrations/builtin/activity/CnActivityCard.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/activity/CnActivityCard.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/activity/CnActivityTab.vue.js +1 -1
- package/dist/esm/integrations/builtin/activity/CnActivityTab.vue2.js +4 -3
- package/dist/esm/integrations/builtin/activity/CnActivityTab.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/activity/CnActivityTab.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/analytics/CnAnalyticsTab.vue.js +1 -1
- package/dist/esm/integrations/builtin/analytics/CnAnalyticsTab.vue2.js +3 -2
- package/dist/esm/integrations/builtin/analytics/CnAnalyticsTab.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/analytics/CnAnalyticsTab.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/calendar/CnCalendarCard.vue.js +1 -1
- package/dist/esm/integrations/builtin/calendar/CnCalendarCard.vue2.js +2 -1
- package/dist/esm/integrations/builtin/calendar/CnCalendarCard.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/calendar/CnCalendarCard.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/calendar/CnCalendarTab.vue.js +1 -1
- package/dist/esm/integrations/builtin/calendar/CnCalendarTab.vue2.js +6 -5
- package/dist/esm/integrations/builtin/calendar/CnCalendarTab.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/calendar/CnCalendarTab.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/contactmoment/CnContactmomentCard.vue.js +1 -1
- package/dist/esm/integrations/builtin/contactmoment/CnContactmomentCard.vue2.js +2 -1
- package/dist/esm/integrations/builtin/contactmoment/CnContactmomentCard.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/contactmoment/CnContactmomentCard.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/cospend/CnCospendTab.vue.js +1 -1
- package/dist/esm/integrations/builtin/cospend/CnCospendTab.vue2.js +2 -1
- package/dist/esm/integrations/builtin/cospend/CnCospendTab.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/cospend/CnCospendTab.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/deck/CnDeckTab.vue.js +1 -1
- package/dist/esm/integrations/builtin/deck/CnDeckTab.vue2.js +2 -1
- package/dist/esm/integrations/builtin/deck/CnDeckTab.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/deck/CnDeckTab.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/email/CnEmailCard.vue.js +1 -1
- package/dist/esm/integrations/builtin/email/CnEmailCard.vue2.js +2 -1
- package/dist/esm/integrations/builtin/email/CnEmailCard.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/email/CnEmailCard.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/field-inspection/CnFieldInspectionCard.vue.js +1 -1
- package/dist/esm/integrations/builtin/field-inspection/CnFieldInspectionCard.vue2.js +2 -1
- package/dist/esm/integrations/builtin/field-inspection/CnFieldInspectionCard.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/field-inspection/CnFieldInspectionCard.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/field-inspection/CnFieldInspectionTab.vue.js +1 -1
- package/dist/esm/integrations/builtin/field-inspection/CnFieldInspectionTab.vue2.js +2 -1
- package/dist/esm/integrations/builtin/field-inspection/CnFieldInspectionTab.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/field-inspection/CnFieldInspectionTab.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/photos/CnPhotosTab.vue.js +1 -1
- package/dist/esm/integrations/builtin/photos/CnPhotosTab.vue2.js +2 -1
- package/dist/esm/integrations/builtin/photos/CnPhotosTab.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/photos/CnPhotosTab.vue3.js.map +1 -1
- package/dist/esm/l10n/en.json.js +35 -2
- package/dist/esm/l10n/en.json.js.map +1 -1
- package/dist/esm/l10n/nl.json.js +38 -2
- package/dist/esm/l10n/nl.json.js.map +1 -1
- package/dist/esm/library-style.js +1 -1
- package/dist/esm/nextcloud-vue.css +1068 -962
- package/dist/esm/store/useObjectStore.js +7 -2
- package/dist/esm/store/useObjectStore.js.map +1 -1
- package/dist/esm/utils/boardColumns.js +50 -1
- package/dist/esm/utils/boardColumns.js.map +1 -1
- package/dist/esm/utils/boardReferenceColumns.js +115 -4
- package/dist/esm/utils/boardReferenceColumns.js.map +1 -1
- package/dist/esm/utils/contentHeaderLink.js +48 -1
- package/dist/esm/utils/contentHeaderLink.js.map +1 -1
- package/dist/esm/utils/schema.js +5 -4
- package/dist/esm/utils/schema.js.map +1 -1
- package/dist/esm/utils/userLocale.js +30 -0
- package/dist/esm/utils/userLocale.js.map +1 -0
- package/dist/esm/utils/validateManifestV2.compiled.js +2 -2
- package/dist/esm/utils/validateManifestV2.compiled.js.map +1 -1
- package/dist/nextcloud-vue.cjs.js +1088 -476
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +1068 -962
- package/l10n/en.json +35 -2
- package/l10n/nl.json +38 -2
- package/package.json +1 -1
- package/src/components/CnAdvancedFormDialog/CnMetadataTab.vue +3 -2
- package/src/components/CnAdvancedFormDialog/CnPropertyValueCell.vue +5 -4
- package/src/components/CnAnalyticsReportPicker/CnAnalyticsReportPicker.vue +2 -1
- package/src/components/CnAuditTrailCard/CnAuditTrailCard.vue +2 -1
- package/src/components/CnBoardView/CnBoardView.vue +189 -24
- package/src/components/CnCalendarEventPicker/CnCalendarEventPicker.vue +2 -1
- package/src/components/CnCalendarWidget/CnCalendarWidget.vue +2 -1
- package/src/components/CnChartWidget/CnChartWidget.vue +6 -5
- package/src/components/CnCollectivePagePicker/CnCollectivePagePicker.vue +2 -1
- package/src/components/CnConversationThread/CnConversationThread.vue +2 -1
- package/src/components/CnCountdownWidget/CnCountdownWidget.vue +2 -1
- package/src/components/CnDashboardPage/CnDashboardPage.vue +2 -1
- package/src/components/CnDataMatrix/CnDataMatrix.vue +2 -1
- package/src/components/CnDetailPage/CnDetailHeaderChips.vue +2 -1
- package/src/components/CnEmailPicker/CnEmailPicker.vue +2 -1
- package/src/components/CnFederationStatus/CnFederationStatus.vue +3 -1
- package/src/components/CnFileManager/CnFileManager.vue +2 -1
- package/src/components/CnFilePreview/CnFilePreview.vue +2 -1
- package/src/components/CnFilesBrowser/CnFilesBrowser.vue +54 -6
- package/src/components/CnFollowToggle/CnFollowToggle.vue +2 -1
- package/src/components/CnIndexPage/CnIndexPage.vue +30 -4
- package/src/components/CnNotesCard/CnNotesCard.vue +2 -1
- package/src/components/CnObjectCalendar/CnObjectCalendar.vue +3 -2
- package/src/components/CnObjectDataWidget/CnObjectDataWidget.vue +36 -0
- package/src/components/CnObjectMetadataWidget/CnObjectMetadataWidget.vue +5 -4
- package/src/components/CnObjectSidebar/CnAuditTrailTab.vue +2 -1
- package/src/components/CnObjectSidebar/CnFlowTasksPanel.vue +2 -1
- package/src/components/CnObjectSidebar/CnNotesTab.vue +2 -1
- package/src/components/CnObjectSidebar/CnTasksTab.vue +2 -1
- package/src/components/CnPropertySourceField/CnPropertySourceField.vue +2 -1
- package/src/components/CnRoadmapItem/CnRoadmapItem.vue +2 -1
- package/src/components/CnSchemaFormDialog/CnSchemaFormDialog.vue +4 -2
- package/src/components/CnStatsBlock/CnStatsBlock.vue +2 -1
- package/src/components/CnSummaryAggregates/CnSummaryAggregates.vue +2 -1
- package/src/components/CnTabsWidget/CnTabsWidget.vue +71 -0
- package/src/components/CnTasksCard/CnTasksCard.vue +2 -1
- package/src/components/CnTimelineWidget/CnTimelineWidget.vue +2 -1
- package/src/components/CnTranslatedBadge/CnTranslatedBadge.vue +2 -1
- package/src/components/CnVersionHistory/CnVersionHistory.vue +2 -1
- package/src/components/CnWidgetWrapper/CnWidgetWrapper.vue +3 -26
- package/src/css/board.css +40 -0
- package/src/dialogs/CnNoteHistoryDialog.vue +2 -1
- package/src/integrations/builtin/activity/CnActivityCard.vue +3 -2
- package/src/integrations/builtin/activity/CnActivityTab.vue +4 -3
- package/src/integrations/builtin/analytics/CnAnalyticsTab.vue +3 -2
- package/src/integrations/builtin/calendar/CnCalendarCard.vue +2 -1
- package/src/integrations/builtin/calendar/CnCalendarTab.vue +6 -5
- package/src/integrations/builtin/contactmoment/CnContactmomentCard.vue +2 -1
- package/src/integrations/builtin/cospend/CnCospendTab.vue +2 -1
- package/src/integrations/builtin/deck/CnDeckTab.vue +2 -1
- package/src/integrations/builtin/email/CnEmailCard.vue +2 -1
- package/src/integrations/builtin/field-inspection/CnFieldInspectionCard.vue +2 -1
- package/src/integrations/builtin/field-inspection/CnFieldInspectionTab.vue +2 -1
- package/src/integrations/builtin/photos/CnPhotosTab.vue +2 -1
- package/src/schemas/app-manifest-v2.schema.json +4 -1
- package/src/store/useObjectStore.js +7 -2
- package/src/utils/boardColumns.js +49 -0
- package/src/utils/boardReferenceColumns.js +114 -3
- package/src/utils/contentHeaderLink.js +47 -0
- package/src/utils/schema.js +5 -4
- package/src/utils/userLocale.js +26 -0
- package/src/utils/validateManifestV2.compiled.js +2 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { capacityValue } from './boardColumns.js';
|
|
1
2
|
import { prefixUrl, buildQueryString, buildHeaders } from './headers.js';
|
|
2
3
|
import { readPath } from './readPath.js';
|
|
3
4
|
import { schemaRefSlug } from './schemaRefSlug.js';
|
|
@@ -125,7 +126,14 @@ function referenceTargetOf(source, { register = '', property = null } = {}) {
|
|
|
125
126
|
* @param {string} [options.mergeBy] The row field whose equal values make one column.
|
|
126
127
|
* @param {{field: string, rowField: string}|null} [options.narrowBy] The parent link.
|
|
127
128
|
* @param {string} [options.narrowValue] The parent the board is narrowed to, '' for all.
|
|
128
|
-
* @
|
|
129
|
+
* @param {string} [options.capacityField] The numeric row field that holds a column's limit.
|
|
130
|
+
* A column merged from two or more rows shows none: each row has its own limit.
|
|
131
|
+
* @param {string} [options.neutralColor] The colour a row holds when nobody chose one. A merged
|
|
132
|
+
* column then takes its first row colour that is not this one, and this one only when no row
|
|
133
|
+
* has another. Compared as written: "Grey" is not "grey", and a hex value is not a name.
|
|
134
|
+
* @param {object} [options.colorMap] A stored colour to the CSS colour a column is drawn in,
|
|
135
|
+
* applied after the merge. A colour it does not map is kept as stored.
|
|
136
|
+
* @return {{states: Array<{key: string, label: string, color: string, capacity?: (number|null)}>, keyByValue: Map<string, string>, refsByKey: Map<string, Array<object>>}} The stages.
|
|
129
137
|
* @spec openspec/changes/screens-board-reference-columns/specs/board-view/spec.md#requirement-columns-can-be-the-rows-a-field-references
|
|
130
138
|
*/
|
|
131
139
|
function buildReferenceStages({
|
|
@@ -136,6 +144,9 @@ function buildReferenceStages({
|
|
|
136
144
|
mergeBy = '',
|
|
137
145
|
narrowBy = null,
|
|
138
146
|
narrowValue = '',
|
|
147
|
+
capacityField = '',
|
|
148
|
+
neutralColor = '',
|
|
149
|
+
colorMap = null,
|
|
139
150
|
} = {}) {
|
|
140
151
|
const list = (Array.isArray(refs) ? refs : []).filter((ref) => ref && typeof ref === 'object' && refIdOf(ref) !== '');
|
|
141
152
|
const narrowed = narrowBy && narrowBy.field && narrowValue !== ''
|
|
@@ -161,14 +172,114 @@ function buildReferenceStages({
|
|
|
161
172
|
keyByValue.set(id, key);
|
|
162
173
|
if (!refsByKey.has(key)) {
|
|
163
174
|
refsByKey.set(key, []);
|
|
164
|
-
const
|
|
165
|
-
|
|
175
|
+
const state = { key, label, color: colorOfRef(ref, colorField) };
|
|
176
|
+
if (capacityField) {
|
|
177
|
+
state.capacity = capacityOfRef(ref, capacityField);
|
|
178
|
+
}
|
|
179
|
+
states.push(state);
|
|
166
180
|
}
|
|
167
181
|
refsByKey.get(key).push(ref);
|
|
168
182
|
}
|
|
183
|
+
for (const state of states) {
|
|
184
|
+
const rows = refsByKey.get(state.key);
|
|
185
|
+
if (capacityField && rows.length > 1) {
|
|
186
|
+
state.capacity = null;
|
|
187
|
+
}
|
|
188
|
+
if (neutralColor && rows.length > 1) {
|
|
189
|
+
state.color = mergedColumnColor(rows.map((ref) => colorOfRef(ref, colorField)), neutralColor, state.color);
|
|
190
|
+
}
|
|
191
|
+
state.color = mappedColor(state.color, colorMap);
|
|
192
|
+
}
|
|
169
193
|
return { states, keyByValue, refsByKey }
|
|
170
194
|
}
|
|
171
195
|
|
|
196
|
+
/**
|
|
197
|
+
* The colour one referenced row carries.
|
|
198
|
+
*
|
|
199
|
+
* @param {object} ref The referenced row.
|
|
200
|
+
* @param {string} colorField The row field that holds the colour, '' for `color`.
|
|
201
|
+
* @return {string} The colour, '' when it has none.
|
|
202
|
+
*/
|
|
203
|
+
function colorOfRef(ref, colorField) {
|
|
204
|
+
const color = colorField ? readPath(ref, colorField) : ref.color;
|
|
205
|
+
return typeof color === 'string' ? color : ''
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* The colour a column merged from several rows takes when a neutral colour
|
|
210
|
+
* is declared: the first chosen colour, so a row stored with the default
|
|
211
|
+
* never outranks one somebody picked, whatever order the rows come in.
|
|
212
|
+
*
|
|
213
|
+
* @param {Array<string>} colors The rows' colours, in column order.
|
|
214
|
+
* @param {string} neutralColor The colour a row holds when nobody chose one.
|
|
215
|
+
* @param {string} fallback The colour when no row has a chosen or neutral one.
|
|
216
|
+
* @return {string} The column's colour.
|
|
217
|
+
* @spec openspec/changes/board-neutral-column-colour/specs/board-view/spec.md#requirement-a-merged-column-prefers-a-chosen-colour
|
|
218
|
+
*/
|
|
219
|
+
function mergedColumnColor(colors, neutralColor, fallback = '') {
|
|
220
|
+
const chosen = colors.find((color) => color !== '' && color !== neutralColor);
|
|
221
|
+
if (chosen !== undefined) {
|
|
222
|
+
return chosen
|
|
223
|
+
}
|
|
224
|
+
return colors.includes(neutralColor) ? neutralColor : fallback
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* The CSS colour a stored colour maps to, so a palette name such as
|
|
229
|
+
* "orange" or "grey-light" can draw a theme token.
|
|
230
|
+
*
|
|
231
|
+
* @param {string} color The stored colour.
|
|
232
|
+
* @param {object|null} colorMap A stored colour to a CSS colour.
|
|
233
|
+
* @return {string} The mapped colour, else the stored one.
|
|
234
|
+
* @spec openspec/changes/board-column-colour-map/specs/board-view/spec.md#requirement-a-column-colour-can-be-mapped-to-a-css-colour
|
|
235
|
+
*/
|
|
236
|
+
function mappedColor(color, colorMap) {
|
|
237
|
+
if (!colorMap || typeof colorMap !== 'object' || color === '' || !Object.hasOwn(colorMap, color)) {
|
|
238
|
+
return color
|
|
239
|
+
}
|
|
240
|
+
const mapped = colorMap[color];
|
|
241
|
+
return typeof mapped === 'string' && mapped !== '' ? mapped : color
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* The limit one referenced row declares.
|
|
246
|
+
*
|
|
247
|
+
* @param {object} ref The referenced row.
|
|
248
|
+
* @param {string} capacityField The row field that holds the limit.
|
|
249
|
+
* @return {number|null} The limit, or null when it has none.
|
|
250
|
+
* @spec openspec/changes/board-column-capacity/specs/board-view/spec.md#requirement-a-column-can-carry-a-capacity
|
|
251
|
+
*/
|
|
252
|
+
function capacityOfRef(ref, capacityField) {
|
|
253
|
+
return capacityField ? capacityValue(readPath(ref, capacityField)) : null
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Whether a drop fills a referenced row past its limit: the cards that
|
|
258
|
+
* already carry that row, counted against the row's own limit. Counted per
|
|
259
|
+
* row, not per column, so a column merged from several rows still refuses
|
|
260
|
+
* the one that is full.
|
|
261
|
+
*
|
|
262
|
+
* @param {object} options The call.
|
|
263
|
+
* @param {object} options.target The referenced row the drop would write.
|
|
264
|
+
* @param {object} options.card The card being moved.
|
|
265
|
+
* @param {Array<object>} options.rows The cards the board holds.
|
|
266
|
+
* @param {string} options.field The row field the columns come from.
|
|
267
|
+
* @param {string} options.capacityField The referenced row's limit field.
|
|
268
|
+
* @param {string} [options.rowKey] The row key, so the moving card is not counted.
|
|
269
|
+
* @return {{count: number, capacity: number}|null} The count and limit when full, else null.
|
|
270
|
+
* @spec openspec/changes/board-column-capacity/specs/board-view/spec.md#requirement-a-drop-into-a-full-column-is-refused
|
|
271
|
+
*/
|
|
272
|
+
function fullTargetOf({ target, card, rows = [], field, capacityField, rowKey = 'id' } = {}) {
|
|
273
|
+
const capacity = capacityOfRef(target, capacityField);
|
|
274
|
+
if (capacity === null) {
|
|
275
|
+
return null
|
|
276
|
+
}
|
|
277
|
+
const id = refIdOf(target);
|
|
278
|
+
const self = String(card?.[rowKey] ?? '');
|
|
279
|
+
const count = (Array.isArray(rows) ? rows : []).filter((row) => String(row?.[rowKey] ?? '') !== self && refIdOf(readPath(row, field)) === id).length;
|
|
280
|
+
return count >= capacity ? { count, capacity } : null
|
|
281
|
+
}
|
|
282
|
+
|
|
172
283
|
/**
|
|
173
284
|
* The stages of a field with no referenced schema (a user id): the values
|
|
174
285
|
* present on the rows, by label, then one column for no value.
|
|
@@ -274,5 +385,5 @@ async function fetchReferenceObjects({ register, schema, filter = {}, limit = 50
|
|
|
274
385
|
return Array.isArray(data?.results) ? data.results : (Array.isArray(data) ? data : [])
|
|
275
386
|
}
|
|
276
387
|
|
|
277
|
-
export { NO_VALUE_KEY, buildReferenceStages, buildValueStages, columnFieldsOf, columnKeyOfRow, fetchReferenceObjects, refIdOf, referenceTargetOf, resolveDropValue };
|
|
388
|
+
export { NO_VALUE_KEY, buildReferenceStages, buildValueStages, capacityOfRef, columnFieldsOf, columnKeyOfRow, fetchReferenceObjects, fullTargetOf, mappedColor, mergedColumnColor, refIdOf, referenceTargetOf, resolveDropValue };
|
|
278
389
|
//# sourceMappingURL=boardReferenceColumns.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boardReferenceColumns.js","sources":["../../../src/utils/boardReferenceColumns.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V. <info@conduction.nl>\n * SPDX-License-Identifier: EUPL-1.2\n *\n * Board columns from a REFERENCED field (screens-board-reference-columns).\n *\n * A status that is an enum or a lifecycle list carries its stages on the\n * field, and `boardColumns.js` reads them there. A status that is a reference\n * to another object (a case's `status` pointing at a statusType row) carries\n * nothing on the field: the stages are the rows of the referenced schema. This\n * module turns those rows into the same `states` list `stagesOf()` reads, plus\n * the map from a row's raw value (the referenced id) to its column.\n *\n * 🔴 THE COLUMNS ARE STILL THE SCHEMA'S, NOT THE DATA'S. They are the\n * referenced rows, fetched, not the values present on the loaded cards, so an\n * empty stage is still a column to drop a card into. The one exception is a\n * field with no referenced schema at all (a Nextcloud user id): there the\n * values present are all there is, and a \"nobody\" column is always added so\n * work without an owner stays visible and can be dropped back to nobody.\n *\n * 🔴 MERGED COLUMNS RESOLVE PER CARD. Referenced rows are often per parent\n * (every case type has its own \"In behandeling\"). Merged by name they make one\n * column, and a drop must then write the row of THAT card's parent. A column\n * with no row for the card's parent is not a place the card can go, and the\n * drop is refused rather than written to some other parent's row.\n *\n * Pure apart from `fetchReferenceObjects`: no store, no Vue.\n */\n\nimport { buildHeaders, buildQueryString, prefixUrl } from './headers.js'\nimport { readPath } from './readPath.js'\nimport { schemaRefSlug } from './schemaRefSlug.js'\n\n/** The column of cards with no value, for a `values` column field. */\nexport const NO_VALUE_KEY = '__none__'\n\n/**\n * The id a reference value carries: a string as is, an object by its `id`,\n * `uuid` or `@self.id`.\n *\n * @param {unknown} value A reference as a row holds it.\n * @return {string} The id, '' when there is none.\n */\nexport function refIdOf(value) {\n\tif (value === null || value === undefined) {\n\t\treturn ''\n\t}\n\tif (typeof value === 'object') {\n\t\tconst id = value.id ?? value.uuid ?? value['@self']?.id ?? value.value ?? ''\n\t\treturn id === null || id === undefined ? '' : String(id)\n\t}\n\treturn String(value)\n}\n\n/**\n * A value as text: a string or number as is, an object by its name.\n *\n * @param {unknown} value The raw value.\n * @return {string} The text.\n */\nfunction textOf(value) {\n\tif (value === null || value === undefined) {\n\t\treturn ''\n\t}\n\tif (typeof value === 'object') {\n\t\treturn String(value.displayName ?? value.name ?? value.title ?? value.label ?? '').trim()\n\t}\n\treturn String(value).trim()\n}\n\n/**\n * The column fields a board offers, normalised. Without `columnFields` the\n * board has one, its `statusField`, read from the schema as before.\n *\n * @param {object} board The board configuration (manifest `config.board`).\n * @return {Array<{field: string, label: string, source: (object|null), kind: string, readOnly: boolean, moveHandler: string, moveTargetsHandler: string}>} The fields.\n * @spec openspec/changes/screens-board-reference-columns/specs/board-view/spec.md#requirement-a-board-can-switch-the-field-its-columns-come-from\n */\nexport function columnFieldsOf(board) {\n\tconst declared = Array.isArray(board?.columnFields) ? board.columnFields : []\n\treturn declared\n\t\t.map((entry) => (typeof entry === 'string' ? { field: entry } : entry))\n\t\t.filter((entry) => entry && typeof entry.field === 'string' && entry.field !== '')\n\t\t.map((entry) => ({\n\t\t\tfield: entry.field,\n\t\t\tlabel: typeof entry.label === 'string' && entry.label !== '' ? entry.label : entry.field,\n\t\t\tsource: entry.source && typeof entry.source === 'object' ? entry.source : null,\n\t\t\tkind: entry.kind === 'values' ? 'values' : (entry.source ? 'reference' : 'schema'),\n\t\t\treadOnly: entry.readOnly === true,\n\t\t\tmoveHandler: typeof entry.moveHandler === 'string' ? entry.moveHandler : '',\n\t\t\tmoveTargetsHandler: typeof entry.moveTargetsHandler === 'string' ? entry.moveTargetsHandler : '',\n\t\t\tvalueLabels: entry.valueLabels && typeof entry.valueLabels === 'object' ? entry.valueLabels : null,\n\t\t\temptyLabel: typeof entry.emptyLabel === 'string' ? entry.emptyLabel : '',\n\t\t}))\n}\n\n/**\n * The register and schema a reference column reads its rows from: the\n * source's own, else the page's register and the property's `$ref`.\n *\n * @param {object} source The column field's `source`.\n * @param {object} options The context.\n * @param {string} options.register The page's register.\n * @param {object} [options.property] The field's schema property.\n * @return {{register: string, schema: string}} Both, '' when unknown.\n */\nexport function referenceTargetOf(source, { register = '', property = null } = {}) {\n\tconst schema = source?.schema || schemaRefSlug(property?.$ref ?? property?.items?.$ref ?? '')\n\treturn {\n\t\tregister: String(source?.register || register || ''),\n\t\tschema: schema === '' || schema === null || schema === undefined ? '' : String(schema),\n\t}\n}\n\n/**\n * The stages of a referenced field: the referenced rows, narrowed to one\n * parent when asked, ordered, and merged by a field when asked.\n *\n * @param {object} options The call.\n * @param {Array<object>} options.refs The referenced rows.\n * @param {string} [options.labelField] The row field that names a column.\n * @param {string} [options.orderField] The numeric row field the columns are ordered by.\n * @param {string} [options.colorField] The row field that holds the dot colour.\n * @param {string} [options.mergeBy] The row field whose equal values make one column.\n * @param {{field: string, rowField: string}|null} [options.narrowBy] The parent link.\n * @param {string} [options.narrowValue] The parent the board is narrowed to, '' for all.\n * @return {{states: Array<{key: string, label: string, color: string}>, keyByValue: Map<string, string>, refsByKey: Map<string, Array<object>>}} The stages.\n * @spec openspec/changes/screens-board-reference-columns/specs/board-view/spec.md#requirement-columns-can-be-the-rows-a-field-references\n */\nexport function buildReferenceStages({\n\trefs = [],\n\tlabelField = '',\n\torderField = '',\n\tcolorField = '',\n\tmergeBy = '',\n\tnarrowBy = null,\n\tnarrowValue = '',\n} = {}) {\n\tconst list = (Array.isArray(refs) ? refs : []).filter((ref) => ref && typeof ref === 'object' && refIdOf(ref) !== '')\n\tconst narrowed = narrowBy && narrowBy.field && narrowValue !== ''\n\t\t? list.filter((ref) => refIdOf(readPath(ref, narrowBy.field)) === String(narrowValue))\n\t\t: list\n\n\tconst orderOf = (ref) => {\n\t\tconst n = Number(orderField ? readPath(ref, orderField) : NaN)\n\t\treturn Number.isFinite(n) ? n : Number.MAX_SAFE_INTEGER\n\t}\n\tconst ordered = narrowed\n\t\t.map((ref, index) => ({ ref, index }))\n\t\t.sort((a, b) => (orderOf(a.ref) - orderOf(b.ref)) || (a.index - b.index))\n\t\t.map((entry) => entry.ref)\n\n\tconst states = []\n\tconst keyByValue = new Map()\n\tconst refsByKey = new Map()\n\tfor (const ref of ordered) {\n\t\tconst id = refIdOf(ref)\n\t\tconst label = textOf(labelField ? readPath(ref, labelField) : (ref.name ?? ref.title)) || id\n\t\tconst key = mergeBy ? (textOf(readPath(ref, mergeBy)) || id) : id\n\t\tkeyByValue.set(id, key)\n\t\tif (!refsByKey.has(key)) {\n\t\t\trefsByKey.set(key, [])\n\t\t\tconst color = colorField ? readPath(ref, colorField) : ref.color\n\t\t\tstates.push({ key, label, color: typeof color === 'string' ? color : '' })\n\t\t}\n\t\trefsByKey.get(key).push(ref)\n\t}\n\treturn { states, keyByValue, refsByKey }\n}\n\n/**\n * The stages of a field with no referenced schema (a user id): the values\n * present on the rows, by label, then one column for no value.\n *\n * @param {object} options The call.\n * @param {Array<object>} options.rows The rows the list holds.\n * @param {string} options.field The row field.\n * @param {object} [options.valueLabels] Raw value to the label to show.\n * @param {string} [options.emptyLabel] The no-value column's label.\n * @return {{states: Array<{key: string, label: string, color: string}>, keyByValue: Map<string, string>, refsByKey: Map<string, Array<object>>}} The stages.\n * @spec openspec/changes/screens-board-reference-columns/specs/board-view/spec.md#requirement-a-field-without-a-referenced-schema-takes-its-values\n */\nexport function buildValueStages({ rows = [], field = '', valueLabels = null, emptyLabel = 'Nobody' } = {}) {\n\tconst labels = valueLabels && typeof valueLabels === 'object' ? valueLabels : {}\n\tconst seen = new Map()\n\tfor (const row of Array.isArray(rows) ? rows : []) {\n\t\tconst raw = readPath(row, field)\n\t\tconst id = refIdOf(raw)\n\t\tif (id !== '' && !seen.has(id)) {\n\t\t\tseen.set(id, typeof labels[id] === 'string' ? labels[id] : (textOf(raw) || id))\n\t\t}\n\t}\n\tconst states = [...seen.entries()]\n\t\t.sort((a, b) => a[1].localeCompare(b[1]))\n\t\t.map(([key, label]) => ({ key, label, color: '' }))\n\tstates.push({ key: NO_VALUE_KEY, label: emptyLabel, color: '' })\n\tconst keyByValue = new Map(states.map((state) => [state.key, state.key]))\n\tkeyByValue.set('', NO_VALUE_KEY)\n\treturn { states, keyByValue, refsByKey: new Map() }\n}\n\n/**\n * The column a row sits in, under a value-to-column map.\n *\n * @param {object} row The row.\n * @param {string} field The row field.\n * @param {Map<string, string>} keyByValue The value-to-column map.\n * @return {string} The column key, or the raw value when the map has none\n * (which lands the card in the off-board column).\n */\nexport function columnKeyOfRow(row, field, keyByValue) {\n\tconst id = refIdOf(readPath(row, field))\n\treturn keyByValue.has(id) ? keyByValue.get(id) : id\n}\n\n/**\n * What a drop on a column writes for one card: the referenced row of that\n * column which belongs to the card's parent, or null when the column has none\n * (the card cannot go there).\n *\n * @param {object} options The call.\n * @param {object} options.card The card.\n * @param {string} options.toKey The column it was dropped on.\n * @param {string} options.kind `reference` or `values`.\n * @param {Map<string, Array<object>>} [options.refsByKey] The column's rows.\n * @param {{field: string, rowField: string}|null} [options.narrowBy] The parent link.\n * @return {{value: (string|null), target: (object|null)}|null} The value to write and its row, or null.\n * @spec openspec/changes/screens-board-reference-columns/specs/board-view/spec.md#requirement-a-drop-writes-the-reference\n */\nexport function resolveDropValue({ card, toKey, kind, refsByKey = new Map(), narrowBy = null } = {}) {\n\tif (kind === 'values') {\n\t\treturn { value: toKey === NO_VALUE_KEY ? null : String(toKey), target: null }\n\t}\n\tconst candidates = refsByKey.get(String(toKey)) || []\n\tif (candidates.length === 0) {\n\t\treturn null\n\t}\n\tif (narrowBy && narrowBy.field && narrowBy.rowField) {\n\t\tconst parent = refIdOf(readPath(card, narrowBy.rowField))\n\t\tconst match = candidates.find((ref) => refIdOf(readPath(ref, narrowBy.field)) === parent)\n\t\treturn match ? { value: refIdOf(match), target: match } : null\n\t}\n\treturn { value: refIdOf(candidates[0]), target: candidates[0] }\n}\n\n/**\n * Fetch the rows a reference column is built from, one list request.\n *\n * @param {object} options The call.\n * @param {string} options.register The register slug.\n * @param {string} options.schema The schema slug.\n * @param {object} [options.filter] Equality filters, e.g. `{ isFinal: false }`.\n * @param {number} [options.limit] The page size, 500 by default.\n * @return {Promise<Array<object>>} The rows.\n * @spec openspec/changes/screens-board-reference-columns/specs/board-view/spec.md#requirement-columns-can-be-the-rows-a-field-references\n */\nexport async function fetchReferenceObjects({ register, schema, filter = {}, limit = 500 } = {}) {\n\tif (!register || !schema) {\n\t\treturn []\n\t}\n\tconst params = { _limit: limit }\n\tfor (const [key, value] of Object.entries(filter || {})) {\n\t\tif (value !== undefined && value !== null && typeof value !== 'object') {\n\t\t\tparams[key] = typeof value === 'boolean' ? String(value) : value\n\t\t}\n\t}\n\tconst url = prefixUrl(`/apps/openregister/api/objects/${encodeURIComponent(register)}/${encodeURIComponent(schema)}${buildQueryString(params)}`)\n\tconst response = await fetch(url, { headers: buildHeaders() })\n\tif (!response.ok) {\n\t\tthrow new Error(`list returned ${response.status}`)\n\t}\n\tconst data = await response.json()\n\treturn Array.isArray(data?.results) ? data.results : (Array.isArray(data) ? data : [])\n}\n"],"names":[],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;AACY,MAAC,YAAY,GAAG,WAAU;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,OAAO,CAAC,KAAK,EAAE;AAC/B,CAAC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE;AAC5C,EAAE,OAAO,EAAE;AACX,EAAE;AACF,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAChC,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,EAAE,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,KAAK,CAAC,KAAK,IAAI,GAAE;AAC9E,EAAE,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,SAAS,GAAG,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC;AAC1D,EAAE;AACF,CAAC,OAAO,MAAM,CAAC,KAAK,CAAC;AACrB,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,MAAM,CAAC,KAAK,EAAE;AACvB,CAAC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,EAAE;AAC1D,EAAE,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC1E,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,OAAO,KAAK,KAAK,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,MAAK;AACnE,GAAG;AACH,EAAE;AACF,CAAC,MAAM,GAAG,GAAG,SAAS,CAAC,CAAC,+BAA+B,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAC;AACjJ,CAAC,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAC;AAC/D,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;AACnB,EAAE,MAAM,IAAI,KAAK,CAAC,CAAC,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;AACrD,EAAE;AACF,CAAC,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,GAAE;AACnC,CAAC,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,EAAE,CAAC;AACvF;;;;"}
|
|
1
|
+
{"version":3,"file":"boardReferenceColumns.js","sources":["../../../src/utils/boardReferenceColumns.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V. <info@conduction.nl>\n * SPDX-License-Identifier: EUPL-1.2\n *\n * Board columns from a REFERENCED field (screens-board-reference-columns).\n *\n * A status that is an enum or a lifecycle list carries its stages on the\n * field, and `boardColumns.js` reads them there. A status that is a reference\n * to another object (a case's `status` pointing at a statusType row) carries\n * nothing on the field: the stages are the rows of the referenced schema. This\n * module turns those rows into the same `states` list `stagesOf()` reads, plus\n * the map from a row's raw value (the referenced id) to its column.\n *\n * 🔴 THE COLUMNS ARE STILL THE SCHEMA'S, NOT THE DATA'S. They are the\n * referenced rows, fetched, not the values present on the loaded cards, so an\n * empty stage is still a column to drop a card into. The one exception is a\n * field with no referenced schema at all (a Nextcloud user id): there the\n * values present are all there is, and a \"nobody\" column is always added so\n * work without an owner stays visible and can be dropped back to nobody.\n *\n * 🔴 MERGED COLUMNS RESOLVE PER CARD. Referenced rows are often per parent\n * (every case type has its own \"In behandeling\"). Merged by name they make one\n * column, and a drop must then write the row of THAT card's parent. A column\n * with no row for the card's parent is not a place the card can go, and the\n * drop is refused rather than written to some other parent's row.\n *\n * Pure apart from `fetchReferenceObjects`: no store, no Vue.\n */\n\nimport { capacityValue } from './boardColumns.js'\nimport { buildHeaders, buildQueryString, prefixUrl } from './headers.js'\nimport { readPath } from './readPath.js'\nimport { schemaRefSlug } from './schemaRefSlug.js'\n\n/** The column of cards with no value, for a `values` column field. */\nexport const NO_VALUE_KEY = '__none__'\n\n/**\n * The id a reference value carries: a string as is, an object by its `id`,\n * `uuid` or `@self.id`.\n *\n * @param {unknown} value A reference as a row holds it.\n * @return {string} The id, '' when there is none.\n */\nexport function refIdOf(value) {\n\tif (value === null || value === undefined) {\n\t\treturn ''\n\t}\n\tif (typeof value === 'object') {\n\t\tconst id = value.id ?? value.uuid ?? value['@self']?.id ?? value.value ?? ''\n\t\treturn id === null || id === undefined ? '' : String(id)\n\t}\n\treturn String(value)\n}\n\n/**\n * A value as text: a string or number as is, an object by its name.\n *\n * @param {unknown} value The raw value.\n * @return {string} The text.\n */\nfunction textOf(value) {\n\tif (value === null || value === undefined) {\n\t\treturn ''\n\t}\n\tif (typeof value === 'object') {\n\t\treturn String(value.displayName ?? value.name ?? value.title ?? value.label ?? '').trim()\n\t}\n\treturn String(value).trim()\n}\n\n/**\n * The column fields a board offers, normalised. Without `columnFields` the\n * board has one, its `statusField`, read from the schema as before.\n *\n * @param {object} board The board configuration (manifest `config.board`).\n * @return {Array<{field: string, label: string, source: (object|null), kind: string, readOnly: boolean, moveHandler: string, moveTargetsHandler: string}>} The fields.\n * @spec openspec/changes/screens-board-reference-columns/specs/board-view/spec.md#requirement-a-board-can-switch-the-field-its-columns-come-from\n */\nexport function columnFieldsOf(board) {\n\tconst declared = Array.isArray(board?.columnFields) ? board.columnFields : []\n\treturn declared\n\t\t.map((entry) => (typeof entry === 'string' ? { field: entry } : entry))\n\t\t.filter((entry) => entry && typeof entry.field === 'string' && entry.field !== '')\n\t\t.map((entry) => ({\n\t\t\tfield: entry.field,\n\t\t\tlabel: typeof entry.label === 'string' && entry.label !== '' ? entry.label : entry.field,\n\t\t\tsource: entry.source && typeof entry.source === 'object' ? entry.source : null,\n\t\t\tkind: entry.kind === 'values' ? 'values' : (entry.source ? 'reference' : 'schema'),\n\t\t\treadOnly: entry.readOnly === true,\n\t\t\tmoveHandler: typeof entry.moveHandler === 'string' ? entry.moveHandler : '',\n\t\t\tmoveTargetsHandler: typeof entry.moveTargetsHandler === 'string' ? entry.moveTargetsHandler : '',\n\t\t\tvalueLabels: entry.valueLabels && typeof entry.valueLabels === 'object' ? entry.valueLabels : null,\n\t\t\temptyLabel: typeof entry.emptyLabel === 'string' ? entry.emptyLabel : '',\n\t\t}))\n}\n\n/**\n * The register and schema a reference column reads its rows from: the\n * source's own, else the page's register and the property's `$ref`.\n *\n * @param {object} source The column field's `source`.\n * @param {object} options The context.\n * @param {string} options.register The page's register.\n * @param {object} [options.property] The field's schema property.\n * @return {{register: string, schema: string}} Both, '' when unknown.\n */\nexport function referenceTargetOf(source, { register = '', property = null } = {}) {\n\tconst schema = source?.schema || schemaRefSlug(property?.$ref ?? property?.items?.$ref ?? '')\n\treturn {\n\t\tregister: String(source?.register || register || ''),\n\t\tschema: schema === '' || schema === null || schema === undefined ? '' : String(schema),\n\t}\n}\n\n/**\n * The stages of a referenced field: the referenced rows, narrowed to one\n * parent when asked, ordered, and merged by a field when asked.\n *\n * @param {object} options The call.\n * @param {Array<object>} options.refs The referenced rows.\n * @param {string} [options.labelField] The row field that names a column.\n * @param {string} [options.orderField] The numeric row field the columns are ordered by.\n * @param {string} [options.colorField] The row field that holds the dot colour.\n * @param {string} [options.mergeBy] The row field whose equal values make one column.\n * @param {{field: string, rowField: string}|null} [options.narrowBy] The parent link.\n * @param {string} [options.narrowValue] The parent the board is narrowed to, '' for all.\n * @param {string} [options.capacityField] The numeric row field that holds a column's limit.\n * A column merged from two or more rows shows none: each row has its own limit.\n * @param {string} [options.neutralColor] The colour a row holds when nobody chose one. A merged\n * column then takes its first row colour that is not this one, and this one only when no row\n * has another. Compared as written: \"Grey\" is not \"grey\", and a hex value is not a name.\n * @param {object} [options.colorMap] A stored colour to the CSS colour a column is drawn in,\n * applied after the merge. A colour it does not map is kept as stored.\n * @return {{states: Array<{key: string, label: string, color: string, capacity?: (number|null)}>, keyByValue: Map<string, string>, refsByKey: Map<string, Array<object>>}} The stages.\n * @spec openspec/changes/screens-board-reference-columns/specs/board-view/spec.md#requirement-columns-can-be-the-rows-a-field-references\n */\nexport function buildReferenceStages({\n\trefs = [],\n\tlabelField = '',\n\torderField = '',\n\tcolorField = '',\n\tmergeBy = '',\n\tnarrowBy = null,\n\tnarrowValue = '',\n\tcapacityField = '',\n\tneutralColor = '',\n\tcolorMap = null,\n} = {}) {\n\tconst list = (Array.isArray(refs) ? refs : []).filter((ref) => ref && typeof ref === 'object' && refIdOf(ref) !== '')\n\tconst narrowed = narrowBy && narrowBy.field && narrowValue !== ''\n\t\t? list.filter((ref) => refIdOf(readPath(ref, narrowBy.field)) === String(narrowValue))\n\t\t: list\n\n\tconst orderOf = (ref) => {\n\t\tconst n = Number(orderField ? readPath(ref, orderField) : NaN)\n\t\treturn Number.isFinite(n) ? n : Number.MAX_SAFE_INTEGER\n\t}\n\tconst ordered = narrowed\n\t\t.map((ref, index) => ({ ref, index }))\n\t\t.sort((a, b) => (orderOf(a.ref) - orderOf(b.ref)) || (a.index - b.index))\n\t\t.map((entry) => entry.ref)\n\n\tconst states = []\n\tconst keyByValue = new Map()\n\tconst refsByKey = new Map()\n\tfor (const ref of ordered) {\n\t\tconst id = refIdOf(ref)\n\t\tconst label = textOf(labelField ? readPath(ref, labelField) : (ref.name ?? ref.title)) || id\n\t\tconst key = mergeBy ? (textOf(readPath(ref, mergeBy)) || id) : id\n\t\tkeyByValue.set(id, key)\n\t\tif (!refsByKey.has(key)) {\n\t\t\trefsByKey.set(key, [])\n\t\t\tconst state = { key, label, color: colorOfRef(ref, colorField) }\n\t\t\tif (capacityField) {\n\t\t\t\tstate.capacity = capacityOfRef(ref, capacityField)\n\t\t\t}\n\t\t\tstates.push(state)\n\t\t}\n\t\trefsByKey.get(key).push(ref)\n\t}\n\tfor (const state of states) {\n\t\tconst rows = refsByKey.get(state.key)\n\t\tif (capacityField && rows.length > 1) {\n\t\t\tstate.capacity = null\n\t\t}\n\t\tif (neutralColor && rows.length > 1) {\n\t\t\tstate.color = mergedColumnColor(rows.map((ref) => colorOfRef(ref, colorField)), neutralColor, state.color)\n\t\t}\n\t\tstate.color = mappedColor(state.color, colorMap)\n\t}\n\treturn { states, keyByValue, refsByKey }\n}\n\n/**\n * The colour one referenced row carries.\n *\n * @param {object} ref The referenced row.\n * @param {string} colorField The row field that holds the colour, '' for `color`.\n * @return {string} The colour, '' when it has none.\n */\nfunction colorOfRef(ref, colorField) {\n\tconst color = colorField ? readPath(ref, colorField) : ref.color\n\treturn typeof color === 'string' ? color : ''\n}\n\n/**\n * The colour a column merged from several rows takes when a neutral colour\n * is declared: the first chosen colour, so a row stored with the default\n * never outranks one somebody picked, whatever order the rows come in.\n *\n * @param {Array<string>} colors The rows' colours, in column order.\n * @param {string} neutralColor The colour a row holds when nobody chose one.\n * @param {string} fallback The colour when no row has a chosen or neutral one.\n * @return {string} The column's colour.\n * @spec openspec/changes/board-neutral-column-colour/specs/board-view/spec.md#requirement-a-merged-column-prefers-a-chosen-colour\n */\nexport function mergedColumnColor(colors, neutralColor, fallback = '') {\n\tconst chosen = colors.find((color) => color !== '' && color !== neutralColor)\n\tif (chosen !== undefined) {\n\t\treturn chosen\n\t}\n\treturn colors.includes(neutralColor) ? neutralColor : fallback\n}\n\n/**\n * The CSS colour a stored colour maps to, so a palette name such as\n * \"orange\" or \"grey-light\" can draw a theme token.\n *\n * @param {string} color The stored colour.\n * @param {object|null} colorMap A stored colour to a CSS colour.\n * @return {string} The mapped colour, else the stored one.\n * @spec openspec/changes/board-column-colour-map/specs/board-view/spec.md#requirement-a-column-colour-can-be-mapped-to-a-css-colour\n */\nexport function mappedColor(color, colorMap) {\n\tif (!colorMap || typeof colorMap !== 'object' || color === '' || !Object.hasOwn(colorMap, color)) {\n\t\treturn color\n\t}\n\tconst mapped = colorMap[color]\n\treturn typeof mapped === 'string' && mapped !== '' ? mapped : color\n}\n\n/**\n * The limit one referenced row declares.\n *\n * @param {object} ref The referenced row.\n * @param {string} capacityField The row field that holds the limit.\n * @return {number|null} The limit, or null when it has none.\n * @spec openspec/changes/board-column-capacity/specs/board-view/spec.md#requirement-a-column-can-carry-a-capacity\n */\nexport function capacityOfRef(ref, capacityField) {\n\treturn capacityField ? capacityValue(readPath(ref, capacityField)) : null\n}\n\n/**\n * Whether a drop fills a referenced row past its limit: the cards that\n * already carry that row, counted against the row's own limit. Counted per\n * row, not per column, so a column merged from several rows still refuses\n * the one that is full.\n *\n * @param {object} options The call.\n * @param {object} options.target The referenced row the drop would write.\n * @param {object} options.card The card being moved.\n * @param {Array<object>} options.rows The cards the board holds.\n * @param {string} options.field The row field the columns come from.\n * @param {string} options.capacityField The referenced row's limit field.\n * @param {string} [options.rowKey] The row key, so the moving card is not counted.\n * @return {{count: number, capacity: number}|null} The count and limit when full, else null.\n * @spec openspec/changes/board-column-capacity/specs/board-view/spec.md#requirement-a-drop-into-a-full-column-is-refused\n */\nexport function fullTargetOf({ target, card, rows = [], field, capacityField, rowKey = 'id' } = {}) {\n\tconst capacity = capacityOfRef(target, capacityField)\n\tif (capacity === null) {\n\t\treturn null\n\t}\n\tconst id = refIdOf(target)\n\tconst self = String(card?.[rowKey] ?? '')\n\tconst count = (Array.isArray(rows) ? rows : []).filter((row) => String(row?.[rowKey] ?? '') !== self && refIdOf(readPath(row, field)) === id).length\n\treturn count >= capacity ? { count, capacity } : null\n}\n\n/**\n * The stages of a field with no referenced schema (a user id): the values\n * present on the rows, by label, then one column for no value.\n *\n * @param {object} options The call.\n * @param {Array<object>} options.rows The rows the list holds.\n * @param {string} options.field The row field.\n * @param {object} [options.valueLabels] Raw value to the label to show.\n * @param {string} [options.emptyLabel] The no-value column's label.\n * @return {{states: Array<{key: string, label: string, color: string}>, keyByValue: Map<string, string>, refsByKey: Map<string, Array<object>>}} The stages.\n * @spec openspec/changes/screens-board-reference-columns/specs/board-view/spec.md#requirement-a-field-without-a-referenced-schema-takes-its-values\n */\nexport function buildValueStages({ rows = [], field = '', valueLabels = null, emptyLabel = 'Nobody' } = {}) {\n\tconst labels = valueLabels && typeof valueLabels === 'object' ? valueLabels : {}\n\tconst seen = new Map()\n\tfor (const row of Array.isArray(rows) ? rows : []) {\n\t\tconst raw = readPath(row, field)\n\t\tconst id = refIdOf(raw)\n\t\tif (id !== '' && !seen.has(id)) {\n\t\t\tseen.set(id, typeof labels[id] === 'string' ? labels[id] : (textOf(raw) || id))\n\t\t}\n\t}\n\tconst states = [...seen.entries()]\n\t\t.sort((a, b) => a[1].localeCompare(b[1]))\n\t\t.map(([key, label]) => ({ key, label, color: '' }))\n\tstates.push({ key: NO_VALUE_KEY, label: emptyLabel, color: '' })\n\tconst keyByValue = new Map(states.map((state) => [state.key, state.key]))\n\tkeyByValue.set('', NO_VALUE_KEY)\n\treturn { states, keyByValue, refsByKey: new Map() }\n}\n\n/**\n * The column a row sits in, under a value-to-column map.\n *\n * @param {object} row The row.\n * @param {string} field The row field.\n * @param {Map<string, string>} keyByValue The value-to-column map.\n * @return {string} The column key, or the raw value when the map has none\n * (which lands the card in the off-board column).\n */\nexport function columnKeyOfRow(row, field, keyByValue) {\n\tconst id = refIdOf(readPath(row, field))\n\treturn keyByValue.has(id) ? keyByValue.get(id) : id\n}\n\n/**\n * What a drop on a column writes for one card: the referenced row of that\n * column which belongs to the card's parent, or null when the column has none\n * (the card cannot go there).\n *\n * @param {object} options The call.\n * @param {object} options.card The card.\n * @param {string} options.toKey The column it was dropped on.\n * @param {string} options.kind `reference` or `values`.\n * @param {Map<string, Array<object>>} [options.refsByKey] The column's rows.\n * @param {{field: string, rowField: string}|null} [options.narrowBy] The parent link.\n * @return {{value: (string|null), target: (object|null)}|null} The value to write and its row, or null.\n * @spec openspec/changes/screens-board-reference-columns/specs/board-view/spec.md#requirement-a-drop-writes-the-reference\n */\nexport function resolveDropValue({ card, toKey, kind, refsByKey = new Map(), narrowBy = null } = {}) {\n\tif (kind === 'values') {\n\t\treturn { value: toKey === NO_VALUE_KEY ? null : String(toKey), target: null }\n\t}\n\tconst candidates = refsByKey.get(String(toKey)) || []\n\tif (candidates.length === 0) {\n\t\treturn null\n\t}\n\tif (narrowBy && narrowBy.field && narrowBy.rowField) {\n\t\tconst parent = refIdOf(readPath(card, narrowBy.rowField))\n\t\tconst match = candidates.find((ref) => refIdOf(readPath(ref, narrowBy.field)) === parent)\n\t\treturn match ? { value: refIdOf(match), target: match } : null\n\t}\n\treturn { value: refIdOf(candidates[0]), target: candidates[0] }\n}\n\n/**\n * Fetch the rows a reference column is built from, one list request.\n *\n * @param {object} options The call.\n * @param {string} options.register The register slug.\n * @param {string} options.schema The schema slug.\n * @param {object} [options.filter] Equality filters, e.g. `{ isFinal: false }`.\n * @param {number} [options.limit] The page size, 500 by default.\n * @return {Promise<Array<object>>} The rows.\n * @spec openspec/changes/screens-board-reference-columns/specs/board-view/spec.md#requirement-columns-can-be-the-rows-a-field-references\n */\nexport async function fetchReferenceObjects({ register, schema, filter = {}, limit = 500 } = {}) {\n\tif (!register || !schema) {\n\t\treturn []\n\t}\n\tconst params = { _limit: limit }\n\tfor (const [key, value] of Object.entries(filter || {})) {\n\t\tif (value !== undefined && value !== null && typeof value !== 'object') {\n\t\t\tparams[key] = typeof value === 'boolean' ? String(value) : value\n\t\t}\n\t}\n\tconst url = prefixUrl(`/apps/openregister/api/objects/${encodeURIComponent(register)}/${encodeURIComponent(schema)}${buildQueryString(params)}`)\n\tconst response = await fetch(url, { headers: buildHeaders() })\n\tif (!response.ok) {\n\t\tthrow new Error(`list returned ${response.status}`)\n\t}\n\tconst data = await response.json()\n\treturn Array.isArray(data?.results) ? data.results : (Array.isArray(data) ? data : [])\n}\n"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AACY,MAAC,YAAY,GAAG,WAAU;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,OAAO,CAAC,KAAK,EAAE;AAC/B,CAAC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE;AAC5C,EAAE,OAAO,EAAE;AACX,EAAE;AACF,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAChC,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,EAAE,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,KAAK,CAAC,KAAK,IAAI,GAAE;AAC9E,EAAE,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,SAAS,GAAG,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC;AAC1D,EAAE;AACF,CAAC,OAAO,MAAM,CAAC,KAAK,CAAC;AACrB,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,MAAM,CAAC,KAAK,EAAE;AACvB,CAAC,IAAI,KAAK,KAAK,IAAI,IAAI,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,CAAC,IAAI,GAAE;AACnC,CAAC,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,EAAE,CAAC;AACvF;;;;"}
|
|
@@ -47,5 +47,52 @@ function contentHeaderLink(content) {
|
|
|
47
47
|
return link
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
/**
|
|
51
|
+
* The header link a widget DEFINITION declares: `headerLink` on the
|
|
52
|
+
* definition itself, else what its content asks for (see contentHeaderLink).
|
|
53
|
+
*
|
|
54
|
+
* @param {object|null|undefined} widget A widget definition.
|
|
55
|
+
* @return {{label: string, route?: string, params?: object, query?: object, href?: string}|null}
|
|
56
|
+
*/
|
|
57
|
+
function widgetHeaderLink(widget) {
|
|
58
|
+
if (!widget || typeof widget !== 'object') {
|
|
59
|
+
return null
|
|
60
|
+
}
|
|
61
|
+
const declared = widget.headerLink;
|
|
62
|
+
if (declared && typeof declared === 'object' && typeof declared.label === 'string' && declared.label !== '') {
|
|
63
|
+
return declared
|
|
64
|
+
}
|
|
65
|
+
return contentHeaderLink(widget.content)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* How to draw a header link: the tag and its attributes. A `route` is a
|
|
70
|
+
* `router-link` (only when a router is mounted), an `href` a plain anchor.
|
|
71
|
+
* An empty tag means there is nothing usable to draw.
|
|
72
|
+
*
|
|
73
|
+
* @param {object|null|undefined} link A link `{ label, route?, params?, query?, href? }`.
|
|
74
|
+
* @param {boolean} hasRouter Whether a router is mounted.
|
|
75
|
+
* @return {{tag: string, attrs: object}}
|
|
76
|
+
*/
|
|
77
|
+
function headerLinkTarget(link, hasRouter) {
|
|
78
|
+
if (!link || typeof link.label !== 'string' || link.label === '') {
|
|
79
|
+
return { tag: '', attrs: {} }
|
|
80
|
+
}
|
|
81
|
+
if (link.route && hasRouter) {
|
|
82
|
+
const to = { name: link.route };
|
|
83
|
+
if (link.params && typeof link.params === 'object') {
|
|
84
|
+
to.params = link.params;
|
|
85
|
+
}
|
|
86
|
+
if (link.query && typeof link.query === 'object') {
|
|
87
|
+
to.query = link.query;
|
|
88
|
+
}
|
|
89
|
+
return { tag: 'router-link', attrs: { to } }
|
|
90
|
+
}
|
|
91
|
+
if (typeof link.href === 'string' && link.href !== '') {
|
|
92
|
+
return { tag: 'a', attrs: { href: link.href } }
|
|
93
|
+
}
|
|
94
|
+
return { tag: '', attrs: {} }
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export { contentHeaderLink, headerLinkTarget, widgetHeaderLink };
|
|
51
98
|
//# sourceMappingURL=contentHeaderLink.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contentHeaderLink.js","sources":["../../../src/utils/contentHeaderLink.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V.\n * SPDX-License-Identifier: EUPL-1.2\n *\n * contentHeaderLink — the text link a widget's content asks its card header\n * to carry: `content.headerLink`, or the shorter `viewAllRoute` (with an\n * optional `viewAllLabel`) that an inbox-style widget uses for its \"View all\".\n *\n * @module utils/contentHeaderLink\n */\n\n/**\n * The header link a widget's `content` declares, in the shape\n * CnWidgetWrapper's `headerLink` takes, or null when it declares none.\n * The label is left as written: the wrapper translates it.\n *\n * `viewAllRoute` is a route name, or a location `{ name, params?, query? }`.\n *\n * @param {object|null|undefined} content The widget's content.\n * @return {{label: string, route?: string, params?: object, query?: object, href?: string}|null}\n */\nexport function contentHeaderLink(content) {\n\tif (!content || typeof content !== 'object') {\n\t\treturn null\n\t}\n\tconst declared = content.headerLink\n\tif (declared && typeof declared === 'object' && typeof declared.label === 'string' && declared.label !== '') {\n\t\treturn declared\n\t}\n\tconst view = content.viewAllRoute\n\tconst name = typeof view === 'string' ? view : (view && typeof view === 'object' ? view.name : '')\n\tif (typeof name !== 'string' || name === '') {\n\t\treturn null\n\t}\n\tconst link = {\n\t\tlabel: typeof content.viewAllLabel === 'string' && content.viewAllLabel !== '' ? content.viewAllLabel : 'View all',\n\t\troute: name,\n\t}\n\tif (view && typeof view === 'object') {\n\t\tif (view.params && typeof view.params === 'object') {\n\t\t\tlink.params = view.params\n\t\t}\n\t\tif (view.query && typeof view.query === 'object') {\n\t\t\tlink.query = view.query\n\t\t}\n\t}\n\treturn link\n}\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,iBAAiB,CAAC,OAAO,EAAE;AAC3C,CAAC,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;AAC9C,EAAE,OAAO,IAAI;AACb,EAAE;AACF,CAAC,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAU;AACpC,CAAC,IAAI,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,OAAO,QAAQ,CAAC,KAAK,KAAK,QAAQ,IAAI,QAAQ,CAAC,KAAK,KAAK,EAAE,EAAE;AAC9G,EAAE,OAAO,QAAQ;AACjB,EAAE;AACF,CAAC,MAAM,IAAI,GAAG,OAAO,CAAC,aAAY;AAClC,CAAC,MAAM,IAAI,GAAG,OAAO,IAAI,KAAK,QAAQ,GAAG,IAAI,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,GAAG,IAAI,CAAC,IAAI,GAAG,EAAE,EAAC;AACnG,CAAC,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,EAAE,EAAE;AAC9C,EAAE,OAAO,IAAI;AACb,EAAE;AACF,CAAC,MAAM,IAAI,GAAG;AACd,EAAE,KAAK,EAAE,OAAO,OAAO,CAAC,YAAY,KAAK,QAAQ,IAAI,OAAO,CAAC,YAAY,KAAK,EAAE,GAAG,OAAO,CAAC,YAAY,GAAG,UAAU;AACpH,EAAE,KAAK,EAAE,IAAI;AACb,GAAE;AACF,CAAC,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;AACvC,EAAE,IAAI,IAAI,CAAC,MAAM,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ,EAAE;AACtD,GAAG,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,OAAM;AAC5B,GAAG;AACH,EAAE,IAAI,IAAI,CAAC,KAAK,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,EAAE;AACpD,GAAG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAK;AAC1B,GAAG;AACH,EAAE;AACF,CAAC,OAAO,IAAI;AACZ;;;;"}
|
|
1
|
+
{"version":3,"file":"contentHeaderLink.js","sources":["../../../src/utils/contentHeaderLink.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V.\n * SPDX-License-Identifier: EUPL-1.2\n *\n * contentHeaderLink — the text link a widget's content asks its card header\n * to carry: `content.headerLink`, or the shorter `viewAllRoute` (with an\n * optional `viewAllLabel`) that an inbox-style widget uses for its \"View all\".\n *\n * @module utils/contentHeaderLink\n */\n\n/**\n * The header link a widget's `content` declares, in the shape\n * CnWidgetWrapper's `headerLink` takes, or null when it declares none.\n * The label is left as written: the wrapper translates it.\n *\n * `viewAllRoute` is a route name, or a location `{ name, params?, query? }`.\n *\n * @param {object|null|undefined} content The widget's content.\n * @return {{label: string, route?: string, params?: object, query?: object, href?: string}|null}\n */\nexport function contentHeaderLink(content) {\n\tif (!content || typeof content !== 'object') {\n\t\treturn null\n\t}\n\tconst declared = content.headerLink\n\tif (declared && typeof declared === 'object' && typeof declared.label === 'string' && declared.label !== '') {\n\t\treturn declared\n\t}\n\tconst view = content.viewAllRoute\n\tconst name = typeof view === 'string' ? view : (view && typeof view === 'object' ? view.name : '')\n\tif (typeof name !== 'string' || name === '') {\n\t\treturn null\n\t}\n\tconst link = {\n\t\tlabel: typeof content.viewAllLabel === 'string' && content.viewAllLabel !== '' ? content.viewAllLabel : 'View all',\n\t\troute: name,\n\t}\n\tif (view && typeof view === 'object') {\n\t\tif (view.params && typeof view.params === 'object') {\n\t\t\tlink.params = view.params\n\t\t}\n\t\tif (view.query && typeof view.query === 'object') {\n\t\t\tlink.query = view.query\n\t\t}\n\t}\n\treturn link\n}\n\n/**\n * The header link a widget DEFINITION declares: `headerLink` on the\n * definition itself, else what its content asks for (see contentHeaderLink).\n *\n * @param {object|null|undefined} widget A widget definition.\n * @return {{label: string, route?: string, params?: object, query?: object, href?: string}|null}\n */\nexport function widgetHeaderLink(widget) {\n\tif (!widget || typeof widget !== 'object') {\n\t\treturn null\n\t}\n\tconst declared = widget.headerLink\n\tif (declared && typeof declared === 'object' && typeof declared.label === 'string' && declared.label !== '') {\n\t\treturn declared\n\t}\n\treturn contentHeaderLink(widget.content)\n}\n\n/**\n * How to draw a header link: the tag and its attributes. A `route` is a\n * `router-link` (only when a router is mounted), an `href` a plain anchor.\n * An empty tag means there is nothing usable to draw.\n *\n * @param {object|null|undefined} link A link `{ label, route?, params?, query?, href? }`.\n * @param {boolean} hasRouter Whether a router is mounted.\n * @return {{tag: string, attrs: object}}\n */\nexport function headerLinkTarget(link, hasRouter) {\n\tif (!link || typeof link.label !== 'string' || link.label === '') {\n\t\treturn { tag: '', attrs: {} }\n\t}\n\tif (link.route && hasRouter) {\n\t\tconst to = { name: link.route }\n\t\tif (link.params && typeof link.params === 'object') {\n\t\t\tto.params = link.params\n\t\t}\n\t\tif (link.query && typeof link.query === 'object') {\n\t\t\tto.query = link.query\n\t\t}\n\t\treturn { tag: 'router-link', attrs: { to } }\n\t}\n\tif (typeof link.href === 'string' && link.href !== '') {\n\t\treturn { tag: 'a', attrs: { href: link.href } }\n\t}\n\treturn { tag: '', attrs: {} }\n}\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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C,KAAK,GAAG,IAAI,CAAC,MAAK;AACxB,GAAG;AACH,EAAE,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE;AAC9C,EAAE;AACF,CAAC,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,KAAK,EAAE,EAAE;AACxD,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE;AACjD,EAAE;AACF,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;AAC9B;;;;"}
|
package/dist/esm/utils/schema.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { schemaRefSlug } from './schemaRefSlug.js';
|
|
2
|
+
import { userLocale } from './userLocale.js';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Schema utility functions for auto-generating table columns, cell formatting,
|
|
@@ -160,7 +161,7 @@ function formatValue(value, property = {}, options = {}) {
|
|
|
160
161
|
if (Number.isNaN(num)) {
|
|
161
162
|
return String(value)
|
|
162
163
|
}
|
|
163
|
-
return num.toLocaleString()
|
|
164
|
+
return num.toLocaleString(userLocale())
|
|
164
165
|
}
|
|
165
166
|
|
|
166
167
|
// Array
|
|
@@ -214,17 +215,17 @@ function formatValue(value, property = {}, options = {}) {
|
|
|
214
215
|
return str
|
|
215
216
|
}
|
|
216
217
|
if (format === 'date') {
|
|
217
|
-
return date.toLocaleDateString(
|
|
218
|
+
return date.toLocaleDateString(userLocale(), {
|
|
218
219
|
day: '2-digit',
|
|
219
220
|
month: '2-digit',
|
|
220
221
|
year: 'numeric',
|
|
221
222
|
})
|
|
222
223
|
}
|
|
223
|
-
return date.toLocaleDateString(
|
|
224
|
+
return date.toLocaleDateString(userLocale(), {
|
|
224
225
|
day: '2-digit',
|
|
225
226
|
month: '2-digit',
|
|
226
227
|
year: 'numeric',
|
|
227
|
-
}) + ', ' + date.toLocaleTimeString(
|
|
228
|
+
}) + ', ' + date.toLocaleTimeString(userLocale(), {
|
|
228
229
|
hour: '2-digit',
|
|
229
230
|
minute: '2-digit',
|
|
230
231
|
second: '2-digit',
|