@plotdb/form 0.1.2 → 0.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # Change Logs
2
2
 
3
+ ## v0.2.0
4
+
5
+ - fix typo in image opset
6
+ - tweak file opset: update i18n and add min-size in size-limit op
7
+ - add `paths` and `resolve` api
8
+ - add experimental conditor module
9
+ - upgrade dependencies
10
+ - fix bug: child isn't reinitialized in manager.order api
11
+ - support export api in manager and widget
12
+ - support `mod.value` api
13
+ - explicitly define the purpose of fromSource option in value api
14
+ - widget.validate: lazy get of widget content to improve performance
15
+ - widget.value: equality check in widget.validate use internal value.
16
+ - add form.value.toString api for convert generic widget value to string
17
+ - add additional utils api for merging exported json
18
+
19
+
20
+
21
+ ## v0.1.3
22
+
23
+ - upgrade dependencies
24
+ - add `widgets` api in manager
25
+ - tweak `condctrl` interface
26
+ - add valspec and valdef support in widget
27
+ - add choice opset for valspec @plotdb/form:valdef/choice
28
+ - support id in term
29
+ - support function-based meta in op
30
+ - tweak length opset i18n
31
+
32
+
3
33
  ## v0.1.2
4
34
 
5
35
  - fix bug: `disabled`, `isRequired`, `readonly` may return undefined, causing issue for caller that need an explicit defined value.
package/README.md CHANGED
@@ -1,33 +1,35 @@
1
1
  # @plotdb/form
2
2
 
3
- Form related modules for interactive form design throught GUI, with following (expected, TODO) features:
3
+ `@plotdb/form` is a form management package with following feature:
4
4
 
5
- - design a form through GUI.
6
- - designed form serializable and renderable in frontend for end users to fill.
7
- - end user filled result of a form is also serializable.
8
- - Aware of OT for collaborative editing.
9
- - Works in both frontend and backend.
5
+ - form construction with block-based widget
6
+ - serializable form spec and filled data
10
7
 
8
+ It includes following modules:
11
9
 
12
- `@plotdb/form` includes following modules:
10
+ `form.manager`: a recursive manager of a set of widgets.
11
+ `form.widget`: a form widget as a bridge between user and manager.
12
+ `form.opset` and `form.op`: operation set and individual operations for validating given inputs from users.
13
+ `form.term`: validation rule with configs including used opset/op and corresponding configurations.
14
+ `form.condctrl`: controller for form dynamics based on given conditions.
13
15
 
14
- - `form.manager`: manage a set of form widgets.
15
- - `form.widget`: interface between form manager and UI.
16
- - `form.opset`: a set of op for validating given input from user.
17
- - `form.op`: a specific operation for validating given input from user.
18
- - `form.term`: a rule ( a op, opset and config based on the specified op ) for validating given input from user.
19
16
 
17
+ For more information, check markdown document for corresponding modules under `docs/` folder.
20
18
 
21
- ## Draft
22
19
 
23
- ### form.block attrubite
20
+ ## Simple Usage
24
21
 
25
- An attribute is an aspect of data from a form.block. For example, a File form.block could contains following attributes:
22
+ mgr = form.manager!
23
+ # prepare a widget
24
+ widget = new form.widget({root: ...})
25
+ <~ widget.init!then _
26
+ widget.deserialize({isRequired: true}, {init: true})
27
+ mgr.add {widget, path: "name"}
28
+ mgr.on \change, -> console.log mgr.value!
29
+ # use condition control
30
+ mgr.condition!reset conditions: [{src: "name", config: {value: "dummy", path: [...]}}]
26
31
 
27
- - `size` - size of all files combined.
28
- - `count` - count of files.
29
- - `modifiedtime` - modified time of last touched files.
30
- - `ext` - type of files.
31
32
 
32
- Every attribute can be associated with one or multiple `form.opset` For example, above `ext` attribute can be associated with `extensions` type, which helps in determining if files in a given `ext` array all belong to certain file type.
33
+ ## License
33
34
 
35
+ MIT