Here to experience.
中文说明点击这里。
中文应用点击体验。
中文分支请切换master_cn
This is a web app for:
- Generate config json for form and list setting.
- Rebuild form and list through input config json.
Angular-Custom-Form is built with Angular4 and Webpack, with the help of these plugins and libs:
// clone code
git clone https://github.com/godbasin/angular-custom-app.git
cd angular-custom-app
// npm install
npm install -g webpack
npm install -g webpack-dev-server
npm install
// start project
npm run dev
// build
npm run build
We now have two modes:
- Setting a form, by setting each control that inside the form.
- Setting a list, by provide it certain functions(
add
/edit
/delete
) and a dialog form.
Setting A Form
- Add controls.
- Set up each control.
- Generate json(or build a form).
Build A Form
- Input json that generated above.
- Build the form.
Setting A List
- Checked the functions you want(add/edit/delete).
- Set up the dialog form(Same with setting a form).
- Generate json(or build a list).
Build A List
- Input json that generated above.
- Build the list.
Setting An App
- Set up the sidebar menus and it's route-link.
- Set up it's link page list config(same with setting a list).
- Generate json(or rebuild a simulation app).
Rebuild A Simulation App
- Input json that generated above.
- Rebuild the simulation app.
By now we support these form control types:
- 'text':
<input type="text" />
- 'number':
<input type="number" />
- 'select':
<select>
- 'select2':
<select2>
sealed with select2 plugins - 'radio':
<input type="radio" />
group - 'radio-with-input': radio group with input
- 'checkbox':
<input type="checkbox" />
group - 'checkbox-with-input': checkbox group with input
- 'date'| 'date-time' | 'date-hour': date-picker, sealed with bootstrap-datetimepicker
- 'upload-image': images upload with certain limits, such as width/height/size/type
Each control is defined up to these configs:
type (string)
: control type('text'
,'number'
,'select'
,'radio'
and more)label (string)
: label for the controlkey (string)
: key(to connect the data or model and get value) for the controlvalidations (array)
: formbuilder validationstype (string)
: Validators type('required'
,'email'
,'maxLength'
,'minLength'
,'pattern'
and more)param
: Validators' function called with param(maxLength(length)
,minLength(length)
and more)message (string)
: error message when not valid
hiddenWhen (object)
: conditions when control hiddencondition
: way to combinatevalidations
('||'
,'&&'
,''
)validations (array)
: conditions when other control matchkey (string)
: other control's keyvalidate (string)
: validate type('>'
,'>='
,'=='
,'==='
,'!='
,'indexOf'
and more)param
: value to compare or calculate with other control
setOptions (boolean)
: if allowed to set optionsoptions
: options for select or radio or checkbox etc.id (string)
: option valuetext (string)
: option textwithInput (boolean)
: if with inputtype
: input type('text'
,'number'
,'email'
)
limit
: upload image limitwidth (number)
height (number)
size (number)
type? (string)
description (string)
: help description