├── .gitattributes ├── .gitignore ├── README.md ├── Resources ├── builder.png └── viewer.png ├── build ├── optimajet-builder.js └── optimajet-form.js ├── demo ├── ajaxinterceptor.js ├── application-form-data.json ├── application-form.json ├── build │ ├── optimajet-builder.js │ └── optimajet-form.js ├── builder.html ├── contactform.json ├── css │ ├── fonts │ │ ├── lato-bold-700-latin-ext.woff2 │ │ ├── lato-bold-700-latin.woff2 │ │ ├── lato-bolditalic-700-latin-ext.woff2 │ │ ├── lato-bolditalic-700-latin.woff2 │ │ ├── lato-italic-400-latin-ext.woff2 │ │ ├── lato-italic-400-latin.woff2 │ │ ├── lato-regular-400-latin-ext.woff2 │ │ ├── lato-regular-400-latin.woff2 │ │ └── semantic-font.css │ ├── optimajet-formbuilder.css │ ├── semantic.min.css │ └── themes │ │ └── default │ │ └── assets │ │ └── fonts │ │ ├── icons.eot │ │ ├── icons.svg │ │ ├── icons.ttf │ │ ├── icons.woff │ │ └── icons.woff2 ├── download.html ├── favicon.ico ├── formbuilderdev-builder.js ├── formbuilderdev-viewer.js ├── formsample.html ├── formsample.js ├── images │ ├── builder.png │ ├── collapse.svg │ ├── dwkitbuilder-copy.svg │ ├── dwkitbuilder-delete.svg │ ├── dwkitbuilder-edit.svg │ ├── dwkitbuilder-info.png │ ├── dwkitbuilder-move.svg │ ├── dwkitbuilder-sarr.png │ ├── dwkitbuilder-toolbar-move.png │ ├── expand.svg │ ├── formsample.png │ ├── logo.svg │ ├── logoviewer.svg │ ├── mobile-frame.png │ ├── unknown.png │ └── viewer.png ├── index.html ├── package-lock.json ├── package.json ├── scripts │ ├── Chart.min.js │ ├── ace.js │ ├── jquery.js │ ├── json5.js │ ├── mode-csharp.js │ ├── mode-javascript.js │ ├── mode-json.js │ ├── react-data-grid.js │ ├── theme-monokai.js │ ├── worker-javascript.js │ └── worker-json.js ├── src │ └── readme.md ├── toolbarbuttons.json ├── tsconfig.json ├── upload.html ├── viewer.html └── webpack.config.js ├── eula.txt ├── readme.md ├── release-notes.md └── version.txt /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.sln.docstates 8 | 9 | # Build results 10 | 11 | [Dd]ebug/ 12 | [Rr]elease/ 13 | x64/ 14 | [Bb]in/ 15 | [Oo]bj/ 16 | 17 | # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets 18 | !packages/*/build/ 19 | 20 | #node.js 21 | node_modules/ 22 | 23 | # MSTest test Results 24 | [Tt]est[Rr]esult*/ 25 | [Bb]uild[Ll]og.* 26 | 27 | *_i.c 28 | *_p.c 29 | *.ilk 30 | # *.meta 31 | *.obj 32 | *.pch 33 | *.pdb 34 | *.pgc 35 | *.pgd 36 | *.rsp 37 | *.sbr 38 | *.tlb 39 | *.tli 40 | *.tlh 41 | *.tmp 42 | *.tmp_proj 43 | *.log 44 | *.vspscc 45 | *.vssscc 46 | .builds 47 | *.pidb 48 | *.log 49 | *.scc 50 | 51 | # Visual C++ cache files 52 | ipch/ 53 | *.aps 54 | *.ncb 55 | *.opensdf 56 | *.sdf 57 | *.cachefile 58 | 59 | # Visual Studio profiler 60 | *.psess 61 | *.vsp 62 | *.vspx 63 | .vs/ 64 | 65 | # Guidance Automation Toolkit 66 | *.gpState 67 | 68 | # ReSharper is a .NET coding add-in 69 | _ReSharper*/ 70 | *.[Rr]e[Ss]harper 71 | 72 | # TeamCity is a build add-in 73 | _TeamCity* 74 | 75 | #IDEA 76 | .idea/ 77 | 78 | # DotCover is a Code Coverage Tool 79 | *.dotCover 80 | 81 | # NCrunch 82 | *.ncrunch* 83 | .*crunch*.local.xml 84 | 85 | # Installshield output folder 86 | [Ee]xpress/ 87 | 88 | # DocProject is a documentation generator add-in 89 | DocProject/buildhelp/ 90 | DocProject/Help/*.HxT 91 | DocProject/Help/*.HxC 92 | DocProject/Help/*.hhc 93 | DocProject/Help/*.hhk 94 | DocProject/Help/*.hhp 95 | DocProject/Help/Html2 96 | DocProject/Help/html 97 | 98 | # Click-Once directory 99 | publish/ 100 | 101 | # Publish Web Output 102 | *.Publish.xml 103 | 104 | # NuGet Packages Directory 105 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line 106 | packages/ 107 | 108 | # Windows Azure Build Output 109 | csx 110 | *.build.csdef 111 | 112 | # Windows Store app package directory 113 | AppPackages/ 114 | 115 | # Others 116 | *.Cache 117 | ClientBin/ 118 | [Ss]tyle[Cc]op.* 119 | ~$* 120 | *~ 121 | *.dbmdl 122 | *.[Pp]ublish.xml 123 | *.pfx 124 | *.publishsettings 125 | 126 | # RIA/Silverlight projects 127 | Generated_Code/ 128 | 129 | # Backup & report files from converting an old project file to a newer 130 | # Visual Studio version. Backup files are not needed, because we have git ;-) 131 | _UpgradeReport_Files/ 132 | UpgradeLog*.XML 133 | UpgradeLog*.htm 134 | 135 | # SQL Server files 136 | App_Data/*.mdf 137 | App_Data/*.ldf 138 | 139 | 140 | #LightSwitch generated files 141 | GeneratedArtifacts/ 142 | _Pvt_Extensions/ 143 | ModelManifest.xml 144 | 145 | # ========================= 146 | # Windows detritus 147 | # ========================= 148 | 149 | # Windows image file caches 150 | Thumbs.db 151 | ehthumbs.db 152 | 153 | # Folder config file 154 | Desktop.ini 155 | 156 | # Recycle Bin used on file shares 157 | $RECYCLE.BIN/ 158 | 159 | # Mac desktop service store files 160 | .DS_Store 161 | Logs/ 162 | Optimajet.DWKit.StarterApplication/bower_components/ 163 | Samples/VacationRequest/OptimaJet.DWKit.StarterApplication/bower_components/ 164 | .vs/ 165 | *.lock 166 | 167 | .archives 168 | *.app.js.map 169 | *.nupkg 170 | *.js.map 171 | aspnet-keys 172 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OptimaJet FormBuilder 2 | 3 | FormBuilder - is a lightweight, user-friendly, effective and essential form tool used to create and manage forms. It is based on React and 4 | can be integrated into any web app. 5 | 6 | For deployment and further development, you will need the following toolkit: 7 | 8 | - npm; 9 | - webpack 3 (!); 10 | 11 | 1. Run the commands in the project's root folder: 12 | ```bash 13 | cd demo 14 | npm install --legacy-peer-deps 15 | npm run start 16 | ``` 17 | 18 | 2. Open the sample in a browser (by default at http://localhost:8080/) 19 | 20 | ## Features 21 | 22 | - Drag-&-drop form builder 23 | - Templates 24 | - Inline parameters 25 | - Event-based 26 | - JSON file format 27 | - Clean HTML layout 28 | 29 | ## Screenshots 30 | 31 | [](https://formbuilder.dev/demo/) 32 | 33 | [](https://formbuilder.dev/viewer/) 34 | 35 | ## Information 36 | 37 | - **Official website** - [https://formbuilder.dev](https://formbuilder.dev) 38 | - **Documentation** - [https://formbuilder.dev/documentation/](https://formbuilder.dev/documentation/) 39 | - **Demo** - [https://formbuilder.dev/demo/](https://formbuilder.dev/demo/) 40 | 41 | For commercial use, please contact [support@optimajet.com](mailto:support@optimajet.com). 42 | -------------------------------------------------------------------------------- /Resources/builder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/optimajet/formbuilder/bceb088bf441abff3810f63d30e2ab547c5f63d4/Resources/builder.png -------------------------------------------------------------------------------- /Resources/viewer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/optimajet/formbuilder/bceb088bf441abff3810f63d30e2ab547c5f63d4/Resources/viewer.png -------------------------------------------------------------------------------- /demo/ajaxinterceptor.js: -------------------------------------------------------------------------------- 1 | // based on https://github.com/slorber/ajax-interceptor 2 | 3 | // restore prototype chain: https://github.com/HubSpot/pace/issues/261 4 | 5 | const XMLHttpRequestProto = Object.getPrototypeOf(new XMLHttpRequest); 6 | if (XMLHttpRequestProto !== XMLHttpRequest.prototype) { 7 | XMLHttpRequest.prototype = XMLHttpRequestProto; 8 | } 9 | 10 | const RealXHRSend = XMLHttpRequest.prototype.send; 11 | const RealXHRSetRequestHeader = XMLHttpRequest.prototype.setRequestHeader; 12 | 13 | let authToken = null; 14 | const browserFetch = window.fetch; 15 | 16 | const requestCallbacks = []; 17 | let onRequestCallback = null; 18 | 19 | let wired = false; 20 | 21 | function arrayRemove(array, item) { 22 | const index = array.indexOf(item); 23 | if (index > -1) { 24 | array.splice(index, 1); 25 | } else { 26 | throw new Error('Could not remove ' + item + ' from array'); 27 | } 28 | } 29 | 30 | function fireCallbacks(callbacks, xhr) { 31 | for (let i = 0; i < callbacks.length; i++) { 32 | callbacks[i](xhr); 33 | } 34 | } 35 | 36 | const ajaxInterceptor = { 37 | addRequestCallback: function (callback) { 38 | requestCallbacks.push(callback); 39 | }, 40 | removeRequestCallback: function (callback) { 41 | arrayRemove(requestCallbacks, callback); 42 | }, 43 | 44 | isWired: function () { 45 | return wired; 46 | }, 47 | 48 | wire: function () { 49 | if (wired) { 50 | throw new Error('Ajax interceptor already wired'); 51 | } 52 | 53 | // Override send method of all XHR requests 54 | XMLHttpRequest.prototype.send = function () { 55 | 56 | // Fire request callbacks before sending the request 57 | fireCallbacks(requestCallbacks, this); 58 | 59 | if (this.authToken) { // setting Authorization header for the last saved token 60 | RealXHRSetRequestHeader.apply(this, ['Authorization', this.authToken]); 61 | } 62 | 63 | RealXHRSend.apply(this, arguments); 64 | }; 65 | 66 | XMLHttpRequest.prototype.setRequestHeader = function (name, value) { 67 | 68 | if (name === 'Authorization') { 69 | this.authToken = value; //saving authToken instead of creating the header 70 | authToken = this.authToken; 71 | } else { 72 | RealXHRSetRequestHeader.apply(this, arguments); 73 | } 74 | }; 75 | 76 | 77 | wired = true; 78 | }, 79 | 80 | unwire: function () { 81 | if (!wired) { 82 | throw new Error('Ajax interceptor not currently wired'); 83 | } 84 | XMLHttpRequest.prototype.send = RealXHRSend; 85 | XMLHttpRequest.prototype.setRequestHeader = RealXHRSetRequestHeader; 86 | wired = false; 87 | }, 88 | 89 | fetch: function (resource, init) { 90 | const newInit = init || {}; 91 | const headers = newInit.headers || new Headers(); 92 | if (authToken) { 93 | headers.append('Authorization', authToken); 94 | } 95 | newInit.headers = headers; 96 | return browserFetch(resource, newInit); 97 | }, 98 | 99 | configureHeaders: function (accessToken) { 100 | let options = null; 101 | 102 | if (window.globalFetchOptions) { 103 | options = window.globalFetchOptions(); 104 | } 105 | 106 | if (!options) { 107 | options = {headers : {}}; 108 | } 109 | 110 | const bearerHeader = accessToken ? ('Bearer ' + accessToken) : null; 111 | 112 | options.headers = { 113 | ...options.headers, 114 | 'Authorization': bearerHeader 115 | }; 116 | 117 | if (onRequestCallback) { 118 | ajaxInterceptor.removeRequestCallback(onRequestCallback); 119 | } else { 120 | ajaxInterceptor.wire(); 121 | } 122 | 123 | onRequestCallback = (xhr) => { 124 | xhr.setRequestHeader('Authorization', bearerHeader); 125 | }; 126 | 127 | ajaxInterceptor.addRequestCallback(onRequestCallback); 128 | } 129 | 130 | }; 131 | 132 | export default ajaxInterceptor; -------------------------------------------------------------------------------- /demo/application-form-data.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Test application", 3 | "firstname": "John", 4 | "lastname": "Doe", 5 | "type": 2, 6 | "comment": "This is a test application for John Doe" 7 | } -------------------------------------------------------------------------------- /demo/application-form.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "key": "header_1", 4 | "data-buildertype": "header", 5 | "content": "Application Form", 6 | "size": "medium", 7 | "subheader": "Make it easier", 8 | "textAlign": "center" 9 | }, 10 | { 11 | "key": "form_1", 12 | "data-buildertype": "form", 13 | "children": [ 14 | { 15 | "key": "title", 16 | "data-buildertype": "input", 17 | "label": "Title", 18 | "fluid": true, 19 | "other-required": false 20 | }, 21 | { 22 | "key": "formgroup_1", 23 | "data-buildertype": "formgroup", 24 | "widths": "equal", 25 | "children": [ 26 | { 27 | "key": "firstname", 28 | "data-buildertype": "input", 29 | "label": "First name", 30 | "fluid": true 31 | }, 32 | { 33 | "key": "lastname", 34 | "data-buildertype": "input", 35 | "label": "Last name", 36 | "fluid": true 37 | } 38 | ] 39 | }, 40 | { 41 | "key": "type", 42 | "data-buildertype": "dropdown", 43 | "label": "Type", 44 | "fluid": true, 45 | "selection": true, 46 | "data-elements": "[{key: 0, value: '', text: ''},\n{key: 1, value: 1, text: 'Internal'},\n{key: 2, value: 2, text: 'External'},\n{key: 3, value: 2, text: 'Direct'}]", 47 | "placeholder": "" 48 | }, 49 | { 50 | "key": "comment", 51 | "data-buildertype": "textarea", 52 | "label": "Comment", 53 | "fluid": true, 54 | "rows": 5 55 | } 56 | ], 57 | "events": {}, 58 | "style-marginBottom": "10px" 59 | }, 60 | { 61 | "key": "btnSave", 62 | "data-buildertype": "button", 63 | "content": "Save", 64 | "primary": true, 65 | "fluid": false, 66 | "events-onclick-actions": [ 67 | "validate", 68 | "saveandexit" 69 | ], 70 | "events": { 71 | "onClick": { 72 | "active": true, 73 | "actions": [ 74 | "save" 75 | ], 76 | "targets": [], 77 | "parameters": [] 78 | } 79 | } 80 | }, 81 | { 82 | "key": "btnCancel", 83 | "data-buildertype": "button", 84 | "content": "Cancel", 85 | "primary": false, 86 | "fluid": false, 87 | "events-onclick-actions": [ 88 | "validate", 89 | "saveandexit" 90 | ], 91 | "events": { 92 | "onClick": { 93 | "active": true, 94 | "actions": [ 95 | "cancel" 96 | ], 97 | "targets": [], 98 | "parameters": [] 99 | } 100 | } 101 | } 102 | ] -------------------------------------------------------------------------------- /demo/builder.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |FormBuilder - is a lightweight, user-friendly, effective and essential form tool used to create and manage forms.It is based on React and can be integrated into any web app.
47 |You can reach out more information on formbuilder.dev.
48 |FormBuilder
54 | 55 |Viewer
60 | 61 |Form Sample
66 | 67 |