-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathmaterial-decorator.min.js
More file actions
2 lines (2 loc) · 35.7 KB
/
material-decorator.min.js
File metadata and controls
2 lines (2 loc) · 35.7 KB
1
2
angular.module("schemaForm").run(["$templateCache",function(e){e.put("decorators/material/actions-trcl.html",'<div class="btn-group schema-form-actions {{form.htmlClass}}" ng-transclude=""></div>'),e.put("decorators/material/actions.html",'<section layout="row" class="btn-group schema-form-actions {{form.htmlClass}}"></section>'),e.put("decorators/material/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><md-list class="list-group" sf-field-model="" ui-sortable="form.sortOptions"><md-list-item layout="row" class="list-group-item" sf-field-model="ng-repeat" ng-repeat="item in modelArray track by $index" schema-form-array-items=""><md-button flex="none" flex-order="2" type="button" ng-if="!( form.readonly || form.remove === null )" ng-click="deleteFromArray($index)" ng-disabled="form.schema.minItems >= modelArray.length" class="md-icon-button" aria-label="More" style="position: relative; z-index: 20;"><md-icon>close</md-icon></md-button></md-list-item></md-list><div class="clearfix" ng-model="modelArray" schema-validate="form" layout="row" layout-align="end center"><div class="help-block" ng-show="(hasError() && errorMessage(schemaError())) || form.description" ng-bind-html="(hasError() && errorMessage(schemaError())) || form.description"></div><md-button ng-if="!( form.readonly || form.add === null )" ng-click="appendToArray()" ng-disabled="form.schema.maxItems <= modelArray.length" type="button" style="align-self: flex-end;" class="md-raised md-mini md-primary {{ form.style.add || \'btn-default\' }} pull-right"><i class="glyphicon glyphicon-plus"></i> {{ form.add || \'Add\'}}</md-button></div></div>'),e.put("decorators/material/autocomplete.html",'<div class="form-group {{::form.htmlClass ? form.htmlClass : \'flex-100\'}} schema-form-select" sf-layout=""><md-autocomplete flex="" sf-messages="" ng-class="{\'has-error\': hasError(), \'has-success\': hasSuccess(), \'has-feedback\': form.feedback !== false}" ng-disabled="form.readonly" ng-model="$$value$$" sf-autocomplete="" sf-field-model="replaceAll" sf-changed-auto-complete="form" schema-validate="form" md-selected-item="$$value$$" md-search-text="searchText" md-selected-item-change="\'todo\';" md-items="item in evalExpr(\'this[\\\\\'\'+form.optionFilter+\'\\\\\'](\\\\\'\'+searchText+\'\\\\\')\')" md-item-text="item.name" md-floating-label="{{::form.title}}" md-menu-class="autocomplete-custom-template"><md-item-template><span md-highlight-text="searchText">{{item.name}}</span></md-item-template><md-not-found>No matches found</md-not-found></md-autocomplete></div>'),e.put("decorators/material/card-content.html",'<md-card-content class="schema-form-card-content {{form.htmlClass}}"></md-card-content>'),e.put("decorators/material/card.html",'<md-card ng-disabled="form.readonly"><md-card-header ng-if="form.title && !form.notitle"><md-card-header-text><span class="md-title">{{ form.title }}</span></md-card-header-text></md-card-header><md-card-content ng-class=\'{"layout-column": !form.inline, "layout-row": form.inline}\' layout-wrap="" sf-field-transclude=""></md-card-content></md-card>'),e.put("decorators/material/checkbox.html",'<div class="checkbox schema-form-checkbox {{::form.htmlClass}}" ng-class="{\'has-error\': hasError(), \'has-success\': hasSuccess()}" sf-messages=""><md-checkbox sf-field-model="" sf-changed="form" ng-disabled="form.readonly" schema-validate="form" sf-material-class="md-checked" class="{{::form.fieldHtmlClass}}" name="{{::form.key|sfCamelKey}}" aria-label="{{::form.title}}"><span>{{::form.title}}</span></md-checkbox></div>'),e.put("decorators/material/checkboxes.html",'<div sf-array="form" sf-field-model="" class="form-group schema-form-checkboxes {{::form.htmlClass}}" ng-class="{\'has-error\': hasError(), \'has-success\': hasSuccess()}" sf-messages=""><label class="control-label" ng-show="showTitle()">{{::form.title}}</label><div class="checkbox" ng-repeat="val in titleMapValues track by $index"><md-checkbox ng-model="titleMapValues[$index]" sf-changed="form" ng-disabled="::form.readonly" name="{{::form.key|sfCamelKey}}" ng-true-value="true" ng-false-value="false" aria-label="{{::form.title}}">{{::form.titleMap[$index].name}}</md-checkbox></div></div>'),e.put("decorators/material/chips.html",'<div class="form-group schema-form-chips {{form.htmlClass}}" ng-class="{\'has-error\': hasError(), \'has-success\': hasSuccess(), \'has-feedback\': form.feedback !== false}"><md-chips sf-field-model="" readonly="form.readonly" flex="" placeholder="{{::form.title}}"><md-chip-template><strong ng-if="!form.template">{{$chip}}</strong></md-chip-template></md-chips><div ng-messages="ngModel.$error"><div sf-message="" ng-message=""></div></div></div>'),e.put("decorators/material/date.html",'<div class="schema-form-date {{::form.htmlClass ? form.htmlClass : \'flex-100\'}} layout-row"><md-input-container sf-messages="" flex="100"><label ng-show="showTitle()" for="{{::form.key|sfCamelKey}}">{{::form.title}}</label><md-datepicker sf-field-model="" sf-changed="form" schema-validate="form" sf-type-parser="form.schema" id="{{::form.key|sfCamelKey}}" ng-show="::form.key" ng-class="::form.fieldHtmlClass" ng-disabled="::form.readonly"></md-datepicker></md-input-container></div>'),e.put("decorators/material/default.html",'<md-input-container class="form-group schema-form-input" ng-class="[ form.htmlClass ? form.htmlClass : \'flex-100\', {\'has-error\': hasError(), \'has-success\': hasSuccess(), \'has-feedback\': form.feedback !== false }]" sf-messages="" sf-layout=""><label ng-show="showTitle()" for="{{::form.key|sfCamelKey}}">{{::form.title}}</label><md-icon ng-show="form.mdIcon">{{form.mdIcon}}</md-icon><input sf-field-model="" ng-show="::form.key" type="{{::form.type}}" step="any" sf-changed="form" id="{{::form.key|sfCamelKey}}" ng-class="::form.fieldHtmlClass" sf-type-parser="form.schema" ng-disabled="::form.readonly" schema-validate="form" name="{{::form.key|sfCamelKey}}" aria-describedby="{{::form.key|sfCamelKey}}Status" ng-attr-md-maxlength="{{form.maxlength}}" ng-attr-maxlength="{{form.maxlength}}"></md-input-container>'),e.put("decorators/material/fieldset-trcl.html",'<fieldset ng-disabled="form.readonly" class="standard {{form.htmlClass}}" flex=""><legend ng-show="showTitle()">{{ form.title }}</legend><div ng-transclude=""></div></fieldset>'),e.put("decorators/material/fieldset.html",'<fieldset ng-disabled="form.readonly" class="standard {{ form.htmlClass ? form.htmlClass : \'flex-100\' }}"><legend ng-show="showTitle()">{{ form.title }}</legend><div layout="row" layout-wrap="" sf-field-transclude=""></div></fieldset>'),e.put("decorators/material/help.html",'<div class="helpvalue schema-form-helpvalue {{form.htmlClass}}" ng-bind-html="form.helpvalue"></div>'),e.put("decorators/material/radio-buttons.html",'<div class="form-group schema-form-radiobuttons {{form.htmlClass}}" ng-class="{\'has-error\': hasError(), \'has-success\': hasSuccess()}" sf-layout="" sf-messages=""><div><label class="control-label" ng-show="showTitle()">{{form.title}}</label></div><section layout="row" layout-sm="column" layout-align="center center"><md-input-container ng-repeat="item in form.titleMap"><md-button type="button" class="group md-raised" sf-field-model="replaceAll" ng-model="$$value$$" sf-changed="form" ng-class="{\'md-primary\': ($$value$$ == item.value)}" ng-disabled="form.readonly" ng-model-options="form.ngModelOptions" schema-validate="form" ng-value="item.value" ng-click="$$value$$ = item.value" name="{{form.key.join(\'.\')}}"><span ng-bind-html="item.name"></span></md-button></md-input-container></section></div>'),e.put("decorators/material/radios-inline.html",'<div class="form-group schema-form-radios-inline {{form.htmlClass}}" ng-class="{\'has-error\': hasError(), \'has-success\': hasSuccess()}" sf-layout="" sf-messages=""><label class="control-label" ng-show="showTitle()">{{form.title}}</label><md-radio-group layout="row" sf-field-model="replaceAll" ng-model="$$value$$" class="{{form.fieldHtmlClass}}" ng-class="{ active: item.value === $$value$$ }" sf-changed="form" schema-validate="form" ng-disabled="form.readonly" name="{{form.key.join(\'.\')}}"><md-radio-button ng-repeat="item in form.titleMap" ng-value="item.value"><span ng-bind-html="item.name"></span></md-radio-button></md-radio-group></div>'),e.put("decorators/material/radios.html",'<div class="form-group schema-form-radios {{form.htmlClass}}" ng-class="{\'has-error\': hasError(), \'has-success\': hasSuccess()}" sf-messages=""><label class="control-label" ng-show="showTitle()" aria-label="{{form.title}}" layout="row" ng-class="{\'md-required\': form.required}">{{form.title}}</label><div><md-radio-group sf-field-model="" sf-changed="form" ng-disabled="form.readonly" name="{{form.key.join(\'.\')}}" schema-validate="form" sf-layout=""><md-radio-button ng-repeat="item in form.titleMap" ng-value="item.value" sf-field-model="ng-class" ng-class="{ active: item.value === $$value$$ }" aria-label="item.name"><span ng-bind-html="item.name"></span></md-radio-button></md-radio-group></div></div>'),e.put("decorators/material/section.html",'<md-content class="schema-form-section {{::form.htmlClass}}" sf-layout=""></md-content>'),e.put("decorators/material/select.html",'<md-input-container class="form-group {{::form.htmlClass ? form.htmlClass : \'flex-100\'}} schema-form-select" ng-class="{\'has-error\': hasError(), \'has-success\': hasSuccess(), \'has-feedback\': form.feedback !== false}" sf-messages="" sf-layout=""><label ng-show="::showTitle()">{{::form.title}}</label><md-select sf-field-model="" schema-validate="form" ng-disabled="::form.readonly"><md-optgroup ng-repeat-start="(key, opt) in form.getOptions(form, evalExpr) | orderBy:\'group\' as optGroups" ng-if="opt.group && opt.group != optGroups[key-1].group" label="{{::opt.group}}" aria-label="{{::opt.group}}"><md-option ng-repeat="(key, filtered) in form.getOptions(form, evalExpr) | filter: {group: opt.group} | orderBy:\'name\' as opts" ng-value="::filtered.value" aria-label="{{::filtered.name}}">{{::filtered.name}}</md-option></md-optgroup><md-option ng-if="!opt.group" ng-value="::opt.value" ng-repeat-end="">{{::opt.name}}</md-option></md-select><div class="md-errors-spacer"></div></md-input-container>'),e.put("decorators/material/slider.html",'<md-input-container class="schema-form-slider {{form.htmlClass}}"><label ng-show="showTitle()" for="{{::form.key|sfCamelKey}}">{{::form.title}}</label><md-slider sf-field-model="" flex="" id="{{::form.key|sfCamelKey}}" min="0" max="255" aria-label="blue"></md-slider></md-input-container>'),e.put("decorators/material/submit.html",'<section class="schema-form-submit {{form.htmlClass}}" sf-messages="" layout="row"><md-progress-circular class="md-accent md-hue-1" md-mode="indeterminate" md-diameter="32" aria-label="Saving" style="margin: 0 8px 0 0;" ng-if="model.processing"></md-progress-circular><md-button class="md-raised {{ form.style || \'md-primary\' }} {{form.fieldHtmlClass}}" type="{{::form.type}}" ng-disabled="form.readonly" aria-label="{{::form.title}}" layout="row" layout-align="space-around center"><md-tooltip ng-if="::form.tip">{{::form.tip}}</md-tooltip>{{::form.title}}</md-button></section>'),e.put("decorators/material/switch.html",'<md-input-container class="schema-form-switch {{::form.htmlClass}}"><md-switch sf-field-model="" sf-changed="form" sf-type-parser="form.schema" sf-messages="" schema-validate="form" id="{{::form.key|sfCamelKey}}" aria-label="{{form.title}}" ng-show="::form.key" ng-class="form.fieldHtmlClass" ng-disabled="::form.readonly"><span ng-show="showTitle()" for="{{::form.key|sfCamelKey}}">{{::form.title}}</span></md-switch></md-input-container>'),e.put("decorators/material/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/material/tabs.html",'<div sf-field-model="" class="schema-form-tabs {{::form.htmlClass}}"><md-tabs md-dynamic-height="" md-selected="selected" md-autoselect="" ng-init="selected = 0"></md-tabs></div>'),e.put("decorators/material/textarea.html",'<md-input-container class="{{::form.htmlClass ? form.htmlClass : \'flex-100\'}} schema-form-textarea" sf-messages="" sf-layout=""><label ng-show="showTitle()" for="{{::form.key|sfCamelKey}}">{{::form.title}}</label> <textarea ng-class="::form.fieldHtmlClass" id="{{::form.key|sfCamelKey}}" sf-changed="form" ng-disabled="::form.readonly" sf-field-model="" schema-validate="form" name="{{::form.key|sfCamelKey}}"></textarea></md-input-container>')}]),angular.module("schemaForm").run(["$templateCache",function(e){e.put("decorators/material/actions-trcl.html",'<div class="btn-group schema-form-actions {{form.htmlClass}}" ng-transclude=""></div>'),e.put("decorators/material/actions.html",'<section layout="row" class="btn-group schema-form-actions {{form.htmlClass}}"></section>'),e.put("decorators/material/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><md-list class="list-group" sf-field-model="" ui-sortable="form.sortOptions"><md-list-item layout="row" class="list-group-item" sf-field-model="ng-repeat" ng-repeat="item in modelArray track by $index" schema-form-array-items=""><md-button flex="none" flex-order="2" type="button" ng-if="!( form.readonly || form.remove === null )" ng-click="deleteFromArray($index)" ng-disabled="form.schema.minItems >= modelArray.length" class="md-icon-button" aria-label="More" style="position: relative; z-index: 20;"><md-icon>close</md-icon></md-button></md-list-item></md-list><div class="clearfix" ng-model="modelArray" schema-validate="form" layout="row" layout-align="end center"><div class="help-block" ng-show="(hasError() && errorMessage(schemaError())) || form.description" ng-bind-html="(hasError() && errorMessage(schemaError())) || form.description"></div><md-button ng-if="!( form.readonly || form.add === null )" ng-click="appendToArray()" ng-disabled="form.schema.maxItems <= modelArray.length" type="button" style="align-self: flex-end;" class="md-raised md-mini md-primary {{ form.style.add || \'btn-default\' }} pull-right"><i class="glyphicon glyphicon-plus"></i> {{ form.add || \'Add\'}}</md-button></div></div>'),e.put("decorators/material/autocomplete.html",'<div class="form-group {{::form.htmlClass ? form.htmlClass : \'flex-100\'}} schema-form-select" sf-layout=""><md-autocomplete flex="" sf-messages="" ng-class="{\'has-error\': hasError(), \'has-success\': hasSuccess(), \'has-feedback\': form.feedback !== false}" ng-disabled="form.readonly" ng-model="$$value$$" sf-autocomplete="" sf-field-model="replaceAll" sf-changed-auto-complete="form" schema-validate="form" md-selected-item="$$value$$" md-search-text="searchText" md-selected-item-change="\'todo\';" md-items="item in evalExpr(\'this[\\\\\'\'+form.optionFilter+\'\\\\\'](\\\\\'\'+searchText+\'\\\\\')\')" md-item-text="item.name" md-floating-label="{{::form.title}}" md-menu-class="autocomplete-custom-template"><md-item-template><span md-highlight-text="searchText">{{item.name}}</span></md-item-template><md-not-found>No matches found</md-not-found></md-autocomplete></div>'),e.put("decorators/material/card-content.html",'<md-card-content class="schema-form-card-content {{form.htmlClass}}"></md-card-content>'),e.put("decorators/material/card.html",'<md-card ng-disabled="form.readonly"><md-card-header ng-if="form.title && !form.notitle"><md-card-header-text><span class="md-title">{{ form.title }}</span></md-card-header-text></md-card-header><md-card-content ng-class=\'{"layout-column": !form.inline, "layout-row": form.inline}\' layout-wrap="" sf-field-transclude=""></md-card-content></md-card>'),e.put("decorators/material/checkbox.html",'<div class="checkbox schema-form-checkbox {{::form.htmlClass}}" ng-class="{\'has-error\': hasError(), \'has-success\': hasSuccess()}" sf-messages=""><md-checkbox sf-field-model="" sf-changed="form" ng-disabled="form.readonly" schema-validate="form" sf-material-class="md-checked" class="{{::form.fieldHtmlClass}}" name="{{::form.key|sfCamelKey}}" aria-label="{{::form.title}}"><span>{{::form.title}}</span></md-checkbox></div>'),e.put("decorators/material/checkboxes.html",'<div sf-array="form" sf-field-model="" class="form-group schema-form-checkboxes {{::form.htmlClass}}" ng-class="{\'has-error\': hasError(), \'has-success\': hasSuccess()}" sf-messages=""><label class="control-label" ng-show="showTitle()">{{::form.title}}</label><div class="checkbox" ng-repeat="val in titleMapValues track by $index"><md-checkbox ng-model="titleMapValues[$index]" sf-changed="form" ng-disabled="::form.readonly" name="{{::form.key|sfCamelKey}}" ng-true-value="true" ng-false-value="false" aria-label="{{::form.title}}">{{::form.titleMap[$index].name}}</md-checkbox></div></div>'),e.put("decorators/material/chips.html",'<div class="form-group schema-form-chips {{form.htmlClass}}" ng-class="{\'has-error\': hasError(), \'has-success\': hasSuccess(), \'has-feedback\': form.feedback !== false}"><md-chips sf-field-model="" readonly="form.readonly" flex="" placeholder="{{::form.title}}"><md-chip-template><strong ng-if="!form.template">{{$chip}}</strong></md-chip-template></md-chips><div ng-messages="ngModel.$error"><div sf-message="" ng-message=""></div></div></div>'),e.put("decorators/material/date.html",'<div class="schema-form-date {{::form.htmlClass ? form.htmlClass : \'flex-100\'}} layout-row"><md-input-container sf-messages="" flex="100"><label ng-show="showTitle()" for="{{::form.key|sfCamelKey}}">{{::form.title}}</label><md-datepicker sf-field-model="" sf-changed="form" schema-validate="form" sf-type-parser="form.schema" id="{{::form.key|sfCamelKey}}" ng-show="::form.key" ng-class="::form.fieldHtmlClass" ng-disabled="::form.readonly"></md-datepicker></md-input-container></div>'),e.put("decorators/material/default.html",'<md-input-container class="form-group schema-form-input" ng-class="[ form.htmlClass ? form.htmlClass : \'flex-100\', {\'has-error\': hasError(), \'has-success\': hasSuccess(), \'has-feedback\': form.feedback !== false }]" sf-messages="" sf-layout=""><label ng-show="showTitle()" for="{{::form.key|sfCamelKey}}">{{::form.title}}</label><md-icon ng-show="form.mdIcon">{{form.mdIcon}}</md-icon><input sf-field-model="" ng-show="::form.key" type="{{::form.type}}" step="any" sf-changed="form" id="{{::form.key|sfCamelKey}}" ng-class="::form.fieldHtmlClass" sf-type-parser="form.schema" ng-disabled="::form.readonly" schema-validate="form" name="{{::form.key|sfCamelKey}}" aria-describedby="{{::form.key|sfCamelKey}}Status" ng-attr-md-maxlength="{{form.maxlength}}" ng-attr-maxlength="{{form.maxlength}}"></md-input-container>'),e.put("decorators/material/fieldset-trcl.html",'<fieldset ng-disabled="form.readonly" class="standard {{form.htmlClass}}" flex=""><legend ng-show="showTitle()">{{ form.title }}</legend><div ng-transclude=""></div></fieldset>'),e.put("decorators/material/fieldset.html",'<fieldset ng-disabled="form.readonly" class="standard {{ form.htmlClass ? form.htmlClass : \'flex-100\' }}"><legend ng-show="showTitle()">{{ form.title }}</legend><div layout="row" layout-wrap="" sf-field-transclude=""></div></fieldset>'),e.put("decorators/material/help.html",'<div class="helpvalue schema-form-helpvalue {{form.htmlClass}}" ng-bind-html="form.helpvalue"></div>'),e.put("decorators/material/radio-buttons.html",'<div class="form-group schema-form-radiobuttons {{form.htmlClass}}" ng-class="{\'has-error\': hasError(), \'has-success\': hasSuccess()}" sf-layout="" sf-messages=""><div><label class="control-label" ng-show="showTitle()">{{form.title}}</label></div><section layout="row" layout-sm="column" layout-align="center center"><md-input-container ng-repeat="item in form.titleMap"><md-button type="button" class="group md-raised" sf-field-model="replaceAll" ng-model="$$value$$" sf-changed="form" ng-class="{\'md-primary\': ($$value$$ == item.value)}" ng-disabled="form.readonly" ng-model-options="form.ngModelOptions" schema-validate="form" ng-value="item.value" ng-click="$$value$$ = item.value" name="{{form.key.join(\'.\')}}"><span ng-bind-html="item.name"></span></md-button></md-input-container></section></div>'),e.put("decorators/material/radios-inline.html",'<div class="form-group schema-form-radios-inline {{form.htmlClass}}" ng-class="{\'has-error\': hasError(), \'has-success\': hasSuccess()}" sf-layout="" sf-messages=""><label class="control-label" ng-show="showTitle()">{{form.title}}</label><md-radio-group layout="row" sf-field-model="replaceAll" ng-model="$$value$$" class="{{form.fieldHtmlClass}}" ng-class="{ active: item.value === $$value$$ }" sf-changed="form" schema-validate="form" ng-disabled="form.readonly" name="{{form.key.join(\'.\')}}"><md-radio-button ng-repeat="item in form.titleMap" ng-value="item.value"><span ng-bind-html="item.name"></span></md-radio-button></md-radio-group></div>'),e.put("decorators/material/radios.html",'<div class="form-group schema-form-radios {{form.htmlClass}}" ng-class="{\'has-error\': hasError(), \'has-success\': hasSuccess()}" sf-messages=""><label class="control-label" ng-show="showTitle()" aria-label="{{form.title}}" layout="row" ng-class="{\'md-required\': form.required}">{{form.title}}</label><div><md-radio-group sf-field-model="" sf-changed="form" ng-disabled="form.readonly" name="{{form.key.join(\'.\')}}" schema-validate="form" sf-layout=""><md-radio-button ng-repeat="item in form.titleMap" ng-value="item.value" sf-field-model="ng-class" ng-class="{ active: item.value === $$value$$ }" aria-label="item.name"><span ng-bind-html="item.name"></span></md-radio-button></md-radio-group></div></div>'),e.put("decorators/material/section.html",'<md-content class="schema-form-section {{::form.htmlClass}}" sf-layout=""></md-content>'),e.put("decorators/material/select.html",'<md-input-container class="form-group {{::form.htmlClass ? form.htmlClass : \'flex-100\'}} schema-form-select" ng-class="{\'has-error\': hasError(), \'has-success\': hasSuccess(), \'has-feedback\': form.feedback !== false}" sf-messages="" sf-layout=""><label ng-show="::showTitle()">{{::form.title}}</label><md-select sf-field-model="" schema-validate="form" ng-disabled="::form.readonly"><md-optgroup ng-repeat-start="(key, opt) in form.getOptions(form, evalExpr) | orderBy:\'group\' as optGroups" ng-if="opt.group && opt.group != optGroups[key-1].group" label="{{::opt.group}}" aria-label="{{::opt.group}}"><md-option ng-repeat="(key, filtered) in form.getOptions(form, evalExpr) | filter: {group: opt.group} | orderBy:\'name\' as opts" ng-value="::filtered.value" aria-label="{{::filtered.name}}">{{::filtered.name}}</md-option></md-optgroup><md-option ng-if="!opt.group" ng-value="::opt.value" ng-repeat-end="">{{::opt.name}}</md-option></md-select><div class="md-errors-spacer"></div></md-input-container>'),e.put("decorators/material/slider.html",'<md-input-container class="schema-form-slider {{form.htmlClass}}"><label ng-show="showTitle()" for="{{::form.key|sfCamelKey}}">{{::form.title}}</label><md-slider sf-field-model="" flex="" id="{{::form.key|sfCamelKey}}" min="0" max="255" aria-label="blue"></md-slider></md-input-container>'),e.put("decorators/material/submit.html",'<section class="schema-form-submit {{form.htmlClass}}" sf-messages="" layout="row"><md-progress-circular class="md-accent md-hue-1" md-mode="indeterminate" md-diameter="32" aria-label="Saving" style="margin: 0 8px 0 0;" ng-if="model.processing"></md-progress-circular><md-button class="md-raised {{ form.style || \'md-primary\' }} {{form.fieldHtmlClass}}" type="{{::form.type}}" ng-disabled="form.readonly" aria-label="{{::form.title}}" layout="row" layout-align="space-around center"><md-tooltip ng-if="::form.tip">{{::form.tip}}</md-tooltip>{{::form.title}}</md-button></section>'),e.put("decorators/material/switch.html",'<md-input-container class="schema-form-switch {{::form.htmlClass}}"><md-switch sf-field-model="" sf-changed="form" sf-type-parser="form.schema" sf-messages="" schema-validate="form" id="{{::form.key|sfCamelKey}}" aria-label="{{form.title}}" ng-show="::form.key" ng-class="form.fieldHtmlClass" ng-disabled="::form.readonly"><span ng-show="showTitle()" for="{{::form.key|sfCamelKey}}">{{::form.title}}</span></md-switch></md-input-container>'),e.put("decorators/material/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/material/tabs.html",'<div sf-field-model="" class="schema-form-tabs {{::form.htmlClass}}"><md-tabs md-dynamic-height="" md-selected="selected" md-autoselect="" ng-init="selected = 0"></md-tabs></div>'),e.put("decorators/material/textarea.html",'<md-input-container class="{{::form.htmlClass ? form.htmlClass : \'flex-100\'}} schema-form-textarea" sf-messages="" sf-layout=""><label ng-show="showTitle()" for="{{::form.key|sfCamelKey}}">{{::form.title}}</label> <textarea ng-class="::form.fieldHtmlClass" id="{{::form.key|sfCamelKey}}" sf-changed="form" ng-disabled="::form.readonly" sf-field-model="" schema-validate="form" name="{{::form.key|sfCamelKey}}"></textarea></md-input-container>')}]),angular.module("schemaForm").directive("sfMaterialClass",["$compile","$timeout",function(e,a){return{restrict:"A",scope:!1,link:function(e,t,r,l){function s(e,a){return e[a]}var o;try{o=e.form.key.reduce(s,e.model)}catch(m){o=void 0}a(function(){null!==o&&"undefined"!=typeof o&&o!==!1&&""!==o&&t.addClass(r.sfMaterialClass)},100)}}}]),function(e,a){"use strict";function t(e,t,s,o,m){function i(e){var a=e.fieldFrag.querySelector("[sf-layout]");e.form.grid&&Object.getOwnPropertyNames(e.form.grid).forEach(function(t,r,l){a.setAttribute(t,e.form.grid[t])})}function d(){var e='<div ng-show="ngModel.$invalid" ng-messages="{dummy: true}" class="ng-active"><div ng-message="dummy" class="md-input-message-animation" sf-message="form.description"></div></div>',a=document.createElement("div");return a.innerHTML=e,a.firstChild}function n(e){var a=e.fieldFrag.querySelector("[sf-messages]");if(a&&S){var t=S.cloneNode(!0);a.appendChild(t)}}function c(e){var a=e.fieldFrag.querySelector("textarea"),t=e.form.maxlength||!1;a&&t&&a.setAttribute("md-maxlength",t)}function f(e){var t=e.fieldFrag.querySelector("md-autocomplete"),r=e.form.minLength!==a?e.form.minLength:1,l=e.form.maxLength||!1,s=e.form.title||e.form.placeholder||e.form.key.slice(-1)[0];t&&(e.form.onChange&&(t.setAttribute("md-selected-item-change","onChangeFn()"),t.setAttribute("md-search-text-change","onChangeFn(searchText)")),t.setAttribute("md-min-length",r),l&&t.setAttribute("md-max-length",l),s&&t.setAttribute("md-floating-label",s),e.form.schema.requireMatch&&t.setAttribute("md-require-match",!0))}function h(e){var a=e.fieldFrag.querySelector("md-switch");e.form.schema.titleMap&&(a.setAttribute("ng-true-value",e.form.schema.titleMap["true"]),a.setAttribute("ng-false-value",e.form.schema.titleMap["false"]))}function u(e){var a,t=e.fieldFrag.querySelector("md-select");if(e.form.selectOptions=[],e.form.getOptions=r,e.form.schema.links&&"object"==typeof e.form.schema.links){var s,o=/({)([^}]*)(})/gm;for(a=0;a<e.form.schema.links.length;a++)s=e.form.schema.links[a],"options"===s.rel&&(e.form.optionSource=s.href.replace(o,"$1$1 model.$2 $3$3"));t.setAttribute("sfm-external-options",e.form.optionSource)}else e.form.selectOptions=l(e.form)}function p(e){console.log("Date Picker",e);var a=e.fieldFrag.querySelector("md-datepicker");if(a){e.form.onChange&&a.setAttribute("ng-change","args.form.onChange(searchText)");var t=e.form.minimum||!1,r=e.form.maximum||!1;t&&a.setAttribute("md-min-date",t),r&&a.setAttribute("md-max-date",r),e.form.mdHideIcons&&a.setAttribute("md-hide-icons",e.form.mdHideIcons)}}function g(e){if(e.form.tabs&&e.form.tabs.length>0){var a=e.fieldFrag.querySelector("md-tabs");e.form.tabs.forEach(function(t,r){var l=document.createElement("md-tab");l.setAttribute("label","{{"+e.path+".tabs["+r+"].title}}");
var s=document.createElement("md-tab-body"),o=e.build(t.items,e.path+".tabs["+r+"].items",e.state);s.appendChild(o),l.appendChild(s),a.appendChild(l)})}}function b(a,t,r){if("string"===t.type&&("date"===t.format||"date-time"===t.format)){var l=e.stdFormObj(a,t,r);return l.key=r.path,l.type="date",r.lookup[o.stringify(r.path)]=l,l}}function y(a,t,r){if("object"===t.type&&("date"===t.format||"date-time"===t.format)){var l=e.stdFormObj(a,t,r);return l.key=r.path,l.type="date",r.lookup[o.stringify(r.path)]=l,l}}var v="decorators/material/",x=s.builders.simpleTransclusion,$=s.builders.transclusion,k=s.builders.ngModelOptions,C=s.builders.ngModel,w=s.builders.sfField,T=s.builders.condition,A=s.builders.array,E=s.builders.numeric,i=i,S=d(),M=n,F=u,K=f,q=h,O=p,j=g,H=c,I=function(e){w(e);var a=e.fieldFrag.querySelector("input, textarea, md-select");e.form.required&&a&&a.setAttribute("ng-required","form.required")},D=[I,C,k,T,i],P=D.concat(M),V=D.concat(A);e.defaults.string.unshift(b),e.defaults.object.unshift(y),t.defineDecorator("materialDecorator",{actions:{template:v+"actions.html",builder:[w,x,T]},array:{template:v+"array.html",builder:V},autocomplete:{template:v+"autocomplete.html",builder:P.concat(K)},"boolean":{template:v+"checkbox.html",builder:P},button:{template:v+"submit.html",builder:P},card:{template:v+"card.html",builder:[w,$,T]},checkbox:{template:v+"checkbox.html",builder:P},checkboxes:{template:v+"checkboxes.html",builder:V},date:{template:v+"date.html",builder:P.concat(O)},"default":{template:v+"default.html",builder:P},fieldset:{template:v+"fieldset.html",builder:[w,$,T]},help:{template:v+"help.html",builder:P},number:{template:v+"default.html",builder:P.concat(E)},password:{template:v+"default.html",builder:P},radios:{template:v+"radios.html",builder:P},"radios-inline":{template:v+"radios-inline.html",builder:P},radiobuttons:{template:v+"radio-buttons.html",builder:P},section:{template:v+"section.html",builder:[w,x,T,i]},select:{template:v+"select.html",builder:P.concat(F)},submit:{template:v+"submit.html",builder:P},tabs:{template:v+"tabs.html",builder:[w,j,T]},tabarray:{template:v+"tabarray.html",builder:V},textarea:{template:v+"textarea.html",builder:P.concat(H)},"switch":{template:v+"switch.html",builder:P.concat(q)}});var N=/^[0-9]{4,}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]+|)(?:[+-][0-9]{2}:?(?:[0-9]{2}|)|Z)$/,B=/^(:?[A-Z][a-z]{2}\s){2}\d{1,2}\s\d{4}\s(:?\d{2}\:?){3}\s[A-Z]{3}\-\d{4}\s\([A-Z]{3}\)$/,L={date:function(e){return e&&"string"!=typeof e&&e.toISOString&&(e=e.toISOString()||""),N.test(e)||B.test(e)?null:"A valid date expected"}};tv4.addFormat("date",L.date)}function r(e,a){return e.optionData?a(e.optionData):e.selectOptions?e.selectOptions:[]}function l(e){var a=[];if(e.titleMap)return e.titleMap;if(e["enum"]&&e["enum"].length)for(i=0;i<e["enum"].length;i++)e["enum"][i]&&e["enum"][i].length&&a.push({name:e["enum"][i],value:e["enum"][i]});return a}function s(e){function a(a,t,r){r.$observe("sfmExternalOptions",function(t){e.get(t).then(function(e){a.form.selectOptions=l(e.data)})})}var t={link:a,restrict:"A"};return t}function o(){return function(e){if(!e)return"";var a,t,r;for(r=e.slice(),t=0;t<r.length;t++)a=r[t].toLowerCase().split(""),t&&a.length&&(a[0]=a[0].toUpperCase()),r[t]=a.join("");return r.join("")}}e.module("schemaForm").config(t).directive("sfmExternalOptions",s).filter("sfCamelKey",o).directive("sfChangedAutoComplete",function(){return{require:"ngModel",restrict:"AC",link:function(a,t,r,l){var s=a.$eval(r.sfChangedAutoComplete);s&&s.onChange&&(a.onChangeFn=function(){e.isFunction(s.onChange)?s.onChange(l.$modelValue,s):a.evalExpr(s.onChange,{modelValue:l.$modelValue,form:s})})}}}),t.$inject=["schemaFormProvider","schemaFormDecoratorsProvider","sfBuilderProvider","sfPathProvider","$injector"],s.$inject=["$http"]}(angular,void 0),require("../bower_components/angular-schema-form/dist/schema-form.js"),require("./angular-schema-form-material-templates.js"),require("./type-parser.js"),require("./material-decorator.js"),require("./material-class.js"),angular.module("schemaForm").directive("sfTypeParser",function(){return{restrict:"A",scope:!1,require:"ngModel",link:function(e,a,t,r){var l=e.$watch(t.sfTypeParser,function(e){if(e){var a=e.type.indexOf("number")!==-1,t=e.type.indexOf("integer")!==-1,s=/^[0-9]*$/;(a||t)&&r.$parsers.push(function(e){var t;return a?t=parseFloat(e):s.test(e)&&(t=parseInt(e,10)),console.log("parser",s.test(e),e,t),void 0===t||isNaN(t)?e:t}),l()}})}}});