From d25927763dce53bb8c8f5c7b3cae78f08c7e0287 Mon Sep 17 00:00:00 2001 From: chenzhx <346839943@qq.com> Date: Wed, 26 Oct 2016 11:35:15 +0800 Subject: [PATCH] KYLIN 1820 Column autocomplete should remove the user input in model designer --- webapp/app/js/directives/select.js | 939 +++++++++++++++++++++++++++---------- 1 file changed, 703 insertions(+), 236 deletions(-) diff --git a/webapp/app/js/directives/select.js b/webapp/app/js/directives/select.js index c8cf6a2..7327af9 100644 --- a/webapp/app/js/directives/select.js +++ b/webapp/app/js/directives/select.js @@ -1,14 +1,13 @@ /*! * ui-select * http://github.com/angular-ui/ui-select - * Version: 0.13.2 - 2015-10-09T15:34:24.040Z + * Version: 0.19.5 - 2016-10-24T23:13:59.434Z * License: MIT */ (function () { "use strict"; - var KEY = { TAB: 9, ENTER: 13, @@ -42,7 +41,7 @@ var KEY = { return true; } - if (e.metaKey) return true; + if (e.metaKey || e.ctrlKey || e.altKey) return true; return false; }, @@ -55,6 +54,13 @@ var KEY = { }, isHorizontalMovement: function (k){ return ~[KEY.LEFT,KEY.RIGHT,KEY.BACKSPACE,KEY.DELETE].indexOf(k); + }, + toSeparator: function (k) { + var sep = {ENTER:"\n",TAB:"\t",SPACE:" "}[k]; + if (sep) return sep; + // return undefined for special keys other than enter, tab or space. + // no way to use them to cut strings. + return KEY[k] ? undefined : k; } }; @@ -103,11 +109,16 @@ var uis = angular.module('ui.select', []) placeholder: '', // Empty by default, like HTML tag
"); -$templateCache.put("bootstrap/select.tpl.html","
"); -$templateCache.put("selectize/choices.tpl.html","
"); -$templateCache.put("selectize/match.tpl.html","
"); -$templateCache.put("selectize/select.tpl.html","
"); -$templateCache.put("select2/choices.tpl.html",""); -$templateCache.put("select2/match-multiple.tpl.html","
  • "); +angular.module("ui.select").run(["$templateCache", function($templateCache) {$templateCache.put("bootstrap/choices.tpl.html",""); +$templateCache.put("bootstrap/match-multiple.tpl.html"," × "); +$templateCache.put("bootstrap/match.tpl.html","
    {{$select.placeholder}}
    "); +$templateCache.put("bootstrap/no-choice.tpl.html",""); +$templateCache.put("bootstrap/select-multiple.tpl.html","
    "); +$templateCache.put("bootstrap/select.tpl.html","
    "); +$templateCache.put("select2/choices.tpl.html",""); +$templateCache.put("select2/match-multiple.tpl.html","
  • "); $templateCache.put("select2/match.tpl.html","{{$select.placeholder}} "); -$templateCache.put("select2/select-multiple.tpl.html","
    "); -$templateCache.put("select2/select.tpl.html","
    ");}]); +$templateCache.put("select2/no-choice.tpl.html","
    "); +$templateCache.put("select2/select-multiple.tpl.html","
    "); +$templateCache.put("select2/select.tpl.html","
    "); +$templateCache.put("selectize/choices.tpl.html","
    "); +$templateCache.put("selectize/match-multiple.tpl.html","
    ×
    "); +$templateCache.put("selectize/match.tpl.html","
    {{$select.placeholder}}
    "); +$templateCache.put("selectize/no-choice.tpl.html","
    "); +$templateCache.put("selectize/select-multiple.tpl.html","
    "); +$templateCache.put("selectize/select.tpl.html","
    ");}]); -- 2.7.2.windows.1