@@ -65,6 +65,7 @@ return /******/ (function(modules) { // webpackBootstrap
65
65
__webpack_require__ ( 4 ) ;
66
66
__webpack_require__ ( 5 ) ;
67
67
__webpack_require__ ( 6 ) ;
68
+ __webpack_require__ ( 7 ) ;
68
69
69
70
/***/ } ,
70
71
/* 1 */
@@ -3700,11 +3701,11 @@ return /******/ (function(modules) { // webpackBootstrap
3700
3701
$templateCache . put ( "decorators/material/autocomplete.html" , "<div class=\"form-group {{form.htmlClass}} schema-form-select\" ng-class=\"{\'has-error\': hasError(), \'has-success\': hasSuccess(), \'has-feedback\': form.feedback !== false}\" sf-messages=\"\" sf-layout=\"\"><md-autocomplete flex=\"\" ng-disabled=\"form.readonly\" ng-model=\"$$value$$\" sf-autocomplete=\"\" sf-field-model=\"replaceAll\" 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>" ) ;
3701
3702
$templateCache . put ( "decorators/material/card-content.html" , "<md-card-content class=\"schema-form-card-content {{form.htmlClass}}\"></md-card-content>" ) ;
3702
3703
$templateCache . put ( "decorators/material/card.html" , "<md-card class=\"schema-form-card {{form.htmlClass}}\"></md-card>" ) ;
3703
- $templateCache . 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\" class=\"{{::form.fieldHtmlClass}}\" name=\"{{::form.key|sfCamelKey}}\" aria-label=\"{{::form.title}}\"><span>{{::form.title}}</span></md-checkbox></div>" ) ;
3704
+ $templateCache . 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>" ) ;
3704
3705
$templateCache . 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>" ) ;
3705
3706
$templateCache . 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>" ) ;
3706
3707
$templateCache . put ( "decorators/material/date.html" , "<div class=\"schema-form-date {{::form.htmlClass}}\"><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-placeholder=\"Enter date\" sf-messages=\"\"></md-datepicker></div>" ) ;
3707
- $templateCache . put ( "decorators/material/default.html" , "<md-input-container class=\"schema-form-{{::form.type}} {{::form.htmlClass}}\" ng-class=\"{\'md-input- has-value\': model[\'{{form.key.join(\'\\\'][\\\'\')}}\'], \'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> <input sf-field-model=\"\" ng-show=\"::form.key\" type=\"{{::form.type}}\" step=\"any\" sf-changed=\"form\" placeholder=\"{{form.placeholder}}\" 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\"></md-input-container>" ) ;
3708
+ $templateCache . put ( "decorators/material/default.html" , "<md-input-container class=\"schema-form-{{::form.type}} {{::form.htmlClass}}\" ng-class=\"{\'has-error\': hasError(), \'has-success\': hasSuccess(), \'has-feedback\': form.feedback !== false}\" sf-messages=\"\" sf-layout=\"\" sf-material-class=\"md-input-has-value \"><label ng-show=\"showTitle()\" for=\"{{::form.key|sfCamelKey}}\">{{::form.title}}</label> <input sf-field-model=\"\" ng-show=\"::form.key\" type=\"{{::form.type}}\" step=\"any\" sf-changed=\"form\" placeholder=\"{{form.placeholder}}\" 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\"></md-input-container>" ) ;
3708
3709
$templateCache . put ( "decorators/material/fieldset-trcl.html" , "<fieldset ng-disabled=\"form.readonly\" class=\"standard {{form.htmlClass}}\" flex=\"\"><legend ng-show=\"form.title\">{{ form.title }}</legend><div ng-transclude=\"\"></div></fieldset>" ) ;
3709
3710
$templateCache . put ( "decorators/material/fieldset.html" , "<fieldset ng-disabled=\"form.readonly\" class=\"standard {{form.htmlClass}}\" flex=\"\"><legend ng-show=\"form.title\">{{ form.title }}</legend></fieldset>" ) ;
3710
3711
$templateCache . put ( "decorators/material/help.html" , "<div class=\"helpvalue schema-form-helpvalue {{form.htmlClass}}\" ng-bind-html=\"form.helpvalue\"></div>" ) ;
@@ -3848,7 +3849,7 @@ return /******/ (function(modules) { // webpackBootstrap
3848
3849
} ;
3849
3850
3850
3851
function sfMessagesNodeHandler ( ) {
3851
- var html = '<div ng-if="ngModel.$invalid" ng-messages="ngModel.$error"> <div sf -message ng- message></div></div>' ;
3852
+ var html = '<div ng-if="ngModel.$invalid" ng-messages="{dummy: true}" class="ng-active">' + ' <div ng -message="dummy" class="md-input- message-animation" sf-message="form.description" ></div></div>';
3852
3853
var div = document . createElement ( 'div' ) ;
3853
3854
div . innerHTML = html ;
3854
3855
return div . firstChild ;
@@ -3857,7 +3858,7 @@ return /******/ (function(modules) { // webpackBootstrap
3857
3858
function sfMessagesBuilder ( args ) {
3858
3859
var messagesDiv = args . fieldFrag . querySelector ( '[sf-messages]' ) ;
3859
3860
if ( messagesDiv && sfMessagesNode ) {
3860
- var child = sfMessagesNode . cloneNode ( ) ;
3861
+ var child = sfMessagesNode . cloneNode ( true ) ;
3861
3862
messagesDiv . appendChild ( child ) ;
3862
3863
}
3863
3864
} ;
@@ -3942,7 +3943,7 @@ return /******/ (function(modules) { // webpackBootstrap
3942
3943
var minDate = args . form . minimum || false ;
3943
3944
var maxDate = args . form . maximum || false ;
3944
3945
if ( minDate ) {
3945
- mdDatepickerFrag . setAttribute ( 'md-max -date' , minDate ) ;
3946
+ mdDatepickerFrag . setAttribute ( 'md-min -date' , minDate ) ;
3946
3947
}
3947
3948
if ( maxDate ) {
3948
3949
mdDatepickerFrag . setAttribute ( 'md-max-date' , maxDate ) ;
@@ -4081,6 +4082,37 @@ return /******/ (function(modules) { // webpackBootstrap
4081
4082
})
4082
4083
*/
4083
4084
4085
+ /***/ } ,
4086
+ /* 7 */
4087
+ /***/ function ( module , exports ) {
4088
+
4089
+ angular . module ( 'schemaForm' ) . directive ( 'sfMaterialClass' , function ( $compile , $timeout ) {
4090
+ return {
4091
+ restrict : 'A' ,
4092
+ scope : false ,
4093
+ link : function ( scope , element , attrs , ngModel ) {
4094
+ function reduceHelper ( obj , i ) {
4095
+ return obj [ i ] ;
4096
+ }
4097
+
4098
+ var modelValue ;
4099
+ try {
4100
+ modelValue = scope . form . key . reduce ( reduceHelper , scope . model ) ;
4101
+ } catch ( e ) {
4102
+ modelValue = undefined ;
4103
+ }
4104
+
4105
+ // Element class is not set in DOM if executed immediately.
4106
+ // I don't understand exactly why but it's probably related to other directive job.
4107
+ $timeout ( function ( ) {
4108
+ if ( modelValue !== null && typeof modelValue !== 'undefined' && modelValue !== false ) {
4109
+ element . addClass ( attrs . sfMaterialClass ) ;
4110
+ }
4111
+ } , 0 ) ;
4112
+ }
4113
+ } ;
4114
+ } ) ;
4115
+
4084
4116
/***/ }
4085
4117
/******/ ] )
4086
4118
} ) ;
0 commit comments