1.0.0-beta.2 • Published 14 days ago

@leaddreamer/staticforms v1.0.0-beta.2

Weekly downloads
-
License
MIT
Repository
github
Last release
14 days ago

view on
npm

@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

A set of "forms objects", organized by type of form, each with an index by "form type"

Kind: static constant of StaticForms
Properties

NameTypeDescription
BaseArray.objectThe base "object" for this business type - keys and default values
BaseFormArray.objectThe base "form" for this business type - values are "form editor" strings
CreateFormArray.objectThe "form" to generate an editor to create such an object
EditArray.objecta form descriptor for editting a business object of this type
AccountFormArray.objectThe "form" to use for "account"-level editting
DataArray.objectThe descriptor for a "Faker" utility for mass simulation data
TableArray.objectan object of descriptors of how to display this type's fields in reactdatagrid
ChoicesArray.objectan object holding name/order pairs for a business object field type
UpdateChangeArray.functiona function to process changes to an object, especially in the case of cross-field dependencies
SummarizeArray.functiona function to provide a string summary of this type of business object
SaveArray.functiona fanction to save this type of business object to database - in case of cross-dependencies
SearchByArray.functiona string identifying which property to use to "search" for this business object type
LineSumArray.functiona function for calculating table-sums/grouping for this type of object
EditableArray.functionA function to calculate which fields of an object Type can be editted (based on data)
RenderArray.functiona function to "render" a cell-value for a property/field of this object type
EditorArray.functiona 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

ParamTypeDescription
objectobjectsource object for data
formtypestringindexing 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

ParamTypeDescription
objectRecordpartially populated record, most likely from editting
typestring

© 2020-2024 Tracy Hall / Dreams and Logic Inc / SaltSweetSpirits

1.0.0-beta.3

14 days ago

1.0.0-beta.2

14 days ago