Skip to content

1.0.0

Choose a tag to compare

@HRADigital HRADigital released this 29 Jun 17:00
· 24 commits to master since this release

First stable release. SmartForms is a zero-dependency, framework-free client-side manager for static HTML forms: it tracks per-field state, drives toolbar actions from that state, and submits via configurable HTTP tasks. From this release on, the public API follows Semantic Versioning.

Highlights

  • State-aware fields â�� every input is tracked as new, unchanged, changed, invalid, or empty, and the form aggregates a single state that UI reacts to.
  • Toolbar driven by state â�� edit, save, cancel, destroy, back, and toggle roles enable/disable automatically per the current form state.
  • HTTP submission via TaskExecutor â�� synchronous and asynchronous form submissions with verb/mode resolution, Laravel resource-controller defaults, and CSRF support.
  • Zero dependencies, any setup â�� ships as ESM, CJS, and UMD with TypeScript definitions; drop in via autoInit() or instantiate classes directly.

Components

  • Forms: SmartForm, SmartFormList, SmartFormRecord
  • Inputs: TextInput, EmailInput, UrlInput, NumberInput, DateTimeInput, ColorInput, FileInput, SelectInput, TextAreaInput, CheckBoxInput, RadioInput, DynamicTableInput
  • Toolbar: Toolbar, Button, AdminForm
  • Constants: Roles, State, Tasks
  • HTTP: TaskExecutor
  • Entry point: autoInit(), plus data-track-form trackers and a toggleable debug logger

Changes since 0.1.1

Added

  • SmartFormList.resource() returning the list's data-resource attribute, mirroring SmartForm.resource(), so TaskExecutor can resolve the resource from either a form or a list body.

Fixed

  • README.md now documents EmailInput, the input[type=password] â�� TextInput mapping, the edit / destroy / back toolbar roles, and the corrected per-state button-enable matrix.
  • types/index.d.ts rewritten to match the real public API (dropped the non-existent reordered state and LINK / REORDER roles; added EmailInput, Tasks, TaskExecutor).
  • CONTRIBUTING.md no longer references a non-existent .nvmrc.

Install

npm install @hradigital/smartforms

Full Changelog: https://github.com/HRADigital/smartforms/commits/1.0.0