diff --git a/src/components/CnContextMenu/CnContextMenu.vue b/src/components/CnContextMenu/CnContextMenu.vue index 56e2752..887251c 100644 --- a/src/components/CnContextMenu/CnContextMenu.vue +++ b/src/components/CnContextMenu/CnContextMenu.vue @@ -88,7 +88,7 @@ export default { * a native tooltip — useful for explaining why an entry is disabled. * When the entire array is empty (or all entries are filtered out), only * the default slot content is rendered. - * @type {Array<{label: string, icon?: object, handler?: Function, disabled?: boolean | Function, visible?: boolean | Function, title?: string | Function, destructive?: boolean}>} + * @type {Array<{label: string, icon: object, handler: Function, disabled: boolean | Function, visible: boolean | Function, title: string | Function, destructive: boolean}>} */ actions: { type: Array, diff --git a/src/components/CnDashboardPage/CnDashboardPage.vue b/src/components/CnDashboardPage/CnDashboardPage.vue index e72fc8e..1c2c7b6 100644 --- a/src/components/CnDashboardPage/CnDashboardPage.vue +++ b/src/components/CnDashboardPage/CnDashboardPage.vue @@ -207,8 +207,7 @@ export default { * Custom widgets: `{ id: 'my-widget', title: 'My Widget', type: 'custom' }` * NC API widgets: `{ id: 'calendar', title: 'Calendar', itemApiVersions: [1,2], ... }` * Tile widgets: `{ id: 'tile-files', type: 'tile', title: 'Files', icon: 'M12...', iconType: 'svg', backgroundColor: '#0082c9', textColor: '#fff', linkType: 'app', linkValue: 'files' }` - * - * @type {Array<{ id: string, title: string, type?: string, iconUrl?: string, iconClass?: string, buttons?: Array, itemApiVersions?: number[], reloadInterval?: number, [key: string]: any }>} + * @type {Array<{ id: string, title: string, type: string, iconUrl: string, iconClass: string, buttons: Array, itemApiVersions: number[], reloadInterval: number }>} */ widgets: { type: Array, @@ -220,8 +219,7 @@ export default { * Each item: `{ id: 'unique-id', widgetId: 'my-widget', gridX: 0, gridY: 0, gridWidth: 4, gridHeight: 3 }` * * Additional properties (showTitle, styleConfig, tile config) are passed through. - * - * @type {Array<{ id: string|number, widgetId: string, gridX: number, gridY: number, gridWidth: number, gridHeight: number, showTitle?: boolean, styleConfig?: object, [key: string]: any }>} + * @type {Array<{ id: string|number, widgetId: string, gridX: number, gridY: number, gridWidth: number, gridHeight: number, showTitle: boolean, styleConfig: object }>} */ layout: { type: Array, diff --git a/src/components/CnDataTable/CnDataTable.vue b/src/components/CnDataTable/CnDataTable.vue index 94ab8d2..a9ef253 100644 --- a/src/components/CnDataTable/CnDataTable.vue +++ b/src/components/CnDataTable/CnDataTable.vue @@ -162,7 +162,7 @@ export default { /** * Column definitions (manual mode). * Not required when `schema` is provided. - * @type {Array<{key: string, label: string, sortable?: boolean, width?: string, class?: string, cellClass?: string}>} + * @type {Array<{key: string, label: string, sortable: boolean, width: string, class: string, cellClass: string}>} */ columns: { type: Array, diff --git a/src/components/CnDependencyMissing/CnDependencyMissing.vue b/src/components/CnDependencyMissing/CnDependencyMissing.vue index 1611a96..2685827 100644 --- a/src/components/CnDependencyMissing/CnDependencyMissing.vue +++ b/src/components/CnDependencyMissing/CnDependencyMissing.vue @@ -50,8 +50,7 @@ export default { * set; otherwise the default Nextcloud apps page is used * - `enabled` discriminates the link label: `false` means the * app is installed but disabled; otherwise it's not installed - * - * @type {Array<{id: string, name?: string, installUrl?: string, enabled?: boolean}>} + * @type {Array<{id: string, name: string, installUrl: string, enabled: boolean}>} */ dependencies: { type: Array, diff --git a/src/components/CnDetailGrid/CnDetailGrid.vue b/src/components/CnDetailGrid/CnDetailGrid.vue index ee3fc21..564a8e6 100644 --- a/src/components/CnDetailGrid/CnDetailGrid.vue +++ b/src/components/CnDetailGrid/CnDetailGrid.vue @@ -89,7 +89,7 @@ export default { props: { /** * Array of detail items to render. - * @type {Array<{ label: string, value?: string|number }>} + * @type {Array<{ label: string, value: string|number }>} */ items: { type: Array, diff --git a/src/components/CnDetailPage/CnDetailPage.vue b/src/components/CnDetailPage/CnDetailPage.vue index 7e2ee5b..66779f0 100644 --- a/src/components/CnDetailPage/CnDetailPage.vue +++ b/src/components/CnDetailPage/CnDetailPage.vue @@ -366,8 +366,7 @@ export default { /** * Column definitions for the statistics table. * Each column: `{ key: string, label: string, align?: 'left'|'center'|'right' }` - * - * @type {Array<{ key: string, label: string, align?: string }>} + * @type {Array<{ key: string, label: string, align: string }>} */ statsColumns: { type: Array, diff --git a/src/components/CnFilterBar/CnFilterBar.md b/src/components/CnFilterBar/CnFilterBar.md index 10a4d2c..65dde32 100644 --- a/src/components/CnFilterBar/CnFilterBar.md +++ b/src/components/CnFilterBar/CnFilterBar.md @@ -70,7 +70,7 @@ export default { methods: { onFilterChange({ key, value }) { if (key === 'status') { - this.activeStatus = value?.value || null + this.activeStatus = (value && value.value) || null this.filters[0].value = value } if (key === 'active') { diff --git a/src/components/CnFilterBar/CnFilterBar.vue b/src/components/CnFilterBar/CnFilterBar.vue index da51c38..13f086e 100644 --- a/src/components/CnFilterBar/CnFilterBar.vue +++ b/src/components/CnFilterBar/CnFilterBar.vue @@ -100,8 +100,9 @@ export default { props: { /** - * Filter definitions. - * @type {Array<{key: string, label: string, type: 'select'|'text'|'checkbox', options?: Array, value?: *}>} + * Filter definitions. Each item has `key`, `label`, `type` ('select'|'text'|'checkbox'), + * optional `options` (for select), and optional `value`. + * @type {Array<{key: string, label: string, type: 'select'|'text'|'checkbox', options: Array, value: any}>} */ filters: { type: Array, @@ -145,7 +146,7 @@ export default { onFilterChange(key, value) { /** * @event filter-change Emitted when any filter changes. - * @type {{ key: string, value: * }} + * @type {{ key: string, value: any }} */ this.$emit('filter-change', { key, value }) }, diff --git a/src/components/CnObjectDataWidget/CnObjectDataWidget.vue b/src/components/CnObjectDataWidget/CnObjectDataWidget.vue index c49731d..97c8439 100644 --- a/src/components/CnObjectDataWidget/CnObjectDataWidget.vue +++ b/src/components/CnObjectDataWidget/CnObjectDataWidget.vue @@ -330,8 +330,7 @@ export default { * - `editable` (boolean) — Override editability (default: based on schema readOnly) * - `label` (string) — Override the display label * - `widget` (string) — Override the widget type for editing - * - * @type {{ [key: string]: { order?: number, gridColumn?: number, gridRow?: number, hidden?: boolean, editable?: boolean, label?: string, widget?: string } }} + * @type {object} */ overrides: { type: Object, diff --git a/src/components/CnRegisterMapping/CnRegisterMapping.vue b/src/components/CnRegisterMapping/CnRegisterMapping.vue index 36b358b..85b3070 100644 --- a/src/components/CnRegisterMapping/CnRegisterMapping.vue +++ b/src/components/CnRegisterMapping/CnRegisterMapping.vue @@ -230,7 +230,7 @@ export default { }, /** * Groups of object types that share a register. - * @type {Array<{ name: string, description?: string, registerConfigKey?: string, types: Array<{ slug: string, label: string, description?: string, configKey?: string }> }>} + * @type {Array<{ name: string, description: string, registerConfigKey: string, types: Array<{ slug: string, label: string, description: string, configKey: string }> }>} */ groups: { type: Array, diff --git a/src/components/CnRowActions/CnRowActions.vue b/src/components/CnRowActions/CnRowActions.vue index 9abbafc..64023e0 100644 --- a/src/components/CnRowActions/CnRowActions.vue +++ b/src/components/CnRowActions/CnRowActions.vue @@ -54,8 +54,7 @@ export default { * - `visible` (boolean | (row) => boolean) — when `false`, hide the entry from the menu (default: shown) * - `title` (string | (row) => string) — native tooltip shown on hover (useful to explain why an entry is disabled) * - `destructive` (boolean) — apply error color styling - * - * @type {Array<{label: string, icon?: object, handler: Function, disabled?: boolean | Function, visible?: boolean | Function, title?: string | Function, destructive?: boolean}>} + * @type {Array<{label: string, icon: object, handler: Function, disabled: boolean | Function, visible: boolean | Function, title: string | Function, destructive: boolean}>} */ actions: { type: Array, diff --git a/src/components/CnTabbedFormDialog/CnTabbedFormDialog.vue b/src/components/CnTabbedFormDialog/CnTabbedFormDialog.vue index bd1280c..deea12d 100644 --- a/src/components/CnTabbedFormDialog/CnTabbedFormDialog.vue +++ b/src/components/CnTabbedFormDialog/CnTabbedFormDialog.vue @@ -137,8 +137,7 @@ export default { * Array of tab definitions. Each tab must have at least an `id` and `title`. * The optional `icon` field should be a Vue component reference (e.g. an imported MDI icon). * The optional `disabled` field prevents tab selection. - * - * @type {Array<{ id: string, title: string, icon?: object, disabled?: boolean }>} + * @type {Array<{ id: string, title: string, icon: object, disabled: boolean }>} */ tabs: { type: Array, @@ -276,8 +275,7 @@ export default { /** * Result of the last operation. * null = form phase, { success: true } = success, { error: 'msg' } = error - * - * @type {{ success?: boolean, error?: string }|null} + * @type {{ success: boolean, error: string }|null} */ result: null, /** @type {number|null} Timeout ID for auto-close after success */ diff --git a/src/components/CnTableWidget/CnTableWidget.vue b/src/components/CnTableWidget/CnTableWidget.vue index badc14a..607593c 100644 --- a/src/components/CnTableWidget/CnTableWidget.vue +++ b/src/components/CnTableWidget/CnTableWidget.vue @@ -101,8 +101,7 @@ export default { }, /** * Column definitions for CnDataTable. - * - * @type {{ key: string, label: string, sortable?: boolean }[]} + * @type {{ key: string, label: string, sortable: boolean }[]} */ columns: { type: Array, diff --git a/src/components/CnTileWidget/CnTileWidget.vue b/src/components/CnTileWidget/CnTileWidget.vue index 169171c..8ece5b3 100644 --- a/src/components/CnTileWidget/CnTileWidget.vue +++ b/src/components/CnTileWidget/CnTileWidget.vue @@ -59,7 +59,7 @@ export default { props: { /** * Tile configuration object. - * @type {{ title: string, icon: string, iconType: 'svg'|'class'|'url'|'emoji', backgroundColor?: string, textColor?: string, linkType: 'app'|'url', linkValue: string }} + * @type {{ title: string, icon: string, iconType: 'svg'|'class'|'url'|'emoji', backgroundColor: string, textColor: string, linkType: 'app'|'url', linkValue: string }} */ tile: { type: Object, diff --git a/src/components/CnTimelineStages/CnTimelineStages.vue b/src/components/CnTimelineStages/CnTimelineStages.vue index 6f8daa2..3144ca5 100644 --- a/src/components/CnTimelineStages/CnTimelineStages.vue +++ b/src/components/CnTimelineStages/CnTimelineStages.vue @@ -104,7 +104,7 @@ export default { /** * Array of stage objects. Each must have `id` (unique) and `label` (display text). * Optional `subtitle` for secondary text below the label. - * @type {{ id: string, label: string, subtitle?: string }[]} + * @type {{ id: string, label: string, subtitle: string }[]} */ stages: { type: Array, diff --git a/src/components/CnWidgetRenderer/CnWidgetRenderer.vue b/src/components/CnWidgetRenderer/CnWidgetRenderer.vue index d5c4667..5a795fa 100644 --- a/src/components/CnWidgetRenderer/CnWidgetRenderer.vue +++ b/src/components/CnWidgetRenderer/CnWidgetRenderer.vue @@ -71,7 +71,7 @@ export default { props: { /** * Nextcloud widget object from the Dashboard API. - * @type {{ id: string, title: string, iconClass?: string, iconUrl?: string, widgetUrl?: string, itemIconsRound?: boolean, itemApiVersions?: number[], reloadInterval?: number, buttons?: Array }} + * @type {{ id: string, title: string, iconClass: string, iconUrl: string, widgetUrl: string, itemIconsRound: boolean, itemApiVersions: number[], reloadInterval: number, buttons: Array }} */ widget: { type: Object, diff --git a/src/components/CnWidgetWrapper/CnWidgetWrapper.vue b/src/components/CnWidgetWrapper/CnWidgetWrapper.vue index 2341b8c..7ceb862 100644 --- a/src/components/CnWidgetWrapper/CnWidgetWrapper.vue +++ b/src/components/CnWidgetWrapper/CnWidgetWrapper.vue @@ -150,7 +150,7 @@ export default { }, /** * Style configuration for the wrapper. - * @type {{ backgroundColor?: string, borderStyle?: string, borderWidth?: number, borderColor?: string, borderRadius?: number, padding?: { top: number, right: number, bottom: number, left: number } }} + * @type {{ backgroundColor: string, borderStyle: string, borderWidth: number, borderColor: string, borderRadius: number, padding: { top: number, right: number, bottom: number, left: number } }} */ styleConfig: { type: Object, diff --git a/styleguide/styleguide.config.js b/styleguide/styleguide.config.js index d529f5f..1d9ff82 100644 --- a/styleguide/styleguide.config.js +++ b/styleguide/styleguide.config.js @@ -46,6 +46,14 @@ module.exports = { exampleMode: 'collapse', pagePerSection: true, + // Buble (live-example transpiler) config: pass async/await and object spread through natively. + compilerConfig: { + objectAssign: 'Object.assign', + transforms: { + asyncAwait: false, + }, + }, + // Build output — relative to this styleguide/ directory styleguideDir: 'build',