')}]),angular.module("schemaForm").config(["schemaFormProvider","schemaFormDecoratorsProvider","sfPathProvider",function(e,t,l){var o=function(t,o,s){if("string"===o.type&&"enum"in o){var a=e.stdFormObj(t,o,s);return a.key=s.path,a.type="strapselect",s.lookup[l.stringify(s.path)]=a,a}};e.defaults.string.unshift(o),t.addMapping("bootstrapDecorator","strapselect","directives/decorators/bootstrap/strap/strapselect.html"),t.addMapping("bootstrapDecorator","strapmultiselect","directives/decorators/bootstrap/strap/strapmultiselect.html"),t.addMapping("bootstrapDecorator","strapselectdynamic","directives/decorators/bootstrap/strap/strapselect.html"),t.addMapping("bootstrapDecorator","strapmultiselectdynamic","directives/decorators/bootstrap/strap/strapmultiselect.html"),t.addMapping("bootstrapDecorator","uiselect","directives/decorators/bootstrap/uiselect/uiselect.html"),t.addMapping("bootstrapDecorator","uiselectmultiple","directives/decorators/bootstrap/uiselect/uiselectmultiple.html")}]).directive("toggleSingleModel",function(){return{require:"ngModel",restrict:"A",scope:{},replace:!0,controller:["$scope",function(e){e.$parent.$watch("select_model.selected",function(){void 0!=e.$parent.select_model.selected&&(e.$parent.insideModel=e.$parent.select_model.selected.value,e.$parent.ngModel.$setViewValue(e.$parent.select_model.selected.value))})}]}}).directive("multipleOn",function(){return{link:function(e,t,l){e.$watch(function(){return t.attr("multiple-on")},function(e){if("true"==e){var l=angular.element(t).scope().$$childTail;l.$isMultiple=!0,l.options.multiple=!0,l.$select.$element.addClass("select-multiple")}else angular.element(t).scope().$$childTail.$isMultiple=!1})}}}).filter("whereMulti",function(){return function(e,t,l){var o=[];return angular.isArray(l)&&void 0!==e?l.forEach(function(l){for(var s=0;s-1?l.splice(l.indexOf(e.value),1):l==e.value&&(console.log("Setting model of type "+t.localModelType+"to null."),l=null))}),"[object Array]"!=t.localModelType||l||(console.log("Resetting model of type "+t.localModelType+" to []."),t.$eval(o+"=[]")),console.log("----- Exiting filter for "+t.form.title+"-----"),s}}]),e});
\ No newline at end of file
+!function(e,t){"function"==typeof define&&define.amd?define(["angularSchemaFormDynamicSelect"],t):"object"==typeof exports?module.exports=t(require("angularSchemaFormDynamicSelect")):e.angularSchemaFormDynamicSelect=t(e.angularSchemaFormDynamicSelect)}(this,function(e){return angular.module("schemaForm").run(["$templateCache",function(e){e.put("directives/decorators/bootstrap/strap/strapmultiselect.html",'
')}]),angular.module("schemaForm").config(["schemaFormProvider","schemaFormDecoratorsProvider","sfPathProvider",function(e,t,o){var l=function(t,l,s){if("string"===l.type&&"enum"in l){var i=e.stdFormObj(t,l,s);return i.key=s.path,i.type="strapselect",s.lookup[o.stringify(s.path)]=i,i}};e.defaults.string.unshift(l),t.addMapping("bootstrapDecorator","strapselect","directives/decorators/bootstrap/strap/strapselect.html"),t.addMapping("bootstrapDecorator","strapmultiselect","directives/decorators/bootstrap/strap/strapmultiselect.html"),t.addMapping("bootstrapDecorator","strapselectdynamic","directives/decorators/bootstrap/strap/strapselect.html"),t.addMapping("bootstrapDecorator","strapmultiselectdynamic","directives/decorators/bootstrap/strap/strapmultiselect.html"),t.addMapping("bootstrapDecorator","uiselect","directives/decorators/bootstrap/uiselect/uiselect.html"),t.addMapping("bootstrapDecorator","uiselectmultiple","directives/decorators/bootstrap/uiselect/uiselectmultiple.html")}]).directive("toggleSingleModel",function(){return{require:"ngModel",restrict:"A",scope:{},replace:!0,controller:["$scope",function(e){e.$parent.$watch("select_model.selected",function(){void 0!=e.$parent.select_model.selected&&(e.$parent.insideModel=e.$parent.select_model.selected.value,e.$parent.ngModel.$setViewValue(e.$parent.select_model.selected.value))})}]}}).directive("multipleOn",function(){return{link:function(e,t,o){e.$watch(function(){return t.attr("multiple-on")},function(e){if("true"==e){var o=angular.element(t).scope().$$childTail;o.$isMultiple=!0,o.options.multiple=!0,o.$select.$element.addClass("select-multiple")}else angular.element(t).scope().$$childTail.$isMultiple=!1})}}}).filter("whereMulti",function(){return function(e,t,o){var l=[];return angular.isArray(o)&&void 0!==e?o.forEach(function(o){for(var s=0;s-1?o.splice(o.indexOf(e.value),1):o==e.value&&(console.log("Setting model of type "+t.localModelType+"to null."),o=null))}),"[object Array]"!=t.localModelType||o||(console.log("Resetting model of type "+t.localModelType+" to []."),t.$eval(l+"=[]")),console.log("----- Exiting filter for "+t.form.title+"-----"),s}}]),e});
\ No newline at end of file
diff --git a/app.js b/app.js
index fd506ee..675377d 100644
--- a/app.js
+++ b/app.js
@@ -161,7 +161,6 @@ testApp.controller("appController", ["$scope", "$http", function ($scope, $http)
}
}
}
-
},
required: ["select", "multiselect"]
};
@@ -314,6 +313,37 @@ testApp.controller("appController", ["$scope", "$http", function ($scope, $http)
}
]
},
+ {
+ "type": "help",
+ "helpvalue" :
+ "
Support for fieldAddonLeft and fieldAddonRight
" +
+ "
Standard angular-schema-form selects don't support the fieldAddonLeft and fieldAddonRight options " +
+ "because Bootstrap doesn't support the input-group-addon class with selects. With this library, selects " +
+ "are composed from a button, which enables the use of these options.
"
+ },
+ {
+ "key": "select",
+ "title": "Single select strap-select, demonstrating support for fieldAddonLeft and fieldAddonRight.",
+ "description": null,
+ "fieldAddonLeft": "Left",
+ "fieldAddonRight": "Right"
+ },
+ {
+ "key": "multiselect",
+ "title": "Multi select strap-select, demonstrating support for fieldAddonLeft and fieldAddonRight.",
+ "type": "strapselect",
+ "placeholder": "My items feel unselected. Or you selected text3 in the selector above me.",
+ "description": null,
+ "options": {
+ "multiple": "true",
+ },
+ "titleMap": [
+ {"value": "value1", "name": "text1"},
+ {"value": "value2", "name": "text2"}
+ ],
+ "fieldAddonLeft": "Left",
+ "fieldAddonRight": "Right"
+ },
{
type: "submit",
style: "btn-info",
diff --git a/src/strapmultiselect.html b/src/strapmultiselect.html
index 95cdf29..8ddf988 100644
--- a/src/strapmultiselect.html
+++ b/src/strapmultiselect.html
@@ -3,14 +3,29 @@