@molecule/app-audit-log-row-vue
Feature · audit-log-row · App (browser) · v1.1.1 · Apache-2.0
Audit / error / event-log row: actor + action + object + timestamp + old/new values
npm install @molecule/app-audit-log-row-vueHow it works
@molecule/app-audit-log-row-vue is a ready-made audit-log-row feature for the app (browser) side. It composes the core interfaces it needs, so it works with whichever providers your app has bonded.
import { createApp, defineComponent, h } from 'vue'
import { AuditLogRow } from '@molecule/app-audit-log-row-vue'
const App = defineComponent({
setup() {
return () =>
h(AuditLogRow, {
entry: {
id: 'evt-001',
actor: 'alice@example.com',
action: 'updated',
target: 'Invoice #1042',
timestamp: '2 min ago',
oldValue: 'Draft',
newValue: 'Sent',
},
onClick: () => openDetail('evt-001'),
})
},
})
createApp(App).mount('#app')Works with: @molecule/app-ui, @molecule/app-ui-vue, @molecule/app-vue
Reference
Vue audit / activity / event-log row.
Exports <AuditLogRow> and the AuditLogEntry type — the Vue counterpart
of @molecule/app-audit-log-row-react: the same props (React names) and the
same DOM for the same input.
Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit
src/index.tsJSDoc, not this file.
Quick Start
import { createApp, defineComponent, h } from 'vue'
import { AuditLogRow } from '@molecule/app-audit-log-row-vue'
const App = defineComponent({
setup() {
return () =>
h(AuditLogRow, {
entry: {
id: 'evt-001',
actor: 'alice@example.com',
action: 'updated',
target: 'Invoice #1042',
timestamp: '2 min ago',
oldValue: 'Draft',
newValue: 'Sent',
},
onClick: () => openDetail('evt-001'),
})
},
})
createApp(App).mount('#app')
Type
feature
Installation
npm install @molecule/app-audit-log-row-vue @molecule/app-ui @molecule/app-ui-vue @molecule/app-vue vue
API
Interfaces
AuditLogEntry
Shape of a single audit / activity log entry displayed by AuditLogRow.
interface AuditLogEntry {
id: string
/** Actor name or id (React's `ReactNode`: any Vue node child). */
actor: VNodeChild
/** Verb describing what happened ("updated", "deleted", "assigned"). */
action: VNodeChild
/** Target object / record. */
target?: VNodeChild
/** Pre-formatted display timestamp (rendered verbatim — format before passing, e.g. "2 min ago"). */
timestamp: VNodeChild
/** Optional summary field for delta display — old + new values. */
oldValue?: VNodeChild
newValue?: VNodeChild
/** Environment / source badge. */
environment?: VNodeChild
/** Optional trace or correlation id. */
traceId?: VNodeChild
}
AuditLogRowProps
Props accepted by the AuditLogRow component.
interface AuditLogRowProps {
/** The entry to display. */
entry: AuditLogEntry
/** Called when the row is clicked. */
onClick?: () => void
/** Extra classes. */
className?: string
}
Constants
AuditLogRow
One audit / activity / event-log row. Shape: [actor] [action] [target] · [timestamp] with an optional [old → new] diff line and environment/trace
metadata. With onClick the row is promoted to a real button in the a11y
tree (role="button", tabindex="0") and Enter / Space activate it,
matching native button keyboard semantics.
const AuditLogRow: DefineComponent<
ExtractPropTypes<{
entry: { type: PropType<AuditLogRowProps['entry']>; required: true }
onClick: { type: PropType<() => void>; default: undefined }
className: { type: StringConstructor; default: undefined }
}>,
() => VNode,
{},
{},
{},
ComponentOptionsMixin,
ComponentOptionsMixin,
{},
string,
PublicProps,
Readonly<
ExtractPropTypes<{
entry: { type: PropType<AuditLogRowProps['entry']>; required: true }
onClick: { type: PropType<() => void>; default: undefined }
className: { type: StringConstructor; default: undefined }
}>
> &
Readonly<{}>,
{ onClick: () => void; className: string },
{},
{},
{},
string,
ComponentProvideOptions,
true,
{},
any
>
props— Component props (seeAuditLogRowProps).
Returns: The audit log row component.
Injection Notes
Requirements
Peer dependencies:
@molecule/app-ui^1.0.1@molecule/app-ui-vue^1.1.0@molecule/app-vue^3.5.0 || ^4.0.0vue^3.4.0
Runtime Dependencies
-
@molecule/app-ui -
@molecule/app-ui-vue -
@molecule/app-vue -
vue -
Requires a bonded ClassMap — rendering throws otherwise.
-
entryfields are display nodes: pass pre-formatted, translated values. A Vue node (vnode, template ref render) works anywhere a string does. -
With
onClickthe row carriesrole="button"+tabindex="0"and Enter / Space activate it, like a native button; without it the row is static.