7
7
root . angularSchemaFormDynamicSelect = factory ( root . schemaForm ) ;
8
8
}
9
9
} ( this , function ( schemaForm ) {
10
- angular . module ( "schemaForm" ) . run ( [ "$templateCache" , function ( $templateCache ) { $templateCache . put ( "directives/decorators/bootstrap/strap/strapmultiselect.html" , "<div ng-controller=\"dynamicSelectController\" class=\"form-group {{form.htmlClass}}\"\n ng-class=\"{\'has-error\': hasError(), \'has-success\': hasSuccess()}\">\n <label class=\"control-label {{form.labelHtmlClass}}\" ng-show=\"showTitle()\">{{form.title}}</label>\n\n <div class=\"form-group {{form.fieldHtmlClass}}\" ng-init=\"populateTitleMap(form)\">\n <button type=\"button\" class=\"btn btn-default\" sf-changed=\"form\" schema-validate=\"form\" ng-model=\"$$value$$\"\n data-placeholder=\"{{form.placeholder || form.schema.placeholder || (\'placeholders.select\')}}\"\n data-html=\"1\"\n data-multiple=\"1\"\n data-placement=\"{{form.options.placement || \'bottom-left\'}}\"\n data-max-length=\"{{form.options.inlineMaxLength}}\"\n data-max-length-html=\"{{form.options.inlineMaxLengthHtml}}\"\n bs-options=\"item.value as item.name for item in form.titleMap | selectFilter:this:$$value$$:"$$value$$"\"\n bs-select>\n </button>\n <span class=\"help-block\">{{ (hasError() && errorMessage(schemaError())) || form.description}}</span>\n </div>\n</div>\n" ) ;
11
- $templateCache . put ( "directives/decorators/bootstrap/strap/strapselect.html" , "<div ng-controller=\"dynamicSelectController\" class=\"form-group {{form.htmlClass}}\"\n ng-class=\"{\'has-error\': hasError(), \'has-success\': hasSuccess()}\">\n <label class=\"control-label {{form.labelHtmlClass}}\" ng-show=\"showTitle()\">{{form.title}}</label>\n\n <div class=\"form-group {{form.fieldHtmlClass}}\" ng-init=\"populateTitleMap(form)\">\n <button ng-if=\"(form.options.multiple == \'true\') || (form.options.multiple == true)\"\n type=\"button\" class=\"btn btn-default\" sf-changed=\"form\" schema-validate=\"form\" ng-model=\"$$value$$\"\n data-placeholder=\"{{form.placeholder || form.schema.placeholder || (\'placeholders.select\')}}\"\n data-html=\"1\" data-multiple=\"1\" data-max-length=\"{{form.options.inlineMaxLength}}\"\n data-placement=\"{{form.options.placement || \'bottom-left\'}}\"\n data-max-length-html=\"{{form.options.inlineMaxLengthHtml}}\"\n bs-options=\"item.value as item.name for item in form.titleMap | selectFilter:this:$$value$$:"$$value$$"\"\n bs-select>\n </button>\n <button ng-if=\"!((form.options.multiple == \'true\') || (form.options.multiple == true))\"\n type=\"button\" class=\"btn btn-default\" sf-changed=\"form\" schema-validate=\"form\" ng-model=\"$$value$$\"\n data-placeholder=\"{{form.placeholder || form.schema.placeholder || (\'placeholders.select\')}}\"\n data-html=\"1\"\n data-placement=\"{{form.options.placement || \'bottom-left\'}}\"\n bs-options=\"item.value as item.name for item in form.titleMap | selectFilter:this:$$value$$:"$$value$$"\"\n bs-select>\n </button>\n <span class=\"help-block\">{{ (hasError() && errorMessage(schemaError())) || form.description}} </span>\n </div>\n</div>\n\n" ) ; } ] ) ;
10
+ angular . module ( "schemaForm" ) . run ( [ "$templateCache" , function ( $templateCache ) { $templateCache . put ( "directives/decorators/bootstrap/strap/strapmultiselect.html" , "<div ng-controller=\"dynamicSelectController\" class=\"form-group {{form.htmlClass}}\"\n ng-class=\"{\'has-error\': hasError(), \'has-success\': hasSuccess()}\">\n <label class=\"control-label {{form.labelHtmlClass}}\" ng-show=\"showTitle()\">{{form.title}}</label>\n\n <div class=\"form-group {{form.fieldHtmlClass}}\" ng-init=\"populateTitleMap(form)\">\n <button type=\"button\" class=\"btn btn-default\" sf-changed=\"form\" schema-validate=\"form\" sf-field-model=\"\"\n data-placeholder=\"{{form.placeholder || form.schema.placeholder || (\'placeholders.select\')}}\"\n data-html=\"1\"\n data-multiple=\"1\"\n data-placement=\"{{form.options.placement || \'bottom-left\'}}\"\n data-max-length=\"{{form.options.inlineMaxLength}}\"\n data-max-length-html=\"{{form.options.inlineMaxLengthHtml}}\"\n bs-options=\"item.value as item.name for item in form.titleMap | selectFilter:this:$$value$$:"$$value$$"\"\n bs-select>\n </button>\n <span class=\"help-block\">{{ (hasError() && errorMessage(schemaError())) || form.description}}</span>\n </div>\n</div>\n" ) ;
11
+ $templateCache . put ( "directives/decorators/bootstrap/strap/strapselect.html" , "<div ng-controller=\"dynamicSelectController\" class=\"form-group {{form.htmlClass}}\"\n ng-class=\"{\'has-error\': hasError(), \'has-success\': hasSuccess()}\">\n <label class=\"control-label {{form.labelHtmlClass}}\" ng-show=\"showTitle()\">{{form.title}}</label>\n\n <div class=\"form-group {{form.fieldHtmlClass}}\" ng-init=\"populateTitleMap(form)\">\n <button ng-if=\"(form.options.multiple == \'true\') || (form.options.multiple == true)\"\n type=\"button\" class=\"btn btn-default\" sf-changed=\"form\" schema-validate=\"form\" sf-field-model=\"\"\n data-placeholder=\"{{form.placeholder || form.schema.placeholder || (\'placeholders.select\')}}\"\n data-html=\"1\" data-multiple=\"1\" data-max-length=\"{{form.options.inlineMaxLength}}\"\n data-placement=\"{{form.options.placement || \'bottom-left\'}}\"\n data-max-length-html=\"{{form.options.inlineMaxLengthHtml}}\"\n bs-options=\"item.value as item.name for item in form.titleMap | selectFilter:this:$$value$$:"$$value$$"\"\n bs-select>\n </button>\n <button ng-if=\"!((form.options.multiple == \'true\') || (form.options.multiple == true))\"\n type=\"button\" class=\"btn btn-default\" sf-changed=\"form\" schema-validate=\"form\" sf-field-model=\"\"\n data-placeholder=\"{{form.placeholder || form.schema.placeholder || (\'placeholders.select\')}}\"\n data-html=\"1\"\n data-placement=\"{{form.options.placement || \'bottom-left\'}}\"\n bs-options=\"item.value as item.name for item in form.titleMap | selectFilter:this:$$value$$:"$$value$$"\"\n bs-select>\n </button>\n <span class=\"help-block\">{{ (hasError() && errorMessage(schemaError())) || form.description}} </span>\n </div>\n</div>\n\n" ) ; } ] ) ;
12
12
angular . module ( "schemaForm" ) . run ( [ "$templateCache" , function ( $templateCache ) { $templateCache . put ( "directives/decorators/bootstrap/uiselect/uiselect.html" , "<div ng-controller=\"dynamicSelectController\" class=\"form-group\"\n ng-class=\"{\'has-error\': hasError(), \'has-success\': hasSuccess(), \'has-feedback\': form.feedback !== false}\"\n ng-init=\"insideModel=$$value$$;\">\n <label class=\"control-label {{form.labelHtmlClass}}\" ng-show=\"showTitle()\">{{form.title}}</label>\n\n <div class=\"form-group\">\n <ui-select ng-model=\"select_model.selected\"\n ng-if=\"!(form.options.tagging||false)\" theme=\"bootstrap\" ng-disabled=\"form.disabled\"\n on-select=\"$$value$$=$item.value\" class=\"{{form.options.uiClass}}\">\n <ui-select-match\n placeholder=\"{{form.placeholder || form.schema.placeholder || (\'placeholders.select\' | translate)}}\">\n {{select_model.selected.name}}\n </ui-select-match>\n <ui-select-choices refresh=\"populateTitleMap(form, $select.search)\"\n refresh-delay=\"form.options.refreshDelay\" group-by=\"form.options.groupBy\"\n repeat=\"item in form.titleMap | propsFilter: {name: $select.search, description: (form.options.searchDescriptions===true ? $select.search : \'NOTSEARCHINGFORTHIS\') }\">\n <div ng-bind-html=\"item.name | highlight: $select.search\"></div>\n <div ng-if=\"item.description\">\n <span ng-bind-html=\"\'<small>\' + (\'\'+item.description | highlight: (form.options.searchDescriptions===true ? $select.search : \'NOTSEARCHINGFORTHIS\'))+ \'</small>\'\"></span>\n </div>\n </ui-select-choices>\n </ui-select>\n <ui-select ng-controller=\"dynamicSelectController\" ng-model=\"select_model.selected\"\n ng-if=\"(form.options.tagging||false) && !(form.options.groupBy || false)\"\n tagging=\"form.options.tagging||false\" tagging-label=\"form.options.taggingLabel\"\n tagging-tokens=\"form.options.taggingTokens\"\n theme=\"bootstrap\" ng-disabled=\"form.disabled\" on-select=\"$$value$$=$item.value\"\n class=\"{{form.options.uiClass}}\">\n <ui-select-match\n placeholder=\"{{form.placeholder || form.schema.placeholder || (\'placeholders.select\' | translate)}}\">\n {{select_model.selected.name}} \n <small>{{(select_model.selected.isTag===true ? form.options.taggingLabel : \'\')}}</small>\n </ui-select-match>\n <!--repeat code because tagging does not display properly under group by but is still useful -->\n <ui-select-choices refresh=\"populateTitleMap(form, $select.search)\"\n refresh-delay=\"form.options.refreshDelay\"\n repeat=\"item in form.titleMap | propsFilter: {name: $select.search, description: (form.options.searchDescription===true ? $select.search : \'NOTSEARCHINGFORTHIS\') }\">\n <div ng-if=\"item.isTag\"\n ng-bind-html=\"\'<div>\' + (item.name | highlight: $select.search) + \' \' + form.options.taggingLabel + \'</div><div class="divider"></div>\'\"></div>\n <div ng-if=\"!item.isTag\" ng-bind-html=\"item.name + item.isTag| highlight: $select.search\"></div>\n <div ng-if=\"item.description\">\n <span ng-bind-html=\"\'<small>\' + (\'\'+item.description | highlight: (form.options.searchDescriptions===true ? $select.search : \'NOTSEARCHINGFORTHIS\')) + \'</small>\'\"></span>\n </div>\n </ui-select-choices>\n </ui-select>\n\n <!--repeat code because tagging does not display properly under group by but is still useful -->\n\n <ui-select ng-controller=\"dynamicSelectController\" ng-model=\"select_model.selected\"\n ng-if=\"(form.options.tagging||false) && (form.options.groupBy || false)\"\n tagging=\"form.options.tagging||false\" tagging-label=\"form.options.taggingLabel\"\n tagging-tokens=\"form.options.taggingTokens\"\n theme=\"bootstrap\" ng-disabled=\"form.disabled\" on-select=\"$$value$$=$item.value\"\n class=\"{{form.options.uiClass}}\">\n <ui-select-match\n placeholder=\"{{form.placeholder || form.schema.placeholder || (\'placeholders.select\' | translate)}}\">\n {{select_model.selected.name}} \n <small>{{(select_model.selected.isTag===true ? form.options.taggingLabel : \'\')}}</small>\n </ui-select-match>\n <ui-select-choices group-by=\"form.options.groupBy\"\n refresh=\"populateTitleMap(form, $select.search)\"\n refresh-delay=\"form.options.refreshDelay\"\n repeat=\"item in form.titleMap | propsFilter: {name: $select.search, description: (form.options.searchDescription===true ? $select.search : \'NOTSEARCHINGFORTHIS\') }\">\n <div ng-if=\"item.isTag\"\n ng-bind-html=\"\'<div>\' + (item.name | highlight: $select.search) + \' \' + form.options.taggingLabel + \'</div><div class="divider"></div>\'\"></div>\n <div ng-if=\"!item.isTag\" ng-bind-html=\"item.name + item.isTag| highlight: $select.search\"></div>\n <div ng-if=\"item.description\">\n <span ng-bind-html=\"\'<small>\' + (\'\'+item.description | highlight: (form.options.searchDescriptions===true ? $select.search : \'NOTSEARCHINGFORTHIS\')) + \'</small>\'\"></span>\n </div>\n </ui-select-choices>\n </ui-select>\n\n <input\n type=\"hidden\"\n name=\"{{form.key.slice(-1)[0]}}\"\n toggle-single-model\n sf-changed=\"form\"\n ng-model=\"insideModel\"\n schema-validate=\"form\"/>\n\n <span ng-if=\"form.feedback !== false\"\n class=\"form-control-feedback\"\n id=\"{{form.key.slice(-1)[0] + \'Status\'}}\"\n ng-class=\"evalInScope(form.feedback) || {\'glyphicon\': true, \'glyphicon-ok\': hasSuccess(), \'glyphicon-remove\': hasError() }\"></span>\n\n <div class=\"help-block\" sf-message=\"form.description\"></div>\n\n </div>\n</div>\n" ) ;
13
13
$templateCache . put ( "directives/decorators/bootstrap/uiselect/uiselectmultiple.html" , "\n<div class=\"form-group\" ng-class=\"{\'has-error\': hasError(), \'has-success\': hasSuccess(), \'has-feedback\': form.feedback !== false}\"\n ng-controller=\"dynamicSelectController\" ng-init=\"$$value$$=$$value$$||[];uiMultiSelectInitInternalModel($$value$$)\">\n <label class=\"control-label {{form.labelHtmlClass}}\" ng-show=\"showTitle()\">{{form.title}}</label>\n <div class=\"form-group\">\n <ui-select multiple sortable-options=\"{{form.sortableOptions}}\" ng-model=\"internalModel\" theme=\"bootstrap\"\n on-select=\"$$value$$.push($item.value)\" on-remove=\"$$value$$.splice($$value$$.indexOf($item.value), 1)\"\n class=\"{{form.options.uiClass}}\">\n <ui-select-match placeholder=\"{{form.placeholder || form.schema.placeholder || (\'placeholders.select\' | translate)}}\">{{$item.name}}</ui-select-match>\n <ui-select-choices repeat=\"item in form.titleMap | propsFilter: {name: $select.search}\"\n refresh=\"populateTitleMap(form, $select.search)\"\n refresh-delay=\"form.options.refreshDelay\"\n group-by=\"form.options.groupBy\">\n <div ng-bind-html=\"item.name | highlight: $select.search\"></div>\n </ui-select-choices>\n </ui-select>\n <span ng-if=\"form.feedback !== false\"\n class=\"form-control-feedback\"\n ng-class=\"evalInScope(form.feedback) || {\'glyphicon\': true, \'glyphicon-ok\': hasSuccess(), \'glyphicon-remove\': hasError() }\"></span>\n <div class=\"help-block\"\n ng-show=\"(hasError() && errorMessage(schemaError())) || form.description\"\n ng-bind-html=\"(hasError() && errorMessage(schemaError())) || form.description\"></div>\n </div>\n</div>\n" ) ; } ] ) ;
14
14
angular . module ( 'schemaForm' ) . config (
15
- [ 'schemaFormProvider' , 'schemaFormDecoratorsProvider' , 'sfPathProvider' ,
16
- function ( schemaFormProvider , schemaFormDecoratorsProvider , sfPathProvider ) {
15
+ [ 'schemaFormProvider' , 'schemaFormDecoratorsProvider' , 'sfPathProvider' , 'sfBuilderProvider' ,
16
+ function ( schemaFormProvider , schemaFormDecoratorsProvider , sfPathProvider , sfBuilderProvider ) {
17
17
18
18
var select = function ( name , schema , options ) {
19
19
if ( ( schema . type === 'string' ) && ( "enum" in schema ) ) {
@@ -26,11 +26,28 @@ angular.module('schemaForm').config(
26
26
} ;
27
27
28
28
schemaFormProvider . defaults . string . unshift ( select ) ;
29
-
29
+ // Building up new angular schema for builders;
30
+
31
+ var simpleTransclusion = sfBuilderProvider . builders . simpleTransclusion ;
32
+ var ngModelOptions = sfBuilderProvider . builders . ngModelOptions ;
33
+ var ngModel = sfBuilderProvider . builders . ngModel ;
34
+ var sfField = sfBuilderProvider . builders . sfField ;
35
+ var condition = sfBuilderProvider . builders . condition ;
36
+ var array = sfBuilderProvider . builders . array ;
37
+ var defaults = [ sfField , ngModel , ngModelOptions , condition ] ;
38
+
30
39
//Add to the bootstrap directive
31
- schemaFormDecoratorsProvider . addMapping ( 'bootstrapDecorator' , 'strapselect' ,
32
- 'directives/decorators/bootstrap/strap/strapselect.html' ) ;
33
-
40
+ /*schemaFormDecoratorsProvider.addMapping('bootstrapDecorator', 'strapselect',
41
+ 'directives/decorators/bootstrap/strap/strapselect.html');*/
42
+
43
+ //Add to the bootstrap directive with non deprecated methods
44
+ schemaFormDecoratorsProvider . defineAddOn (
45
+ 'bootstrapDecorator' ,
46
+ 'strapselect' ,
47
+ 'directives/decorators/bootstrap/strap/strapselect.html' ,
48
+ defaults
49
+ ) ;
50
+
34
51
schemaFormDecoratorsProvider . addMapping ( 'bootstrapDecorator' , 'strapmultiselect' ,
35
52
'directives/decorators/bootstrap/strap/strapmultiselect.html' ) ;
36
53
@@ -39,17 +56,24 @@ angular.module('schemaForm').config(
39
56
40
57
schemaFormDecoratorsProvider . addMapping ( 'bootstrapDecorator' , 'strapmultiselectdynamic' ,
41
58
'directives/decorators/bootstrap/strap/strapmultiselect.html' ) ;
42
-
43
-
59
+
44
60
// UI SELECT
45
61
//Add to the bootstrap directive
46
- schemaFormDecoratorsProvider . addMapping ( 'bootstrapDecorator' , 'uiselect' ,
47
- 'directives/decorators/bootstrap/uiselect/uiselect.html' ) ;
48
-
49
-
62
+ /*schemaFormDecoratorsProvider.addMapping('bootstrapDecorator', 'uiselect',
63
+ 'directives/decorators/bootstrap/uiselect/uiselect.html');*/
64
+
65
+ //Add to the bootstrap directive with non deprecated methods
66
+ schemaFormDecoratorsProvider . defineAddOn (
67
+ 'bootstrapDecorator' ,
68
+ 'uiselect' ,
69
+ 'directives/decorators/bootstrap/uiselect/uiselect.html' ,
70
+ defaults
71
+ ) ;
72
+
50
73
schemaFormDecoratorsProvider . addMapping ( 'bootstrapDecorator' , 'uiselectmultiple' ,
51
74
'directives/decorators/bootstrap/uiselect/uiselectmultiple.html' ) ;
52
75
76
+
53
77
54
78
} ] )
55
79
. directive ( "toggleSingleModel" , function ( ) {
0 commit comments