forked from json-schema-form/angular-schema-form-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap-decorator.min.js
2 lines (2 loc) · 37.8 KB
/
bootstrap-decorator.min.js
1
2
angular.module("schemaForm").run(["$templateCache",function(e){e.put("decorators/bootstrap/actions-trcl.html",'<div class="btn-group schema-form-actions {{form.htmlClass}}" ng-transclude=""></div>'),e.put("decorators/bootstrap/actions.html",'<div class="btn-group schema-form-actions {{form.htmlClass}}"><input ng-repeat-start="item in form.items" type="submit" class="btn {{ item.style || \'btn-default\' }} {{form.fieldHtmlClass}}" value="{{item.title}}" ng-if="item.type === \'submit\'"> <button ng-repeat-end="" class="btn {{ item.style || \'btn-default\' }} {{form.fieldHtmlClass}}" type="button" ng-disabled="form.readonly" ng-if="item.type !== \'submit\'" ng-click="buttonClick($event,item)"><span ng-if="item.icon" class="{{item.icon}}"></span>{{item.title}}</button></div>'),e.put("decorators/bootstrap/array.html",'<div ng-if="form.readonly && $$value$$" sf-array="form" class="schema-form-array {{form.htmlClass}}" ng-model="$$value$$" ng-model-options="form.ngModelOptions"><label class="control-label" ng-show="showTitle()">{{ form.title }}</label><ol class="list-group" ng-model="modelArray" ui-sortable=""><li class="list-group-item {{form.fieldHtmlClass}}" ng-repeat="item in modelArray track by $index"><sf-decorator ng-init="arrayIndex = $index" form="copyWithIndex($index)"></sf-decorator></li></ol></div><div sf-array="form" class="schema-form-array {{form.htmlClass}}" ng-if="!form.readonly" ng-model="$$value$$" ng-model-options="form.ngModelOptions"><label class="control-label" ng-show="showTitle()">{{ form.title }}</label><ol class="list-group" ng-model="modelArray" ui-sortable=""><li class="list-group-item {{form.fieldHtmlClass}}" ng-repeat="item in modelArray track by $index"><button ng-hide="form.readonly || form.remove === null" ng-click="deleteFromArray($index)" style="position: relative; z-index: 20;" type="button" class="close pull-right"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button><sf-decorator ng-init="arrayIndex = $index" form="copyWithIndex($index)"></sf-decorator></li></ol><div class="clearfix" style="padding: 15px;"><button ng-hide="form.readonly || form.add === null" ng-click="appendToArray()" type="button" class="btn {{ form.style.add || \'btn-default\' }} pull-right"><i class="glyphicon glyphicon-plus"></i> {{ form.add || \'Add\'}}</button></div><div class="help-block" ng-show="(hasError() && errorMessage(schemaError())) || form.description" ng-bind-html="(hasError() && errorMessage(schemaError())) || form.description"></div></div>'),e.put("decorators/bootstrap/checkbox.html",'<div class="checkbox schema-form-checkbox {{form.htmlClass}}" ng-class="{\'has-error\': form.disableErrorState !== true && hasError(), \'has-success\': form.disableSuccessState !== true && hasSuccess()}"><label class="{{form.labelHtmlClass}}"><input type="checkbox" sf-changed="form" ng-disabled="form.readonly" ng-model="$$value$$" ng-model-options="form.ngModelOptions" schema-validate="form" class="{{form.fieldHtmlClass}}" name="{{form.key.slice(-1)[0]}}"> <span ng-bind-html="form.title"></span></label><div class="help-block" sf-message="form.description"></div></div>'),e.put("decorators/bootstrap/checkboxes.html",'<div sf-array="form" ng-model="$$value$$" class="form-group schema-form-checkboxes {{form.htmlClass}}" ng-class="{\'has-error\': form.disableErrorState !== true && hasError(), \'has-success\': form.disableSuccessState !== true && hasSuccess()}"><label class="control-label {{form.labelHtmlClass}}" ng-show="showTitle()">{{form.title}}</label><div class="checkbox" ng-repeat="val in titleMapValues track by $index"><label><input type="checkbox" ng-disabled="form.readonly" sf-changed="form" class="{{form.fieldHtmlClass}}" ng-model="titleMapValues[$index]" name="{{form.key.slice(-1)[0]}}"> <span ng-bind-html="form.titleMap[$index].name"></span></label></div><div class="help-block" sf-message="form.description"></div></div>'),e.put("decorators/bootstrap/cut-image.html",'<style>\r\n .cropArea {\r\n background: #E4E4E4;\r\n overflow: hidden;\r\n /*width:500px;*/\r\n height:350px;\r\n }\r\n\r\n /** Styling input[type=file] **/\r\n .btn-file { position: relative; overflow: hidden; margin-right: 4px; }\r\n .btn-file input { position: absolute; top: 0; right: 0; margin: 0; opacity: 0; filter: alpha(opacity=0);\r\n transform: translate(-300px, 0) scale(4); font-size: 23px; direction: ltr; cursor: pointer; }\r\n /* Fix for IE 7: */\r\n * + html .btn-file { padding: 2px 15px; margin: 1px 0 0 0; }\r\n</style><div class="dialog"><div class="modal-header"><h3 class="modal-title">{{title}}</h3></div><div class="modal-body"><div><div class="cropArea"><img-crop image="fullImage" result-image="croppedImage" area-type="square"></img-crop></div></div></div><div class="modal-footer"><span class="btn btn-default btn-file navbar-left"><i class="glyphicon glyphicon-folder-open"></i> <input type="file" id="fileInput" name="fileInput" onchange="angular.element(this).scope().file_changed(this)"></span> <button class="btn btn-primary" ng-click="ok()">{{translate(\'button.ok\')}}</button> <button class="btn btn-warning" ng-click="cancel()">{{translate(\'button.cancel\')}}</button></div></div>'),e.put("decorators/bootstrap/default.html",'<div ng-if="form.readonly && $$value$$ && $$value$$.length > 0" class="panel panel-default schema-form-{{form.type}} {{form.htmlClass}}"><div class="panel-heading"><label ng-show="showTitle()">{{form.title}}</label></div><div class="panel-body"><span ng-bind="$$value$$"></span> <button ng-if="form.description" class="btn btn-default pull-right" ng-click="tab.show_index = !tab.show_index ? $index : tab.show_index !== $index ? $index : null"><i class="glyphicon glyphicon-question-sign"></i></button></div><div class="panel-footer" ng-if="form.feedback || (form.description && tab.show_index === $index )"><span ng-if="form.feedback !== false" class="form-control-feedback" aria-hidden="true"></span><div ng-show="tab.show_index === $index" class="help-block" sf-message="form.description"></div></div></div><div class="form-group schema-form-{{form.type}} {{form.htmlClass}}" ng-if="!form.readonly" ng-class="{\'has-error\': form.disableErrorState !== true && hasError(), \'has-success\': form.disableSuccessState !== true && hasSuccess(), \'has-feedback\': form.feedback !== false }"><label class="control-label {{form.labelHtmlClass}}" ng-class="{\'sr-only\': !showTitle()}" for="{{form.key.slice(-1)[0]}}">{{form.title}}</label><div ng-class="{\'input-group\': form.description || hasSuccess() }" ng-if="!form.fieldAddonLeft && !form.fieldAddonRight"><input ng-show="form.key" type="{{form.type}}" step="any" sf-changed="form" placeholder="{{form.placeholder}}" class="form-control {{form.fieldHtmlClass}}" id="{{form.key.slice(-1)[0]}}" ng-model-options="form.ngModelOptions" ng-model="$$value$$" ng-disabled="form.readonly" schema-validate="form" name="{{form.key.slice(-1)[0]}}" aria-describedby="{{form.key.slice(-1)[0] + \'Status\'}}"> <span class="input-group-btn"><button class="btn btn-default" style="border-color: #3c763d;" ng-if="hasSuccess() && form.feedback !== false" disabled="disabled"><i class="glyphicon glyphicon-ok" style="color: #3c763d;"></i></button> <button ng-if="form.description" class="btn btn-default" ng-click="tab.show_index = !tab.show_index ? $index : tab.show_index !== $index ? $index : null"><i class="glyphicon glyphicon-question-sign"></i></button></span></div><div ng-if="form.fieldAddonLeft || form.fieldAddonRight" class="input-group"><span ng-if="form.fieldAddonLeft" class="input-group-addon" ng-bind-html="form.fieldAddonLeft"></span> <input ng-show="form.key" type="{{form.type}}" step="any" sf-changed="form" placeholder="{{form.placeholder}}" class="form-control {{form.fieldHtmlClass}}" id="{{form.key.slice(-1)[0]}}" ng-model-options="form.ngModelOptions" ng-model="$$value$$" ng-disabled="form.readonly" schema-validate="form" name="{{form.key.slice(-1)[0]}}" aria-describedby="{{form.key.slice(-1)[0] + \'Status\'}}"> <span class="input-group-btn"><button class="btn btn-default" style="border-color: #3c763d;" ng-if="hasSuccess() && form.feedback !== false" disabled="disabled"><i class="glyphicon glyphicon-ok" style="color: #3c763d;"></i></button> <button ng-if="form.description" class="btn btn-default" ng-click="tab.show_index = !tab.show_index ? $index : tab.show_index !== $index ? $index : null"><i class="glyphicon glyphicon-question-sign"></i></button></span> <span ng-if="form.fieldAddonRight" class="input-group-addon" ng-bind-html="form.fieldAddonRight"></span></div><span ng-if="hasError() || hasSuccess()" id="{{form.key.slice(-1)[0] + \'Status\'}}" class="sr-only">{{ hasSuccess() ? \'(success)\' : \'(error)\' }}</span><div ng-show="$index === tab.show_index" class="help-block" ng-if="form.description" sf-message="form.description"></div></div>'),e.put("decorators/bootstrap/fieldset.html",'<fieldset ng-disabled="form.readonly" class="schema-form-fieldset {{form.htmlClass}}"><legend ng-class="{\'sr-only\': !showTitle() }">{{ form.title }}</legend><div class="help-block" ng-show="form.description" ng-bind-html="form.description"></div><sf-decorator ng-repeat="item in form.items" form="item"></sf-decorator></fieldset>'),e.put("decorators/bootstrap/help.html",'<div class="helpvalue schema-form-helpvalue {{form.htmlClass}}" ng-bind-html="form.helpvalue"></div>'),e.put("decorators/bootstrap/image-url.html",'<div ng-if="form.readonly && $$value$$ && $$value$$.length > 0" class="panel panel-default schema-form-{{form.type}} {{form.htmlClass}}"><div class="panel-heading"><label ng-show="showTitle()">{{form.title}}</label></div><div class="panel-body"><img class="img-responsive" ng-src="{{$$value$$}}" alt=""> <button ng-if="form.description" class="btn btn-default pull-right" ng-click="tab.show_index = !tab.show_index ? $index : tab.show_index !== $index ? $index : null"><i class="glyphicon glyphicon-question-sign"></i></button></div><div class="panel-footer" ng-if="form.feedback || (form.description && tab.show_index === $index )"><span ng-if="form.feedback !== false" class="form-control-feedback" aria-hidden="true"></span><div ng-show="tab.show_index === $index" class="help-block" sf-message="form.description"></div></div></div><div class="form-group schema-form-{{form.type}} {{form.htmlClass}}" ng-if="!form.readonly" ng-class="{\'has-error\': form.disableErrorState !== true && hasError(), \'has-success\': form.disableSuccessState !== true && hasSuccess(), \'has-feedback\': form.feedback !== false }"><label class="control-label {{form.labelHtmlClass}}" ng-class="{\'sr-only\': !showTitle()}" for="{{form.key.slice(-1)[0]}}">{{form.title}}</label><div ng-class="{\'input-group\': form.description || hasSuccess() }" ng-if="!form.fieldAddonLeft && !form.fieldAddonRight"><input ng-if="!form.fieldAddonLeft && !form.fieldAddonRight" ng-show="form.key" type="{{form.type}}" step="any" sf-changed="form" placeholder="{{form.placeholder}}" class="form-control {{form.fieldHtmlClass}}" id="{{form.key.slice(-1)[0]}}" ng-model-options="form.ngModelOptions" ng-model="$$value$$" ng-disabled="form.readonly" schema-validate="form" name="{{form.key.slice(-1)[0]}}" aria-describedby="{{form.key.slice(-1)[0] + \'Status\'}}"> <span class="input-group-btn"><button class="btn btn-default" ng-if="hasSuccess() && form.feedback !== false" disabled="disabled"><i class="glyphicon glyphicon-ok" style="color: #3c763d;"></i></button> <button ng-if="form.description" class="btn btn-default" ng-click="tab.show_index = !tab.show_index ? $index : tab.show_index !== $index ? $index : null"><i class="glyphicon glyphicon-question-sign"></i></button></span></div><button class="btn btn-default" ng-click="$ctrl.open()"><i class="glyphicon glyphicon-plus-sign"></i> <span>Add image</span></button><script type="text/ng-template" id="myModalContent.html"><style> </style> <div class="modal-header"> <h3 class="modal-title" id="modal-title">I\'m a modal!</h3> </div> <div class="modal-body" id="modal-body"> <ul> <li ng-repeat="item in $ctrl.items"> <a href="#" ng-click="$event.preventDefault(); $ctrl.selected.item = item">{{ item }}</a> </li> </ul> Selected: <b>{{ $ctrl.selected.item }}</b> </div> <div class="modal-footer"> <button class="btn btn-primary" type="button" ng-click="$ctrl.ok()">OK</button> <button class="btn btn-warning" type="button" ng-click="$ctrl.cancel()">Cancel</button> </div></script><div ng-if="form.fieldAddonLeft || form.fieldAddonRight" ng-class="{\'input-group\': (form.fieldAddonLeft || form.fieldAddonRight)}"><span ng-if="form.fieldAddonLeft" class="input-group-addon" ng-bind-html="form.fieldAddonLeft"></span> <input ng-show="form.key" type="{{form.type}}" step="any" sf-changed="form" placeholder="{{form.placeholder}}" class="form-control {{form.fieldHtmlClass}}" id="{{form.key.slice(-1)[0]}}" ng-model-options="form.ngModelOptions" ng-model="$$value$$" ng-disabled="form.readonly" schema-validate="form" name="{{form.key.slice(-1)[0]}}" aria-describedby="{{form.key.slice(-1)[0] + \'Status\'}}"> <span class="input-group-btn"><button class="btn btn-default" ng-if="hasSuccess() && form.feedback !== false" disabled="disabled"><i class="glyphicon glyphicon-ok" style="color: #3c763d;"></i></button> <button ng-if="form.description" class="btn btn-default" ng-click="tab.show_index = !tab.show_index ? $index : tab.show_index !== $index ? $index : null"><i class="glyphicon glyphicon-question-sign"></i></button></span> <img class="img-thumbnail" ng-show="form.key" ng-src="{{$$value$$}}" alt="" width="{{form.preview.width}}" height="{{form.preview.height}}"> <span ng-if="form.fieldAddonRight" class="input-group-addon" ng-bind-html="form.fieldAddonRight"></span></div><span ng-if="hasError() || hasSuccess()" id="{{form.key.slice(-1)[0] + \'Status\'}}" class="sr-only">{{ hasSuccess() ? \'(success)\' : \'(error)\' }}</span><div ng-show="$index === tab.show_index" class="help-block" sf-message="form.description"></div></div><script>\r\n\r\n angular.module(\'ui.bootstrap.demo\', [\'ngAnimate\', \'ngSanitize\', \'ui.bootstrap\']);\r\n angular.module(\'ui.bootstrap.demo\').controller(\'ModalDemoCtrl\', function ($uibModal, $log) {\r\n var $ctrl = this;\r\n $ctrl.items = [\'item1\', \'item2\', \'item3\'];\r\n\r\n $ctrl.animationsEnabled = true;\r\n\r\n $ctrl.title = "asdasd";\r\n\r\n $ctrl.open = function (size) {\r\n var modalInstance = $uibModal.open({\r\n animation: $ctrl.animationsEnabled,\r\n ariaLabelledBy: \'modal-title\',\r\n ariaDescribedBy: \'modal-body\',\r\n templateUrl: \'myModalContent.html\',\r\n controller: \'ModalInstanceCtrl\',\r\n controllerAs: \'$ctrl\',\r\n size: size,\r\n resolve: {\r\n items: function () {\r\n return $ctrl.items;\r\n }\r\n }\r\n });\r\n\r\n modalInstance.result.then(function (selectedItem) {\r\n $ctrl.selected = selectedItem;\r\n }, function () {\r\n $log.info(\'Modal dismissed at: \' + new Date());\r\n });\r\n };\r\n\r\n $ctrl.openComponentModal = function () {\r\n var modalInstance = $uibModal.open({\r\n animation: $ctrl.animationsEnabled,\r\n component: \'modalComponent\',\r\n resolve: {\r\n items: function () {\r\n return $ctrl.items;\r\n }\r\n }\r\n });\r\n\r\n modalInstance.result.then(function (selectedItem) {\r\n $ctrl.selected = selectedItem;\r\n }, function () {\r\n $log.info(\'modal-component dismissed at: \' + new Date());\r\n });\r\n };\r\n\r\n $ctrl.toggleAnimation = function () {\r\n $ctrl.animationsEnabled = !$ctrl.animationsEnabled;\r\n };\r\n });\r\n\r\n // Please note that $uibModalInstance represents a modal window (instance) dependency.\r\n // It is not the same as the $uibModal service used above.\r\n\r\n angular.module(\'ui.bootstrap.demo\').controller(\'ModalInstanceCtrl\', function ($uibModalInstance, items) {\r\n var $ctrl = this;\r\n $ctrl.items = items;\r\n $ctrl.selected = {\r\n item: $ctrl.items[0]\r\n };\r\n\r\n $ctrl.ok = function () {\r\n $uibModalInstance.close($ctrl.selected.item);\r\n };\r\n\r\n $ctrl.cancel = function () {\r\n $uibModalInstance.dismiss(\'cancel\');\r\n };\r\n });\r\n\r\n // Please note that the close and dismiss bindings are from $uibModalInstance.\r\n\r\n angular.module(\'ui.bootstrap.demo\').component(\'modalComponent\', {\r\n templateUrl: \'myModalContent.html\',\r\n bindings: {\r\n resolve: \'<\',\r\n close: \'&\',\r\n dismiss: \'&\'\r\n },\r\n controller: function () {\r\n var $ctrl = this;\r\n\r\n $ctrl.$onInit = function () {\r\n $ctrl.items = $ctrl.resolve.items;\r\n $ctrl.selected = {\r\n item: $ctrl.items[0]\r\n };\r\n };\r\n\r\n $ctrl.ok = function () {\r\n $ctrl.close({$value: $ctrl.selected.item});\r\n };\r\n\r\n $ctrl.cancel = function () {\r\n $ctrl.dismiss({$value: \'cancel\'});\r\n };\r\n }\r\n });\r\n\r\n</script>'),e.put("decorators/bootstrap/radio-buttons-allergens.html",'<div ng-if="form.readonly" class="form-group panel panel-default {{form.htmlClass}}"><div class="panel-heading"><label class="control-label {{form.labelHtmlClass}}" ng-show="showTitle()">{{form.title}}</label></div><div ng-repeat="item in form.titleMap"><p class="panel-body" ng-if="item.value == $$value$$"><i ng-if="item.value === \'C\'" class="allergencolor fa fa-lg fa-square"></i> <i ng-if="item.value === \'T\'" class="allergencolor fa fa-lg fa-play fa-rotate-270"></i> <i ng-if="item.value === \'F\'" class="allergencolor fa fa-lg fa-circle"></i> <i ng-if="item.value === \'U\'" class="allergencolor fa fa-lg fa-question-circle"></i> {{item.name}}</p></div><div ng-if="form.description" class="panel-footer help-block" sf-message="form.description"></div></div><div ng-if="!form.readonly" class="form-group schema-form-radiobuttons {{form.htmlClass}}" ng-class="{\'has-error\': form.disableErrorState !== true && hasError(), \'has-success\': form.disableSuccessState !== true && hasSuccess()}"><div><label class="control-label {{form.labelHtmlClass}}" ng-show="showTitle()">{{form.title}}</label></div><div class="btn-group"><label class="btn {{ (item.value === $$value$$) ? form.style.selected || \'btn-default\' : form.style.unselected || \'btn-default\'; }}" ng-class="{ active: item.value === $$value$$ }" ng-repeat="item in form.titleMap"><input type="radio" class="{{form.fieldHtmlClass}}" sf-changed="form" style="display: none;" ng-disabled="form.readonly" ng-model="$$value$$" ng-model-options="form.ngModelOptions" schema-validate="form" ng-value="item.value" name="{{form.key.join(\'.\')}}"> <span ng-bind-html="item.name"></span></label></div><div class="help-block" sf-message="form.description"></div></div>'),e.put("decorators/bootstrap/radio-buttons.html",'<div ng-if="form.readonly" class="form-group panel panel-default {{form.htmlClass}}"><div class="panel-heading"><label class="control-label {{form.labelHtmlClass}}" ng-show="showTitle()">{{form.title}}</label></div><div ng-repeat="item in form.titleMap"><p class="panel-body" ng-if="item.value == $$value$$">{{item.name}}</p></div><div ng-if="form.description" class="panel-footer help-block" sf-message="form.description"></div></div><div ng-if="!form.readonly" class="form-group schema-form-radiobuttons {{form.htmlClass}}" ng-class="{\'has-error\': form.disableErrorState !== true && hasError(), \'has-success\': form.disableSuccessState !== true && hasSuccess()}"><div><label class="control-label {{form.labelHtmlClass}}" ng-show="showTitle()">{{form.title}}</label></div><div class="btn-group"><label class="btn {{ (item.value === $$value$$) ? form.style.selected || \'btn-default\' : form.style.unselected || \'btn-default\'; }}" ng-class="{ active: item.value === $$value$$ }" ng-repeat="item in form.titleMap"><input type="radio" class="{{form.fieldHtmlClass}}" sf-changed="form" style="display: none;" ng-disabled="form.readonly" ng-model="$$value$$" ng-model-options="form.ngModelOptions" schema-validate="form" ng-value="item.value" name="{{form.key.join(\'.\')}}"> <span ng-bind-html="item.name"></span></label></div><div class="help-block" sf-message="form.description"></div></div>'),e.put("decorators/bootstrap/radios-inline.html",'<div class="form-group schema-form-radios-inline {{form.htmlClass}}" ng-class="{\'has-error\': form.disableErrorState !== true && hasError(), \'has-success\': form.disableSuccessState !== true && hasSuccess()}"><label ng-model="$$value$$" ng-model-options="form.ngModelOptions" schema-validate="form" class="control-label {{form.labelHtmlClass}}" ng-show="showTitle()">{{form.title}}</label><div><label class="radio-inline" ng-repeat="item in form.titleMap"><input type="radio" class="{{form.fieldHtmlClass}}" sf-changed="form" ng-disabled="form.readonly" ng-model="$$value$$" ng-value="item.value" name="{{form.key.join(\'.\')}}"> <span ng-bind-html="item.name"></span></label></div><div class="help-block" sf-message="form.description"></div></div>'),e.put("decorators/bootstrap/radios.html",'<div class="form-group schema-form-radios {{form.htmlClass}}" ng-class="{\'has-error\': form.disableErrorState !== true && hasError(), \'has-success\': form.disableSuccessState !== true && hasSuccess()}"><label ng-model="$$value$$" ng-model-options="form.ngModelOptions" schema-validate="form" class="control-label {{form.labelHtmlClass}}" ng-show="showTitle()">{{form.title}}</label><div class="radio" ng-repeat="item in form.titleMap"><label><input type="radio" class="{{form.fieldHtmlClass}}" sf-changed="form" ng-disabled="form.readonly" ng-model="$$value$$" ng-value="item.value" name="{{form.key.join(\'.\')}}"> <span ng-bind-html="item.name"></span></label></div><div class="help-block" sf-message="form.description"></div></div>'),e.put("decorators/bootstrap/rollup.html",'<fieldset ng-disabled="form.readonly" class="schema-form-fieldset {{form.htmlClass}}"><div ng-click="form.hide_fieldset = !form.hide_fieldset"><label class="control-label">{{ form.title }}</label> <i class="pull-right glyphicon ng-scope" ng-class="{\'glyphicon-chevron-down\': form.hide_fieldset, \'glyphicon-chevron-right\': !form.hide_fieldset}"></i></div><div ng-show="!form.hide_fieldset" style="border-top: 1px solid #ddd; margin-bottom: 20px;"></div><div class="help-block" ng-show="form.description" ng-bind-html="form.description"></div><ol ng-show="form.hide_fieldset" class="list-group"><li class="list-group-item {{form.fieldHtmlClass}}"><sf-decorator ng-repeat="item in form.items" form="item"></sf-decorator></li></ol></fieldset>'),e.put("decorators/bootstrap/section.html",'<div class="schema-form-section {{form.htmlClass}}"><sf-decorator ng-repeat="item in form.items" form="item"></sf-decorator></div>'),e.put("decorators/bootstrap/select.html",'<div class="form-group {{form.htmlClass}} schema-form-select" ng-class="{\'has-error\': form.disableErrorState !== true && hasError(), \'has-success\': form.disableSuccessState !== true && hasSuccess(), \'has-feedback\': form.feedback !== false}"><label class="control-label {{form.labelHtmlClass}}" ng-show="showTitle()">{{form.title}}</label><select ng-model="$$value$$" ng-model-options="form.ngModelOptions" ng-disabled="form.readonly" sf-changed="form" class="form-control {{form.fieldHtmlClass}}" schema-validate="form" ng-options="item.value as item.name group by item.group for item in form.titleMap" name="{{form.key.slice(-1)[0]}}"></select><div class="help-block" sf-message="form.description"></div></div>'),e.put("decorators/bootstrap/strapselect.html",'<div ng-if="!form.readonly" ng-controller="dynamicSelectController" class="form-group {{form.htmlClass}}" ng-class="{\'has-error\': hasError(), \'has-success\': hasSuccess()}"><label class="control-label {{form.labelHtmlClass}}" ng-show="showTitle()">{{form.title}}</label><div class="form-group {{form.fieldHtmlClass}}" ng-init="populateTitleMap(form)"><button ng-if="(form.options.multiple == \'true\') || (form.options.multiple == true)" type="button" class="btn btn-default" sf-changed="form" schema-validate="form" ng-model="$$value$$" data-placeholder="{{form.placeholder || form.schema.placeholder || (\'placeholders.select\')}}" data-html="1" data-multiple="1" data-max-length="{{form.options.inlineMaxLength}}" data-max-length-html="{{form.options.inlineMaxLengthHtml}}" bs-options="item.value as item.name for item in form.titleMap | selectFilter:this:$$value$$:"$$value$$"" bs-select=""></button> <button ng-if="!((form.options.multiple == \'true\') || (form.options.multiple == true))" type="button" class="btn btn-default" sf-changed="form" schema-validate="form" ng-model="$$value$$" data-placeholder="{{form.placeholder || form.schema.placeholder || (\'placeholders.select\')}}" data-html="1" bs-options="item.value as item.name for item in form.titleMap | selectFilter:this:$$value$$:"$$value$$"" bs-select=""></button> <span class="help-block">{{ (hasError() && errorMessage(schemaError())) || form.description}}</span></div></div><div ng-if="form.readonly && (form.titleMap | emptyArray).length > 0 && $$value$$" ng-controller="dynamicSelectController" class="panel panel-default {{form.htmlClass}}"><div class="panel-heading" ng-show="showTitle()"><label>{{form.title}}</label></div><div class="panel panel-body {{form.fieldHtmlClass}}" ng-init="populateTitleMap(form)"><div ng-if="(form.options.multiple === \'true\') || (form.options.multiple === true)"><div ng-repeat="item in form.titleMap | filterMulti:$$value$$">{{item.name}}</div></div><div ng-if="!((form.options.multiple == \'true\') || (form.options.multiple == true))"><div ng-repeat="item in form.titleMap"><div ng-if="item.value == $$value$$">{{item.name}}</div></div></div></div><div ng-if="form.description" class="panel-footer">{{form.description}}</div></div>'),e.put("decorators/bootstrap/submit.html",'<div class="form-group schema-form-submit {{form.htmlClass}}"><input type="submit" class="btn {{ form.style || \'btn-primary\' }} {{form.fieldHtmlClass}}" value="{{form.title}}" ng-disabled="form.readonly" ng-if="form.type === \'submit\'"> <button class="btn {{ form.style || \'btn-default\' }}" type="button" ng-click="buttonClick($event,form)" ng-disabled="form.readonly" ng-if="form.type !== \'submit\'"><span ng-if="form.icon" class="{{form.icon}}"></span> {{form.title}}</button></div>'),e.put("decorators/bootstrap/tabarray-inline.html",'<div ng-if="!form.readonly" sf-array="form" ng-init="selected = { tab: 0 }" class="clearfix schema-form-tabarray schema-form-tabarray-{{form.tabType || \'left\'}} {{form.htmlClass}}"><div ng-if="!form.tabType || form.tabType !== \'right\'" ng-class="{\'col-xs-3\': !form.tabType || form.tabType === \'left\'}"><ul class="nav nav-tabs" ng-class="{ \'tabs-left\': !form.tabType || form.tabType === \'left\'}"><li ng-repeat="item in modelArray track by $index" ng-click="$event.preventDefault() || (selected.tab = $index)" ng-class="{active: selected.tab === $index}"><a class="link-hide-style"><span>{{interp(form.title,{\'$index\':$index, value: item}) || $index}}</span><div ng-hide="form.readonly" class="pull-right remove-hide-style" ng-click="selected.tab = deleteFromArray($index).length - 1"><i class="glyphicon glyphicon-trash"></i></div></a></li><li ng-hide="form.readonly" ng-click="$event.preventDefault() || (selected.tab = appendToArray().length - 1)"><a href="#"><i class="glyphicon glyphicon-plus"></i> {{ form.add || \'Add\'}}</a></li></ul></div><div ng-class="{\'col-xs-9\': !form.tabType || form.tabType === \'left\' || form.tabType === \'right\'}"><div class="tab-content {{form.fieldHtmlClass}}"><div class="tab-pane clearfix" ng-repeat="item in modelArray track by $index" ng-show="selected.tab === $index" ng-class="{active: selected.tab === $index}"><sf-decorator ng-init="arrayIndex = $index" form="copyWithIndex($index)"></sf-decorator></div></div></div><div ng-if="form.tabType === \'right\'" class="col-xs-3"><ul class="nav nav-tabs tabs-right"><li ng-repeat="item in modelArray track by $index" ng-click="$event.preventDefault() || (selected.tab = $index)" ng-class="{active: selected.tab === $index}"><a href="#">{{interp(form.title,{\'$index\':$index, value: item}) || $index}}</a></li><li ng-hide="form.readonly" ng-click="$event.preventDefault() || appendToArray()"><a href="#"><i class="glyphicon glyphicon-plus"></i> {{ form.add || \'Add\'}}</a></li></ul></div></div><div ng-if="form.readonly" sf-array="form" ng-init="selected = { tab: 0 }" class="clearfix schema-form-tabarray schema-form-tabarray-{{form.tabType || \'left\'}} {{form.htmlClass}}"><div ng-if="!form.tabType || form.tabType !== \'right\'" ng-class="{\'col-xs-3\': !form.tabType || form.tabType === \'left\'}"><ul class="nav nav-tabs" ng-class="{ \'tabs-left\': !form.tabType || form.tabType === \'left\'}"><li ng-repeat="item in modelArray track by $index" ng-click="$event.preventDefault() || (selected.tab = $index)" ng-class="{active: selected.tab === $index}"><a class="link-hide-style"><span>{{interp(form.title,{\'$index\':$index, value: item}) || $index}}</span></a></li></ul></div><div ng-class="{\'col-xs-9\': !form.tabType || form.tabType === \'left\' || form.tabType === \'right\'}"><div class="tab-content {{form.fieldHtmlClass}}"><div class="tab-pane clearfix" ng-repeat="item in modelArray track by $index" ng-show="selected.tab === $index" ng-class="{active: selected.tab === $index}"><sf-decorator ng-init="arrayIndex = $index" form="copyWithIndex($index)"></sf-decorator></div></div></div><div ng-if="form.tabType === \'right\'" class="col-xs-3"><ul class="nav nav-tabs tabs-right"><li ng-repeat="item in modelArray track by $index" ng-click="$event.preventDefault() || (selected.tab = $index)" ng-class="{active: selected.tab === $index}"><a href="#">{{interp(form.title,{\'$index\':$index, value: item}) || $index}}</a></li></ul></div></div>'),e.put("decorators/bootstrap/tabarray.html",'<div sf-array="form" ng-init="selected = { tab: 0 }" class="clearfix schema-form-tabarray schema-form-tabarray-{{form.tabType || \'left\'}} {{form.htmlClass}}"><div ng-if="!form.tabType || form.tabType !== \'right\'" ng-class="{\'col-xs-3\': !form.tabType || form.tabType === \'left\'}"><ul class="nav nav-tabs" ng-class="{ \'tabs-left\': !form.tabType || form.tabType === \'left\'}"><li ng-repeat="item in modelArray track by $index" ng-click="$event.preventDefault() || (selected.tab = $index)" ng-class="{active: selected.tab === $index}"><a href="#">{{interp(form.title,{\'$index\':$index, value: item}) || $index}}</a></li><li ng-hide="form.readonly" ng-click="$event.preventDefault() || (selected.tab = appendToArray().length - 1)"><a href="#"><i class="glyphicon glyphicon-plus"></i> {{ form.add || \'Add\'}}</a></li></ul></div><div ng-class="{\'col-xs-9\': !form.tabType || form.tabType === \'left\' || form.tabType === \'right\'}"><div class="tab-content {{form.fieldHtmlClass}}"><div class="tab-pane clearfix" ng-repeat="item in modelArray track by $index" ng-show="selected.tab === $index" ng-class="{active: selected.tab === $index}"><sf-decorator ng-init="arrayIndex = $index" form="copyWithIndex($index)"></sf-decorator><button ng-hide="form.readonly" ng-click="selected.tab = deleteFromArray($index).length - 1" type="button" class="btn {{ form.style.remove || \'btn-default\' }} pull-right"><i class="glyphicon glyphicon-trash"></i> {{ form.remove || \'Remove\'}}</button></div></div></div><div ng-if="form.tabType === \'right\'" class="col-xs-3"><ul class="nav nav-tabs tabs-right"><li ng-repeat="item in modelArray track by $index" ng-click="$event.preventDefault() || (selected.tab = $index)" ng-class="{active: selected.tab === $index}"><a href="#">{{interp(form.title,{\'$index\':$index, value: item}) || $index}}</a></li><li ng-hide="form.readonly" ng-click="$event.preventDefault() || appendToArray()"><a href="#"><i class="glyphicon glyphicon-plus"></i> {{ form.add || \'Add\'}}</a></li></ul></div></div>'),
e.put("decorators/bootstrap/tabs.html",'<div ng-if="!form.readonly" ng-init="selected = { tab: 0 }" class="schema-form-tabs {{form.htmlClass}}"><ul class="nav nav-tabs"><li ng-repeat="tab in form.tabs" ng-click="$event.preventDefault() || (selected.tab = $index)" ng-class="{active: selected.tab === $index}"><a href="#">{{ tab.title }}</a></li></ul><div class="tab-content {{form.fieldHtmlClass}}"><div class="tab-pane" ng-repeat="tab in form.tabs" ng-show="selected.tab === $index" ng-class="{active: selected.tab === $index}"><sf-decorator ng-repeat="item in tab.items" form="item"></sf-decorator></div></div></div><div ng-if="form.readonly" class="schema-form-tabs {{form.htmlClass}}"><div ng-repeat="tab in form.tabs"><h1>{{tab.title}}</h1><sf-decorator ng-repeat="item in tab.items" form="item"></sf-decorator></div></div>'),e.put("decorators/bootstrap/textarea.html",'<div class="form-group has-feedback {{form.htmlClass}} schema-form-textarea" ng-class="{\'has-error\': form.disableErrorState !== true && hasError(), \'has-success\': form.disableSuccessState !== true && hasSuccess()}"><label class="{{form.labelHtmlClass}}" ng-class="{\'sr-only\': !showTitle()}" for="{{form.key.slice(-1)[0]}}">{{form.title}}</label> <textarea ng-if="!form.fieldAddonLeft && !form.fieldAddonRight" class="form-control {{form.fieldHtmlClass}}" id="{{form.key.slice(-1)[0]}}" sf-changed="form" placeholder="{{form.placeholder}}" ng-disabled="form.readonly" ng-model="$$value$$" ng-model-options="form.ngModelOptions" schema-validate="form" name="{{form.key.slice(-1)[0]}}"></textarea><div ng-if="form.fieldAddonLeft || form.fieldAddonRight" ng-class="{\'input-group\': (form.fieldAddonLeft || form.fieldAddonRight)}"><span ng-if="form.fieldAddonLeft" class="input-group-addon" ng-bind-html="form.fieldAddonLeft"></span> <textarea class="form-control {{form.fieldHtmlClass}}" id="{{form.key.slice(-1)[0]}}" sf-changed="form" placeholder="{{form.placeholder}}" ng-disabled="form.readonly" ng-model="$$value$$" ng-model-options="form.ngModelOptions" schema-validate="form" name="{{form.key.slice(-1)[0]}}"></textarea> <span ng-if="form.fieldAddonRight" class="input-group-addon" ng-bind-html="form.fieldAddonRight"></span></div><span class="help-block" sf-message="form.description"></span></div>'),e.put("decorators/bootstrap/treeKm.html",'<div ng-if="!form.readonly" class="form-group" ng-class="{\'has-error\': hasError(), \'has-success\': form.disableSuccessState !== true && hasSuccess()}"><label class="control-label" ng-show="showTitle()">{{form.title}}</label><km-tree-view km-data="form.options.data" hierarchy-key="{{form.options.hierarchyKey}}" km-url="{{form.options.dataUrl}}" expand-level="1" validation="true" placeholder="" selected-node="$$value$$" readonly="form.readonly" form="form"></km-tree-view><span class="help-block" sf-message="form.description"></span></div><div ng-if="form.readonly && $$value$$ && $$value$$.length > 0" class="panel panel-default schema-form-{{form.type}} {{form.htmlClass}}"><div class="panel-heading"><label ng-show="showTitle()">{{form.title}}</label></div><div class="panel-body"><span ng-bind="$$value$$"></span> <button ng-if="form.description" class="btn btn-default pull-right" ng-click="tab.show_index = !tab.show_index ? $index : tab.show_index !== $index ? $index : null"><i class="glyphicon glyphicon-question-sign"></i></button></div><div class="panel-footer" ng-if="form.feedback || (form.description && $index === tab.show_index)"><span ng-if="form.feedback !== false" class="form-control-feedback" aria-hidden="true"></span><div ng-show="$index === tab.show_index" class="help-block" sf-message="form.description"></div></div></div>')}]),angular.module("schemaForm").config(["schemaFormDecoratorsProvider",function(e){var t="decorators/bootstrap/";e.defineDecorator("bootstrapReportDecorator",{textarea:{template:t+"textarea.html",replace:!1},fieldset:{template:t+"fieldset.html",replace:!1},array:{template:t+"array.html",replace:!1},tabarray:{template:t+"tabarray.html",replace:!1},tabs:{template:t+"tabs.html",replace:!1},section:{template:t+"section.html",replace:!1},conditional:{template:t+"section.html",replace:!1},actions:{template:t+"actions.html",replace:!1},select:{template:t+"select.html",replace:!1},checkbox:{template:t+"checkbox.html",replace:!1},checkboxes:{template:t+"checkboxes.html",replace:!1},number:{template:t+"default.html",replace:!1},password:{template:t+"default.html",replace:!1},submit:{template:t+"submit.html",replace:!1},button:{template:t+"submit.html",replace:!1},radios:{template:t+"radios.html",replace:!1},"radios-inline":{template:t+"radios-inline.html",replace:!1},radiobuttons:{template:t+"radio-buttons.html",replace:!1},"radiobuttons-allergens":{template:t+"radio-buttons-allergens.html",replace:!1},help:{template:t+"help.html",replace:!1},"default":{template:t+"default.html",replace:!1},"tabarray-inline":{template:t+"tabarray-inline.html",replace:!1},treeKm:{template:t+"treeKm.html",replace:!1},strapselect:{template:t+"strapselect.html",replace:!1},rollup:{template:t+"rollup.html",replace:!1},imageUrl:{template:t+"image-url.html",replace:!1},cutImage:{template:t+"cut-image.html",replace:!1}},[]),e.createDirectives({textarea:t+"textarea.html",select:t+"select.html",checkbox:t+"checkbox.html",checkboxes:t+"checkboxes.html",number:t+"default.html",submit:t+"submit.html",button:t+"submit.html",text:t+"default.html",date:t+"default.html",password:t+"default.html",datepicker:t+"datepicker.html",input:t+"default.html",radios:t+"radios.html","radios-inline":t+"radios-inline.html",radiobuttons:t+"radio-buttons.html"})}]).directive("sfFieldset",function(){return{transclude:!0,scope:!0,templateUrl:"decorators/bootstrap/fieldset-trcl.html",link:function(e,t,l){e.title=e.$eval(l.title)},controller:function(){$scope.dishImages=[],$scope.addImage=function(){var e=$modal.open({template:"cutImage",controller:"CutImageCtrl",size:"",resolve:{options:function(){return{title:i18n.t("view.dishEdit.selectImage")}}}});e.result.then(function(e){$scope.onFileSelect([e.image],e.fileName)},function(){})}}}}).filter("filterMulti",function(){return function(e,t){var l=[];angular.isArray(t)||(t=[t]);for(var a,s=t.length,o=e.length,r=0;r<s;r++)for(a=0;a<o;a++)e[a].value===t[r]&&l.push(e[a]);return l}}).filter("emptyArray",function(){return function(e){function t(e){return!!e&&(angular.isArray(e)||angular.isString(e)?e.length>0:!angular.isObject(e)||Object.keys(e).length>0)}return e&&angular.isObject(e)?e.some(t)?e:[]:e}});