-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating the form renderer to fix some rendering issues.
- Loading branch information
Showing
16 changed files
with
2,100 additions
and
1,175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
The MIT License (MIT) | ||
Copyright (c) 2015 Form.io | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
this software and associated documentation files (the "Software"), to deal in the | ||
Software without restriction, including without limitation the rights to use, | ||
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the | ||
Software, and to permit persons to whom the Software is furnished to do so, | ||
subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, | ||
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A | ||
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/*! ng-formio v1.6.12 | https://npmcdn.com/[email protected]/LICENSE.txt */ | ||
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
(function (process){ | ||
// vim:ts=4:sts=4:sw=4: | ||
|
@@ -6499,7 +6500,7 @@ module.exports = function() { | |
}; | ||
|
||
// Show the current page. | ||
var showPage = function() { | ||
var showPage = function(scroll) { | ||
// If the page is past the components length, try to clear first. | ||
if ($scope.currentPage >= $scope.form.components.length) { | ||
$scope.clear(); | ||
|
@@ -6525,7 +6526,9 @@ module.exports = function() { | |
}))($scope)); | ||
$scope.wizardLoaded = true; | ||
$scope.formioAlerts = []; | ||
window.scrollTo(0, 0); | ||
if (scroll) { | ||
window.scrollTo(0, 0); | ||
} | ||
$scope.$emit('wizardPage', $scope.currentPage); | ||
}; | ||
|
||
|
@@ -6591,7 +6594,7 @@ module.exports = function() { | |
|
||
$scope.cancel = function() { | ||
$scope.clear(); | ||
showPage(); | ||
showPage(true); | ||
}; | ||
|
||
// Move onto the next page. | ||
|
@@ -6603,7 +6606,7 @@ module.exports = function() { | |
return; | ||
} | ||
$scope.currentPage++; | ||
showPage(); | ||
showPage(true); | ||
$scope.$emit('wizardNext', $scope.currentPage); | ||
}; | ||
|
||
|
@@ -6613,7 +6616,7 @@ module.exports = function() { | |
return; | ||
} | ||
$scope.currentPage--; | ||
showPage(); | ||
showPage(true); | ||
$scope.$emit('wizardPrev', $scope.currentPage); | ||
}; | ||
|
||
|
@@ -6625,7 +6628,7 @@ module.exports = function() { | |
return; | ||
} | ||
$scope.currentPage = page; | ||
showPage(); | ||
showPage(true); | ||
}; | ||
|
||
$scope.isValid = function() { | ||
|
@@ -7163,7 +7166,7 @@ app.run([ | |
function($templateCache) { | ||
// The template for the formio forms. | ||
$templateCache.put('formio.html', | ||
"<div>\n <i style=\"font-size: 2em;\" ng-if=\"formLoading\" class=\"glyphicon glyphicon-refresh glyphicon-spin\"></i>\n <formio-wizard ng-if=\"form.display === 'wizard'\" src=\"src\" form=\"form\" submission=\"submission\" form-action=\"formAction\" read-only=\"readOnly\" hide-components=\"hideComponents\" formio-options=\"formioOptions\" storage=\"form.name\"></formio-wizard>\n <form ng-if=\"!form.display || (form.display === 'form')\" role=\"form\" name=\"formioForm\" ng-submit=\"onSubmit(formioForm)\" novalidate>\n <div ng-repeat=\"alert in formioAlerts track by $index\" class=\"alert alert-{{ alert.type }}\" role=\"alert\">\n {{ alert.message }}\n </div>\n <formio-component ng-repeat=\"component in form.components track by $index\" component=\"component\" data=\"submission.data\" form=\"formioForm\" formio=\"formio\" read-only=\"readOnly || component.disabled\"></formio-component>\n </form>\n</div>\n" | ||
"<div>\n <i style=\"font-size: 2em;\" ng-if=\"formLoading\" class=\"glyphicon glyphicon-refresh glyphicon-spin\"></i>\n <formio-wizard ng-if=\"form.display === 'wizard'\" src=\"src\" form=\"form\" submission=\"submission\" form-action=\"formAction\" read-only=\"readOnly\" hide-components=\"hideComponents\" formio-options=\"formioOptions\" storage=\"form.name\"></formio-wizard>\n <ng-form ng-if=\"!form.display || (form.display === 'form')\" role=\"form\" name=\"formioForm\" ng-submit=\"onSubmit(formioForm)\" novalidate>\n <div ng-repeat=\"alert in formioAlerts track by $index\" class=\"alert alert-{{ alert.type }}\" role=\"alert\">\n {{ alert.message }}\n </div>\n <!-- DO NOT PUT \"track by $index\" HERE SINCE DYNAMICALLY ADDING/REMOVING COMPONENTS WILL BREAK -->\n <formio-component ng-repeat=\"component in form.components\" component=\"component\" data=\"submission.data\" form=\"formioForm\" formio=\"formio\" read-only=\"readOnly || component.disabled\"></formio-component>\n </ng-form>\n</div>\n" | ||
); | ||
|
||
$templateCache.put('formio-wizard.html', | ||
|
@@ -7184,7 +7187,7 @@ app.run([ | |
|
||
// A formio component template. | ||
$templateCache.put('formio/component.html', | ||
"<ng-form name=\"formioFieldForm\" class=\"formio-component-{{ component.key }}\" ng-hide=\"component.hidden\">\n <div class=\"form-group has-feedback form-field-type-{{ component.type }} {{component.customClass}}\" id=\"form-group-{{ component.key }}\" ng-class=\"{'has-error': formioFieldForm[component.key].$invalid && !formioFieldForm[component.key].$pristine }\" ng-style=\"component.style\">\n <formio-element></formio-element>\n </div>\n</ng-form>\n" | ||
"<div name=\"formioFieldForm\" class=\"formio-component-{{ component.key }}\" ng-hide=\"component.hidden\">\n <div class=\"form-group has-feedback form-field-type-{{ component.type }} {{component.customClass}}\" id=\"form-group-{{ component.key }}\" ng-class=\"{'has-error': formioFieldForm[component.key].$invalid && !formioFieldForm[component.key].$pristine }\" ng-style=\"component.style\">\n <formio-element></formio-element>\n </div>\n</div>\n" | ||
); | ||
|
||
$templateCache.put('formio/errors.html', | ||
|
@@ -7578,4 +7581,4 @@ module.exports = function() { | |
}; | ||
}; | ||
|
||
},{}]},{},[56]); | ||
},{}]},{},[56]); |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<ng-form name="formioFieldForm" class="formio-component-{{ component.key }}" ng-hide="component.hidden"> | ||
<div name="formioFieldForm" class="formio-component-{{ component.key }}" ng-hide="component.hidden"> | ||
<div class="form-group has-feedback form-field-type-{{ component.type }} {{component.customClass}}" id="form-group-{{ component.key }}" ng-class="{'has-error': formioFieldForm[component.key].$invalid && !formioFieldForm[component.key].$pristine }" ng-style="component.style"> | ||
<formio-element></formio-element> | ||
</div> | ||
</ng-form> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
<div> | ||
<i style="font-size: 2em;" ng-if="formLoading" class="glyphicon glyphicon-refresh glyphicon-spin"></i> | ||
<formio-wizard ng-if="form.display === 'wizard'" src="src" form="form" submission="submission" form-action="formAction" read-only="readOnly" hide-components="hideComponents" formio-options="formioOptions" storage="form.name"></formio-wizard> | ||
<form ng-if="!form.display || (form.display === 'form')" role="form" name="formioForm" ng-submit="onSubmit(formioForm)" novalidate> | ||
<ng-form ng-if="!form.display || (form.display === 'form')" role="form" name="formioForm" ng-submit="onSubmit(formioForm)" novalidate> | ||
<div ng-repeat="alert in formioAlerts track by $index" class="alert alert-{{ alert.type }}" role="alert"> | ||
{{ alert.message }} | ||
</div> | ||
<formio-component ng-repeat="component in form.components track by $index" component="component" data="submission.data" form="formioForm" formio="formio" read-only="readOnly || component.disabled"></formio-component> | ||
</form> | ||
<!-- DO NOT PUT "track by $index" HERE SINCE DYNAMICALLY ADDING/REMOVING COMPONENTS WILL BREAK --> | ||
<formio-component ng-repeat="component in form.components" component="component" data="submission.data" form="formioForm" formio="formio" read-only="readOnly || component.disabled"></formio-component> | ||
</ng-form> | ||
</div> |