@leaddreamer/staticforms v1.0.0-beta.2
@leaddreamer/StaticForms
A set of arrays to hold pointers to base structures and functions used for forms driven editors, data tables, simulated data, etc
StaticForms
A set of arrays to hold pointers to base structures and functions used for forms driven editors, data tables, simulated data, etc
- StaticForms
- .Forms : Array.Object
- .fillForm(object, formtype) ⇒ object
- .cleanType(object, type) ⇒ object
StaticForms.Forms : Array.Object
A set of "forms objects", organized by type of form, each with an index by "form type"
Kind: static constant of StaticForms
Properties
Name | Type | Description |
---|---|---|
Base | Array.object | The base "object" for this business type - keys and default values |
BaseForm | Array.object | The base "form" for this business type - values are "form editor" strings |
CreateForm | Array.object | The "form" to generate an editor to create such an object |
Edit | Array.object | a form descriptor for editting a business object of this type |
AccountForm | Array.object | The "form" to use for "account"-level editting |
Data | Array.object | The descriptor for a "Faker" utility for mass simulation data |
Table | Array.object | an object of descriptors of how to display this type's fields in reactdatagrid |
Choices | Array.object | an object holding name/order pairs for a business object field type |
UpdateChange | Array.function | a function to process changes to an object, especially in the case of cross-field dependencies |
Summarize | Array.function | a function to provide a string summary of this type of business object |
Save | Array.function | a fanction to save this type of business object to database - in case of cross-dependencies |
SearchBy | Array.function | a string identifying which property to use to "search" for this business object type |
LineSum | Array.function | a function for calculating table-sums/grouping for this type of object |
Editable | Array.function | A function to calculate which fields of an object Type can be editted (based on data) |
Render | Array.function | a function to "render" a cell-value for a property/field of this object type |
Editor | Array.function | a function to return and editor function to a reactdatagrid table instance |
Example
Forms.Base[LINEITEM] = LineItemDefault;
Forms.BaseForm[LINEITEM] = LineItemDefaultForm;
Forms.CreateForm[LINEITEM] = LineItemDefaultForm;
Forms.Data[LINEITEM] = LineItemData;
Forms.Summarize[LINEITEM] = summarizeLineItem;
Forms.Save[LINEITEM] = updateLineItem;
Forms.SearchBy[LINEITEM] = "description";
StaticForms.fillForm(object, formtype) ⇒ object
creates an object using ONLY the fields in the specified "form" object useful for preventing stray data from entering database
Kind: static method of StaticForms
Param | Type | Description |
---|---|---|
object | object | source object for data |
formtype | string | indexing name of the form to use to specify fields to include - uses schema specific Forms.Baseformtype |
StaticForms.cleanType(object, type) ⇒ object
creates a "fully populated" record, including potentially blank fields"
Kind: static method of StaticForms
Param | Type | Description |
---|---|---|
object | Record | partially populated record, most likely from editting |
type | string |
© 2020-2024 Tracy Hall / Dreams and Logic Inc / SaltSweetSpirits
14 days ago
14 days ago