@fieldia/viewer 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +41 -0
- package/bundle/fieldia.js +426 -0
- package/bundle/fieldia.js.map +7 -0
- package/package.json +43 -0
- package/src/index.d.mts +1 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +5 -0
- package/src/index.js.map +1 -0
- package/src/index.mjs +2 -0
- package/src/index.mjs.map +1 -0
- package/src/lib/viewer.d.mts +58 -0
- package/src/lib/viewer.d.ts +58 -0
- package/src/lib/viewer.js +550 -0
- package/src/lib/viewer.js.map +1 -0
- package/src/lib/viewer.mjs +546 -0
- package/src/lib/viewer.mjs.map +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 fieldia-dev
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# @fieldia/viewer
|
|
2
|
+
|
|
3
|
+
Show a [Fieldia](https://fieldia.dev) page and let people fill it in. Plain DOM,
|
|
4
|
+
no framework: sections, tabs and wizards, the statusbar, stat buttons, drafts,
|
|
5
|
+
right-to-left layout, and messages in English, Arabic, German and French.
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install @fieldia/viewer
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { mountViewer } from '@fieldia/viewer';
|
|
13
|
+
import { createMemoryDataSource } from '@fieldia/core';
|
|
14
|
+
import page from './signup.page.json';
|
|
15
|
+
|
|
16
|
+
const viewer = mountViewer(document.getElementById('app')!, {
|
|
17
|
+
page,
|
|
18
|
+
dataSource: createMemoryDataSource(), // or your own DataSource
|
|
19
|
+
skin: 'outlined', // or 'underline'
|
|
20
|
+
locale: 'en', // 'ar' lays the form out right to left
|
|
21
|
+
});
|
|
22
|
+
// later: viewer.destroy()
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## With no build step
|
|
26
|
+
|
|
27
|
+
This package carries a `<script>` bundle that sets the global `Fieldia`
|
|
28
|
+
(core, widgets and viewer; about 60 KB gzipped):
|
|
29
|
+
|
|
30
|
+
```html
|
|
31
|
+
<script src="https://cdn.jsdelivr.net/npm/@fieldia/viewer/bundle/fieldia.js"></script>
|
|
32
|
+
<script>
|
|
33
|
+
Fieldia.mountViewer(document.getElementById('app'), {
|
|
34
|
+
page,
|
|
35
|
+
dataSource: Fieldia.createMemoryDataSource(),
|
|
36
|
+
});
|
|
37
|
+
</script>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
For React, Vue and Angular, use `@fieldia/react`, `@fieldia/vue` or
|
|
41
|
+
`@fieldia/angular` — thin shells over this viewer. MIT licensed.
|