From 6ea68c2c4e6bc8577075f45ed8817426a22ecd48 Mon Sep 17 00:00:00 2001 From: Ugurcan Sengit Date: Mon, 19 Dec 2016 14:31:02 +0300 Subject: [PATCH] Resolved an scenario that leads to no selected class on selected option #27 --- bower.json | 2 +- dist/uxrocket.select.css | 35 ++++---------------------------- dist/uxrocket.select.js | 3 ++- dist/uxrocket.select.min.css | 6 +++--- dist/uxrocket.select.min.css.map | 2 +- dist/uxrocket.select.min.js | 6 +++--- lib/uxrocket.select.js | 3 ++- package.json | 2 +- uxrocket.json | 2 +- version.md | 3 +++ 10 files changed, 21 insertions(+), 43 deletions(-) diff --git a/bower.json b/bower.json index 8598b10..2b5d6f7 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "uxrocket.select", - "version": "3.5.9", + "version": "3.5.10", "homepage": "https://github.com/uxrocket/uxrocket.select", "authors": [ "Bilal Çınarlı " diff --git a/dist/uxrocket.select.css b/dist/uxrocket.select.css index b533c42..bfdfe01 100644 --- a/dist/uxrocket.select.css +++ b/dist/uxrocket.select.css @@ -50,8 +50,7 @@ border-radius: 50%; border: dashed 2px #ccc; background-color: #fff; - -webkit-animation: uxr-select-loading 2s infinite linear; - animation: uxr-select-loading 2s infinite linear; + animation: uxr-select-loading 2s infinite linear; content: ""; } @@ -73,8 +72,7 @@ .uxr-select-multiple.uxr-select-opened .uxr-select-selection-text:after { content: "|"; - -webkit-animation: uxr-select-blink linear infinite 1s; - animation: uxr-select-blink linear infinite 1s; + animation: uxr-select-blink linear infinite 1s; } .uxr-select-disabled, .uxr-select-disabled:hover { @@ -224,18 +222,6 @@ display: none; } -@-webkit-keyframes uxr-select-blink { - 0% { - opacity: 0; - } - 50% { - opacity: 0; - } - 100% { - opacity: 1; - } -} - @keyframes uxr-select-blink { 0% { opacity: 0; @@ -248,24 +234,11 @@ } } -@-webkit-keyframes uxr-select-loading { - from { - -webkit-transform: rotate(0deg); - transform: rotate(0deg); - } - to { - -webkit-transform: rotate(360deg); - transform: rotate(360deg); - } -} - @keyframes uxr-select-loading { from { - -webkit-transform: rotate(0deg); - transform: rotate(0deg); + transform: rotate(0deg); } to { - -webkit-transform: rotate(360deg); - transform: rotate(360deg); + transform: rotate(360deg); } } diff --git a/dist/uxrocket.select.js b/dist/uxrocket.select.js index 62c5a51..f06f8fb 100644 --- a/dist/uxrocket.select.js +++ b/dist/uxrocket.select.js @@ -546,6 +546,7 @@ } this.$el.find('[value="' + value + '"]').prop('selected', true); + this.$list.find('#' + optionID).addClass(selected); $option.addClass(selected); if(this.options.displayType === 'tags') { @@ -1178,7 +1179,7 @@ }); // version - ux.version = '3.5.9'; + ux.version = '3.5.10'; // default settings ux.settings = defaults; diff --git a/dist/uxrocket.select.min.css b/dist/uxrocket.select.min.css index 398ec04..9839c2a 100644 --- a/dist/uxrocket.select.min.css +++ b/dist/uxrocket.select.min.css @@ -1,9 +1,9 @@ /*! UX Rocket Select * jQuery based Select box replacement function * @author Bilal Cinarli (http://bcinarli.com/) - * @version 3.5.9 - * @build Tue Nov 08 2016 13:24:32 GMT+0300 (+03) + * @version 3.5.10 + * @build Mon Dec 19 2016 12:52:41 GMT+0300 (MSK) */ -[class^="uxr-select-"]{box-sizing:border-box}.uxr-select-wrap .uxr-select-aria-hidden{position:absolute;overflow:hidden;width:1px;height:1px;margin:-1px;padding:0;border:0;clip:rect(0, 0, 0, 0);-webkit-clip-path:inset(0 0 0 0);clip-path:inset(0 0 0 0)}.uxr-select-ready{visibility:hidden}.uxr-select-selection{position:relative;overflow:hidden;display:inline-block;min-height:32px;border-radius:4px;border:1px solid #ccc;color:#222;text-decoration:none;vertical-align:middle}.uxr-select-selection.uxr-select-opened{border-radius:4px 4px 0 0}.uxr-select-selection.uxr-select-loading:after{position:absolute;top:4px;right:4px;width:20px;height:20px;border-radius:50%;border:dashed 2px #ccc;background-color:#fff;-webkit-animation:uxr-select-loading 2s infinite linear;animation:uxr-select-loading 2s infinite linear;content:""}.uxr-select-selection-text{display:block;overflow:hidden;width:100%;padding:5px 30px 5px 5px;text-overflow:ellipsis;white-space:nowrap}.uxr-select-multiple .uxr-select-selection-text{padding:5px;overflow:auto;background-color:#fff;white-space:normal}.uxr-select-multiple.uxr-select-opened .uxr-select-selection-text:after{content:"|";-webkit-animation:uxr-select-blink linear infinite 1s;animation:uxr-select-blink linear infinite 1s}.uxr-select-disabled,.uxr-select-disabled:hover{color:#999;cursor:default}.uxr-select-readonly,.uxr-select-readonly:hover{color:#777;cursor:default}.uxr-select-arrow{position:absolute;top:50%;right:5px;width:0;height:0;margin-top:-2px;border:5px solid;border-color:#555 transparent transparent}.uxr-select-multiple .uxr-select-arrow{display:none}.uxr-select-opened .uxr-select-arrow{margin-top:-7px;border-color:transparent transparent #555}.uxr-select-disabled .uxr-select-arrow{border-color:#999 transparent transparent}.uxr-select-disabled.uxr-select-opened .uxr-select-arrow{border-color:transparent transparent #999}.uxr-select-readonly .uxr-select-arrow{border-color:#777 transparent transparent}.uxr-select-readonly.uxr-select-opened .uxr-select-arrow{border-color:transparent transparent #777}.uxr-select-selected-tag{position:relative;display:inline-block;margin-bottom:3px;padding:3px 25px 3px 3px;border-radius:4px;background-color:#ddd;font-size:.8em;line-height:1}.uxr-select-remove-selected-tag{position:absolute;top:0;right:0;width:20px;height:100%;padding:3px;text-align:center;cursor:pointer}.uxr-select-drop{position:absolute;z-index:11000;border:1px solid #ccc;border-radius:0 0 4px;background-color:#fff}.uxr-select-drop ul{list-style:none;margin:0;padding:0}.uxr-select-drop li{list-style:none}.uxr-select-list{max-height:250px;overflow-y:auto}.uxr-select-list,.uxr-select-list ul{margin:0;padding:0;list-style:none}.uxr-select-search{display:block;padding:4px}.uxr-select-search input{width:calc(100% - 8px);padding:4px;border:1px solid #ccc;border-radius:4px}.uxr-select-search div[searchField="true"]{width:calc(100% - 8px);padding:4px;border:1px solid #ccc;border-radius:4px;height:25px}.uxr-select-group-name{display:block;padding:4px;font-weight:bold}.uxr-select-option{display:block;max-width:400px;padding:4px;cursor:pointer}.uxr-select-option:hover,.uxr-select-selected .uxr-select-option,.uxr-select-highlight .uxr-select-option{background-color:#f0f0f0}.uxr-select-disabled .uxr-select-option{background-color:#fff;color:#ccc;cursor:default}.uxr-select-hide{display:none}@-webkit-keyframes uxr-select-blink{0%{opacity:0}50%{opacity:0}100%{opacity:1}}@keyframes uxr-select-blink{0%{opacity:0}50%{opacity:0}100%{opacity:1}}@-webkit-keyframes uxr-select-loading{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes uxr-select-loading{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}} +[class^="uxr-select-"]{box-sizing:border-box}.uxr-select-wrap .uxr-select-aria-hidden{position:absolute;overflow:hidden;width:1px;height:1px;margin:-1px;padding:0;border:0;clip:rect(0, 0, 0, 0);-webkit-clip-path:inset(0 0 0 0);clip-path:inset(0 0 0 0)}.uxr-select-ready{visibility:hidden}.uxr-select-selection{position:relative;overflow:hidden;display:inline-block;min-height:32px;border-radius:4px;border:1px solid #ccc;color:#222;text-decoration:none;vertical-align:middle}.uxr-select-selection.uxr-select-opened{border-radius:4px 4px 0 0}.uxr-select-selection.uxr-select-loading:after{position:absolute;top:4px;right:4px;width:20px;height:20px;border-radius:50%;border:dashed 2px #ccc;background-color:#fff;animation:uxr-select-loading 2s infinite linear;content:""}.uxr-select-selection-text{display:block;overflow:hidden;width:100%;padding:5px 30px 5px 5px;text-overflow:ellipsis;white-space:nowrap}.uxr-select-multiple .uxr-select-selection-text{padding:5px;overflow:auto;background-color:#fff;white-space:normal}.uxr-select-multiple.uxr-select-opened .uxr-select-selection-text:after{content:"|";animation:uxr-select-blink linear infinite 1s}.uxr-select-disabled,.uxr-select-disabled:hover{color:#999;cursor:default}.uxr-select-readonly,.uxr-select-readonly:hover{color:#777;cursor:default}.uxr-select-arrow{position:absolute;top:50%;right:5px;width:0;height:0;margin-top:-2px;border:5px solid;border-color:#555 transparent transparent}.uxr-select-multiple .uxr-select-arrow{display:none}.uxr-select-opened .uxr-select-arrow{margin-top:-7px;border-color:transparent transparent #555}.uxr-select-disabled .uxr-select-arrow{border-color:#999 transparent transparent}.uxr-select-disabled.uxr-select-opened .uxr-select-arrow{border-color:transparent transparent #999}.uxr-select-readonly .uxr-select-arrow{border-color:#777 transparent transparent}.uxr-select-readonly.uxr-select-opened .uxr-select-arrow{border-color:transparent transparent #777}.uxr-select-selected-tag{position:relative;display:inline-block;margin-bottom:3px;padding:3px 25px 3px 3px;border-radius:4px;background-color:#ddd;font-size:.8em;line-height:1}.uxr-select-remove-selected-tag{position:absolute;top:0;right:0;width:20px;height:100%;padding:3px;text-align:center;cursor:pointer}.uxr-select-drop{position:absolute;z-index:11000;border:1px solid #ccc;border-radius:0 0 4px;background-color:#fff}.uxr-select-drop ul{list-style:none;margin:0;padding:0}.uxr-select-drop li{list-style:none}.uxr-select-list{max-height:250px;overflow-y:auto}.uxr-select-list,.uxr-select-list ul{margin:0;padding:0;list-style:none}.uxr-select-search{display:block;padding:4px}.uxr-select-search input{width:calc(100% - 8px);padding:4px;border:1px solid #ccc;border-radius:4px}.uxr-select-search div[searchField="true"]{width:calc(100% - 8px);padding:4px;border:1px solid #ccc;border-radius:4px;height:25px}.uxr-select-group-name{display:block;padding:4px;font-weight:bold}.uxr-select-option{display:block;max-width:400px;padding:4px;cursor:pointer}.uxr-select-option:hover,.uxr-select-selected .uxr-select-option,.uxr-select-highlight .uxr-select-option{background-color:#f0f0f0}.uxr-select-disabled .uxr-select-option{background-color:#fff;color:#ccc;cursor:default}.uxr-select-hide{display:none}@keyframes uxr-select-blink{0%{opacity:0}50%{opacity:0}100%{opacity:1}}@keyframes uxr-select-loading{from{transform:rotate(0deg)}to{transform:rotate(360deg)}} /*# sourceMappingURL=uxrocket.select.min.css.map */ diff --git a/dist/uxrocket.select.min.css.map b/dist/uxrocket.select.min.css.map index 358f116..9ea3af1 100644 --- a/dist/uxrocket.select.min.css.map +++ b/dist/uxrocket.select.min.css.map @@ -1 +1 @@ -{"version":3,"sources":["uxrocket.select.min.css","uxrocket.select.css","../stdin"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,uBCOE,qBAAuB,CACxB,yCAGC,kBACA,gBACA,UACA,WACA,YACA,UACA,SACA,sBACA,iCACQ,wBAAgB,CAG1B,kBACE,iBAAmB,CACpB,sBAGC,kBACA,gBACA,qBACA,gBACA,kBACA,sBACA,WACA,qBACA,qBAAuB,CACxB,wCAGC,yBAA2B,CAC5B,+CAGC,kBACA,QACA,UACA,WACA,YACA,kBACA,uBACA,sBACA,wDACQ,gDACR,UAAY,CAGd,2BACE,cACA,gBACA,WACA,yBACA,uBACA,kBAAoB,CACrB,gDAGC,YACA,cACA,sBACA,kBAAoB,CAGtB,wEACE,YACA,sDACQ,6CAA+C,CACxD,gDAGC,WACA,cAAgB,CACjB,gDAGC,WACA,cAAgB,CACjB,kBAGC,kBACA,QACA,UACA,QACA,SACA,gBACA,iBACA,yCAA2C,CAG7C,uCACE,YAAc,CACf,qCAGC,gBACA,yCAA2C,CAG7C,uCACE,yCAA2C,CAC5C,yDAGC,yCAA2C,CAG7C,uCACE,yCAA2C,CAC5C,yDAGC,yCAA2C,CAG7C,yBACE,kBACA,qBACA,kBACA,yBACA,kBACA,sBACA,eACA,aAAe,CAChB,gCAGC,kBACA,MACA,QACA,WACA,YACA,YACA,kBACA,cAAgB,CACjB,iBAGC,kBACA,cACA,sBACA,sBACA,qBAAuB,CACxB,oBAGC,gBACA,SACA,SAAW,CACZ,oBAGC,eAAiB,CAGnB,iBACE,iBACA,eAAiB,CAGnB,qCAEE,SACA,UACA,eAAiB,CAClB,mBAGC,cACA,WAAa,CACd,yBAGC,uBACA,YACA,sBACA,iBAAmB,CAGrB,2CACE,uBACA,YACA,sBACA,kBACA,WAAa,CACd,uBAGC,cACA,YACA,gBAAkB,CAGpB,mBACE,cACA,gBACA,YACA,cAAgB,CACjB,0GAKC,wBAA0B,CAC3B,wCAGC,sBACA,WACA,cAAgB,CACjB,iBAGC,YAAc,CACf,oCAGC,GACE,SAAW,CAEb,IACE,SAAW,CAEb,KACE,SAAW,CAAA,CAIf,4BACE,GACE,SAAW,CAEb,IACE,SAAW,CAEb,KACE,SAAW,CAAA,CAIf,sCACE,KACE,+BACQ,sBAAiB,CAE3B,GACE,iCACQ,wBAAiB,CAAA,CAI7B,8BACE,KACE,+BACQ,sBAAiB,CAE3B,GACE,iCACQ,wBAAiB,CAAA,CAAA","file":"uxrocket.select.min.css","sourcesContent":["/*! UX Rocket Select \n * jQuery based Select box replacement function \n * @author Bilal Cinarli (http://bcinarli.com/) \n * @version 3.5.8 \n * @build Tue Nov 08 2016 13:05:03 GMT+0300 (+03) \n */\n[class^=\"uxr-select-\"]{box-sizing:border-box}.uxr-select-wrap .uxr-select-aria-hidden{position:absolute;overflow:hidden;width:1px;height:1px;margin:-1px;padding:0;border:0;clip:rect(0, 0, 0, 0);-webkit-clip-path:inset(0 0 0 0);clip-path:inset(0 0 0 0)}.uxr-select-ready{visibility:hidden}.uxr-select-selection{position:relative;overflow:hidden;display:inline-block;min-height:32px;border-radius:4px;border:1px solid #ccc;color:#222;text-decoration:none;vertical-align:middle}.uxr-select-selection.uxr-select-opened{border-radius:4px 4px 0 0}.uxr-select-selection.uxr-select-loading:after{position:absolute;top:4px;right:4px;width:20px;height:20px;border-radius:50%;border:dashed 2px #ccc;background-color:#fff;-webkit-animation:uxr-select-loading 2s infinite linear;animation:uxr-select-loading 2s infinite linear;content:\"\"}.uxr-select-selection-text{display:block;overflow:hidden;width:100%;padding:5px 30px 5px 5px;text-overflow:ellipsis;white-space:nowrap}.uxr-select-multiple .uxr-select-selection-text{padding:5px;overflow:auto;background-color:#fff;white-space:normal}.uxr-select-multiple.uxr-select-opened .uxr-select-selection-text:after{content:\"|\";-webkit-animation:uxr-select-blink linear infinite 1s;animation:uxr-select-blink linear infinite 1s}.uxr-select-disabled,.uxr-select-disabled:hover{color:#999;cursor:default}.uxr-select-readonly,.uxr-select-readonly:hover{color:#777;cursor:default}.uxr-select-arrow{position:absolute;top:50%;right:5px;width:0;height:0;margin-top:-2px;border:5px solid;border-color:#555 transparent transparent}.uxr-select-multiple .uxr-select-arrow{display:none}.uxr-select-opened .uxr-select-arrow{margin-top:-7px;border-color:transparent transparent #555}.uxr-select-disabled .uxr-select-arrow{border-color:#999 transparent transparent}.uxr-select-disabled.uxr-select-opened .uxr-select-arrow{border-color:transparent transparent #999}.uxr-select-readonly .uxr-select-arrow{border-color:#777 transparent transparent}.uxr-select-readonly.uxr-select-opened .uxr-select-arrow{border-color:transparent transparent #777}.uxr-select-selected-tag{position:relative;display:inline-block;margin-bottom:3px;padding:3px 25px 3px 3px;border-radius:4px;background-color:#ddd;font-size:.8em;line-height:1}.uxr-select-remove-selected-tag{position:absolute;top:0;right:0;width:20px;height:100%;padding:3px;text-align:center;cursor:pointer}.uxr-select-drop{position:absolute;z-index:11000;border:1px solid #ccc;border-radius:0 0 4px;background-color:#fff}.uxr-select-drop ul{list-style:none;margin:0;padding:0}.uxr-select-drop li{list-style:none}.uxr-select-list{max-height:250px;overflow-y:auto}.uxr-select-list,.uxr-select-list ul{margin:0;padding:0;list-style:none}.uxr-select-search{display:block;padding:4px}.uxr-select-search input{width:calc(100% - 8px);padding:4px;border:1px solid #ccc;border-radius:4px}.uxr-select-search div[searchField=\"true\"]{width:calc(100% - 8px);padding:4px;border:1px solid #ccc;border-radius:4px;height:25px}.uxr-select-group-name{display:block;padding:4px;font-weight:bold}.uxr-select-option{display:block;max-width:400px;padding:4px;cursor:pointer}.uxr-select-option:hover,.uxr-select-selected .uxr-select-option,.uxr-select-highlight .uxr-select-option{background-color:#f0f0f0}.uxr-select-disabled .uxr-select-option{background-color:#fff;color:#ccc;cursor:default}.uxr-select-hide{display:none}@-webkit-keyframes uxr-select-blink{0%{opacity:0}50%{opacity:0}100%{opacity:1}}@keyframes uxr-select-blink{0%{opacity:0}50%{opacity:0}100%{opacity:1}}@-webkit-keyframes uxr-select-loading{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes uxr-select-loading{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}\n\n/*# sourceMappingURL=uxrocket.select.min.css.map */\n","[class^=\"uxr-select-\"]{box-sizing:border-box}.uxr-select-wrap .uxr-select-aria-hidden{position:absolute;overflow:hidden;width:1px;height:1px;margin:-1px;padding:0;border:0;clip:rect(0, 0, 0, 0);-webkit-clip-path:inset(0 0 0 0);clip-path:inset(0 0 0 0)}.uxr-select-ready{visibility:hidden}.uxr-select-selection{position:relative;overflow:hidden;display:inline-block;min-height:32px;border-radius:4px;border:1px solid #ccc;color:#222;text-decoration:none;vertical-align:middle}.uxr-select-selection.uxr-select-opened{border-radius:4px 4px 0 0}.uxr-select-selection.uxr-select-loading:after{position:absolute;top:4px;right:4px;width:20px;height:20px;border-radius:50%;border:dashed 2px #ccc;background-color:#fff;-webkit-animation:uxr-select-loading 2s infinite linear;animation:uxr-select-loading 2s infinite linear;content:\"\"}.uxr-select-selection-text{display:block;overflow:hidden;width:100%;padding:5px 30px 5px 5px;text-overflow:ellipsis;white-space:nowrap}.uxr-select-multiple .uxr-select-selection-text{padding:5px;overflow:auto;background-color:#fff;white-space:normal}.uxr-select-multiple.uxr-select-opened .uxr-select-selection-text:after{content:\"|\";-webkit-animation:uxr-select-blink linear infinite 1s;animation:uxr-select-blink linear infinite 1s}.uxr-select-disabled,.uxr-select-disabled:hover{color:#999;cursor:default}.uxr-select-readonly,.uxr-select-readonly:hover{color:#777;cursor:default}.uxr-select-arrow{position:absolute;top:50%;right:5px;width:0;height:0;margin-top:-2px;border:5px solid;border-color:#555 transparent transparent}.uxr-select-multiple .uxr-select-arrow{display:none}.uxr-select-opened .uxr-select-arrow{margin-top:-7px;border-color:transparent transparent #555}.uxr-select-disabled .uxr-select-arrow{border-color:#999 transparent transparent}.uxr-select-disabled.uxr-select-opened .uxr-select-arrow{border-color:transparent transparent #999}.uxr-select-readonly .uxr-select-arrow{border-color:#777 transparent transparent}.uxr-select-readonly.uxr-select-opened .uxr-select-arrow{border-color:transparent transparent #777}.uxr-select-selected-tag{position:relative;display:inline-block;margin-bottom:3px;padding:3px 25px 3px 3px;border-radius:4px;background-color:#ddd;font-size:.8em;line-height:1}.uxr-select-remove-selected-tag{position:absolute;top:0;right:0;width:20px;height:100%;padding:3px;text-align:center;cursor:pointer}.uxr-select-drop{position:absolute;z-index:11000;border:1px solid #ccc;border-radius:0 0 4px;background-color:#fff}.uxr-select-drop ul{list-style:none;margin:0;padding:0}.uxr-select-drop li{list-style:none}.uxr-select-list{max-height:250px;overflow-y:auto}.uxr-select-list,.uxr-select-list ul{margin:0;padding:0;list-style:none}.uxr-select-search{display:block;padding:4px}.uxr-select-search input{width:calc(100% - 8px);padding:4px;border:1px solid #ccc;border-radius:4px}.uxr-select-search div[searchField=\"true\"]{width:calc(100% - 8px);padding:4px;border:1px solid #ccc;border-radius:4px;height:25px}.uxr-select-group-name{display:block;padding:4px;font-weight:bold}.uxr-select-option{display:block;max-width:400px;padding:4px;cursor:pointer}.uxr-select-option:hover,.uxr-select-selected .uxr-select-option,.uxr-select-highlight .uxr-select-option{background-color:#f0f0f0}.uxr-select-disabled .uxr-select-option{background-color:#fff;color:#ccc;cursor:default}.uxr-select-hide{display:none}@-webkit-keyframes uxr-select-blink{0%{opacity:0}50%{opacity:0}100%{opacity:1}}@keyframes uxr-select-blink{0%{opacity:0}50%{opacity:0}100%{opacity:1}}@-webkit-keyframes uxr-select-loading{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes uxr-select-loading{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}\n","/**\n * @author Bilal Cinarli\n */\n/** -------------------------------------------\n \tSelect Styles\n ------------------------------------------- **/\n[class^=\"uxr-select-\"] {\n box-sizing: border-box;\n}\n\n.uxr-select-wrap .uxr-select-aria-hidden {\n position: absolute;\n overflow: hidden;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n border: 0;\n clip: rect(0, 0, 0, 0);\n -webkit-clip-path: inset(0 0 0 0);\n clip-path: inset(0 0 0 0);\n}\n\n.uxr-select-ready {\n visibility: hidden;\n}\n\n.uxr-select-selection {\n position: relative;\n overflow: hidden;\n display: inline-block;\n min-height: 32px;\n border-radius: 4px;\n border: 1px solid #ccc;\n color: #222;\n text-decoration: none;\n vertical-align: middle;\n}\n\n.uxr-select-selection.uxr-select-opened {\n border-radius: 4px 4px 0 0;\n}\n\n.uxr-select-selection.uxr-select-loading:after {\n position: absolute;\n top: 4px;\n right: 4px;\n width: 20px;\n height: 20px;\n border-radius: 50%;\n border: dashed 2px #ccc;\n background-color: #fff;\n -webkit-animation: uxr-select-loading 2s infinite linear;\n animation: uxr-select-loading 2s infinite linear;\n content: \"\";\n}\n\n.uxr-select-selection-text {\n display: block;\n overflow: hidden;\n width: 100%;\n padding: 5px 30px 5px 5px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.uxr-select-multiple .uxr-select-selection-text {\n padding: 5px;\n overflow: auto;\n background-color: #fff;\n white-space: normal;\n}\n\n.uxr-select-multiple.uxr-select-opened .uxr-select-selection-text:after {\n content: \"|\";\n -webkit-animation: uxr-select-blink linear infinite 1s;\n animation: uxr-select-blink linear infinite 1s;\n}\n\n.uxr-select-disabled, .uxr-select-disabled:hover {\n color: #999;\n cursor: default;\n}\n\n.uxr-select-readonly, .uxr-select-readonly:hover {\n color: #777;\n cursor: default;\n}\n\n.uxr-select-arrow {\n position: absolute;\n top: 50%;\n right: 5px;\n width: 0;\n height: 0;\n margin-top: -2px;\n border: 5px solid;\n border-color: #555 transparent transparent;\n}\n\n.uxr-select-multiple .uxr-select-arrow {\n display: none;\n}\n\n.uxr-select-opened .uxr-select-arrow {\n margin-top: -7px;\n border-color: transparent transparent #555;\n}\n\n.uxr-select-disabled .uxr-select-arrow {\n border-color: #999 transparent transparent;\n}\n\n.uxr-select-disabled.uxr-select-opened .uxr-select-arrow {\n border-color: transparent transparent #999;\n}\n\n.uxr-select-readonly .uxr-select-arrow {\n border-color: #777 transparent transparent;\n}\n\n.uxr-select-readonly.uxr-select-opened .uxr-select-arrow {\n border-color: transparent transparent #777;\n}\n\n.uxr-select-selected-tag {\n position: relative;\n display: inline-block;\n margin-bottom: 3px;\n padding: 3px 25px 3px 3px;\n border-radius: 4px;\n background-color: #ddd;\n font-size: .8em;\n line-height: 1;\n}\n\n.uxr-select-remove-selected-tag {\n position: absolute;\n top: 0;\n right: 0;\n width: 20px;\n height: 100%;\n padding: 3px;\n text-align: center;\n cursor: pointer;\n}\n\n.uxr-select-drop {\n position: absolute;\n z-index: 11000;\n border: 1px solid #ccc;\n border-radius: 0 0 4px;\n background-color: #fff;\n}\n\n.uxr-select-drop ul {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n.uxr-select-drop li {\n list-style: none;\n}\n\n.uxr-select-list {\n max-height: 250px;\n overflow-y: auto;\n}\n\n.uxr-select-list,\n.uxr-select-list ul {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.uxr-select-search {\n display: block;\n padding: 4px;\n}\n\n.uxr-select-search input {\n width: calc(100% - 8px);\n padding: 4px;\n border: 1px solid #ccc;\n border-radius: 4px;\n}\n\n.uxr-select-search div[searchField=\"true\"] {\n width: calc(100% - 8px);\n padding: 4px;\n border: 1px solid #ccc;\n border-radius: 4px;\n height: 25px;\n}\n\n.uxr-select-group-name {\n display: block;\n padding: 4px;\n font-weight: bold;\n}\n\n.uxr-select-option {\n display: block;\n max-width: 400px;\n padding: 4px;\n cursor: pointer;\n}\n\n.uxr-select-option:hover,\n.uxr-select-selected .uxr-select-option,\n.uxr-select-highlight .uxr-select-option {\n background-color: #f0f0f0;\n}\n\n.uxr-select-disabled .uxr-select-option {\n background-color: #fff;\n color: #ccc;\n cursor: default;\n}\n\n.uxr-select-hide {\n display: none;\n}\n\n@-webkit-keyframes uxr-select-blink {\n 0% {\n opacity: 0;\n }\n 50% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n\n@keyframes uxr-select-blink {\n 0% {\n opacity: 0;\n }\n 50% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n\n@-webkit-keyframes uxr-select-loading {\n from {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n to {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes uxr-select-loading {\n from {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n to {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"sources":["uxrocket.select.css","_uxrocket-select.scss"],"names":[],"mappings":";;;;;;AAAA,uBCaI,qBAAuB,CAC1B,yCAKW,kBACA,gBACA,UACA,WACA,YACA,UACA,SACA,sBACA,iCAAA,wBAAA,CACH,kBAID,iBAAmB,CAhB3B,sBAoBQ,kBACA,gBACA,qBACA,gBACA,kBACA,sBACA,WACA,qBACA,qBAAuB,CA5B/B,wCA+BY,yBAAkC,CA/B9C,+CAoCgB,kBACA,QACA,UACA,WACA,YACA,kBACA,uBACA,sBACA,gDACA,UAAY,CA7C5B,2BAkDY,cACA,gBACA,WACA,yBACA,uBACA,kBAAoB,CAevB,gDAZO,YACA,cACA,sBACA,kBAAoB,CA7DpC,wEAkEoB,YACA,6CAA+C,CAClD,gDAQL,WACA,cAAgB,CA7E5B,gDAoFY,WACA,cAAgB,CArF5B,kBA0FQ,kBACA,QACA,UACA,QACA,SACA,gBACA,iBACA,yCAA2C,CA0B9C,uCAvBO,YAAc,CApG1B,qCAwGY,gBACA,yCAA2C,CAzGvD,uCA6GY,yCAA2C,CA7GvD,yDAiHY,yCAA2C,CAjHvD,uCAqHY,yCAA2C,CAG/C,yDACI,yCAA2C,CAC9C,yBAID,kBACA,qBACA,kBACA,yBACA,kBACA,sBACA,eACA,aAAe,CArIvB,gCAyIQ,kBACA,MACA,QACA,WACA,YACA,YACA,kBACA,cAAgB,CACnB,iBAGG,kBACA,cACA,sBACA,sBACA,qBAAuB,CAxJ/B,oBA2JY,gBACA,SACA,SAAW,CACd,oBAGG,eAAiB,CAjK7B,iBA6KQ,iBACA,eAAiB,CACpB,qCAPO,SACA,UACA,eAAiB,CACpB,mBAOD,cACA,WAAa,CAiBhB,yBAdO,uBACA,YACA,sBACA,iBAlMA,CAqMkB,2CAClB,uBACA,YACA,sBACA,kBACA,WAAa,CAjMzB,uBAwMY,cACA,YACA,gBAAkB,CACrB,mBAID,cACA,gBACA,YACA,cAAgB,CAlNxB,0GAqNY,wBAA0B,CArNtC,wCAyNY,sBACA,WACA,cAAgB,CACnB,iBAID,YAAc,CACjB,4BAMD,GACI,SAAW,CAEf,IACI,SAAW,CAEf,KACI,SAAW,CAAA,CAInB,8BACI,KACI,sBAAA,CAEJ,GACI,wBAAA,CAAA,CAAA","file":"uxrocket.select.min.css","sourcesContent":["/**\n * @author Bilal Cinarli\n */\n/** -------------------------------------------\n \tSelect Styles\n ------------------------------------------- **/\n[class^=\"uxr-select-\"] {\n box-sizing: border-box;\n}\n\n.uxr-select-wrap .uxr-select-aria-hidden {\n position: absolute;\n overflow: hidden;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n border: 0;\n clip: rect(0, 0, 0, 0);\n -webkit-clip-path: inset(0 0 0 0);\n clip-path: inset(0 0 0 0);\n}\n\n.uxr-select-ready {\n visibility: hidden;\n}\n\n.uxr-select-selection {\n position: relative;\n overflow: hidden;\n display: inline-block;\n min-height: 32px;\n border-radius: 4px;\n border: 1px solid #ccc;\n color: #222;\n text-decoration: none;\n vertical-align: middle;\n}\n\n.uxr-select-selection.uxr-select-opened {\n border-radius: 4px 4px 0 0;\n}\n\n.uxr-select-selection.uxr-select-loading:after {\n position: absolute;\n top: 4px;\n right: 4px;\n width: 20px;\n height: 20px;\n border-radius: 50%;\n border: dashed 2px #ccc;\n background-color: #fff;\n animation: uxr-select-loading 2s infinite linear;\n content: \"\";\n}\n\n.uxr-select-selection-text {\n display: block;\n overflow: hidden;\n width: 100%;\n padding: 5px 30px 5px 5px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.uxr-select-multiple .uxr-select-selection-text {\n padding: 5px;\n overflow: auto;\n background-color: #fff;\n white-space: normal;\n}\n\n.uxr-select-multiple.uxr-select-opened .uxr-select-selection-text:after {\n content: \"|\";\n animation: uxr-select-blink linear infinite 1s;\n}\n\n.uxr-select-disabled, .uxr-select-disabled:hover {\n color: #999;\n cursor: default;\n}\n\n.uxr-select-readonly, .uxr-select-readonly:hover {\n color: #777;\n cursor: default;\n}\n\n.uxr-select-arrow {\n position: absolute;\n top: 50%;\n right: 5px;\n width: 0;\n height: 0;\n margin-top: -2px;\n border: 5px solid;\n border-color: #555 transparent transparent;\n}\n\n.uxr-select-multiple .uxr-select-arrow {\n display: none;\n}\n\n.uxr-select-opened .uxr-select-arrow {\n margin-top: -7px;\n border-color: transparent transparent #555;\n}\n\n.uxr-select-disabled .uxr-select-arrow {\n border-color: #999 transparent transparent;\n}\n\n.uxr-select-disabled.uxr-select-opened .uxr-select-arrow {\n border-color: transparent transparent #999;\n}\n\n.uxr-select-readonly .uxr-select-arrow {\n border-color: #777 transparent transparent;\n}\n\n.uxr-select-readonly.uxr-select-opened .uxr-select-arrow {\n border-color: transparent transparent #777;\n}\n\n.uxr-select-selected-tag {\n position: relative;\n display: inline-block;\n margin-bottom: 3px;\n padding: 3px 25px 3px 3px;\n border-radius: 4px;\n background-color: #ddd;\n font-size: .8em;\n line-height: 1;\n}\n\n.uxr-select-remove-selected-tag {\n position: absolute;\n top: 0;\n right: 0;\n width: 20px;\n height: 100%;\n padding: 3px;\n text-align: center;\n cursor: pointer;\n}\n\n.uxr-select-drop {\n position: absolute;\n z-index: 11000;\n border: 1px solid #ccc;\n border-radius: 0 0 4px;\n background-color: #fff;\n}\n\n.uxr-select-drop ul {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n.uxr-select-drop li {\n list-style: none;\n}\n\n.uxr-select-list {\n max-height: 250px;\n overflow-y: auto;\n}\n\n.uxr-select-list,\n.uxr-select-list ul {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.uxr-select-search {\n display: block;\n padding: 4px;\n}\n\n.uxr-select-search input {\n width: calc(100% - 8px);\n padding: 4px;\n border: 1px solid #ccc;\n border-radius: 4px;\n}\n\n.uxr-select-search div[searchField=\"true\"] {\n width: calc(100% - 8px);\n padding: 4px;\n border: 1px solid #ccc;\n border-radius: 4px;\n height: 25px;\n}\n\n.uxr-select-group-name {\n display: block;\n padding: 4px;\n font-weight: bold;\n}\n\n.uxr-select-option {\n display: block;\n max-width: 400px;\n padding: 4px;\n cursor: pointer;\n}\n\n.uxr-select-option:hover,\n.uxr-select-selected .uxr-select-option,\n.uxr-select-highlight .uxr-select-option {\n background-color: #f0f0f0;\n}\n\n.uxr-select-disabled .uxr-select-option {\n background-color: #fff;\n color: #ccc;\n cursor: default;\n}\n\n.uxr-select-hide {\n display: none;\n}\n\n@keyframes uxr-select-blink {\n 0% {\n opacity: 0;\n }\n 50% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n\n@keyframes uxr-select-loading {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n","/**\n * @author Bilal Cinarli\n */\n\n$select-version: \"3.0.0\";\n$prefix: 'uxr-select';\n$border: #ccc;\n$radius: 4px;\n\n/** -------------------------------------------\n \tSelect Styles\n ------------------------------------------- **/\n[class^=\"#{$prefix}-\"] {\n box-sizing: border-box;\n}\n\n.#{$prefix} {\n &-wrap {\n .#{$prefix}-aria-hidden {\n position: absolute;\n overflow: hidden;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n border: 0;\n clip: rect(0, 0, 0, 0);\n clip-path: inset(0 0 0 0);\n }\n }\n\n &-ready {\n visibility: hidden;\n }\n\n &-selection {\n position: relative;\n overflow: hidden;\n display: inline-block;\n min-height: 32px;\n border-radius: $radius;\n border: 1px solid $border;\n color: #222;\n text-decoration: none;\n vertical-align: middle;\n\n &.#{$prefix}-opened {\n border-radius: $radius $radius 0 0;\n }\n\n &.#{$prefix}-loading {\n &:after {\n position: absolute;\n top: 4px;\n right: 4px;\n width: 20px;\n height: 20px;\n border-radius: 50%;\n border: dashed 2px $border;\n background-color: #fff;\n animation: uxr-select-loading 2s infinite linear;\n content: \"\";\n }\n }\n\n &-text {\n display: block;\n overflow: hidden;\n width: 100%;\n padding: 5px 30px 5px 5px;\n text-overflow: ellipsis;\n white-space: nowrap;\n\n .#{$prefix}-multiple & {\n padding: 5px;\n overflow: auto;\n background-color: #fff;\n white-space: normal;\n }\n\n .#{$prefix}-multiple.#{$prefix}-opened & {\n &:after {\n content: \"|\";\n animation: uxr-select-blink linear infinite 1s;\n }\n }\n }\n }\n\n &-disabled {\n &,\n &:hover {\n color: #999;\n cursor: default;\n }\n }\n\n &-readonly {\n &,\n &:hover {\n color: #777;\n cursor: default;\n }\n }\n\n &-arrow {\n position: absolute;\n top: 50%;\n right: 5px;\n width: 0;\n height: 0;\n margin-top: -2px;\n border: 5px solid;\n border-color: #555 transparent transparent;\n\n .#{$prefix}-multiple & {\n display: none;\n }\n\n .#{$prefix}-opened & {\n margin-top: -7px;\n border-color: transparent transparent #555;\n }\n\n .#{$prefix}-disabled & {\n border-color: #999 transparent transparent;\n }\n\n .#{$prefix}-disabled.#{$prefix}-opened & {\n border-color: transparent transparent #999;\n }\n\n .#{$prefix}-readonly & {\n border-color: #777 transparent transparent;\n }\n\n .#{$prefix}-readonly.#{$prefix}-opened & {\n border-color: transparent transparent #777;\n }\n }\n\n &-selected-tag {\n position: relative;\n display: inline-block;\n margin-bottom: 3px;\n padding: 3px 25px 3px 3px;\n border-radius: $radius;\n background-color: #ddd;\n font-size: .8em;\n line-height: 1;\n }\n\n &-remove-selected-tag {\n position: absolute;\n top: 0;\n right: 0;\n width: 20px;\n height: 100%;\n padding: 3px;\n text-align: center;\n cursor: pointer;\n }\n\n &-drop {\n position: absolute;\n z-index: 11000; // usuall modals have 9999-10000 z-indexes\n border: 1px solid $border;\n border-radius: 0 0 $radius;\n background-color: #fff;\n\n ul {\n list-style: none;\n margin: 0;\n padding: 0;\n }\n\n li {\n list-style: none;\n }\n }\n\n &-list {\n &,\n ul {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n\n max-height: 250px;\n overflow-y: auto;\n }\n\n &-search {\n display: block;\n padding: 4px;\n\n input {\n width: calc(100% - 8px);\n padding: 4px;\n border: 1px solid $border;\n border-radius: $radius;\n }\n\n div[searchField=\"true\"] {\n width: calc(100% - 8px);\n padding: 4px;\n border: 1px solid $border;\n border-radius: $radius;\n height: 25px;\n }\n\n }\n\n &-group {\n &-name {\n display: block;\n padding: 4px;\n font-weight: bold;\n }\n }\n\n &-option {\n display: block;\n max-width: 400px;\n padding: 4px;\n cursor: pointer;\n\n &:hover,\n .#{$prefix}-selected &,\n .#{$prefix}-highlight & {\n background-color: #f0f0f0;\n }\n\n .#{$prefix}-disabled & {\n background-color: #fff;\n color: #ccc;\n cursor: default;\n }\n }\n\n &-hide {\n display: none;\n }\n}\n\n\n\n@keyframes uxr-select-blink {\n 0% {\n opacity: 0;\n }\n 50% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n\n@keyframes uxr-select-loading {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n"]} \ No newline at end of file diff --git a/dist/uxrocket.select.min.js b/dist/uxrocket.select.min.js index ccdc259..e2605c1 100644 --- a/dist/uxrocket.select.min.js +++ b/dist/uxrocket.select.min.js @@ -1,7 +1,7 @@ /*! UX Rocket Select * jQuery based Select box replacement function * @author Bilal Cinarli (http://bcinarli.com/) - * @version 3.5.9 - * @build Tue Nov 08 2016 13:25:54 GMT+0300 (+03) + * @version 3.5.10 + * @build Mon Dec 19 2016 12:52:41 GMT+0300 (MSK) */ -!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof exports&&"function"==typeof require?require("jquery"):jQuery)}(function(e){"use strict";"undefined"==typeof window.UXRocket&&console.warn("UXRocket Select is required UXRocket Factory to run properly. You can clone/download factory at https://github.com/uxrocket/uxrocket.factory");var t,s=1,i="uxrSelect",o={lastFocused:null,current:null},n=!1,a=!1,l={selection:' {{selectionText}} ',tags:'{{#each selected}} {{selected.text}} X{{/each}}',multi:' {{selectionText}} X',search:' ',list:'
    {{#each options}} {{#if options.groupStart}}
  • {{options.groupName}} {{/if}} {{/each}}
',drop:'
{{search}} {{list}}
'},r={wrapper:"",opened:"",current:"",arrow:"",drop:"",list:"",option:"",selected:"",disabled:"",search:!0,searchItemLimit:10,searchType:"starts",displayType:"tags",multipleInfoMessage:"Seçilen Kayıt:",minLetters:2,maxSelection:0,maxSelectionWarn:"You have reached allowed maximum selection",numeric:!1,onReady:!1,onOpen:!1,onClose:!1,onSelect:!1,onChange:!1,onUpdate:!1,onDestroy:!1},p={focus:"focus."+i,blur:"blur."+i,change:"change."+i,click:"click."+i+" touchend."+i+" pointerup."+i+" MSPointerUp."+i,mousedown:"mousedown."+i+" touchend."+i+" pointerdown."+i+" MSPointerDown."+i,keyup:"keyup."+i,keydown:"keydown."+i,keypress:"keypress."+i,input:"input."+i,resize:"resize."+i,touchend:"touchend."+i+" pointerup."+i+" MSPointerUp."+i,touchmove:"touchmove."+i,ready:"uxrready."+i,open:"uxropen."+i,close:"uxrclose."+i,select:"uxrselect."+i,update:"uxrupdate."+i,destroy:"uxrdestroy."+i,scroll:"scroll"},h={codes:{8:"backspace",9:"tab",13:"return",27:"esc",37:"left",38:"up",39:"right",40:"down"},backspace:8,tab:9,"return":13,esc:27,left:37,up:38,right:39,down:40},c={prefix:"uxr-",rocket:"uxRocket",data:i,name:"select",classes:{wrap:"wrap",ready:"ready",disabled:"disabled",readonly:"readonly",selection:"selection",selectionText:"selection-text",selectionTag:"selected-tag",removeSelection:"remove-selected-tag",arrow:"arrow",multiple:"multiple",numeric:"numeric",opened:"opened",drop:"drop",reverseDrop:"reverse-drop",list:"list",option:"option",optionName:"option-name",group:"group",groupName:"group-name",highlight:"highlight",selected:"selected",search:"search",hidden:"aria-hidden",hide:"hide"}},d=new window.uxrPluginUtils({ns:c}),u=function(t,o,n){this._instance=s,this._name=i,this._defaults=r,this.wrapped=!1,this.el=t,this.$el=e(t),this.id="uxr-select-options-"+s,this.multiple=this.el.hasAttribute("multiple"),this.disabled=this.el.hasAttribute("disabled"),this.readonly=this.el.hasAttribute("readonly"),this.width=this.getWidth(),this.selector=n,this.opened=!1,this.hasGroup=!1,this.tabbed=!1,this.clicked=!1,this.searchQueryHolder=[],this.nonLetters=[8,9,13,27,38,40,46],this.options=e.extend(!0,{},r,o,this.$el.data()),s++,this.init()};u.prototype.init=function(){""===this.el.id&&(this.el.id=c.data+"-"+this._instance),this.registry(),this.getOptionData(),this.decorateUI(),this.bindUI(),this.bindSelectionUI(),this.$el.addClass(d.getClassname("ready")),this.emitEvent("ready")},u.prototype.getSelected=function(){var t=[];return this.multiple?this.$el.find("option:selected").each(function(){t.push({index:e(this).index(),value:e(this).attr("value"),text:e(this).text()})}):(t.value=this.$el.val(),t.text=this.$el.find("option:selected").text()),t},u.prototype.getOptionData=function(){var t=this,s=0;t.optionData=[],this.$el.find("option").each(function(){var i=!1,o=!1,n=!1;"OPTGROUP"===this.parentElement.tagName&&(this===this.parentElement.firstElementChild&&(o=this.parentElement.label,i=!0),this===this.parentElement.lastElementChild&&(n=!0)),t.optionData.push({groupName:o,groupStart:i,groupEnd:n,index:s,text:e(this).text(),value:e(this).val(),selected:e(this).is(":selected"),disabled:e(this).is(":disabled"),"class":e(this).attr("class")||""}),s++})},u.prototype.decorateUI=function(){this.addAttributes(),this.wrap(),this.addSelection()},u.prototype.undecorateUI=function(){this.unwrap(),this.removeSelection(),this.removeAttributes()},u.prototype.wrap=function(){this.$el.parent().is("label")?this.$el.parent().addClass(d.getClassname("wrap")):(this.wrapped=!0,this.$el.wrap('')),this.$el.parent().addClass(this.options.wrapper)},u.prototype.unwrap=function(){this.wrapped?this.$el.unwrap():this.$el.parent().removeClass(d.getClassname("wrap")+" "+this.options.wrapper)},u.prototype.addSelection=function(){var t=this.renderSelection();this.$selection=e(t),this.$el.after(this.$selection)},u.prototype.removeSelection=function(){this.$el.next("."+d.getClassname("selection")).remove(),delete this.$selection},u.prototype.addAttributes=function(){this.$el.addClass(d.getClassname("hidden")).attr("aria-hidden",!0)},u.prototype.removeAttributes=function(){this.$el.removeAttr("aria-hidden").removeClass(d.getClassname("hidden")+" "+d.getClassname("ready"))},u.prototype.bindUI=function(){var e=this;e.$el.on(p.focus,function(t){t.preventDefault(),e.onFocus()}).on(p.open,function(t){e.onOpen(t)}).on(p.close,function(t){e.onClose(t)}).on(p.change,function(t){e.onChange(t)}).on(p.ready,function(t){e.onReady(t)}).on(p.select,function(t){e.onSelect(t)}).on(p.update,function(){e.onUpdate()}).on(p.destroy,function(){e.onDestroy()})},u.prototype.bindSelectionUI=function(){var t=this;t.$selection.on(p.keyup,function(e){e.preventDefault(),t.onKeyup(e)}).on(p.focus,function(e){e.preventDefault(),t.onFocus()}).on(p.blur,function(){t.onBlur()}).on(p.mousedown,function(e){e.stopPropagation(),e.preventDefault(),t.onClick(e)}).on(p.click,function(e){e.stopPropagation(),e.preventDefault()}).on(p.mousedown,"."+d.getClassname("removeSelection"),function(s){return s.stopPropagation(),s.preventDefault(),t.disabled?!1:(e(t.optionData).each(function(){this.text===e(s.target).parent().data("value")&&(this.selected=!1)}),void t.removeTag(e(this).parent()))}).parent().on(p.mousedown,function(e){e.stopPropagation(),e.preventDefault(),setTimeout(function(){t.onFocus()},100)})},u.prototype.bindDropUI=function(){var t=this;t.$drop.on(p.click,function(e){e.stopPropagation()}).on(p.touchmove,"."+d.getClassname("option"),function(e){e.stopPropagation(),n=!0}).on(p.mousedown,"."+d.getClassname("option"),function(s){s.stopPropagation(),s.preventDefault(),n||(t.emitEvent("select"),t.select(e(s.currentTarget))),n=!1}).on(p.focus,"."+d.getClassname("search")+" input",function(){t.setDropPosition(!0)}),t.bindKeyupListener()},u.prototype.unbindUI=function(){this.emitEvent("destroy"),this.$selection.off("."+i),this.$selection.parent().off("."+i),this.$el.off("."+i)},u.prototype.unbindKeyupListener=function(){e(document).off(p.keyup)},u.prototype.bindKeyupListener=function(){var t=this;e(document).on(p.keyup,function(e){return e.preventDefault(),e.keyCode===h.up||e.keyCode===h.down?t.navigateWithArrow(h.codes[e.keyCode]):e.keyCode===h["return"]?t.navigateWithEnter():e.keyCode===h.esc?t.close():t.$search.val().length>=t.options.minLetters?t.search(t.$search.val()):t.setOriginalList(),!0})},u.prototype.select=function(e){var t=d.getClassname("selected"),s=d.getClassname("highlight"),i=d.getClassname("selectionText"),o=d.getClassname("selectionTag"),n=d.getClassname("removeSelection"),a=e.parent(),r=a.attr("id"),p=e.data("index"),h=e.data("value"),c=e.text(),u=this.$el.val();if(!a.hasClass(d.getClassname("disabled"))){if(this.multiple){if(a.hasClass(t))this.deSelect(h);else{if(this.options.maxSelection>0&&null!==u&&u.length>=this.options.maxSelection)return void alert(this.options.maxSelectionWarn);if(this.$el.find('[value="'+h+'"]').prop("selected",!0),a.addClass(t),"tags"===this.options.displayType){var f=d.render(l.multi,{selectionText:c,selectionTagClass:o,removeSelectionClass:n,index:p,value:h});null===this.$el.val()?this.$selection.find("."+i).html(f):this.$selection.find("."+i).append(f)}else this.$selection.find("."+i).html(this.options.multipleInfoMessage+" "+this.$el.val().length+"/"+this.optionData.length)}this.setDropPosition()}else this.$list.find("."+s).removeClass(s),this.$list.find("."+t).removeClass(t),this.$selection.find("."+i).text(c),this.$el.find('[value="'+h+'"]').prop("selected",!0),this.onBlur(),this.$list.find("#"+r).addClass(t),""!==this.$el.val()?this.$selection.parent().addClass(t+" "+this.options.selected):this.$selection.parent().removeClass(t+" "+this.options.selected);this.emitEvent("change")}},u.prototype.deSelect=function(t){var s=d.getClassname("selected"),i=d.getClassname("selectionText"),o=(d.getClassname("selectionTag"),e('[data-value="'+t+'"]').parent());if(this.$drop?this.$drop.find('[data-value="'+t+'"]').parent().removeClass(s):this.prepareDrop(),this.$el.find('[value="'+t+'"]').removeAttr("selected"),o.removeClass(s),this.$selection.find('[data-value="'+t+'"]').remove(),this.$el.val()&&this.$el.val(e.grep(this.$el.val(),function(e){return e!==t})),this.multiple&&"tags"!==this.options.displayType){var n=this.$selection.find("."+i);this.$el.val()?n.html(this.options.multipleInfoMessage+" "+this.$el.val().length+"/"+this.optionData.length):n.html(this.options.multipleInfoMessage+" 0/"+this.optionData.length)}this.multiple&&"tags"===this.options.displayType&&(null===this.$el.val()||this.$el.val().length<1)&&this.$selection.find("."+i).text(this.multiplePlaceholder),this.emitEvent("change"),this.$el.trigger("change")},u.prototype.removeTag=function(e){this.deSelect(e.data("value")),this.setDropPosition()},u.prototype.search=function(t){var s,i,o=this,n=this.$drop.find("."+d.getClassname("list"));s=e.map(this.optionData,function(e){return o._search(e,t.trim())?e:void 0}),i=this.renderList(s),n.replaceWith(i),this.setDropPosition()},u.prototype._search=function(e,t){var s=e.text.replace("İ","i").toLowerCase(),i=e.value.replace("İ","i").toLowerCase(),o=t.replace("İ","i").toLowerCase();switch(this.options.searchType){default:case"starts":return 0===s.indexOf(o)||0===i.toLowerCase().indexOf(o);case"contains":return s.indexOf(o)>-1||i.toLowerCase().indexOf(o)>-1}},u.prototype.navigateWithEnter=function(){if(!this.multiple){var e=this.$drop.find("."+d.getClassname("list")),t=d.getClassname("highlight"),s=e.find("."+t);s.length>0&&(s.removeClass(t),this.select(s.find("a")),this.emitEvent("select"))}},u.prototype.navigateWithArrow=function(t){var s,i=d.getClassname("highlight"),o=this.$drop.find("."+d.getClassname("list")),n=o.find("li:not(."+d.getClassname("group")+")"),a=o.find("."+i).length>0?o.find("."+i):o.find("."+d.getClassname("selected")),l=n.index(a),r=o.offset().top,p=o.scrollTop(),h=o.height();if(a.length)a.removeClass(i),"up"===t?--l<0&&(l=n.length-1):n.length===++l&&(l=0),s=e(n[l]).addClass(i),s.length&&("down"===t?s.offset().top>r+h-s.height()?o.scrollTop(p+s.height()):s.offset().topr+h&&o.scrollTop(p+s.offset().top));else{var c="up"===t?"last":"first";n[c]().addClass(i)}},u.prototype.renderSelection=function(){var e={id:this.el.id,selectionClass:d.getClassname("selection"),multiple:this.multiple,multipleClass:d.getClassname("multiple"),disabled:this.disabled,disabledClass:d.getClassname("disabled"),readonly:this.readonly,readonlyClass:d.getClassname("readonly"),width:"width:"+this.width,selectionTextClass:d.getClassname("selectionText"),selectionText:this.getSelected().text,arrowClass:d.getClassname("arrow"),themeCurrent:this.options.current,themeArrow:this.options.arrow};return this.multiple&&(this.multiplePlaceholder=this.$el.attr("placeholder")||this.options.placeholder||"",this.getSelected().length>0?"text"===this.options.displayType?e.selectionText=this.options.multipleInfoMessage+" "+this.getSelected().length+"/"+this.optionData.length:e.selectionText=this.renderSelectionTags():e.selectionText=this.multiplePlaceholder),d.render(l.selection,e)},u.prototype.renderSelectionTags=function(){var e={selectionTagClass:d.getClassname("selectionTag"),removeSelectionClass:d.getClassname("removeSelection"),selected:this.getSelected()};return d.render(l.tags,e)},u.prototype.renderSearchField=function(){var e={searchClass:d.getClassname("search"),searchInput:d.getClassname("search")+"-"+this._instance,inputType:this.options.numeric?"tel":"text",list:this.id};return d.render(l.search,e)},u.prototype.renderList=function(e){var t={listClass:d.getClassname("list"),groupClass:d.getClassname("group"),groupNameClass:d.getClassname("groupName"),selectedClass:d.getClassname("selected"),disabledClass:d.getClassname("disabled"),optionClass:d.getClassname("option"),options:e||this.optionData,themeList:this.options.list,themeSelected:this.options.selected,themeDisabled:this.options.disabled,themeOption:this.options.option};return d.render(l.list,t)},u.prototype.renderDrop=function(){var e={dropID:this.id,id:this.el.id,dropClass:d.getClassname("drop"),themeDrop:this.options.drop,multiple:this.multiple,multipleClass:d.getClassname("drop")+"-multiple",search:this.renderSearchField(),list:this.renderList()};return d.render(l.drop,e)},u.prototype.prepareDrop=function(){this.$drop=e(this.renderDrop()),this.$list=this.$drop.find("."+d.getClassname("list")),this.$search=this.$drop.find("."+d.getClassname("search")+" input"),this.setDropPosition(),this.setListPosition(),!this.options.search||this.options.searchItemLimit>=this.optionData.length?this.$search.parent().addClass(d.getClassname("hide")):this.$search.parent().removeClass(d.getClassname("hide"))},u.prototype.setDropPosition=function(){var t={top:this.getPosition().top+this.$selection.height(),left:this.getPosition().left,minWidth:this.$selection.outerWidth()},s=e(".uxr-select-list"),i=this.$drop.height()>280?280:this.$drop.height(),o=a?280:0,n=document.documentElement.clientHeight-o,l=this.$el.offset().top-e(window).scrollTop(),r=n-l-this.$selection.height(),p={top:function(){s.css({maxHeight:l>250?250:l})},bottom:function(){s.css({maxHeight:r>250?250:r})}};if(r>=i)p.bottom();else{var h=i-l>i-r?"bottom":"top";"bottom"===h?p.bottom():(p.top(),t.top=this.getPosition().top-this.$drop.height())}this.$drop.css(t).removeClass(d.getClassname("reverseDrop"))},u.prototype.setListPosition=function(){var e=this.$list.find("."+d.getClassname("selected")+":eq(0)");1===e.length&&this.$list.scrollTop(e.offset().top-this.$list.offset().top-this.$list.height()/2)},u.prototype.setOriginalList=function(){this.$drop.find("."+d.getClassname("list")).replaceWith(this.$list)},u.prototype.showDrop=function(){this.$drop.appendTo("body"),this.setDropPosition(),this.setListPosition(),this.$list.find("."+d.getClassname("highlight")).removeClass(d.getClassname("highlight")),this.bindDropUI()},u.prototype.hideDrop=function(){var t=e("#"+this.id);t.length>0&&(e("#"+this.id).remove(),this.$search.val(""),this.setOriginalList())},u.prototype.open=function(){this.disabled||this.readonly||(t.close(),this.$drop||this.prepareDrop(),this.isVirtualKeyboardVisible(),this.showDrop(),this.$selection.parent().addClass(d.getClassname("opened")+" "+this.options.opened),this.opened=!0,this.$search.focus(),this.emitEvent("open"))},u.prototype.close=function(){n=!1,a=!1,this.clicked=!1,this.tabbed=!1,this.opened=!1,this.unbindKeyupListener(),this.hideDrop(),this.$selection.parent().removeClass(d.getClassname("opened")+" "+this.options.opened),this.emitEvent("close")},u.prototype.onKeyup=function(e){e.keyCode===h.tab&&(this.tabbed=!0)},u.prototype.onClick=function(e){this.clicked=!0,this.opened?this.onBlur():this.onFocus()},u.prototype.onFocus=function(){o.lastFocused=o.current,o.current=this,this.open()},u.prototype.onBlur=function(){this.close()},u.prototype.onChange=function(e){d.callback(this.options.onChange)},u.prototype.onReady=function(){d.callback(this.options.onReady)},u.prototype.onOpen=function(){d.callback(this.options.onOpen)},u.prototype.onClose=function(){d.callback(this.options.onClose)},u.prototype.onSelect=function(){d.callback(this.options.onSelect)},u.prototype.onUpdate=function(){d.callback(this.options.onUpdate)},u.prototype.onDestroy=function(){d.callback(this.options.onDestroy)},u.prototype.resetSelection=function(){this.removeSelection(),this.addSelection(),this.bindSelectionUI()},u.prototype.update=function(t){var s=this.options;this.multiple=this.el.hasAttribute("multiple"),this.disabled=this.el.hasAttribute("disabled"),this.readonly=this.el.hasAttribute("readonly"),this.options=e.extend(!0,{},s,t),this.getOptionData(),this.resetSelection(),this.prepareDrop(),this.emitEvent("update")},u.prototype.destroy=function(){this.emitEvent("destroy"),this.opened&&(this.close(),o.current=null),o.current&&o.current.el===this.$el[0]&&(o.current=null),this.unbindUI(),this.undecorateUI(),this.$el.removeData(i)},u.prototype.registry=function(){var e=this.$el.data(c.rocket)||{};e[c.data]={hasWrapper:!0,wrapper:c.wrap,ready:d.getClassname("ready"),selector:this.selector,options:this.options},this.$el.data(c.rocket,e)},u.prototype.getPosition=function(){return{top:this.$selection.offset().top,left:this.$selection.offset().left}},u.prototype.getWidth=function(){var t,s=this.$el.attr("class"),i=this.$el.attr("style"),o=e(document.createElement("div")).css("display","none"),n="";return s&&(n+=' class="'+s.replace(d.getClassname("ready"),"").replace(d.getClassname("hidden"),"")+'"'),i&&(n+=' style="'+i+'"'),o.html("
").appendTo("body"),t=o.find("div").css("width"),"0px"===t&&(t=this.$el.width()+"px"),o.remove(),t},u.prototype.emitEvent=function(e){this.$el.trigger(p[e])},u.prototype.isTouchDevice=function(){return"ontouchstart"in window||navigator.msMaxTouchPoints},u.prototype.isVirtualKeyboardVisible=function(){a=this.isTouchDevice()};var f=e.fn.select;t=e.fn.uxitdselect=e.fn.select=e.fn.Select=e.fn.uxrselect=e.uxrselect=function(t){var s=this.selector;return this.each(function(){e.data(this,c.data)||e.data(this,c.data,new u(this,t,s))})},e.uxrselect.noConflict=!0,t.update=function(t,s){var i,o=s||t;if(t)if("string"==typeof t)i=e(t);else{if("object"!=typeof t)return;i=t}else i=e("."+d.getClassname("ready"));i.filter("select").each(function(){e(this).hasClass(d.getClassname("ready"))?e(this).data(c.data).update(o):console.warn("Component not initialized yet, update after initialization")})},t.close=function(){var t=e("."+d.getClassname("drop"));t.length>0&&t.each(function(){var t=e(d.escapeSelector("#"+e(this).data("select"))).data(c.data);t.close()})},t.destroy=t.remove=function(t){var s=e("undefined"==typeof t?"."+d.getClassname("ready"):t);s.each(function(){e(this).data(c.data).destroy()})},t.getFocusedInstances=function(){return o},e(document).on("ready",function(){e.uxrselect.noConflict&&(e.fn.select=f)}).on(p.click,function(e){null!==o.current&&o.current.close()}),e(window).on(p.resize+" "+p.touchend+" "+p.scroll,function(){var t=e("."+d.getClassname("drop"));1===t.length&&e(d.escapeSelector("#"+t.data("select"))).data(c.data).setDropPosition()}),t.version="3.5.9",t.settings=r,t.namespace=c}); \ No newline at end of file +!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof exports&&"function"==typeof require?require("jquery"):jQuery)}(function(e){"use strict";"undefined"==typeof window.UXRocket&&console.warn("UXRocket Select is required UXRocket Factory to run properly. You can clone/download factory at https://github.com/uxrocket/uxrocket.factory");var t,s=1,i="uxrSelect",o={lastFocused:null,current:null},n=!1,a=!1,l={selection:' {{selectionText}} ',tags:'{{#each selected}} {{selected.text}} X{{/each}}',multi:' {{selectionText}} X',search:' ',list:'
    {{#each options}} {{#if options.groupStart}}
  • {{options.groupName}} {{/if}} {{/each}}
',drop:'
{{search}} {{list}}
'},r={wrapper:"",opened:"",current:"",arrow:"",drop:"",list:"",option:"",selected:"",disabled:"",search:!0,searchItemLimit:10,searchType:"starts",displayType:"tags",multipleInfoMessage:"Seçilen Kayıt:",minLetters:2,maxSelection:0,maxSelectionWarn:"You have reached allowed maximum selection",numeric:!1,onReady:!1,onOpen:!1,onClose:!1,onSelect:!1,onChange:!1,onUpdate:!1,onDestroy:!1},p={focus:"focus."+i,blur:"blur."+i,change:"change."+i,click:"click."+i+" touchend."+i+" pointerup."+i+" MSPointerUp."+i,mousedown:"mousedown."+i+" touchend."+i+" pointerdown."+i+" MSPointerDown."+i,keyup:"keyup."+i,keydown:"keydown."+i,keypress:"keypress."+i,input:"input."+i,resize:"resize."+i,touchend:"touchend."+i+" pointerup."+i+" MSPointerUp."+i,touchmove:"touchmove."+i,ready:"uxrready."+i,open:"uxropen."+i,close:"uxrclose."+i,select:"uxrselect."+i,update:"uxrupdate."+i,destroy:"uxrdestroy."+i,scroll:"scroll"},h={codes:{8:"backspace",9:"tab",13:"return",27:"esc",37:"left",38:"up",39:"right",40:"down"},backspace:8,tab:9,"return":13,esc:27,left:37,up:38,right:39,down:40},c={prefix:"uxr-",rocket:"uxRocket",data:i,name:"select",classes:{wrap:"wrap",ready:"ready",disabled:"disabled",readonly:"readonly",selection:"selection",selectionText:"selection-text",selectionTag:"selected-tag",removeSelection:"remove-selected-tag",arrow:"arrow",multiple:"multiple",numeric:"numeric",opened:"opened",drop:"drop",reverseDrop:"reverse-drop",list:"list",option:"option",optionName:"option-name",group:"group",groupName:"group-name",highlight:"highlight",selected:"selected",search:"search",hidden:"aria-hidden",hide:"hide"}},d=new window.uxrPluginUtils({ns:c}),u=function(t,o,n){this._instance=s,this._name=i,this._defaults=r,this.wrapped=!1,this.el=t,this.$el=e(t),this.id="uxr-select-options-"+s,this.multiple=this.el.hasAttribute("multiple"),this.disabled=this.el.hasAttribute("disabled"),this.readonly=this.el.hasAttribute("readonly"),this.width=this.getWidth(),this.selector=n,this.opened=!1,this.hasGroup=!1,this.tabbed=!1,this.clicked=!1,this.searchQueryHolder=[],this.nonLetters=[8,9,13,27,38,40,46],this.options=e.extend(!0,{},r,o,this.$el.data()),s++,this.init()};u.prototype.init=function(){""===this.el.id&&(this.el.id=c.data+"-"+this._instance),this.registry(),this.getOptionData(),this.decorateUI(),this.bindUI(),this.bindSelectionUI(),this.$el.addClass(d.getClassname("ready")),this.emitEvent("ready")},u.prototype.getSelected=function(){var t=[];return this.multiple?this.$el.find("option:selected").each(function(){t.push({index:e(this).index(),value:e(this).attr("value"),text:e(this).text()})}):(t.value=this.$el.val(),t.text=this.$el.find("option:selected").text()),t},u.prototype.getOptionData=function(){var t=this,s=0;t.optionData=[],this.$el.find("option").each(function(){var i=!1,o=!1,n=!1;"OPTGROUP"===this.parentElement.tagName&&(this===this.parentElement.firstElementChild&&(o=this.parentElement.label,i=!0),this===this.parentElement.lastElementChild&&(n=!0)),t.optionData.push({groupName:o,groupStart:i,groupEnd:n,index:s,text:e(this).text(),value:e(this).val(),selected:e(this).is(":selected"),disabled:e(this).is(":disabled"),"class":e(this).attr("class")||""}),s++})},u.prototype.decorateUI=function(){this.addAttributes(),this.wrap(),this.addSelection()},u.prototype.undecorateUI=function(){this.unwrap(),this.removeSelection(),this.removeAttributes()},u.prototype.wrap=function(){this.$el.parent().is("label")?this.$el.parent().addClass(d.getClassname("wrap")):(this.wrapped=!0,this.$el.wrap('')),this.$el.parent().addClass(this.options.wrapper)},u.prototype.unwrap=function(){this.wrapped?this.$el.unwrap():this.$el.parent().removeClass(d.getClassname("wrap")+" "+this.options.wrapper)},u.prototype.addSelection=function(){var t=this.renderSelection();this.$selection=e(t),this.$el.after(this.$selection)},u.prototype.removeSelection=function(){this.$el.next("."+d.getClassname("selection")).remove(),delete this.$selection},u.prototype.addAttributes=function(){this.$el.addClass(d.getClassname("hidden")).attr("aria-hidden",!0)},u.prototype.removeAttributes=function(){this.$el.removeAttr("aria-hidden").removeClass(d.getClassname("hidden")+" "+d.getClassname("ready"))},u.prototype.bindUI=function(){var e=this;e.$el.on(p.focus,function(t){t.preventDefault(),e.onFocus()}).on(p.open,function(t){e.onOpen(t)}).on(p.close,function(t){e.onClose(t)}).on(p.change,function(t){e.onChange(t)}).on(p.ready,function(t){e.onReady(t)}).on(p.select,function(t){e.onSelect(t)}).on(p.update,function(){e.onUpdate()}).on(p.destroy,function(){e.onDestroy()})},u.prototype.bindSelectionUI=function(){var t=this;t.$selection.on(p.keyup,function(e){e.preventDefault(),t.onKeyup(e)}).on(p.focus,function(e){e.preventDefault(),t.onFocus()}).on(p.blur,function(){t.onBlur()}).on(p.mousedown,function(e){e.stopPropagation(),e.preventDefault(),t.onClick(e)}).on(p.click,function(e){e.stopPropagation(),e.preventDefault()}).on(p.mousedown,"."+d.getClassname("removeSelection"),function(s){return s.stopPropagation(),s.preventDefault(),!t.disabled&&(e(t.optionData).each(function(){this.text===e(s.target).parent().data("value")&&(this.selected=!1)}),void t.removeTag(e(this).parent()))}).parent().on(p.mousedown,function(e){e.stopPropagation(),e.preventDefault(),setTimeout(function(){t.onFocus()},100)})},u.prototype.bindDropUI=function(){var t=this;t.$drop.on(p.click,function(e){e.stopPropagation()}).on(p.touchmove,"."+d.getClassname("option"),function(e){e.stopPropagation(),n=!0}).on(p.mousedown,"."+d.getClassname("option"),function(s){s.stopPropagation(),s.preventDefault(),n||(t.emitEvent("select"),t.select(e(s.currentTarget))),n=!1}).on(p.focus,"."+d.getClassname("search")+" input",function(){t.setDropPosition(!0)}),t.bindKeyupListener()},u.prototype.unbindUI=function(){this.emitEvent("destroy"),this.$selection.off("."+i),this.$selection.parent().off("."+i),this.$el.off("."+i)},u.prototype.unbindKeyupListener=function(){e(document).off(p.keyup)},u.prototype.bindKeyupListener=function(){var t=this;e(document).on(p.keyup,function(e){return e.preventDefault(),e.keyCode===h.up||e.keyCode===h.down?t.navigateWithArrow(h.codes[e.keyCode]):e.keyCode===h["return"]?t.navigateWithEnter():e.keyCode===h.esc?t.close():t.$search.val().length>=t.options.minLetters?t.search(t.$search.val()):t.setOriginalList(),!0})},u.prototype.select=function(e){var t=d.getClassname("selected"),s=d.getClassname("highlight"),i=d.getClassname("selectionText"),o=d.getClassname("selectionTag"),n=d.getClassname("removeSelection"),a=e.parent(),r=a.attr("id"),p=e.data("index"),h=e.data("value"),c=e.text(),u=this.$el.val();if(!a.hasClass(d.getClassname("disabled"))){if(this.multiple){if(a.hasClass(t))this.deSelect(h);else{if(this.options.maxSelection>0&&null!==u&&u.length>=this.options.maxSelection)return void alert(this.options.maxSelectionWarn);if(this.$el.find('[value="'+h+'"]').prop("selected",!0),this.$list.find("#"+r).addClass(t),a.addClass(t),"tags"===this.options.displayType){var f=d.render(l.multi,{selectionText:c,selectionTagClass:o,removeSelectionClass:n,index:p,value:h});null===this.$el.val()?this.$selection.find("."+i).html(f):this.$selection.find("."+i).append(f)}else this.$selection.find("."+i).html(this.options.multipleInfoMessage+" "+this.$el.val().length+"/"+this.optionData.length)}this.setDropPosition()}else this.$list.find("."+s).removeClass(s),this.$list.find("."+t).removeClass(t),this.$selection.find("."+i).text(c),this.$el.find('[value="'+h+'"]').prop("selected",!0),this.onBlur(),this.$list.find("#"+r).addClass(t),""!==this.$el.val()?this.$selection.parent().addClass(t+" "+this.options.selected):this.$selection.parent().removeClass(t+" "+this.options.selected);this.emitEvent("change")}},u.prototype.deSelect=function(t){var s=d.getClassname("selected"),i=d.getClassname("selectionText"),o=(d.getClassname("selectionTag"),e('[data-value="'+t+'"]').parent());if(this.$drop?this.$drop.find('[data-value="'+t+'"]').parent().removeClass(s):this.prepareDrop(),this.$el.find('[value="'+t+'"]').removeAttr("selected"),o.removeClass(s),this.$selection.find('[data-value="'+t+'"]').remove(),this.$el.val()&&this.$el.val(e.grep(this.$el.val(),function(e){return e!==t})),this.multiple&&"tags"!==this.options.displayType){var n=this.$selection.find("."+i);this.$el.val()?n.html(this.options.multipleInfoMessage+" "+this.$el.val().length+"/"+this.optionData.length):n.html(this.options.multipleInfoMessage+" 0/"+this.optionData.length)}this.multiple&&"tags"===this.options.displayType&&(null===this.$el.val()||this.$el.val().length<1)&&this.$selection.find("."+i).text(this.multiplePlaceholder),this.emitEvent("change"),this.$el.trigger("change")},u.prototype.removeTag=function(e){this.deSelect(e.data("value")),this.setDropPosition()},u.prototype.search=function(t){var s,i,o=this,n=this.$drop.find("."+d.getClassname("list"));s=e.map(this.optionData,function(e){if(o._search(e,t.trim()))return e}),i=this.renderList(s),n.replaceWith(i),this.setDropPosition()},u.prototype._search=function(e,t){var s=e.text.replace("İ","i").toLowerCase(),i=e.value.replace("İ","i").toLowerCase(),o=t.replace("İ","i").toLowerCase();switch(this.options.searchType){default:case"starts":return 0===s.indexOf(o)||0===i.toLowerCase().indexOf(o);case"contains":return s.indexOf(o)>-1||i.toLowerCase().indexOf(o)>-1}},u.prototype.navigateWithEnter=function(){if(!this.multiple){var e=this.$drop.find("."+d.getClassname("list")),t=d.getClassname("highlight"),s=e.find("."+t);s.length>0&&(s.removeClass(t),this.select(s.find("a")),this.emitEvent("select"))}},u.prototype.navigateWithArrow=function(t){var s,i=d.getClassname("highlight"),o=this.$drop.find("."+d.getClassname("list")),n=o.find("li:not(."+d.getClassname("group")+")"),a=o.find("."+i).length>0?o.find("."+i):o.find("."+d.getClassname("selected")),l=n.index(a),r=o.offset().top,p=o.scrollTop(),h=o.height();if(a.length)a.removeClass(i),"up"===t?--l<0&&(l=n.length-1):n.length===++l&&(l=0),s=e(n[l]).addClass(i),s.length&&("down"===t?s.offset().top>r+h-s.height()?o.scrollTop(p+s.height()):s.offset().topr+h&&o.scrollTop(p+s.offset().top));else{var c="up"===t?"last":"first";n[c]().addClass(i)}},u.prototype.renderSelection=function(){var e={id:this.el.id,selectionClass:d.getClassname("selection"),multiple:this.multiple,multipleClass:d.getClassname("multiple"),disabled:this.disabled,disabledClass:d.getClassname("disabled"),readonly:this.readonly,readonlyClass:d.getClassname("readonly"),width:"width:"+this.width,selectionTextClass:d.getClassname("selectionText"),selectionText:this.getSelected().text,arrowClass:d.getClassname("arrow"),themeCurrent:this.options.current,themeArrow:this.options.arrow};return this.multiple&&(this.multiplePlaceholder=this.$el.attr("placeholder")||this.options.placeholder||"",this.getSelected().length>0?"text"===this.options.displayType?e.selectionText=this.options.multipleInfoMessage+" "+this.getSelected().length+"/"+this.optionData.length:e.selectionText=this.renderSelectionTags():e.selectionText=this.multiplePlaceholder),d.render(l.selection,e)},u.prototype.renderSelectionTags=function(){var e={selectionTagClass:d.getClassname("selectionTag"),removeSelectionClass:d.getClassname("removeSelection"),selected:this.getSelected()};return d.render(l.tags,e)},u.prototype.renderSearchField=function(){var e={searchClass:d.getClassname("search"),searchInput:d.getClassname("search")+"-"+this._instance,inputType:this.options.numeric?"tel":"text",list:this.id};return d.render(l.search,e)},u.prototype.renderList=function(e){var t={listClass:d.getClassname("list"),groupClass:d.getClassname("group"),groupNameClass:d.getClassname("groupName"),selectedClass:d.getClassname("selected"),disabledClass:d.getClassname("disabled"),optionClass:d.getClassname("option"),options:e||this.optionData,themeList:this.options.list,themeSelected:this.options.selected,themeDisabled:this.options.disabled,themeOption:this.options.option};return d.render(l.list,t)},u.prototype.renderDrop=function(){var e={dropID:this.id,id:this.el.id,dropClass:d.getClassname("drop"),themeDrop:this.options.drop,multiple:this.multiple,multipleClass:d.getClassname("drop")+"-multiple",search:this.renderSearchField(),list:this.renderList()};return d.render(l.drop,e)},u.prototype.prepareDrop=function(){this.$drop=e(this.renderDrop()),this.$list=this.$drop.find("."+d.getClassname("list")),this.$search=this.$drop.find("."+d.getClassname("search")+" input"),this.setDropPosition(),this.setListPosition(),!this.options.search||this.options.searchItemLimit>=this.optionData.length?this.$search.parent().addClass(d.getClassname("hide")):this.$search.parent().removeClass(d.getClassname("hide"))},u.prototype.setDropPosition=function(){var t={top:this.getPosition().top+this.$selection.height(),left:this.getPosition().left,minWidth:this.$selection.outerWidth()},s=e(".uxr-select-list"),i=this.$drop.height()>280?280:this.$drop.height(),o=a?280:0,n=document.documentElement.clientHeight-o,l=this.$el.offset().top-e(window).scrollTop(),r=n-l-this.$selection.height(),p={top:function(){s.css({maxHeight:l>250?250:l})},bottom:function(){s.css({maxHeight:r>250?250:r})}};if(r>=i)p.bottom();else{var h=i-r0&&(e("#"+this.id).remove(),this.$search.val(""),this.setOriginalList())},u.prototype.open=function(){this.disabled||this.readonly||(t.close(),this.$drop||this.prepareDrop(),this.isVirtualKeyboardVisible(),this.showDrop(),this.$selection.parent().addClass(d.getClassname("opened")+" "+this.options.opened),this.opened=!0,this.$search.focus(),this.emitEvent("open"))},u.prototype.close=function(){n=!1,a=!1,this.clicked=!1,this.tabbed=!1,this.opened=!1,this.unbindKeyupListener(),this.hideDrop(),this.$selection.parent().removeClass(d.getClassname("opened")+" "+this.options.opened),this.emitEvent("close")},u.prototype.onKeyup=function(e){e.keyCode===h.tab&&(this.tabbed=!0)},u.prototype.onClick=function(e){this.clicked=!0,this.opened?this.onBlur():this.onFocus()},u.prototype.onFocus=function(){o.lastFocused=o.current,o.current=this,this.open()},u.prototype.onBlur=function(){this.close()},u.prototype.onChange=function(e){d.callback(this.options.onChange)},u.prototype.onReady=function(){d.callback(this.options.onReady)},u.prototype.onOpen=function(){d.callback(this.options.onOpen)},u.prototype.onClose=function(){d.callback(this.options.onClose)},u.prototype.onSelect=function(){d.callback(this.options.onSelect)},u.prototype.onUpdate=function(){d.callback(this.options.onUpdate)},u.prototype.onDestroy=function(){d.callback(this.options.onDestroy)},u.prototype.resetSelection=function(){this.removeSelection(),this.addSelection(),this.bindSelectionUI()},u.prototype.update=function(t){var s=this.options;this.multiple=this.el.hasAttribute("multiple"),this.disabled=this.el.hasAttribute("disabled"),this.readonly=this.el.hasAttribute("readonly"),this.options=e.extend(!0,{},s,t),this.getOptionData(),this.resetSelection(),this.prepareDrop(),this.emitEvent("update")},u.prototype.destroy=function(){this.emitEvent("destroy"),this.opened&&(this.close(),o.current=null),o.current&&o.current.el===this.$el[0]&&(o.current=null),this.unbindUI(),this.undecorateUI(),this.$el.removeData(i)},u.prototype.registry=function(){var e=this.$el.data(c.rocket)||{};e[c.data]={hasWrapper:!0,wrapper:c.wrap,ready:d.getClassname("ready"),selector:this.selector,options:this.options},this.$el.data(c.rocket,e)},u.prototype.getPosition=function(){return{top:this.$selection.offset().top,left:this.$selection.offset().left}},u.prototype.getWidth=function(){var t,s=this.$el.attr("class"),i=this.$el.attr("style"),o=e(document.createElement("div")).css("display","none"),n="";return s&&(n+=' class="'+s.replace(d.getClassname("ready"),"").replace(d.getClassname("hidden"),"")+'"'),i&&(n+=' style="'+i+'"'),o.html("
").appendTo("body"),t=o.find("div").css("width"),"0px"===t&&(t=this.$el.width()+"px"),o.remove(),t},u.prototype.emitEvent=function(e){this.$el.trigger(p[e])},u.prototype.isTouchDevice=function(){return"ontouchstart"in window||navigator.msMaxTouchPoints},u.prototype.isVirtualKeyboardVisible=function(){a=this.isTouchDevice()};var f=e.fn.select;t=e.fn.uxitdselect=e.fn.select=e.fn.Select=e.fn.uxrselect=e.uxrselect=function(t){var s=this.selector;return this.each(function(){e.data(this,c.data)||e.data(this,c.data,new u(this,t,s))})},e.uxrselect.noConflict=!0,t.update=function(t,s){var i,o=s||t;if(t)if("string"==typeof t)i=e(t);else{if("object"!=typeof t)return;i=t}else i=e("."+d.getClassname("ready"));i.filter("select").each(function(){e(this).hasClass(d.getClassname("ready"))?e(this).data(c.data).update(o):console.warn("Component not initialized yet, update after initialization")})},t.close=function(){var t=e("."+d.getClassname("drop"));t.length>0&&t.each(function(){var t=e(d.escapeSelector("#"+e(this).data("select"))).data(c.data);t.close()})},t.destroy=t.remove=function(t){var s=e("undefined"==typeof t?"."+d.getClassname("ready"):t);s.each(function(){e(this).data(c.data).destroy()})},t.getFocusedInstances=function(){return o},e(document).on("ready",function(){e.uxrselect.noConflict&&(e.fn.select=f)}).on(p.click,function(e){null!==o.current&&o.current.close()}),e(window).on(p.resize+" "+p.touchend+" "+p.scroll,function(){var t=e("."+d.getClassname("drop"));1===t.length&&e(d.escapeSelector("#"+t.data("select"))).data(c.data).setDropPosition()}),t.version="3.5.10",t.settings=r,t.namespace=c}); \ No newline at end of file diff --git a/lib/uxrocket.select.js b/lib/uxrocket.select.js index 62c5a51..f06f8fb 100644 --- a/lib/uxrocket.select.js +++ b/lib/uxrocket.select.js @@ -546,6 +546,7 @@ } this.$el.find('[value="' + value + '"]').prop('selected', true); + this.$list.find('#' + optionID).addClass(selected); $option.addClass(selected); if(this.options.displayType === 'tags') { @@ -1178,7 +1179,7 @@ }); // version - ux.version = '3.5.9'; + ux.version = '3.5.10'; // default settings ux.settings = defaults; diff --git a/package.json b/package.json index 88f78d7..2f5d1d2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "uxrocket.select", - "version": "3.5.9", + "version": "3.5.10", "description": "jQuery based Select box replacement function", "repository": { "type": "git", diff --git a/uxrocket.json b/uxrocket.json index 0da3f24..65f900e 100644 --- a/uxrocket.json +++ b/uxrocket.json @@ -1,7 +1,7 @@ { "name": "Select", "registry": "uxrocket.select", - "version": "3.5.9", + "version": "3.5.10", "paths": { "lib": "lib/", "dist": "dist/", diff --git a/version.md b/version.md index b9f5bcd..15711ce 100644 --- a/version.md +++ b/version.md @@ -1,3 +1,6 @@ +## Versiyon 3.5.10 +- FIX: Multiple select'lerde search sonrasında seçilen seçeneğin yeniden açılan menüde seçilmiş olarak görünmemesi problemi çözüldü. + ## Versiyon 3.5.9 - FIX: Tablet ve telefonlarda, klayve açılınca, drop'un klavyenin altında kalması düzeltildi.