Documents
Description
Documents is the Enso UI frontend package for the laravel-enso/documents backend package. It provides Vue Router route groups, Bulma pages, table screens, backend-driven forms, template editing, type PDF upload UI, signature request monitoring, document browsing, and a reusable requirements component.
The package stays generic. Application-owned links, filters, local business actions, and document generation endpoints belong in the consuming application.
Installation
Install the package from the GitLab repository:
yarn add git+ssh://git@git.xtelecom.ro/enso-ui/documents.git#1.0.3
Register the route groups in the consuming application router:
import { administration, documents } from '@enso-ui/documents';
routes.push(administration, documents);
The backend companion package must be installed and migrated separately:
composer require laravel-enso/documents
php artisan migrate
Features
- Administration pages for document categories, types, fields, partials, and templates.
- Type edit page support for static PDF model upload and deletion.
- Fields page that works standalone or filtered from a type through the
typequery parameter. - Template editor powered by backend forms and
@enso-ui/wysiwyg. - Placeholder catalogue panel for template editing.
- Partials management for headers, footers, and body snippets.
- Root document archive table.
- Signature request monitoring table.
Requirementscomponent for rendering backend-calculated requirements.- Pinia store for backend-provided document types and categories.
- FontAwesome icon registration for package routes and actions.
Usage
Route Groups
The package exports two route groups:
import { administration, documents } from '@enso-ui/documents';
administration registers the administration/documents parent route and these children:
administration.documents.categories.indexadministration.documents.categories.createadministration.documents.categories.editadministration.documents.types.indexadministration.documents.types.createadministration.documents.types.editadministration.documents.fields.indexadministration.documents.fields.createadministration.documents.fields.editadministration.documents.partials.indexadministration.documents.partials.createadministration.documents.partials.editadministration.documents.templates.indexadministration.documents.templates.createadministration.documents.templates.edit
documents registers the root documents parent route and these children:
documents.indexdocuments.signatureRequests.index
The default export returns both groups:
import documentRoutes from '@enso-ui/documents';
Pages
The package ships page modules under src/bulma/pages:
administration/documents/categories: index, create, edit.administration/documents/types: index, create, edit, type file upload component.administration/documents/fields: index, create, edit.administration/documents/partials: index, create, edit.administration/documents/templates: index, create, edit, base form, placeholders panel.documents: document archive index.documents/signatureRequests: signature request index.
Requirements Component
Applications can import and render the requirements component directly:
<template>
<requirements :requirements="requirements"/>
</template>
<script setup>
import { Requirements } from '@enso-ui/documents';
</script>
The component accepts the normalized requirements array returned by local application endpoints that use LaravelEnso\Documents\Services\Requirements. It also accepts legacy object-shaped input where keys map to boolean validity.
Field Tables
The Fields page uses the backend table id document_type_fields. It displays field definitions owned by document types. Values for concrete documents are backend records in document_field_values and are intentionally not managed through this administration page.
API
Exports
- default export:
[administration, documents] - named export
administration - named export
documents - named export
Requirements
Backend Companion
The backend companion provides routes, permissions, menus, form builders, table builders, state, models, PDF generation, placeholder resolution, requirements checking, and signature request lifecycle handling.
Depends On
@enso-ui/files@enso-ui/forms@enso-ui/select@enso-ui/tables@enso-ui/ui@enso-ui/uploader@enso-ui/users@enso-ui/wysiwyg@fortawesome/vue-fontawesomepiniavuevue-router