JavaScript exports
datum-form. and datum-builder. are ES modules. Importing one defines its elements and gives you the names below. datum-builder. exports everything datum-form. does, so a page that loads the builder needs no second import. The classic scripts, datum-form. and datum-builder., expose the same names as window. and window.. Two more modules define nothing when they load: datum-engine., the runtime with no element, and datum-pdf., the PDF kernel. Their names are under The engine file and The PDF file.
import { plugins, createFormRuntime, defineDataSources } from "./datum-form.js";Types are listed beside the values they describe. The engine's own types are exported here too, so one import gives a page its typings.
The form element
| Name | What it is | Page |
|---|---|---|
DATUM_ | The tag name, "datum-form". | The form element |
Datum, define | The element's class, and the function that defines it. Importing the module has already defined it. | The form element |
Datum, define | The inner <datum-form-renderer> element and its definer. | The form element |
Types Datum, Datum, Datum, Datum, Datum, Datum, Datum, Datum, Datum, Datum, Datum, Datum, Datum, Datum, Binding | The detail of each event. | Event details |
Types Datum, Datum, Datum, Datum, Datum, Datum, Datum | Types of the element's properties and method results. | The form element |
to | Checks that a value is a definition and returns it typed; throws a located reason when it is not. | Definition |
Running a form without the element
create builds the engine's runtime for a definition, with no element and no page. It is the entry for a test or a shell of your own. datum-form. needs a DOM when it loads; where there is none, import the same names from datum-engine..
import { createFormRuntime } from "./datum-form.js";
const runtime = createFormRuntime(definition, { dataSources });
runtime.setValue("fullName", "Ada");
const errors = await runtime.validate();| Name | What it is |
|---|---|
create | Builds a Form. config is a Form: data sources, translations, component definitions, plugins, a draft store, a sandbox host, signing providers, a journey choice, the formula error and risky pattern policies, and today. |
Form | The runtime class: values, validation, submission, drafts, locale, journeys, events. The element hands the same object out as datum-ready's detail. and form.. |
Form | The type of config. |
EMBED_, EMBED_ | The submission mode the element runs ("embed") and the runtime and renderer version it records in an envelope ("1.). |
version | The version an envelope carries for a definition. See Submissions and replies. |
Form | The names of the runtime's events, such as Form, for runtime.. Each is the same string as its key, and a plain string subscribes too. Types Form and Form describe what a listener is given. |
Validation, create | The validation stages a runtime runs, and the stage that checks a field's own constraints. For a runtime built by hand. |
create | A component registry over the standard catalogue, plugin components and your own. |
create | A resolver for where uploaded files are kept, over your own storages plus the built-in base64 one. |
Form, Form, Host, Component, Component, Component, Builder | The definition, error and component types. Form and Host are described under Event details and Setting errors and notices. |
Translation, Validation, Locale | The types of the host's translation and message objects, and of a language the switcher offers. See Languages. |
The engine on its own shows the runtime in use and says which names are stable. The runtime's other methods are the engine's own surface and are not described on this site; prefer the element where you can.
Data sources
| Name | What it is | Page |
|---|---|---|
define | Builds one data source set from lists, functions and provider objects. The data property does the same for an object. | Data |
Data, Data | The types of the object it takes and the set it returns. | Data |
with | Adds the data sources plugins carry behind a set. |
Plugins and components
| Name | What it is | Page |
|---|---|---|
plugins | The page's shared plugin registry. plugins. installs a plugin for every form on the page. | Custom components |
create, create | A registry of your own, and the platform that installs plugins into a runtime. | |
plugin, unique | The component definitions of a list of plugins, and a list without duplicates. | |
Form, Datum, Plugin, Register, Plugin | The plugin and registry types. | |
standard, standard, merge | The standard catalogue, its type names, and a merge of catalogues where a later type replaces an earlier one. | Custom components |
standard, css, palette | What a component type of your own builds its inspector and palette entry from. | Custom components |
Design-system bindings and the Datum look
| Name | What it is | Page |
|---|---|---|
bindings | The registry of bindings by id: register, from, get, assets, list and subscribe. | Bindings, Writing a binding |
extend | A binding with some parts replaced or wrapped. | Writing a binding |
create, compose | The Datum binding with its tokens, dark set, frames, parts and controls set, and a function that lays option sets over one another. | Look and chrome |
ASSETS_ | The name of the Trusted Types policy a binding's script addresses are set through. A page that enforces Trusted Types lists it. | Security headers |
Types Live, Live, Binding, Binding, Datum, Datum, Datum, Datum, Datum, Datum, Datum, Adapter, Chrome | The binding and option types. | Writing a binding |
Themes
| Name | What it is | Page |
|---|---|---|
themes | The registry of builder and PDF themes. | |
builder | The builder's theme registry (themes.). | Customising the builder |
pdf | The PDF theme registry (themes.). | PDFs |
create | A theme registry of your own. | |
DEFAULT_, DEFAULT_, PDF_, PDF_, BUILDER_ | The default ids, and the registered lists. | |
resolve, resolve | Turn an id or a definition into the theme it names. | |
Types Pdf, Pdf, Pdf, Builder, Builder, Registered, Register, Datum, Datum, Datum | The registry types. |
Print
| Name | What it is | Page |
|---|---|---|
datum, basic | The print themes Datum ships. | |
PRINT_ | The Trusted Types policy a print theme's HTML is set through. | |
Types Print, Print, Print, Print, Print, Print, Print, Print, Print, Print, Print, Print, Print, Print, Print, Print, Print, Print, Print, Print, Safe | What a print theme of your own is written against. |
Icons
| Name | What it is | Page |
|---|---|---|
set, default | Register and read the icon set the builder draws with. | Customising the builder |
svg, markup | Build an icon set from SVG glyphs or from markup. | Customising the builder |
BUILTIN_, DATUM_, is, render, ICON_ | The built-in set, the list of names a set draws, a check for one, one glyph from a set with the built-in drawing as fallback, and the class the fallback carries. | Customising the builder |
Types Icon, Datum, Icon, Svg | The icon types. |
Journeys
| Name | What it is | Page |
|---|---|---|
load | Starts loading the journeys file ahead of the first journey form. It shares one load with the element. A failed load rejects, and the next call asks again. | Journeys |
create, Journey | The validator that posts a journey's checks to a URL in the body a Datum host's POST /api/ takes, as validate-url does, and the error it throws for an HTTP failure. | Journeys |
load | Loads the checker that reports what will not work in a definition's journeys, which debug uses. | Journeys |
Types Journey, Journey, Journey, Journey, Journey, Journey, Journey, Journey, Journey, Journey, Fetch, Diagnose, Page | The journey types. | Journeys |
Features and drafts
| Name | What it is | Page |
|---|---|---|
FORM_, FORM_, parse | The feature names, the presets (all, minimal), and the parser of a features value. | Leaving parts out |
Types Form, Form, Parsed | The feature types. | |
create, parse | The server draft store that draft-store="server:<url>" builds, and the parser of that value. For a page that builds one itself, to assign as draft. | Drafts |
Draft | The parsed value's type. | |
serialize, parse | The draft as JSON with its keys in a stable order, and the check that reads such a file back into a draft. Use them for a draft file the person downloads and uploads. | Drafts |
Type Form | The shape of a draft. |
Loading the optional files
| Name | What it is | Page |
|---|---|---|
load, resolve | Load the PDF file and resolve its address. | PDFs |
render | A runtime's form as a PDF, with no element: loads datum-pdf. on its first call and runs its render. options. is the file's address, "auto" (beside the bundle) when left out. | The engine on its own |
load, resolve | Load the sandbox file and resolve its address. | Validation |
Wasm | The sandbox host class. | Validation |
Types Datum, Render, Create, Wasm, Wasm, Wasm, Wasm, Wasm | Their types. |
Signing
| Name | What it is | Page |
|---|---|---|
create, register, request | The passkey signing provider, and the registration and assertion ceremonies. | Signing |
verify, verify, verify | Verify a signed submission, an assertion and a registration. | Signing |
Web, describe | The error class of a failed ceremony, and a function that words one. | Signing |
signal, signal, signal, signal | The browser's Signal API helpers, which tell the browser what the server accepts. | Signing |
canonicalize, signed, signed | The canonical text of a value (RFC 8785), the text a signature covers, and the text one delivered signature covers. | Submissions and replies |
create, agent, list, DEFAULT_, Pdf | The hardware-token PDF signer: build one, build one for a listed certificate, list what the token holds, the agent's default address, and its error class. | Signing |
Types Canonical, Signature, Signed, Signing, Submission, Submission, Submission, Web, Web, Web, Web, Assertion, Registration, Pdf, Pdf, Pdf, Pdf, Pdf, Pdf | The signing and envelope types. | Signing, Submissions and replies |
The engine file
datum-engine. is the runtime with no element. It touches no DOM when it loads, so a web worker, a test runner and Node import it as they are. It draws nothing: there is no element, renderer or binding in it. The journeys runtime is in it, so a form with journeys walks page by page here as it does in <datum-form>. The engine on its own shows it in use.
import { createFormRuntime, FormEventType } from "./datum-engine.js";| Name | What it is |
|---|---|
create, Form, Form, create, EMBED_, EMBED_, version | The runtime, as under Running a form without the element. Here create builds every runtime with the journeys runtime. |
Eager | The journeys runtime itself, which create passes for you. Pass it as journey to a Form you build with new. |
JOURNEY_ | "$end", the route target that ends a journey. |
create, Journey | A journey that posts each check to a Datum host, and the error it rejects with for a status that is no verdict. See Checking between pages on the server. |
Form | The runtime's event names. Types Form and Form. |
standard, standard, merge, standard, css, palette | The standard catalogue's definitions: types, defaults and what each validates. Not the drawing, which is the element's. |
plugins, create, create, plugin, unique, with | The plugin registry and its helpers, as in datum-form.. A page that loads both files has one registry. |
define | One data source set from lists, functions and providers. |
Validation, create, create | The validation stages and the file storage resolver. |
canonicalize, signed, signed | The envelope's canonical text: see Submissions and replies. |
serialize, parse | The draft file: see Drafts. |
plain, HOST_, HOST_ | The check the element runs on host: the value as plain data, with what was left out. |
to | Checks that a value is a definition and returns it typed. |
Types Form, Form, Host, Component, Component, Component, Builder, Translation, Validation, Locale, Form, Plugin, Datum, Plugin, Register, Data, Data, Draft, Form, Plain, Canonical, Signed, Signing, Submission, Submission, Submission, Submission, Journey, Journey, Journey, Journey, Journey, Journey, Journey, Journey, Page, Journey, Journey, Journey, Journey, Journey, Journey, Journey, Journey, Resolved, Journey, Journey, Journey, Journey, Journey, Page, Page, Journey, Journey, Fetch, Wasm, Wasm, Wasm, Wasm | The types that go with them. |
A form with journeys opens as its journey. next, previous, go, journey and the page's server checks work as the element's do: see Walking a journey. The journey's drawing is not in the file.
The PDF file
datum-pdf. is the PDF kernel and its fonts. The element loads it with pdf="auto"; a script can import it too, in a page or in Node.
| Name | What it is | Page |
|---|---|---|
render | A runtime's form as a PDF: the bytes and the result <datum-form>'s render gives for the same answers, language, layout and theme. The options are the element's, with four more for its properties: support, theme (an id or a theme), templates and binding. | The engine on its own |
create | The kernel with its fonts loaded, the value pdf and render's support take. fonts is where the fonts are, fonts/ beside the file by default. | PDFs |
create, load, create, create, compose, DEFAULT_ | The parts create is made of, for a support of your own. | PDFs |
Types Datum, Create, Render | Their types. |
The builder (datum-builder.js only)
| Name | What it is | Page |
|---|---|---|
DATUM_, Datum, define | The <datum-form-builder> tag, class and definer. | The builder element |
DATUM_, Datum, define | The <datum-pdf-designer> tag, class and definer. | The PDF designer element |
Datum, define | The builder the other two build on, and its definer. | The builder element |
form | What the builder's own Open refuses beyond to, so a page's own Open can refuse the same files with the same reasons. | Embedding the builder |
BUILDER_, BUILDER_, parse, normalize | The builder's feature list, presets, parser and normaliser. | Embedding the builder |
BUILDER_ | The names of the builder's workspaces. | The builder element |
BUILDER_, adopt | The styles of the controls a host places beside the builder, and the function that adopts them into a document. | Embedding the builder |
create | Builds a resolver that finds the PDF file of a template. | PDFs |
JOURNEY_, load, load | The journeys mode's name, and the loaders of the journeys and PDF modes, which are separate files of the module build. | |
Types Datum (Change, File, Save, Mode, Workspace, Dirty, Binding), Datum, Datum, Datum, Datum, Datum, Datum, Datum | The detail of the builder and designer events. | The builder element |
Types Datum, Builder, Builder, Builder, Builder, Builder, Builder, Builder, Builder, Builder, Builder, Builder, Builder, Builder, Datum, Datum, Datum, New | The builder's option and command types. | The builder element |
Types Journey, Journey, Journey, Journey, Journey, Journey, Journey, Journey, Journey, New, Pdf, Pdf, Pdf, Pdf, Pdf, Pdf | The journeys and PDF modes' types. |
The engine package is private and ships no files of its own, so everything the engine exposes to a page is in the lists above.