Comparing version 1.0.2 to 1.0.3
@@ -6,4 +6,4 @@ /*! | ||
* license: MIT | ||
* version: 1.0.2 | ||
* version: 1.0.3 | ||
*/ | ||
!function(e){function t(s){if(n[s])return n[s].exports;var o=n[s]={exports:{},id:s,loaded:!1};return e[s].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";var s=(n(1),n(2));s.module("bs-select",[]),n(3)},function(e){e.exports=$},function(e){e.exports=angular},function(e,t,n){"use strict";var s=n(2),o=n(4),i=n(5);n(6),s.module("bs-select").directive("bsSelect",function(){return{restrict:"E",transclude:!0,scope:{collection:"="},require:"ng-Model",template:i,link:function(e,t,n,s){function i(t){a+=String.fromCharCode(t);var n=r(a);n>-1&&(e.selectedIndex=n,c(e.collection[e.selectedIndex])),d=setTimeout(function(){a=""},1e3)}function l(t){return t?o.findIndex(e.collection,function(e){return t.key===e.key}):-1}function r(t){return t=t.toLowerCase(),o.findIndex(e.collection,function(e){return 0===e.value.toLowerCase().indexOf(t)})}function c(n){var s=l(n),o=e.collection.length-s;s>5&&6>o?setTimeout(function(){t.find(".bs-select__menu").css({top:-225-36*(5-o)+"px"}).scrollTop(36*s-180)}):s>5?setTimeout(function(){t.find(".bs-select__menu").css({top:"-200px"}).scrollTop(36*s-180)}):t.find(".bs-select__menu").css({top:36*s*-1-20+"px"})}var d,a="";e.showDialog=!1,e.selectedIndex=null,s.$render=function(){var e=s.$viewValue?s.$viewValue.value:"";t.find(".bs-select__selected").text(e)},e.updateModel=function(n){s.$setViewValue(n),s.$render(),e.closeDialog(),setTimeout(function(){t.find("input").focus()})},e.focusSelect=function(){t.find(".bs-select").addClass("+focus")},n.$observe("disabled",function(){e.disabled=o.has(n,"disabled")}),e.keyDown=function(t){var n=t.which,r=s.$viewValue;13===n?e.updateModel(e.collection[e.selectedIndex]):38===n?(e.showDialog=!0,e.selectedIndex=o.isNull(e.selectedIndex)?l(r):e.selectedIndex-1,c(e.collection[e.selectedIndex])):40===n?(e.showDialog=!0,e.selectedIndex=o.isNull(e.selectedIndex)?l(r):e.selectedIndex+1,c(e.collection[e.selectedIndex])):27===n?e.closeDialog():i(t.which)},e.toggleDialog=function(){var n=s.$viewValue;e.showDialog?(e.showDialog=!1,t.find("input").focus()):(e.selectedIndex=null,n&&c(n),e.showDialog=!0,t.find("input").focus())},e.onBlur=function(){t.find(".bs-select").removeClass("+focus"),e.closeDialog()},e.closeDialog=function(){e.showDialog=!1}}}})},function(e){e.exports=_},function(e){e.exports='<input class=bs-select__hidden-input ng-disabled=disabled ng-focus=focusSelect() ng-blur=onBlur($event) ng-keydown=keyDown($event)><div class=bs-select ng-click="!disabled && toggleDialog()" ng-class="{\'+disabled\': disabled}"><div class=bs-select__selected></div><div class=bs-select__icon></div></div><ul class="bs-select__menu bss-dropdown-menu" role=menu ng-show=showDialog><li ng-mousedown=updateModel(item) ng-repeat="item in collection" ng-class="{\'+selected\': (selectedIndex === $index)}"><a>{{item.value}}</a></li></ul>'},function(e,t,n){var s=n(7);"string"==typeof s&&(s=[[e.id,s,""]]);n(8)(s,{})},function(e,t,n){t=e.exports=n(9)(),t.push([e.id,"bs-select{position:relative}.bs-select{border-radius:2px;box-shadow:0 1px 4px 0 rgba(0,0,0,.26);display:inline-block;padding:8px 14px;min-width:180px;color:#AFAFAF;background-color:#fff;cursor:pointer;width:100%}.bs-select.\\+disabled{cursor:not-allowed;background-color:#F9F9F9;opacity:1;border:1px dashed #CFCFCF}.bs-select.\\+focus{box-shadow:0 0 0 2px rgba(76,175,80,.3)}.bs-select__selected{width:calc(100% - 15px);display:inline-block}.bs-select__icon{display:inline-block;border-color:#AFAFAF transparent;border-style:solid;border-width:6px 6px 0 6px;height:0;width:0;float:right;position:relative;top:5px}bs-select .bs-select__menu{display:block;max-height:400px;overflow:auto;width:100%;positoin:absolute}bs-select .bs-select__menu li{height:36px!important}bs-select .bs-select__menu li.\\+selected>a{color:#333;text-decoration:none;background-color:#f7f7f7}.bs-select__hidden-input{opacity:0;position:absolute;left:0;top:0;width:0;height:0}",""])},function(e){function t(e,t){for(var n=0;n<e.length;n++){var s=e[n],i=c[s.id];if(i){i.refs++;for(var l=0;l<i.parts.length;l++)i.parts[l](s.parts[l]);for(;l<s.parts.length;l++)i.parts.push(o(s.parts[l],t))}else{for(var r=[],l=0;l<s.parts.length;l++)r.push(o(s.parts[l],t));c[s.id]={id:s.id,refs:1,parts:r}}}}function n(e){for(var t=[],n={},s=0;s<e.length;s++){var o=e[s],i=o[0],l=o[1],r=o[2],c=o[3],d={css:l,media:r,sourceMap:c};n[i]?n[i].parts.push(d):t.push(n[i]={id:i,parts:[d]})}return t}function s(){var e=document.createElement("style"),t=u();return e.type="text/css",t.appendChild(e),e}function o(e,t){var n,o,i;if(t.singleton){var c=p++;n=f||(f=s()),o=l.bind(null,n,c,!1),i=l.bind(null,n,c,!0)}else n=s(),o=r.bind(null,n),i=function(){n.parentNode.removeChild(n)};return o(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;o(e=t)}else i()}}function i(e,t,n){var s=["/** >>"+t+" **/","/** "+t+"<< **/"],o=e.lastIndexOf(s[0]),i=n?s[0]+n+s[1]:"";if(e.lastIndexOf(s[0])>=0){var l=e.lastIndexOf(s[1])+s[1].length;return e.slice(0,o)+i+e.slice(l)}return e+i}function l(e,t,n,s){var o=n?"":s.css;if(e.styleSheet)e.styleSheet.cssText=i(e.styleSheet.cssText,t,o);else{var l=document.createTextNode(o),r=e.childNodes;r[t]&&e.removeChild(r[t]),r.length?e.insertBefore(l,r[t]):e.appendChild(l)}}function r(e,t){var n=t.css,s=t.media,o=t.sourceMap;if(o&&"function"==typeof btoa)try{n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(JSON.stringify(o))+" */",n='@import url("data:text/css;base64,'+btoa(n)+'")'}catch(i){}if(s&&e.setAttribute("media",s),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var c={},d=function(e){var t;return function(){return"undefined"==typeof t&&(t=e.apply(this,arguments)),t}},a=d(function(){return/msie 9\b/.test(window.navigator.userAgent.toLowerCase())}),u=d(function(){return document.head||document.getElementsByTagName("head")[0]}),f=null,p=0;e.exports=function(e,s){s=s||{},"undefined"==typeof s.singleton&&(s.singleton=a());var o=n(e);return t(o,s),function(e){for(var i=[],l=0;l<o.length;l++){var r=o[l],d=c[r.id];d.refs--,i.push(d)}if(e){var a=n(e);t(a,s)}for(var l=0;l<i.length;l++){var d=i[l];if(0===d.refs){for(var u=0;u<d.parts.length;u++)d.parts[u]();delete c[d.id]}}}}},function(e){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t];e.push(n[2]?"@media "+n[2]+"{"+n[1]+"}":n[1])}return e.join("")},e}}]); | ||
!function(e){function t(s){if(n[s])return n[s].exports;var o=n[s]={exports:{},id:s,loaded:!1};return e[s].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";var s=(n(1),n(2));s.module("bs-select",[]),n(3)},function(e){e.exports=$},function(e){e.exports=angular},function(e,t,n){"use strict";var s=n(2),o=n(4),i=n(5);n(6),s.module("bs-select").directive("bsSelect",function(){return{restrict:"E",transclude:!0,scope:{collection:"="},require:"ng-Model",template:i,link:function(e,t,n,s){function i(t){a+=String.fromCharCode(t);var n=r(a);n>-1&&(e.selectedIndex=n,c(e.collection[e.selectedIndex])),d=setTimeout(function(){a=""},1e3)}function l(t){return t?o.findIndex(e.collection,function(e){return t.key===e.key}):-1}function r(t){return t=t.toLowerCase(),o.findIndex(e.collection,function(e){return 0===e.value.toLowerCase().indexOf(t)})}function c(n){var s=l(n),o=e.collection.length-s;s>5&&6>o?setTimeout(function(){t.find(".bs-select__menu").css({top:-225-36*(5-o)+"px"}).scrollTop(36*s-180)}):s>5?setTimeout(function(){t.find(".bs-select__menu").css({top:"-200px"}).scrollTop(36*s-180)}):t.find(".bs-select__menu").css({top:36*s*-1-20+"px"})}var d,a="";e.showDialog=!1,e.selectedIndex=null,s.$render=function(){var e=s.$viewValue?s.$viewValue.value:"";t.find(".bs-select__selected").text(e)},e.updateModel=function(n){s.$setViewValue(n),s.$render(),e.closeDialog(),setTimeout(function(){t.find("input").focus()})},e.focusSelect=function(){t.find(".bs-select").addClass("+focus")},n.$observe("disabled",function(){e.disabled=o.has(n,"disabled")}),e.keyDown=function(t){var n=t.which,r=s.$viewValue;13===n?e.updateModel(e.collection[e.selectedIndex]):38===n?(e.showDialog=!0,e.selectedIndex=o.isNull(e.selectedIndex)?l(r):e.selectedIndex-1,c(e.collection[e.selectedIndex])):40===n?(e.showDialog=!0,e.selectedIndex=o.isNull(e.selectedIndex)?l(r):e.selectedIndex+1,c(e.collection[e.selectedIndex])):27===n?e.closeDialog():i(t.which)},e.toggleDialog=function(){var n=s.$viewValue;e.showDialog?(e.showDialog=!1,t.find("input").focus()):(e.selectedIndex=null,n&&c(n),e.showDialog=!0,t.find("input").focus())},e.onBlur=function(){t.find(".bs-select").removeClass("+focus"),e.closeDialog()},e.closeDialog=function(){e.showDialog=!1}}}})},function(e){e.exports=_},function(e){e.exports='<input class=bs-select__hidden-input ng-disabled=disabled ng-focus=focusSelect() ng-blur=onBlur($event) ng-keydown=keyDown($event)><div class=bs-select ng-click="!disabled && toggleDialog()" ng-class="{\'+disabled\': disabled}"><div class=bs-select__selected></div><div class=bs-select__icon></div></div><ul class="bs-select__menu bss-dropdown-menu" role=menu ng-show=showDialog><li ng-mousedown=updateModel(item) ng-repeat="item in collection" ng-class="{\'+selected\': (selectedIndex === $index)}"><a>{{item.value}}</a></li></ul>'},function(e,t,n){var s=n(7);"string"==typeof s&&(s=[[e.id,s,""]]);n(8)(s,{})},function(e,t,n){t=e.exports=n(9)(),t.push([e.id,"bs-select{position:relative}.bs-select{border-radius:2px;box-shadow:0 1px 4px 0 rgba(0,0,0,.26);display:inline-block;padding:8px 14px;min-width:140px;color:#AFAFAF;background-color:#fff;cursor:pointer;width:100%}.bs-select.\\+disabled{cursor:not-allowed;background-color:#F9F9F9;opacity:1;border:1px dashed #CFCFCF}.bs-select.\\+focus{box-shadow:0 0 0 2px rgba(76,175,80,.3)}.bs-select__selected{width:calc(100% - 15px);display:inline-block}.bs-select__icon{display:inline-block;border-color:#AFAFAF transparent;border-style:solid;border-width:6px 6px 0 6px;height:0;width:0;float:right;position:relative;top:5px}bs-select .bs-select__menu{display:block;max-height:400px;overflow:auto;width:100%;positoin:absolute}bs-select .bs-select__menu li{height:36px!important}bs-select .bs-select__menu li.\\+selected>a{color:#333;text-decoration:none;background-color:#f7f7f7}.bs-select__hidden-input{opacity:0;position:absolute;left:0;top:0;width:0;height:0}",""])},function(e){function t(e,t){for(var n=0;n<e.length;n++){var s=e[n],i=c[s.id];if(i){i.refs++;for(var l=0;l<i.parts.length;l++)i.parts[l](s.parts[l]);for(;l<s.parts.length;l++)i.parts.push(o(s.parts[l],t))}else{for(var r=[],l=0;l<s.parts.length;l++)r.push(o(s.parts[l],t));c[s.id]={id:s.id,refs:1,parts:r}}}}function n(e){for(var t=[],n={},s=0;s<e.length;s++){var o=e[s],i=o[0],l=o[1],r=o[2],c=o[3],d={css:l,media:r,sourceMap:c};n[i]?n[i].parts.push(d):t.push(n[i]={id:i,parts:[d]})}return t}function s(){var e=document.createElement("style"),t=u();return e.type="text/css",t.appendChild(e),e}function o(e,t){var n,o,i;if(t.singleton){var c=p++;n=f||(f=s()),o=l.bind(null,n,c,!1),i=l.bind(null,n,c,!0)}else n=s(),o=r.bind(null,n),i=function(){n.parentNode.removeChild(n)};return o(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;o(e=t)}else i()}}function i(e,t,n){var s=["/** >>"+t+" **/","/** "+t+"<< **/"],o=e.lastIndexOf(s[0]),i=n?s[0]+n+s[1]:"";if(e.lastIndexOf(s[0])>=0){var l=e.lastIndexOf(s[1])+s[1].length;return e.slice(0,o)+i+e.slice(l)}return e+i}function l(e,t,n,s){var o=n?"":s.css;if(e.styleSheet)e.styleSheet.cssText=i(e.styleSheet.cssText,t,o);else{var l=document.createTextNode(o),r=e.childNodes;r[t]&&e.removeChild(r[t]),r.length?e.insertBefore(l,r[t]):e.appendChild(l)}}function r(e,t){var n=t.css,s=t.media,o=t.sourceMap;if(o&&"function"==typeof btoa)try{n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(JSON.stringify(o))+" */",n='@import url("data:text/css;base64,'+btoa(n)+'")'}catch(i){}if(s&&e.setAttribute("media",s),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var c={},d=function(e){var t;return function(){return"undefined"==typeof t&&(t=e.apply(this,arguments)),t}},a=d(function(){return/msie 9\b/.test(window.navigator.userAgent.toLowerCase())}),u=d(function(){return document.head||document.getElementsByTagName("head")[0]}),f=null,p=0;e.exports=function(e,s){s=s||{},"undefined"==typeof s.singleton&&(s.singleton=a());var o=n(e);return t(o,s),function(e){for(var i=[],l=0;l<o.length;l++){var r=o[l],d=c[r.id];d.refs--,i.push(d)}if(e){var a=n(e);t(a,s)}for(var l=0;l<i.length;l++){var d=i[l];if(0===d.refs){for(var u=0;u<d.parts.length;u++)d.parts[u]();delete c[d.id]}}}}},function(e){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t];e.push(n[2]?"@media "+n[2]+"{"+n[1]+"}":n[1])}return e.join("")},e}}]); |
{ | ||
"name": "bs-select", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "A consistently styled cross-browser select component", | ||
@@ -5,0 +5,0 @@ "main": "build/bs-select.js", |
Sorry, the diff of this file is not supported yet