@conduction/nextcloud-vue

中文文档
2.180.0发布于 2026/11/07EUPL-1.2TypeScriptESM + CJS构建来源已验证近 30 天下载 10万

Shared Vue component library for Conduction Nextcloud apps — complements @nextcloud/vue with higher-level components, OpenRegister integration, and NL Design System support

原始使用文档
文档目录21 节
  1. Features
  2. Layout & Page Components
  3. Data Display
  4. Single-Object Dialogs
  5. Mass-Action Dialogs
  6. Settings & Config
  7. State Management
  8. Composables
  9. Schema Utilities
  10. Architecture
  11. Two-Phase Dialog Pattern
  12. Schema-Driven Components
  13. Installation
  14. Markdown sanitization (CnRoadmapItem / CnSuggestFeatureModa…
  15. Webpack Alias (for local development)
  16. Directory Structure
  17. Development
  18. Tech Stack
  19. Icon sets & licensing
  20. License
  21. Authors

@conduction/nextcloud-vue logo

@conduction/nextcloud-vue

Shared Vue 2 component library for Conduction Nextcloud apps — higher-level UI, OpenRegister integration, and NL Design System support

npm version License Code quality


@conduction/nextcloud-vue is an npm component library that sits on top of @nextcloud/vue and provides higher-level, opinionated components for building Nextcloud apps. It handles the repetitive patterns — schema-driven tables, CRUD dialogs, paginated lists, faceted search — so each app only writes the domain-specific parts.

Used internally by Pipelinq, Dossiq, Larpinq, and other Conduction Nextcloud apps.

Requires: Vue 2.7, Pinia 2, @nextcloud/vue 8

Features

Layout & Page Components

ComponentDescription
CnIndexPageZero-config index page with table/card views, built-in CRUD dialogs, pagination, mass actions, and faceted search
CnPageHeaderPage header with icon, title, and description
CnActionsBarAction bar with add button, mass action triggers, view toggle (table/grid), and search
CnIndexSidebarSidebar for index pages

Data Display

ComponentDescription
CnDataTableSortable table with multi-select, schema-driven columns, loading states, and empty states
CnCardGridResponsive card grid for object summaries
CnObjectCardSingle object card with title, metadata, and actions
CnCellRendererType-aware cell formatter for strings, numbers, dates, objects, arrays, and booleans
CnFacetSidebarFaceted filter sidebar with aggregated count buckets
CnPaginationFull pagination with page numbers, size selector, and "go to page"
CnFilterBarSearch input with filter controls
CnKpiGridKPI metric cards for statistics dashboards

Single-Object Dialogs

ComponentDescription
CnFormDialogSchema-driven form dialog for create and edit; auto-generates fields from JSON Schema
CnDeleteDialogDelete confirmation with two-phase confirm/result pattern
CnCopyDialogCopy dialog with naming pattern selector

Mass-Action Dialogs

ComponentDescription
CnMassDeleteDialogBulk delete confirmation
CnMassCopyDialogBulk copy with per-item naming
CnMassExportDialogExport selected items (JSON, CSV, …)
CnMassImportDialogBulk import with file upload and format detection

Settings & Config

ComponentDescription
CnSettingsCardCollapsible settings card with save state
CnSettingsSectionContainer for grouping settings
CnConfigurationCardConfiguration card with status indicator
CnVersionInfoCardVersion information display
CnStatsBlockStatistics block with count and breakdown
CnRegisterMappingRegister-to-field mapping configuration

State Management

ExportDescription
useObjectStore(id)Generic Pinia store for OpenRegister CRUD — pagination, search, caching
createObjectStore(id)Factory for custom-scoped object stores
createSubResourcePlugin(name)Plugin factory for sub-resource management
auditTrailsPluginAdds audit trail state and getters
relationsPluginManages object relations/associations
filesPluginHandles file attachments and uploads
lifecyclePluginTracks lifecycle states (draft, published, archived)
registerMappingPluginManages register-to-field mappings

Composables

ComposableDescription
useListView(options)Manages list view state: search debounce, filter state, sort, pagination
useDetailView(options)Manages detail view: load, edit, delete, validation
useSubResource(options)Manages sub-resource operations

Schema Utilities

FunctionDescription
columnsFromSchema(schema)Auto-generate data table column definitions from JSON Schema
fieldsFromSchema(schema)Auto-generate form field definitions from JSON Schema
filtersFromSchema(schema)Auto-generate filter definitions from JSON Schema
formatValue(value, format)Type-aware cell value formatter

Architecture

graph TD
    A[Nextcloud App] -->|imports| B[@conduction/nextcloud-vue]
    B --> C[Components]
    B --> D[useObjectStore]
    B --> E[Composables]
    B --> F[Schema Utils]
    D -->|CRUD| G[OpenRegister REST API]
    C -->|styles via| H[Nextcloud CSS Variables]
    C -->|NL Design tokens| I[--nldesign-* CSS vars]

Two-Phase Dialog Pattern

All dialogs follow a predictable confirm/result flow that keeps parent components in control of API calls:

// 1. Dialog emits @confirm with user input
// 2. Parent handles API call
// 3. Parent calls dialog.setResult(response) via $ref
// 4. Dialog shows toast and auto-closes

Schema-Driven Components

Pass a JSON Schema and get a fully working table or form with zero configuration:

<CnIndexPage
  :schema="caseTypeSchema"
  :objects="caseTypes"
  @save="onSave"
  @delete="onDelete"
/>

Installation

npm install @conduction/nextcloud-vue

Import the CSS alongside your component imports:

import '@conduction/nextcloud-vue/dist/nextcloud-vue.css'
import { CnIndexPage, useObjectStore } from '@conduction/nextcloud-vue'

Markdown sanitization (CnRoadmapItem / CnSuggestFeatureModal)

The Features & Roadmap component family (CnRoadmapItem, CnSuggestFeatureModal) renders untrusted markdown coming from GitHub issue bodies and user input. Both components pipe the markdown through marked and then through DOMPurify using the exported SAFE_MARKDOWN_DOMPURIFY_CONFIG constant — <script>, on* handlers, javascript: URLs, <iframe>, and <style> are stripped before v-html.

Both marked and dompurify are declared in this library's dependencies and ship in the consumer's bundle. Apps that already pin different versions can add their own constraints — the strict config is what matters, not the exact dependency version. The minimum compatible versions are documented in package.json (marked ^15, dompurify ^3).

Webpack Alias (for local development)

When developing against the source directly, add deduplication aliases in webpack.config.js to prevent dual-instance bugs:

config.resolve.alias = {
  '@conduction/nextcloud-vue': path.resolve(__dirname, '../nextcloud-vue/src'),
  'vue': path.resolve(__dirname, 'node_modules/vue'),
  'pinia': path.resolve(__dirname, 'node_modules/pinia'),
  '@nextcloud/vue': path.resolve(__dirname, 'node_modules/@nextcloud/vue'),
}

Important: Without these aliases, webpack may resolve Vue and Pinia from the library's node_modules, creating dual instances that break reactivity and state management.

Directory Structure

nextcloud-vue/
├── src/
│   ├── index.js              # Main barrel export
│   ├── components/           # 30+ Vue 2 SFCs (one directory each)
│   │   ├── CnIndexPage/
│   │   ├── CnDataTable/
│   │   ├── CnFormDialog/
│   │   └── ...
│   ├── store/
│   │   ├── index.js          # useObjectStore, createObjectStore
│   │   └── plugins/          # auditTrails, relations, files, lifecycle, registerMapping
│   ├── composables/          # useListView, useDetailView, useSubResource
│   ├── utils/                # schema, headers, errors, formatting
│   ├── css/                  # Modular CSS (one file per component group)
│   └── types/index.d.ts      # TypeScript definitions
├── tests/                    # Jest test suite
├── dist/                     # Built output (ESM, CJS, CSS)
├── rollup.config.js          # Build configuration
└── package.json

Development

npm install
npm run dev       # Watch mode (Rollup)
npm run build     # Production build
npm test          # Jest tests
npm run lint      # ESLint
npm run stylelint # Stylelint

Tech Stack

LayerTechnology
FrameworkVue 2.7 (Options API)
StatePinia 2
BuildRollup 3
CSSPostCSS (extracted to dist/nextcloud-vue.css)
TestingJest 29, @vue/test-utils 1
QualityESLint (@nextcloud/eslint-config), Stylelint
Releasesemantic-release (automated npm publish)

Icon sets & licensing

CnIconPicker can present icons from Material Design Icons (MDI), FontAwesome, and the OpenGemeenten governmental icon set. This library bundles no icon pack. It ships only the capability — the picker UI plus the fromMdiJs / fromFontAwesome / fromOpenGemeenten catalogue adapters. You bring the icon data:

import { fromFontAwesome, fromOpenGemeenten } from '@conduction/nextcloud-vue'
import { fas } from '@fortawesome/free-solid-svg-icons'

<CnIconPicker
  v-model="icon"
  searchable
  :sources="['mdi', 'fontawesome', 'opengemeenten']"
  :catalogues="{
    fontawesome: fromFontAwesome({ fas }),
    opengemeenten: fromOpenGemeenten(myOpenGemeentenIcons),
  }" />

