Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jugsvn committed Dec 16, 2021
1 parent f24dee6 commit db25409
Show file tree
Hide file tree
Showing 29 changed files with 26,666 additions and 5,497 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ RUN python -m pip install --upgrade pip
RUN pip install mkdocs

# Expose the listening port
EXPOSE 8123
EXPOSE 8000

CMD ["mkdocs", "serve", "--dev-addr=0.0.0.0:8123"]
CMD ["mkdocs", "serve", "--dev-addr=0.0.0.0:8000"]
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"!dist/**/*"
],
"dependencies": {
"jquery-ui-sortable": "*",
"jquery-ui-sortable": "*"
"jquery": "^3.1.1"
},
"repository": {
Expand Down
2 changes: 0 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ nav:
- layoutTemplates: formBuilder/options/layoutTemplates.md
- notify: formBuilder/options/notify.md
- onAddField: formBuilder/options/onAddField.md
- onAddFieldAfter: formBuilder/options/onAddFieldAfter.md
- onAddOption: formBuilder/options/onAddOption.md
- onClearAll: formBuilder/options/onClearAll.md
- onCloseFieldEdit: formBuilder/options/onCloseFieldEdit.md
- onOpenFieldEdit: formBuilder/options/onOpenFieldEdit.md
Expand Down
9,654 changes: 4,599 additions & 5,055 deletions package-lock.json

Large diffs are not rendered by default.

15 changes: 9 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"> 1%"
]
},
"loose": true
"loose": false
}
]
],
Expand All @@ -77,8 +77,8 @@
]
},
"scripts": {
"build:analyze": "webpack --mode production -p --progress --config tools/webpack.config --analyze",
"build:plugins": "webpack --mode production -p --display-entrypoints --progress --config tools/webpack.plugins.config",
"build:analyze": "webpack --mode development -p --progress --config tools/webpack.config --analyze",
"build:plugins": "webpack --mode development -p --display-entrypoints --progress --config tools/webpack.plugins.config",
"build:vendor": "babel-node tools/build-vendor",
"build": "webpack --mode production -p --progress --config tools/webpack.config",
"build:all": "npm-run-all build:plugins build:vendor build copy",
Expand All @@ -87,20 +87,23 @@
"deploy:all": "npm-run-all deploy:demo deploy:site",
"deploy:demo": "node tools/deploy-demo.js",
"deploy:site": "node tools/deploy-site.js",
"docs:build": "docker build --rm -t fb_docs .",
"docs:serve": "docker run -v `pwd`/docs/:/usr/src/app/docs --rm -p 8123:8123 -it fb_docs",
"docs:build": "docker build -t fb_docs .",
"docs:serve": "docker run -p 8000:8000 -it fb_docs",
"docs": "npm-run-all docs:build docs:serve",
"font": "babel-node tools/icon-font",
"lint": "eslint ./src --ext .js || true",
"lint:fix": "eslint ./src --ext .js --fix",
"semantic-release": "semantic-release",
"start:devServer": "webpack-dev-server --mode development --config tools/webpack.config",
"start:devServer": "webpack-dev-server -d --mode development --config tools/webpack.config",
"prestart": "npm-run-all -p build:vendor copy:lang",
"start": "npm run start:devServer",
"test": "npm run-script build"
},
"dependencies": {
"jquery": ">=3.4.1",
"jquery-ui": ">=1.13.0",
"jquery-ui-bundle": ">=1.12.1",
"bootstrap": "^5.1.3",
"jquery-ui-sortable": "*"
},
"devDependencies": {
Expand Down
7 changes: 6 additions & 1 deletion src/demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@
media="screen"
href="https://cdnjs.cloudflare.com/ajax/libs/rateYo/2.3.1/jquery.rateyo.min.css"
/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">

<meta
name="viewport"
content="user-scalable=no, width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1"
/>
<style>.rendered-form{padding:10px;}</style>
<title>jQuery formBuilder/formRender Demo</title>
</head>

<body>
<body style="background-color: #fff;">
<header class="demo-header">
<label for="toggleBootstrap">Toggle Bootstrap <input type="checkbox" id="toggleBootstrap"/></label>
<div>
Expand All @@ -40,6 +42,7 @@ <h1 class="formbuilder-title">
<h1 class="formrender-title">
jQuery formRender -
<button class="editForm">Edit</button>
<button id="btnShow">Show UserData</button>
</h1>
<div class="build-wrap"></div>
<form class="render-wrap"></form>
Expand All @@ -53,6 +56,8 @@ <h2>Actions</h2>
</div>
</div>
<div id="formbuilder-options"></div>

<span id='spanResult'></span>
<script src="assets/js/vendor.js"></script>

<script src="<%= htmlWebpackPlugin.options.formBuilder %>"></script>
Expand Down
5 changes: 4 additions & 1 deletion src/demo/js/actionButtons.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ export const setCurrentFieldIdValues = value => {

export const builderActions = {
showData: () => $('.build-wrap').formBuilder('showData'),
clearFields: () => $('.build-wrap').formBuilder('clearFields'),
clearFields: () => {
console.log('here')
$('.build-wrap').formBuilder('clearFields')
},
getData: () => {
console.log($('.build-wrap').formBuilder('getData'))
},
Expand Down
131 changes: 76 additions & 55 deletions src/demo/js/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,17 @@ const toggleBootStrap = ({ target }) => {
}

document.getElementById('toggleBootstrap').addEventListener('click', toggleBootStrap, false)
let frControl

jQuery(function ($) {

$('#btnShow').click(function () {

console.log(frControl.userData)
$('#spanResult').text(JSON.stringify(frControl.userData))

})

const fields = [
{
type: 'autocomplete',
Expand Down Expand Up @@ -108,59 +117,70 @@ jQuery(function ($) {
icon: '👨',
name: 'user-details', // optional
showHeader: true, // optional
fields: [
{
type: 'text',
label: 'First Name',
className: 'form-control',
},
{
type: 'select',
label: 'Profession',
className: 'form-control',
values: [
{
label: 'Street Sweeper',
value: 'option-2',
selected: false,
},
{
label: 'Brain Surgeon',
value: 'option-3',
selected: false,
},
],
},
{
fields:
[
[
{
type: 'text',
label: 'First Name',
className: 'form-control',
},
{
type: 'select',
label: 'Profession',
className: 'form-control',
values: [
{
label: 'Street Sweeper',
value: 'option-2',
selected: false,
},
{
label: 'Brain Surgeon',
value: 'option-3',
selected: false,
},
],
}
],
[
{
type: 'textarea',
label: 'Short Bio:',
className: 'form-control',
},
}
],
],
},
{
label: 'User Agreement',
fields: [
{
type: 'header',
subtype: 'h3',
label: 'Terms & Conditions',
className: 'header',
},
{
type: 'paragraph',
label:
'Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition. Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment.',
},
{
type: 'paragraph',
label:
'Bring to the table win-win survival strategies to ensure proactive domination. At the end of the day, going forward, a new normal that has evolved from generation X is on the runway heading towards a streamlined cloud solution. User generated content in real-time will have multiple touchpoints for offshoring.',
},
{
[
{
type: 'header',
subtype: 'h3',
label: 'Terms & Conditions',
className: 'header',
},
{
type: 'paragraph',
label:
'Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition. Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment.',
}
],
[
{
type: 'paragraph',
label:
'Bring to the table win-win survival strategies to ensure proactive domination. At the end of the day, going forward, a new normal that has evolved from generation X is on the runway heading towards a streamlined cloud solution. User generated content in real-time will have multiple touchpoints for offshoring.',
}
],
[
{
type: 'checkbox',
label: 'Do you agree to the terms and conditions?',
},
}
],
],
},
]
Expand Down Expand Up @@ -208,20 +228,12 @@ jQuery(function ($) {
const disabledAttrs = ['placeholder', 'name']

const fbOptions = {
defaultFields: [
{
className: 'form-control',
label: 'Default Field',
placeholder: 'Enter your default field value',
name: 'default-field-1',
type: 'text',
},
],

persistDefaultFields: true,
disabledSubtypes: {
text: ['password'],
},
// disableHTMLLabels: true,
disableHTMLLabels: false,
disabledAttrs,
// allowStageSort: false,
dataType,
Expand All @@ -243,7 +255,14 @@ jQuery(function ($) {
stickyControls: {
enable: true,
},
roles: {
1: 'Administrator',
2: 'User'
},
sortableControls: true,
propertiesInModal: true,
maxFieldsInRow: 3,
hideDropZones:false,
fields: fields,
templates: templates,
inputSets: inputSets,
Expand All @@ -253,6 +272,7 @@ jQuery(function ($) {
actionButtons: actionButtons,
disableFields: ['autocomplete', 'custom-tinymce'],
replaceFields: replaceFields,
fieldRemoveWarn: true,
disabledFieldButtons: {
text: ['copy'],
},
Expand All @@ -266,7 +286,8 @@ jQuery(function ($) {
},
scrollToFieldOnAdd: false,
}
const formData = window.sessionStorage.getItem('formData')
var formData = '[ [ { "type": "text", "required": false, "label": "Text Field", "className": "form-control row-1 col-md-12", "name": "text-1639444791603-0", "access": false, "subtype": "text" } ]]'//'[[{"type":"paragraph","subtype":"p","label":"Paragraph","className":"row-1 col-md-12","access":false}],[{"type":"header","subtype":"h3","label":"Header","className":"test row-2 col-md-12","access":false}]]'//'[[{"type":"text","required":false,"label":"Text Field","className":"form-control row-1 col-md-6","name":"text-1636453044631-0","access":false,"subtype":"text","readonly":false},{"type":"text","required":false,"label":"Full Name","className":"form-control row-1 col-md-6","name":"text-1476748004559","access":false,"value":"2","subtype":"text","maxlength":2}],[{"type":"select","required":false,"label":"Select","className":"form-control row-2 col-md-4","name":"select-1636461342702-0","access":false,"multiple":false,"values":[{"label":"Option 1","value":"option-1","selected":true},{"label":"Option 2","value":"option-2","selected":false},{"label":"Option 3","value":"option-3","selected":false}]},{"type":"select","required":false,"label":"Select","className":"form-control row-2 col-md-4","name":"select-1636461306907-0","access":false,"multiple":false,"values":[{"label":"Option 1","value":"option-1","selected":true},{"label":"Option 2","value":"option-2","selected":false},{"label":"Option 3","value":"option-3","selected":false}]},{"type":"select","required":false,"label":"Select","className":"form-control row-2 col-md-4","name":"select-1636453046284-0","access":false,"multiple":false,"values":[{"label":"Option 1","value":"option-1","selected":true},{"label":"Option 2","value":"option-2","selected":false},{"label":"Option 3","value":"option-3","selected":false}]}],[{"type":"text","required":false,"label":"Text Field","className":"form-control row-3 col-md-12","name":"text-1636453050671-0","access":false,"value":"4","subtype":"text","maxlength":4}],[{"type":"select","required":false,"label":"Select","className":"form-control row-4 col-md-12","name":"select-1636461342859-0","access":false,"multiple":false,"values":[{"label":"Option 1","value":"option-1","selected":true},{"label":"Option 2","value":"option-2","selected":false},{"label":"Option 3","value":"option-3","selected":false}]}]]'

let editing = true

if (formData) {
Expand All @@ -283,7 +304,7 @@ jQuery(function ($) {
$('.build-wrap').formBuilder('setData', $('.render-wrap').formRender('userData'))
} else {
const formRenderData = $('.build-wrap').formBuilder('getData', dataType)
$('.render-wrap').formRender({
frControl = $('.render-wrap').formRender({
formData: formRenderData,
templates: templates,
dataType,
Expand Down
5 changes: 2 additions & 3 deletions src/demo/sass/demo.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ body {
}

body {
background-color: #f2f2f2;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAAUVBMVEWFhYWDg4N3d3dtbW17e3t1dXWBgYGHh4d5eXlzc3OLi4ubm5uVlZWPj4+NjY19fX2JiYl/f39ra2uRkZGZmZlpaWmXl5dvb29xcXGTk5NnZ2c8TV1mAAAAG3RSTlNAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAvEOwtAAAFVklEQVR4XpWWB67c2BUFb3g557T/hRo9/WUMZHlgr4Bg8Z4qQgQJlHI4A8SzFVrapvmTF9O7dmYRFZ60YiBhJRCgh1FYhiLAmdvX0CzTOpNE77ME0Zty/nWWzchDtiqrmQDeuv3powQ5ta2eN0FY0InkqDD73lT9c9lEzwUNqgFHs9VQce3TVClFCQrSTfOiYkVJQBmpbq2L6iZavPnAPcoU0dSw0SUTqz/GtrGuXfbyyBniKykOWQWGqwwMA7QiYAxi+IlPdqo+hYHnUt5ZPfnsHJyNiDtnpJyayNBkF6cWoYGAMY92U2hXHF/C1M8uP/ZtYdiuj26UdAdQQSXQErwSOMzt/XWRWAz5GuSBIkwG1H3FabJ2OsUOUhGC6tK4EMtJO0ttC6IBD3kM0ve0tJwMdSfjZo+EEISaeTr9P3wYrGjXqyC1krcKdhMpxEnt5JetoulscpyzhXN5FRpuPHvbeQaKxFAEB6EN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aJhwtD8MNlSBeWNNWTa5Z5kPZw5+LbVT99wqTdx29lMUH4OIG/D86ruKEauBjvH5xy6um/Sfj7ei6UUVk4AIl3MyD4MSSTOFgSwsH/QJWaQ5as7ZcmgBZkzjjU1UrQ74ci1gWBCSGHtuV1H2mhSnO3Wp/3fEV5a+4wz//6qy8JxjZsmxxy5+4w9CDNJY09T072iKG0EnOS0arEYgXqYnXcYHwjTtUNAcMelOd4xpkoqiTYICWFq0JSiPfPDQdnt+4/wuqcXY47QILbgAAAABJRU5ErkJggg==);
background-color: #fff;
font-family: Helvetica, 'Helvetica Neue', Arial, sans-serif;
}

Expand Down Expand Up @@ -43,7 +42,7 @@ body {
background-color: #fff;
tr {
&:nth-child(odd) {
background-color: #ddd;
background-color: #ddd;
}
}
}
Expand Down
Binary file added src/fonts/fa-regular-400.eot
Binary file not shown.
Loading

0 comments on commit db25409

Please sign in to comment.