Generate HTML forms and two-way-binding of hierarchical and tabular/grid data with the help of JSON Schema.
See https://decatur.github.io/formchen/index.html
Formchen (little form) supports undo/redo transaction management.
Edits on the original object are emitted as standard JSON Patch, which can be directly passed to the back end.
Formchen is written in plain EcmaScript 2022 modules and can be directly imported as such with any modern browser.
Both demo page and test page should load without errors or warnings in the javascript console.
Check both with
- different browsers
- different locales/languages
Check demo page with both light and dark mode.
export PYTHONPATH=demo; python -m py_server 8081 $(pwd)
http://127.0.0.1:8081/index.html?loglevel=info&console=true
http://127.0.0.1:8081/test/testrunner.html
https://json8.github.io/patch/demos/apply/
tsc --checkJs --allowJs formchen/formchen.js --noEmit --lib dom,es2022 --target es2022 --noUnusedLocals --noImplicitReturns --noImplicitThis --noUnusedParameters
This is what worked for me on WSL end of 2024
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
bash
nvm install 22
node -v
npm -v
npm install -g typescript
http://127.0.0.1:3000/index.html?loglevel=info&console=true
To provide FormChen through cdn.jsdelivr.net, tag and push the release:
git tag 1.0.1 main
git push origin 1.0.1
curl --head https://cdn.jsdelivr.net/gh/decatur/formchen@1.0.1/formchen/formchen.js
release=1.0.3
target_dist_dir=MyPublicWebDir/formchen-$release
curl -sSL "https://github.com/decatur/formchen/archive/refs/tags/$release.zip" -o /tmp/formchen.zip
unzip /tmp/formchen.zip -d /tmp
mv /tmp/formchen-$release/formchen $target_dist_dir
rm /tmp/formchen-$release /tmp/formchen.zip