-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathangular-schema-form-complex-ui.min.js
More file actions
1 lines (1 loc) · 4.06 KB
/
angular-schema-form-complex-ui.min.js
File metadata and controls
1 lines (1 loc) · 4.06 KB
1
angular.module("schemaForm").run(["$templateCache",function(o){o.put("directives/decorators/bootstrap/complex-ui/angular-schema-form-complex-ui.html",'<div ng-class="{\'has-error\': hasError()}"><div ng-init="parentController.model=$$value$$" complex-ui-directive=""><div ng-if="form.options.modal == true"><label>{{form.title}}</label> <button ng-click="parentController.toggleModal()">{{form.options.buttonCaption}}</button><modal title="{{form.title}}" visible="showModal"><div ng-if="form.options.includeURI != \'\'"><ng-include src="form.options.includeURI"></ng-include></div><div ng-if="form.options.includeURI == null || form.options.includeURI == \'\'"><div name="" sf-schema="parentController.schema" sf-form="parentController.form" sf-model="parentController.model"></div></div></modal></div><div ng-if="form.options.modal != true"><label ng-show="showTitle()">{{form.title}}</label><div ng-if="form.options.includeURI != \'\'"><ng-include src="form.options.includeURI"></ng-include></div><div ng-if="form.options.includeURI == null || form.options.includeURI == \'\'"><div name="" sf-schema="parentController.schema" sf-form="parentController.form" sf-model="parentController.model"></div></div></div></div><span class="help-block">{{ (hasError() && errorMessage(schemaError())) || form.description}}</span><br><span ng-show="form.some_setting">The some setting-setting is true for the model at $$value$$!</span></div>')}]),angular.module("schemaForm").config(["schemaFormProvider","schemaFormDecoratorsProvider","sfPathProvider",function(o,e,t){e.addMapping("bootstrapDecorator","complex-ui","directives/decorators/bootstrap/complex-ui/angular-schema-form-complex-ui.html")}]);var ComplexUIController=function(){function o(o,e){var t=this;this.$scope=o,this.toggleModal=function(){this.directiveScope.showModal=!this.directiveScope.showModal},this.getCallback=function(o){if("string"==typeof o){var e=t.directiveScope.$parent.evalExpr(o);if("function"==typeof e)return e;throw"A callback string must match name of a function in the parent scope"}if("function"==typeof o)return o;throw"A callback must either be a string matching the name of a function in the parent scope or a direct function reference"},this.getDefinitions=function(){if(t.directiveScope.form.options){var o=void 0;if(o="schemaRef"in t.directiveScope.form.options?t.directiveScope.form.options.schemaRef:null,"definitionsCallback"in t.directiveScope.form.options){var e=t.getCallback(t.directiveScope.form.options.definitionsCallback),i=e(o);"form"in i?t.form=i.form:"complexForm"in t.directiveScope.form.options?t.form=t.directiveScope.form.options.complexForm:t.form=["*"],t.form.onChange=t.directiveScope.form.onChange,t.schema=i.schema}}},this.innerSubmit=function(o){t.directiveScope.$broadcast("schemaFormValidate"),console.log(t.model)},console.log("Initiating the ComplexUI controller"+o.toString()),o.parentController=this,this.directiveScope=o}return o}();angular.module("schemaForm").directive("modal",function(){return{template:'<div class="modal fade"><div class="{{ form.htmlClass ? form.htmlClass: \'modal-dialog\'}}"><div class="modal-content"><div class="modal-header"><button type="button" class="close" ng-click="parentController.toggleModal()" data-dismiss="modal" aria-hidden="true">×</button><h4 class="modal-title">{{ form.title }}</h4></div><div class="{{ form.fieldHtmlClass ? form.fieldHtmlClass: \'modal-body\'}} " ng-transclude></div></div></div></div>',restrict:"E",transclude:!0,replace:!0,scope:!1,link:function(o,e,t){o.$watch(t.visible,function(o){1==o?$(e).modal("show"):$(e).modal("hide")})}}}),angular.module("schemaForm").directive("complexUiDirective",function(){return{require:[],restrict:"A",scope:!1,controller:["$scope",ComplexUIController],link:function(o,e,t,i){o.parentController.getDefinitions()}}}),angular.module("schemaForm").directive("script",function(){return{restrict:"E",scope:!1,link:function(o,e,t){if("text/javascript-lazy"==t.type){var i=document.createElement("script");i.type="text/javascript";var r=e.attr("src");if(void 0!==r)i.src=r;else{var n=e.text();i.text=n}document.head.appendChild(i),e.remove()}}}});