-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathionic-decorator.min.js
executable file
·1 lines (1 loc) · 13.8 KB
/
ionic-decorator.min.js
1
angular.module("schemaForm").run(["$templateCache",function(e){e.put("decorators/ionic/actions-trcl.html",'<div class="button-bar schema-form-actions {{form.htmlClass}}" ng-transclude=""></div>'),e.put("decorators/ionic/actions.html",'<div class="btn-group schema-form-actions {{form.htmlClass}}"><input ng-repeat-start="item in form.items" type="submit" class="button {{ item.style || \'btn-light\' }} {{form.fieldHtmlClass}}" value="{{item.title}}" ng-if="item.type === \'submit\'"> <button ng-repeat-end="" class="button {{ item.style || \'btn-light\' }} {{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/ionic/array.html",'<div class="schema-form-array {{form.htmlClass}}" sf-field-model="sf-new-array" sf-new-array=""><label class="control-label" ng-show="showTitle()">{{ form.title }}</label><ol class="list-group" sf-field-model="" ui-sortable="form.sortOptions"><li class="list-group-item {{form.fieldHtmlClass}}" schema-form-array-items="" sf-field-model="ng-repeat" ng-repeat="item in $$value$$ track by $index"><button ng-hide="form.readonly || form.remove === null" ng-click="deleteFromArray($index)" ng-disabled="form.schema.minItems >= modelArray.length" style="position: relative; z-index: 20;" type="button" class="close pull-right"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button></li></ol><div class="clearfix" style="padding: 15px;" ng-model="modelArray" schema-validate="form"><div class="help-block" ng-show="(hasError() && errorMessage(schemaError())) || form.description" ng-bind-html="(hasError() && errorMessage(schemaError())) || form.description"></div><button ng-hide="form.readonly || form.add === null" ng-click="appendToArray()" ng-disabled="form.schema.maxItems <= modelArray.length" type="button" class="btn {{ form.style.add || \'btn-default\' }} pull-right"><i class="glyphicon glyphicon-plus"></i> {{ form.add || \'Add\'}}</button></div></div>'),e.put("decorators/ionic/checkbox.html",'<label class="item item-checkbox {{form.htmlClass}}" ng-class="{\'has-error\': form.disableErrorState !== true && hasError(), \'has-success\': form.disableSuccessState !== true && hasSuccess()}"><div class="checkbox checkbox-input-hidden disable-pointer-events checkbox-circle"><input type="checkbox" sf-changed="form" ng-disabled="form.readonly" sf-field-model="" schema-validate="form" class="{{form.fieldHtmlClass}}" name="{{form.key.slice(-1)[0]}}"> <i class="checkbox-icon"></i></div><div class="item-content disable-pointer-events"><span>{{form.title}}</span></div><div class="help-block" sf-message="form.description"></div></label>'),e.put("decorators/ionic/checkboxes.html",'<div sf-field-model="sf-new-array" sf-new-array="" 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}}" sf-field-model="" schema-validate="form" 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/ionic/default.html",'<div class="form-wrap"><label class="item item-input" ng-if="form.labelType == \'placeholder\'"><input type="{{form.type}}" placeholder="{{form.title}}"><div class="help-text" sf-message="form.description"></div></label><div ng-if="form.labelType == \'inline\'"><label class="item item-input"><span class="input-label">{{form.title}}</span> <input type="{{form.type}}" placeholder="{{form.placeholder}}"><div class="help-text" sf-message="form.description"></div></label></div><label class="item item-input item-stacked-label" ng-if="form.labelType == \'stacked\' || !form.labelType"><span class="input-label">{{form.title}}</span> <input type="{{form.type}}" placeholder="{{form.placeholder}}"><div class="help-text" sf-message="form.description"></div></label> <label class="item item-input item-floating-label" ng-if="form.labelType == \'floating\'"><span class="input-label">{{form.title}}</span> <input type="{{form.type}}" placeholder="{{form.placeholder || form.title}}"><div class="help-text" sf-message="form.description"></div></label></div>'),e.put("decorators/ionic/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></fieldset>'),e.put("decorators/ionic/help.html",'<div class="helpvalue schema-form-helpvalue {{form.htmlClass}}" ng-bind-html="form.helpvalue"></div>'),e.put("decorators/ionic/radio-buttons.html",'<div 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}} why is title not coming</label></div><div class="btn-group"><label sf-field-model="replaceAll" 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" sf-field-model="" 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/ionic/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 class="control-label {{form.labelHtmlClass}}" ng-show="showTitle()" sf-field-model="" schema-validate="form">{{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" sf-field-model="" 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/ionic/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 class="control-label {{form.labelHtmlClass}}" sf-field-model="" schema-validate="form" 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" sf-field-model="" 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/ionic/section.html",'<div class="schema-form-section {{form.htmlClass}}"></div>'),e.put("decorators/ionic/select.html",'<ion-item><ion-label>Gender</ion-label><ion-select [(ngmodel)]="gender"><ion-option value="f" selected="true">Female</ion-option><ion-option value="m">Male</ion-option></ion-select></ion-item>'),e.put("decorators/ionic/submit.html",'<div class="schema-form-submit {{form.htmlClass}}"><input type="submit" class="button {{ form.style || \'button-positive\' }} {{form.fieldHtmlClass}}" value="{{form.title}}" ng-disabled="form.readonly" ng-if="form.type === \'submit\'"> <button class="button {{ form.style || \'button-positive\' }}" 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/ionic/tabarray.html",'<div ng-init="selected = { tab: 0 }" ng-model="modelArray" schema-validate="form" sf-field-model="sf-new-array" sf-new-array="" 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\'}"><ol class="nav nav-tabs" ng-class="{ \'tabs-left\': !form.tabType || form.tabType === \'left\'}" sf-field-model="" ui-sortable="form.sortOptions"><li sf-field-model="ng-repeat" ng-repeat="item in $$value$$ 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 || form.add === null" ng-disabled="form.schema.maxItems <= modelArray.length" ng-click="$event.preventDefault() || (selected.tab = appendToArray().length - 1)"><a href="#"><i class="glyphicon glyphicon-plus"></i> {{ form.add || \'Add\'}}</a></li></ol></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 tab{{selected.tab}} index{{$index}}" sf-field-model="ng-repeat" ng-repeat="item in $$value$$ track by $index" ng-show="selected.tab === $index" ng-class="{active: selected.tab === $index}"><div schema-form-array-items=""></div><button ng-hide="form.readonly || form.remove === null" ng-click="selected.tab = deleteFromArray($index).length - 1" ng-disabled="form.schema.minItems >= modelArray.length" type="button" class="btn {{ form.style.remove || \'btn-default\' }} pull-right"><i class="glyphicon glyphicon-trash"></i> {{ form.remove || \'Remove\'}}</button></div><div class="help-block" ng-show="(hasError() && errorMessage(schemaError())) || form.description" ng-bind-html="(hasError() && errorMessage(schemaError())) || form.description"></div></div></div></div><div ng-if="form.tabType === \'right\'" class="col-xs-3"><ul class="nav nav-tabs tabs-right"><li sf-field-model="ng-repeat" ng-repeat="item in $$value$$ 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 || form.add === null" ng-disabled="form.schema.maxItems <= modelArray.length" ng-click="$event.preventDefault() || (selected.tab = appendToArray().length - 1)"><a href="#"><i class="glyphicon glyphicon-plus"></i> {{ form.add || \'Add\'}}</a></li></ul></div>'),e.put("decorators/ionic/tabs.html",'<div ng-init="selected = { tab: 0 }" class="schema-form-tabs {{form.htmlClass}}"><ul class="nav nav-tabs"><li ng-repeat="tab in form.tabs" ng-disabled="form.readonly" 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></div>'),e.put("decorators/ionic/textarea.html",'<label class="item item-input"><textarea placeholder="{{form.title}}"></textarea></label>')}]),angular.module("schemaForm").config(["schemaFormDecoratorsProvider","sfBuilderProvider","sfPathProvider",function(e,l,t){var a="decorators/ionic/",s=l.builders.simpleTransclusion,i=l.builders.ngModelOptions,r=l.builders.ngModel,o=l.builders.sfField,n=l.builders.condition,m=l.builders.array,d=function(e){if(e.form.tabs&&e.form.tabs.length>0){var l=e.fieldFrag.querySelector(".tab-content");e.form.tabs.forEach(function(t,a){var s=document.createElement("div");s.className="tab-pane",s.setAttribute("ng-disabled","form.readonly"),s.setAttribute("ng-show","selected.tab === "+a),s.setAttribute("ng-class","{active: selected.tab === "+a+"}");var i=e.build(t.items,e.path+".tabs["+a+"].items",e.state);s.appendChild(i),l.appendChild(s)})}},c=function(e){e.form.hasOwnProperty("sortOptions")?e.form.sortOptions.hasOwnProperty("items")||(e.form.sortOptions.items="li:not(:last-child)"):e.form.sortOptions={items:"li:not(:last-child)"}},f=function(e){if(e.form.placeholder){var l=e.fieldFrag.querySelector("select"),t=document.createElement("option");t.setAttribute("value",""),t.setAttribute("sf-field-model","replaceAll"),1===angular.version.major&&angular.version.minor<4?t.setAttribute("ng-if","$$value$$ === undefined"):t.setAttribute("ng-show","$$value$$ === undefined"),t.textContent=e.form.placeholder,l.appendChild(t)}},b=[o,r,i,n];e.defineDecorator("ionicDecorator",{textarea:{template:a+"textarea.html",builder:b},fieldset:{template:a+"fieldset.html",builder:[o,s,n]},array:{template:a+"array.html",builder:[o,i,r,m,n]},tabarray:{template:a+"tabarray.html",builder:[o,i,r,m,n,c]},tabs:{template:a+"tabs.html",builder:[o,i,d,n]},section:{template:a+"section.html",builder:[o,s,n]},conditional:{template:a+"section.html",builder:[o,s,n]},actions:{template:a+"actions.html",builder:b},select:{template:a+"select.html",builder:[f,o,r,i,n]},checkbox:{template:a+"checkbox.html",builder:b},checkboxes:{template:a+"checkboxes.html",builder:[o,i,r,m,n]},number:{template:a+"default.html",builder:b},password:{template:a+"default.html",builder:b},submit:{template:a+"submit.html",builder:b},button:{template:a+"submit.html",builder:b},radios:{template:a+"radios.html",builder:b},"radios-inline":{template:a+"radios-inline.html",builder:b},radiobuttons:{template:a+"radio-buttons.html",builder:b},help:{template:a+"help.html",builder:b},"default":{template:a+"default.html",builder:b}},[])}]);