You are responsible for confirming that you are licensed to use FontAwesome and the OpenGemeenten package in your own use case. Passing a pack through the adapters grants no rights — this library provides only the ability to render icons you have obtained and licensed yourself. Attribution is due to the respective projects.

License

EUPL-1.2

Authors

Built by Conduction — open-source software for Dutch government and public sector organizations.

版本与发布记录

@conduction/nextcloud-vue 共发布 690 个版本,首次发布于 2026/02/27;过去 12 个月发布了 690 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
2.180.0latest2026/11/073 天前
2.56.0-beta.76beta2026/11/073 天前
2.179.02026/11/064 天前
2.56.0-beta.752026/11/064 天前
2.56.0-beta.742026/11/055 天前
2.178.02026/11/055 天前

其他发布通道:vue3 → 2.55.1,beta → 2.56.0-beta.76。

关于 @conduction/nextcloud-vue 的常见问题

@conduction/nextcloud-vue 是什么?

Shared Vue component library for Conduction Nextcloud apps — complements @nextcloud/vue with higher-level components, OpenRegister integration, and NL Design System support

如何安装 @conduction/nextcloud-vue?

在项目目录运行 npm install @conduction/nextcloud-vue,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:vue(^3.5.0)、dexie(^4.0.8)、pinia(^2.0.0 || ^3.0.0 || ^4.0.0)、marked(>=12 <19)、dompurify(^3.0.0)、gridstack(^12.0.0 || ^13.0.0)、@vueuse/core(^11.0.0 || ^14.0.0)、@nextcloud/vue(^9.0.0)、@nextcloud/auth(^2.0.0 || ^3.0.0)、@nextcloud/l10n(^2.0.0 || ^3.0.0)、@nextcloud/axios(^2.0.0)、@nextcloud/router(^2.0.0 || ^3.0.0)、@nextcloud/capabilities(^1.2.1)、@nextcloud/initial-state(^2.2.0 || ^3.0.0)、vue-material-design-icons(^5.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。它还提供命令行工具 manifest-migrate,可以用 npx manifest-migrate 直接运行。

@conduction/nextcloud-vue 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@conduction/nextcloud-vue 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@conduction/nextcloud-vue 可以商用吗?

@conduction/nextcloud-vue 使用 EUPL-1.2 许可。声明的许可为 EUPL-1.2,请阅读许可原文确认使用条件。以上为概括,不构成法律意见,请以许可原文为准。

@conduction/nextcloud-vue 的下载量有多少?

根据 npm 官方下载统计,@conduction/nextcloud-vue 在 2026/10/11 – 2026/11/09 这 30 天内被下载 100,070 次,日均约 3,336 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@conduction/nextcloud-vue 还在维护吗?

最新版本 2.180.0 发布于 2026/11/07(3 天前);至今共发布 690 个版本,其中过去 12 个月发布了 690 个;首次发布于 2026/02/27。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。