diff --git a/README.md b/README.md index 2048776..0818be1 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,17 @@ QQ群: 769620939 tips: '请选择', //please selected //空数据提示 empty: '暂无数据', //no data + //搜索延迟 ms + delay: 500, + //搜索默认提示 + searchTips: '请选择', //please search + //是否开始本地搜索 + filterable: false, + //本地搜索过滤方法, 返回true表示显示, false不显示, val:当前输入框搜索值, item:选项数据, index: 数组坐标, porp: 自定义属性 + filterMethod: function(val, item, index, prop){ + if(!val) return true; + return item[prop.name].indexOf(val) != -1; + }, //自定义属性名称 prop: { name: 'name', @@ -151,6 +162,15 @@ xmSelect: setValue(array, show)

换一个主题

+

开启搜索模式

+
+ +

自定义搜索方法

+
+ +

自定义搜索延迟 和 提示

+
+ ``` diff --git a/dist/xm-select.js b/dist/xm-select.js index 0464050..bb985c4 100644 --- a/dist/xm-select.js +++ b/dist/xm-select.js @@ -1 +1 @@ -!function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=4)}([function(t){t.exports={a:"xm-select",b:"1.0.0"}},function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var n=function(t,e){var n=t[1]||"",o=t[3];if(!o)return n;if(e&&"function"==typeof btoa){var r=(l=o,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(l))))+" */"),i=o.sources.map(function(t){return"/*# sourceURL="+o.sourceRoot+t+" */"});return[n].concat(i).concat([r]).join("\n")}var l;return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n}).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var o={},r=0;r=0&&u.splice(e,1)}function b(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var o=function(){0;return n.nc}();o&&(t.attrs.nonce=o)}return y(e,t.attrs),m(t,e),e}function y(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})}function v(t,e){var n,o,r,i;if(e.transform&&t.css){if(!(i="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=i}if(e.singleton){var l=s++;n=c||(c=b(e)),o=g.bind(null,n,l,!1),r=g.bind(null,n,l,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",y(e,t.attrs),m(t,e),e}(e),o=function(t,e,n){var o=n.css,r=n.sourceMap,i=void 0===e.convertToAbsoluteUrls&&r;(e.convertToAbsoluteUrls||i)&&(o=f(o));r&&(o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var l=new Blob([o],{type:"text/css"}),a=t.href;t.href=URL.createObjectURL(l),a&&URL.revokeObjectURL(a)}.bind(null,n,e),r=function(){h(n),n.href&&URL.revokeObjectURL(n.href)}):(n=b(e),o=function(t,e){var n=e.css,o=e.media;o&&t.setAttribute("media",o);if(t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}.bind(null,n),r=function(){h(n)});return o(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;o(t=e)}else r()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=l()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=d(t,e);return p(n,e),function(t){for(var o=[],r=0;r2;)l.push(s[c]);for(e&&null!=e.children&&(l.length||l.push(e.children),delete e.children);l.length;)if((o=l.pop())&&void 0!==o.pop)for(c=o.length;c--;)l.push(o[c]);else"boolean"==typeof o&&(o=null),(i="function"!=typeof t)&&(null==o?o="":"number"==typeof o?o=String(o):"string"!=typeof o&&(i=!1)),i&&n?u[u.length-1]+=o:u===a?u=[o]:u.push(o),n=i;var f=new r;return f.nodeName=t,f.children=u,f.attributes=null==e?void 0:e,f.key=null==e?void 0:e.key,f}function s(t,e){for(var n in e)t[n]=e[n];return t}function u(t,e){null!=t&&("function"==typeof t?t(e):t.current=e)}var f="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,p=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,d=[];function m(t){!t._dirty&&(t._dirty=!0)&&1==d.push(t)&&f(h)}function h(){for(var t;t=d.pop();)t._dirty&&U(t)}function b(t,e){return t.normalizedNodeName===e||t.nodeName.toLowerCase()===e.toLowerCase()}function y(t){var e=s({},t.attributes);e.children=t.children;var n=t.nodeName.defaultProps;if(void 0!==n)for(var o in n)void 0===e[o]&&(e[o]=n[o]);return e}function v(t){var e=t.parentNode;e&&e.removeChild(t)}function x(t,e,n,r,i){if("className"===e&&(e="class"),"key"===e);else if("ref"===e)u(n,null),u(r,t);else if("class"!==e||i)if("style"===e){if(r&&"string"!=typeof r&&"string"!=typeof n||(t.style.cssText=r||""),r&&"object"==o(r)){if("string"!=typeof n)for(var l in n)l in r||(t.style[l]="");for(var l in r)t.style[l]="number"==typeof r[l]&&!1===p.test(l)?r[l]+"px":r[l]}}else if("dangerouslySetInnerHTML"===e)r&&(t.innerHTML=r.__html||"");else if("o"==e[0]&&"n"==e[1]){var a=e!==(e=e.replace(/Capture$/,""));e=e.toLowerCase().substring(2),r?n||t.addEventListener(e,A,a):t.removeEventListener(e,A,a),(t._listeners||(t._listeners={}))[e]=r}else if("list"!==e&&"type"!==e&&!i&&e in t){try{t[e]=null==r?"":r}catch(t){}null!=r&&!1!==r||"spellcheck"==e||t.removeAttribute(e)}else{var c=i&&e!==(e=e.replace(/^xlink:?/,""));null==r||!1===r?c?t.removeAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase()):t.removeAttribute(e):"function"!=typeof r&&(c?t.setAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase(),r):t.setAttribute(e,r))}else t.className=r||""}function A(t){return this._listeners[t.type](t)}var g=[],w=0,C=!1,k=!1;function S(){for(var t;t=g.shift();)t.componentDidMount&&t.componentDidMount()}function O(t,e,n,o,r,i){w++||(C=null!=r&&void 0!==r.ownerSVGElement,k=null!=t&&!("__preactattr_"in t));var l=function t(e,n,o,r,i){var l=e,a=C;if(null!=n&&"boolean"!=typeof n||(n=""),"string"==typeof n||"number"==typeof n)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||i)?e.nodeValue!=n&&(e.nodeValue=n):(l=document.createTextNode(n),e&&(e.parentNode&&e.parentNode.replaceChild(l,e),j(e,!0))),l.__preactattr_=!0,l;var c,s,u=n.nodeName;if("function"==typeof u)return function(t,e,n,o){for(var r=t&&t._component,i=r,l=t,a=r&&t._componentConstructor===e.nodeName,c=a,s=y(e);r&&!c&&(r=r._parentComponent);)c=r.constructor===e.nodeName;return r&&c&&(!o||r._component)?(R(r,s,3,n,o),t=r.base):(i&&!a&&(T(i),t=l=null),r=B(e.nodeName,s,n),t&&!r.nextBase&&(r.nextBase=t,l=null),R(r,s,1,n,o),t=r.base,l&&t!==l&&(l._component=null,j(l,!1))),t}(e,n,o,r);if(C="svg"===u||"foreignObject"!==u&&C,u=String(u),(!e||!b(e,u))&&(c=u,(s=C?document.createElementNS("http://www.w3.org/2000/svg",c):document.createElement(c)).normalizedNodeName=c,l=s,e)){for(;e.firstChild;)l.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(l,e),j(e,!0)}var f=l.firstChild,p=l.__preactattr_,d=n.children;if(null==p){p=l.__preactattr_={};for(var m=l.attributes,h=m.length;h--;)p[m[h].name]=m[h].value}return!k&&d&&1===d.length&&"string"==typeof d[0]&&null!=f&&void 0!==f.splitText&&null==f.nextSibling?f.nodeValue!=d[0]&&(f.nodeValue=d[0]):(d&&d.length||null!=f)&&function(e,n,o,r,i){var l,a,c,s,u,f,p,d,m=e.childNodes,h=[],y={},x=0,A=0,g=m.length,w=0,C=n?n.length:0;if(0!==g)for(var k=0;k"===e?(a(),o=1):o&&("="===e?(o=4,n=r,r=""):"/"===e?(a(),3===o&&(l=l[0]),o=l,(l=l[0]).push(o,4),o=0):" "===e||"\t"===e||"\n"===e||"\r"===e?(a(),o=2):r+=e)}return a(),l},L="function"==typeof Map,F=L?new Map:{},D=L?function(t){var e=F.get(t);return e||F.set(t,e=N(t)),e}:function(t){for(var e="",n=0;n1?e:e[0]}).bind(c);function J(t){return(J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function I(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"zn",e=mt[t]||dt;return{data:[],initValue:null,tips:e.tips,empty:e.empty,reset:!1,isShow:!1,prop:{name:"name",value:"value",selected:"selected",disabled:"disabled"},theme:{color:"#009688"},model:{label:{type:"block",text:{left:"",right:"",separator:", "},block:{showCount:0,showIcon:!0},count:{template:function(t,e){return"已选中 ".concat(e.length," 项, 共 ").concat(t.length," 项")}}}},show:function(){},hidn:function(){},template:function(t,e,n,o){return n}}};function bt(){return(bt=Object.assign||function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};this.options=yt({},this.options,e);var n,o=(n=this.options.el,document.querySelector(n));if(o){var r,i,l;return r=c(ft,bt({},this.options,{onClose:Ct,onRef:function(e){return kt[t.options.el]=e}})),l=i=o,O(i.firstElementChild,r,{},!1,l,!1),wt[this.options.el]=this,this}pt("没有找到渲染对象: ".concat(e.el,", 请检查"))}},{key:"reset",value:function(){var t=this.options;return this.options=ht(t.language),this.update(yt({},gt[t.el])),kt[this.options.el].reset(),this}},{key:"opened",value:function(){var t=kt[this.options.el];return!t.state.show&&t.onClick(),this}},{key:"closed",value:function(){var t=kt[this.options.el];return t.state.show&&t.onClick(),this}},{key:"getValue",value:function(){return t=kt[this.options.el].state.sels,JSON.parse(JSON.stringify(t));var t}},{key:"setValue",value:function(t,e){var n;if(n=t,"[object Array]"==Object.prototype.toString.call(n))return kt[this.options.el].value(t,!!e),this;pt("请传入数组结构...")}}])&&xt(e.prototype,n),o&&xt(e,o),t}();e.a=St},function(t,e,n){"use strict";n.r(e),function(t){var e=n(0),o=(n(6),n(3)),r=(n(7),n(10),{name:e.a,version:e.b,render:function(t){return new o.a(t)}});"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?t.exports=r:"function"==typeof define&&n(12)?define(r):window.layui&&layui.define?layui.define(function(t){t("xmSelect",r)}):window.xmSelect=r}.call(this,n(5)(t))},function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},function(t,e){Array.prototype.map||(Array.prototype.map=function(t,e){var n,o,r,i=Object(this),l=i.length>>>0;for(e&&(n=e),o=new Array(l),r=0;r>>0;if("function"!=typeof t)throw new TypeError(t+" is not a function");for(arguments.length>1&&(n=e),o=0;o>>0;if("function"!=typeof t)throw new TypeError;for(var o=[],r=arguments[1],i=0;i>>0,r=arguments[1],i=0;i .xm-tips {\n color: #999999;\n padding: 0 10px;\n height: 100%;\n}\nxm-select > .xm-icon {\n display: inline-block;\n overflow: hidden;\n position: absolute;\n width: 0;\n height: 0;\n right: 10px;\n top: 50%;\n margin-top: -3px;\n cursor: pointer;\n border: 6px dashed transparent;\n border-top-color: #C2C2C2;\n border-top-style: solid;\n transition: all 0.3s;\n -webkit-transition: all 0.3s;\n}\nxm-select > .xm-icon-expand {\n margin-top: -9px;\n transform: rotate(180deg);\n}\nxm-select > .xm-label {\n padding: 0 10px;\n height: 100%;\n overflow-y: hidden;\n}\nxm-select > .xm-label .xm-label-block {\n display: inline-block;\n position: relative;\n padding: 0px 5px;\n margin: 2px 5px 2px 0;\n height: 22px;\n line-height: 22px;\n border-radius: 3px;\n vertical-align: middle;\n color: #FFF;\n max-width: calc(100% - 20px);\n}\nxm-select > .xm-label .xm-label-block > span {\n display: inline-block;\n color: #FFF;\n text-overflow: ellipsis;\n overflow: hidden;\n}\nxm-select > .xm-label .xm-label-block > i {\n color: #FFF;\n margin-left: 8px;\n font-size: 12px;\n cursor: pointer;\n line-height: 20px;\n float: right;\n margin-top: 2px;\n}\nxm-select > .xm-label .xm-label-block.disabled {\n background-color: #C2C2C2 !important;\n cursor: no-drop !important;\n}\nxm-select > .xm-label .xm-label-block.disabled > i {\n cursor: no-drop !important;\n}\nxm-select > .xm-body {\n position: absolute;\n left: 0;\n top: 42px;\n padding: 5px 0;\n z-index: 999;\n width: 100%;\n border: 1px solid #E6E6E6;\n max-height: 300px;\n overflow-y: auto;\n background-color: #fff;\n border-radius: 2px;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);\n animation-name: xm-upbit;\n animation-duration: 0.3s;\n animation-fill-mode: both;\n}\nxm-select > .xm-body .xm-option {\n position: relative;\n padding: 0 10px;\n cursor: pointer;\n}\nxm-select > .xm-body .xm-option:hover {\n background-color: #f2f2f2;\n}\nxm-select > .xm-body .xm-option:hover > .xm-option-icon > i {\n color: #f2f2f2;\n}\nxm-select > .xm-body .xm-option-icon {\n color: #FFF;\n width: 18px;\n height: 18px;\n border: 1px solid #E6E6E6;\n border-radius: 5px;\n z-index: 2;\n display: inline-block;\n vertical-align: middle;\n}\nxm-select > .xm-body .xm-option-icon > i {\n float: left;\n height: 18px;\n line-height: 17px;\n color: #FFF;\n}\nxm-select > .xm-body .xm-option-content {\n display: inline-block;\n position: relative;\n padding: 0 15px;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n color: #666;\n line-height: 36px;\n vertical-align: middle;\n width: calc(100% - 18px);\n}\nxm-select > .xm-body .xm-select-empty {\n text-align: center;\n color: #999;\n}\nxm-select > .xm-body .disabled {\n cursor: no-drop;\n}\nxm-select > .xm-body .disabled:hover {\n background-color: #FFF;\n}\nxm-select > .xm-body .disabled:hover > .xm-option-icon > i {\n color: #FFF !important;\n}\nxm-select > .xm-body .disabled .xm-option-icon {\n border-color: #C2C2C2 !important;\n}\nxm-select > .xm-body .disabled .xm-option-content {\n color: #C2C2C2 !important;\n}\nxm-select > .xm-body .disabled.selected > .xm-option-icon > i {\n color: #C2C2C2 !important;\n}\nxm-select .dis {\n display: none;\n}\n",""])},function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,o=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(t,e){var r,i=e.trim().replace(/^"(.*)"$/,function(t,e){return e}).replace(/^'(.*)'$/,function(t,e){return e});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(i)?t:(r=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:o+i.replace(/^\.\//,""),"url("+JSON.stringify(r)+")")})}},function(t,e,n){var o=n(11);"string"==typeof o&&(o=[[t.i,o,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(2)(o,r);o.locals&&(t.exports=o.locals)},function(t,e,n){(t.exports=n(1)(!1)).push([t.i,'/* 阿里巴巴矢量图标库 */\n@font-face {\n font-family: "xm-iconfont";\n src: url(\'//at.alicdn.com/t/font_792691_qxv28s6g1l9.eot?t=1534240067831\');\n /* IE9*/\n src: url(\'//at.alicdn.com/t/font_792691_qxv28s6g1l9.eot?t=1534240067831#iefix\') format(\'embedded-opentype\'), /* IE6-IE8 */ url(\'data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAAsYAAsAAAAAEQwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADMAAABCsP6z7U9TLzIAAAE8AAAARAAAAFY8ukovY21hcAAAAYAAAACrAAACPBtV6wxnbHlmAAACLAAABnEAAAmMovtEvWhlYWQAAAigAAAAMQAAADYSctBCaGhlYQAACNQAAAAgAAAAJAgBA69obXR4AAAI9AAAABsAAAAwMCX//WxvY2EAAAkQAAAAGgAAABoN8gwubWF4cAAACSwAAAAeAAAAIAEiAM9uYW1lAAAJTAAAAUUAAAJtPlT+fXBvc3QAAAqUAAAAhAAAALJ1LunfeJxjYGRgYOBikGPQYWB0cfMJYeBgYGGAAJAMY05meiJQDMoDyrGAaQ4gZoOIAgCKIwNPAHicY2BkYWacwMDKwMHUyXSGgYGhH0IzvmYwYuRgYGBiYGVmwAoC0lxTGByeMbwwZ27438AQw9zMcAQozAiSAwDk4AxmeJzlks0JwzAMhZ8bN/1xD4GU0h2Se26BbJMJOkkn6KmTPbJF8mT5UGg3qMRn0EPIRs8A9gAq0YsIhDcCLF5SQ9YrnLMe8VB9RSM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s6g1l9.ttf?t=1534240067831\') format(\'truetype\'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/ url(\'//at.alicdn.com/t/font_792691_qxv28s6g1l9.svg?t=1534240067831#iconfont\') format(\'svg\');\n /* iOS 4.1- */\n}\n.xm-iconfont {\n font-family: "xm-iconfont" !important;\n font-size: 16px;\n font-style: normal;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n.xm-icon-quanxuan:before {\n content: "\\e62c";\n}\n.xm-icon-caidan:before {\n content: "\\e610";\n}\n.xm-icon-fanxuan:before {\n content: "\\e837";\n}\n.xm-icon-pifu:before {\n content: "\\e668";\n}\n.xm-icon-qingkong:before {\n content: "\\e63e";\n}\n.xm-icon-sousuo:before {\n content: "\\e600";\n}\n.xm-icon-danx:before {\n content: "\\e62b";\n}\n.xm-icon-duox:before {\n content: "\\e613";\n}\n.xm-icon-close:before {\n content: "\\e601";\n}\n.xm-icon-expand:before {\n content: "\\e641";\n}\n',""])},function(t,e){(function(e){t.exports=e}).call(this,{})}]); \ No newline at end of file +!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(e){e.exports={a:"xm-select",b:"1.0.0"}},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=function(e,t){var n=e[1]||"",o=e[3];if(!o)return n;if(t&&"function"==typeof btoa){var r=(l=o,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(l))))+" */"),i=o.sources.map(function(e){return"/*# sourceURL="+o.sourceRoot+e+" */"});return[n].concat(i).concat([r]).join("\n")}var l;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var o={},r=0;r=0&&u.splice(t,1)}function b(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var o=function(){0;return n.nc}();o&&(e.attrs.nonce=o)}return y(t,e.attrs),h(e,t),t}function y(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function v(e,t){var n,o,r,i;if(t.transform&&e.css){if(!(i="function"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=i}if(t.singleton){var l=s++;n=c||(c=b(t)),o=g.bind(null,n,l,!1),r=g.bind(null,n,l,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",y(t,e.attrs),h(e,t),t}(t),o=function(e,t,n){var o=n.css,r=n.sourceMap,i=void 0===t.convertToAbsoluteUrls&&r;(t.convertToAbsoluteUrls||i)&&(o=p(o));r&&(o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var l=new Blob([o],{type:"text/css"}),a=e.href;e.href=URL.createObjectURL(l),a&&URL.revokeObjectURL(a)}.bind(null,n,t),r=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=b(t),o=function(e,t){var n=t.css,o=t.media;o&&e.setAttribute("media",o);if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,n),r=function(){m(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 r()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=l()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=d(e,t);return f(n,t),function(e){for(var o=[],r=0;r2;)l.push(s[c]);for(t&&null!=t.children&&(l.length||l.push(t.children),delete t.children);l.length;)if((o=l.pop())&&void 0!==o.pop)for(c=o.length;c--;)l.push(o[c]);else"boolean"==typeof o&&(o=null),(i="function"!=typeof e)&&(null==o?o="":"number"==typeof o?o=String(o):"string"!=typeof o&&(i=!1)),i&&n?u[u.length-1]+=o:u===a?u=[o]:u.push(o),n=i;var p=new r;return p.nodeName=e,p.children=u,p.attributes=null==t?void 0:t,p.key=null==t?void 0:t.key,p}function s(e,t){for(var n in t)e[n]=t[n];return e}function u(e,t){null!=e&&("function"==typeof e?e(t):e.current=t)}var p="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,f=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,d=[];function h(e){!e._dirty&&(e._dirty=!0)&&1==d.push(e)&&p(m)}function m(){for(var e;e=d.pop();)e._dirty&&R(e)}function b(e,t){return e.normalizedNodeName===t||e.nodeName.toLowerCase()===t.toLowerCase()}function y(e){var t=s({},e.attributes);t.children=e.children;var n=e.nodeName.defaultProps;if(void 0!==n)for(var o in n)void 0===t[o]&&(t[o]=n[o]);return t}function v(e){var t=e.parentNode;t&&t.removeChild(e)}function x(e,t,n,r,i){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)u(n,null),u(r,e);else if("class"!==t||i)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"==o(r)){if("string"!=typeof n)for(var l in n)l in r||(e.style[l]="");for(var l in r)e.style[l]="number"==typeof r[l]&&!1===f.test(l)?r[l]+"px":r[l]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var a=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,A,a):e.removeEventListener(t,A,a),(e._listeners||(e._listeners={}))[t]=r}else if("list"!==t&&"type"!==t&&!i&&t in e){try{e[t]=null==r?"":r}catch(e){}null!=r&&!1!==r||"spellcheck"==t||e.removeAttribute(t)}else{var c=i&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?c?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(c?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function A(e){return this._listeners[e.type](e)}var g=[],w=0,C=!1,k=!1;function O(){for(var e;e=g.shift();)e.componentDidMount&&e.componentDidMount()}function S(e,t,n,o,r,i){w++||(C=null!=r&&void 0!==r.ownerSVGElement,k=null!=e&&!("__preactattr_"in e));var l=function e(t,n,o,r,i){var l=t,a=C;if(null!=n&&"boolean"!=typeof n||(n=""),"string"==typeof n||"number"==typeof n)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||i)?t.nodeValue!=n&&(t.nodeValue=n):(l=document.createTextNode(n),t&&(t.parentNode&&t.parentNode.replaceChild(l,t),j(t,!0))),l.__preactattr_=!0,l;var c,s,u=n.nodeName;if("function"==typeof u)return function(e,t,n,o){for(var r=e&&e._component,i=r,l=e,a=r&&e._componentConstructor===t.nodeName,c=a,s=y(t);r&&!c&&(r=r._parentComponent);)c=r.constructor===t.nodeName;return r&&c&&(!o||r._component)?(T(r,s,3,n,o),e=r.base):(i&&!a&&(U(i),e=l=null),r=E(t.nodeName,s,n),e&&!r.nextBase&&(r.nextBase=e,l=null),T(r,s,1,n,o),e=r.base,l&&e!==l&&(l._component=null,j(l,!1))),e}(t,n,o,r);if(C="svg"===u||"foreignObject"!==u&&C,u=String(u),(!t||!b(t,u))&&(c=u,(s=C?document.createElementNS("http://www.w3.org/2000/svg",c):document.createElement(c)).normalizedNodeName=c,l=s,t)){for(;t.firstChild;)l.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(l,t),j(t,!0)}var p=l.firstChild,f=l.__preactattr_,d=n.children;if(null==f){f=l.__preactattr_={};for(var h=l.attributes,m=h.length;m--;)f[h[m].name]=h[m].value}return!k&&d&&1===d.length&&"string"==typeof d[0]&&null!=p&&void 0!==p.splitText&&null==p.nextSibling?p.nodeValue!=d[0]&&(p.nodeValue=d[0]):(d&&d.length||null!=p)&&function(t,n,o,r,i){var l,a,c,s,u,p,f,d,h=t.childNodes,m=[],y={},x=0,A=0,g=h.length,w=0,C=n?n.length:0;if(0!==g)for(var k=0;k"===t?(a(),o=1):o&&("="===t?(o=4,n=r,r=""):"/"===t?(a(),3===o&&(l=l[0]),o=l,(l=l[0]).push(o,4),o=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(a(),o=2):r+=t)}return a(),l},N="function"==typeof Map,I=N?new Map:{},L=N?function(e){var t=I.get(e);return t||I.set(e,t=F(e)),t}:function(e){for(var t="",n=0;n1?t:t[0]}).bind(c);function D(e){return(D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function V(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"zn",t=be[e]||me;return{data:[],initValue:null,tips:t.tips,empty:t.empty,reset:!1,isShow:!1,delay:500,searchTips:t.searchTips,filterable:!1,filterMethod:function(e,t,n,o){return!e||-1!=t[o.name].indexOf(e)},prop:{name:"name",value:"value",selected:"selected",disabled:"disabled"},theme:{color:"#009688"},model:{label:{type:"block",text:{left:"",right:"",separator:", "},block:{showCount:0,showIcon:!0},count:{template:function(e,t){return"已选中 ".concat(t.length," 项, 共 ").concat(e.length," 项")}}}},show:function(){},hidn:function(){},template:function(e,t,n,o){return n}}};function ve(){return(ve=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};this.options=xe({},this.options,t);var n,o=(n=this.options.el,document.querySelector(n));if(o){var r,i,l;return r=c(de,ve({},this.options,{onClose:Oe,onRef:function(t){return Se[e.options.el]=t}})),l=i=o,S(i.firstElementChild,r,{},!1,l,!1),ke[this.options.el]=this,this}he("没有找到渲染对象: ".concat(t.el,", 请检查"))}},{key:"reset",value:function(){var e=this.options;return this.options=ye(e.language),this.update(xe({},Ce[e.el])),Se[this.options.el].reset(),this}},{key:"opened",value:function(){var e=Se[this.options.el];return!e.state.show&&e.onClick(),this}},{key:"closed",value:function(){var e=Se[this.options.el];return e.state.show&&e.onClick(),this}},{key:"getValue",value:function(){return e=Se[this.options.el].state.sels,JSON.parse(JSON.stringify(e));var e}},{key:"setValue",value:function(e,t){var n;if(n=e,"[object Array]"==Object.prototype.toString.call(n))return Se[this.options.el].value(e,!!t),this;he("请传入数组结构...")}}])&&ge(t.prototype,n),o&&ge(t,o),e}();t.a=je},function(e,t,n){"use strict";n.r(t),function(e){var t=n(0),o=(n(6),n(3)),r=(n(7),n(10),{name:t.a,version:t.b,render:function(e){return new o.a(e)}});"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?e.exports=r:"function"==typeof define&&n(12)?define(r):window.layui&&layui.define?layui.define(function(e){e("xmSelect",r)}):window.xmSelect=r}.call(this,n(5)(e))},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t){Array.prototype.map||(Array.prototype.map=function(e,t){var n,o,r,i=Object(this),l=i.length>>>0;for(t&&(n=t),o=new Array(l),r=0;r>>0;if("function"!=typeof e)throw new TypeError(e+" is not a function");for(arguments.length>1&&(n=t),o=0;o>>0;if("function"!=typeof e)throw new TypeError;for(var o=[],r=arguments[1],i=0;i>>0,r=arguments[1],i=0;i .xm-tips {\n color: #999999;\n padding: 0 10px;\n height: 100%;\n}\nxm-select > .xm-icon {\n display: inline-block;\n overflow: hidden;\n position: absolute;\n width: 0;\n height: 0;\n right: 10px;\n top: 50%;\n margin-top: -3px;\n cursor: pointer;\n border: 6px dashed transparent;\n border-top-color: #C2C2C2;\n border-top-style: solid;\n transition: all 0.3s;\n -webkit-transition: all 0.3s;\n}\nxm-select > .xm-icon-expand {\n margin-top: -9px;\n transform: rotate(180deg);\n}\nxm-select > .xm-label {\n padding: 0 10px;\n height: 100%;\n overflow-y: hidden;\n}\nxm-select > .xm-label .xm-label-block {\n display: inline-block;\n position: relative;\n padding: 0px 5px;\n margin: 2px 5px 2px 0;\n height: 22px;\n line-height: 22px;\n border-radius: 3px;\n vertical-align: middle;\n color: #FFF;\n max-width: calc(100% - 20px);\n}\nxm-select > .xm-label .xm-label-block > span {\n display: inline-block;\n color: #FFF;\n text-overflow: ellipsis;\n overflow: hidden;\n}\nxm-select > .xm-label .xm-label-block > i {\n color: #FFF;\n margin-left: 8px;\n font-size: 12px;\n cursor: pointer;\n line-height: 20px;\n float: right;\n margin-top: 2px;\n}\nxm-select > .xm-label .xm-label-block.disabled {\n background-color: #C2C2C2 !important;\n cursor: no-drop !important;\n}\nxm-select > .xm-label .xm-label-block.disabled > i {\n cursor: no-drop !important;\n}\nxm-select > .xm-body {\n position: absolute;\n left: 0;\n top: 42px;\n padding: 5px 0;\n z-index: 999;\n width: 100%;\n border: 1px solid #E6E6E6;\n max-height: 300px;\n overflow-y: auto;\n background-color: #fff;\n border-radius: 2px;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);\n animation-name: xm-upbit;\n animation-duration: 0.3s;\n animation-fill-mode: both;\n}\nxm-select > .xm-body .xm-option {\n position: relative;\n padding: 0 10px;\n cursor: pointer;\n}\nxm-select > .xm-body .xm-option:hover {\n background-color: #f2f2f2;\n}\nxm-select > .xm-body .xm-option:hover > .xm-option-icon > i {\n color: #f2f2f2;\n}\nxm-select > .xm-body .xm-option-icon {\n color: #FFF;\n width: 18px;\n height: 18px;\n border: 1px solid #E6E6E6;\n border-radius: 5px;\n z-index: 2;\n display: inline-block;\n vertical-align: middle;\n}\nxm-select > .xm-body .xm-option-icon > i {\n float: left;\n height: 18px;\n line-height: 17px;\n color: #FFF;\n}\nxm-select > .xm-body .xm-option-content {\n display: inline-block;\n position: relative;\n padding: 0 15px;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n color: #666;\n line-height: 36px;\n vertical-align: middle;\n width: calc(100% - 18px);\n}\nxm-select > .xm-body .xm-select-empty {\n text-align: center;\n color: #999;\n}\nxm-select > .xm-body .disabled {\n cursor: no-drop;\n}\nxm-select > .xm-body .disabled:hover {\n background-color: #FFF;\n}\nxm-select > .xm-body .disabled:hover > .xm-option-icon > i {\n color: #FFF !important;\n}\nxm-select > .xm-body .disabled .xm-option-icon {\n border-color: #C2C2C2 !important;\n}\nxm-select > .xm-body .disabled .xm-option-content {\n color: #C2C2C2 !important;\n}\nxm-select > .xm-body .disabled.selected > .xm-option-icon > i {\n color: #C2C2C2 !important;\n}\nxm-select > .xm-body .xm-search {\n background-color: #FFF !important;\n position: relative;\n padding: 0 10px;\n cursor: pointer;\n}\nxm-select > .xm-body .xm-search > i {\n position: absolute;\n}\nxm-select > .xm-body .xm-search-input {\n border: none;\n border-bottom: 1px solid #E6E6E6;\n padding-left: 27px;\n cursor: text;\n}\nxm-select .xm-input {\n cursor: pointer;\n border-radius: 2px;\n border-width: 1px;\n border-style: solid;\n border-color: #E6E6E6;\n display: block;\n width: 100%;\n box-sizing: border-box;\n background-color: #FFF;\n height: 36px;\n line-height: 1.3;\n padding-left: 10px;\n outline: 0;\n}\nxm-select .dis {\n display: none;\n}\n",""])},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,o=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(e,t){var r,i=t.trim().replace(/^"(.*)"$/,function(e,t){return t}).replace(/^'(.*)'$/,function(e,t){return t});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(i)?e:(r=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:o+i.replace(/^\.\//,""),"url("+JSON.stringify(r)+")")})}},function(e,t,n){var o=n(11);"string"==typeof o&&(o=[[e.i,o,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(2)(o,r);o.locals&&(e.exports=o.locals)},function(e,t,n){(e.exports=n(1)(!1)).push([e.i,'/* 阿里巴巴矢量图标库 */\n@font-face {\n font-family: "xm-iconfont";\n src: url(\'//at.alicdn.com/t/font_792691_qxv28s6g1l9.eot?t=1534240067831\');\n /* IE9*/\n src: url(\'//at.alicdn.com/t/font_792691_qxv28s6g1l9.eot?t=1534240067831#iefix\') format(\'embedded-opentype\'), /* IE6-IE8 */ url(\'data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAAsYAAsAAAAAEQwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADMAAABCsP6z7U9TLzIAAAE8AAAARAAAAFY8ukovY21hcAAAAYAAAACrAAACPBtV6wx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Qb5W7iJO/wKt9Dx6sI+5l5XuI1HL/bHVi+cXqnlQcWhySKTOb+CmV7vkoWt0uqca1vEJlODoF9JU51pW91T7NdD5yIVWZOqCas6SYzKrdnq0AUb5/JRrxeJHoQm5Vhj/rbGAo5xBYUlDowxQhhkiMro6DtVZvSvsUPCXntWPc3ndFsU1P9zhQEC9M9cU7qy0nk6T4E9XxtSdXQrbsuelDSRXs1JErJCXta2VELqATZlV44RelzRiT8oZ0j/AAlabsgAAAB4nG2L3QqCQBCFZ9RWU7sOfAeh8IFi3N10EHYUG1p8+gSjqz44F+cPEjgo4T81Jphihic0mGOBZyyxwhovUCxKIe4ylthRuDqV+I22UcLQ6+QH4ubWdZZkU3m4o/0tUqtSvT33TPLits12fzc+zhRcvoquo0o281OLhcMw7Q+AD8sULE0=\') format(\'woff\'), url(\'//at.alicdn.com/t/font_792691_qxv28s6g1l9.ttf?t=1534240067831\') format(\'truetype\'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/ url(\'//at.alicdn.com/t/font_792691_qxv28s6g1l9.svg?t=1534240067831#iconfont\') format(\'svg\');\n /* iOS 4.1- */\n}\n.xm-iconfont {\n font-family: "xm-iconfont" !important;\n font-size: 16px;\n font-style: normal;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n.xm-icon-quanxuan:before {\n content: "\\e62c";\n}\n.xm-icon-caidan:before {\n content: "\\e610";\n}\n.xm-icon-fanxuan:before {\n content: "\\e837";\n}\n.xm-icon-pifu:before {\n content: "\\e668";\n}\n.xm-icon-qingkong:before {\n content: "\\e63e";\n}\n.xm-icon-sousuo:before {\n content: "\\e600";\n}\n.xm-icon-danx:before {\n content: "\\e62b";\n}\n.xm-icon-duox:before {\n content: "\\e613";\n}\n.xm-icon-close:before {\n content: "\\e601";\n}\n.xm-icon-expand:before {\n content: "\\e641";\n}\n',""])},function(e,t){(function(t){e.exports=t}).call(this,{})}]); \ No newline at end of file diff --git a/index.html b/index.html index d1aa87e..4a182aa 100644 --- a/index.html +++ b/index.html @@ -52,8 +52,16 @@

换一个主题

-
- +
+ +

开启搜索模式

+
+ +

自定义搜索方法

+
+ +

自定义搜索延迟 和 提示

+
diff --git a/src/components/config/language/en.js b/src/components/config/language/en.js index 7b832f9..e55d285 100644 --- a/src/components/config/language/en.js +++ b/src/components/config/language/en.js @@ -1,4 +1,5 @@ export default { tips: 'please selected', empty: 'no data', + searchTips: 'please search', } \ No newline at end of file diff --git a/src/components/config/language/zn.js b/src/components/config/language/zn.js index 28fa3ea..a33a27b 100644 --- a/src/components/config/language/zn.js +++ b/src/components/config/language/zn.js @@ -1,4 +1,5 @@ export default { tips: '请选择', empty: '暂无数据', + searchTips: '请选择', } \ No newline at end of file diff --git a/src/components/config/options.js b/src/components/config/options.js index 00c1b75..675d12d 100644 --- a/src/components/config/options.js +++ b/src/components/config/options.js @@ -19,6 +19,17 @@ export default function (lan = 'zn') { reset: false, //用来判断多选是否显示 isShow: false, + //搜索延迟 ms + delay: 500, + //搜索默认提示 + searchTips: setting.searchTips, + //是否开始本地搜索 + filterable: false, + //本地搜索过滤方法 + filterMethod: function(val, item, index, prop){ + if(!val) return true; + return item[prop.name].indexOf(val) != -1; + }, //自定义属性名称 prop: { name: 'name', diff --git a/src/components/element/framework.js b/src/components/element/framework.js index 034c618..52b910d 100644 --- a/src/components/element/framework.js +++ b/src/components/element/framework.js @@ -57,7 +57,8 @@ class Framework extends Component{ } - render({ tips, theme, data, prop, template, model, empty }, { sels, show }) { + render(config, { sels, show }) { + const { tips, theme, data, prop, template, model, empty } = config; const borderStyle = { borderColor: theme.color }; //最外层边框的属性 const xmSelectProps = { @@ -93,8 +94,8 @@ class Framework extends Component{ } }; - const labelProps = { data, prop, model, theme, sels, ck, title: sels.map(sel => sel[prop.name]).join(',') } - const bodyProps = { data, prop, template, theme, sels, ck, empty } + const labelProps = { ...config, sels, ck, title: sels.map(sel => sel[prop.name]).join(',') } + const bodyProps = { ...config, sels, ck, show } //控制下拉框的显示于隐藏 const bodyClass = show ? 'xm-body' : 'xm-body dis'; diff --git a/src/components/element/model/general.js b/src/components/element/model/general.js index 6a4f5c3..b869062 100644 --- a/src/components/element/model/general.js +++ b/src/components/element/model/general.js @@ -7,6 +7,8 @@ class General extends Component{ constructor(options){ super(options); + this.searchCid = 0; + this.setState({ searchVal: '', }); } optionClick(item, selected, disabled, e){ @@ -15,11 +17,26 @@ class General extends Component{ e.stopPropagation(); } - render({ data, prop, template, theme, sels, empty }) { + searchInputClick(e){ + e.stopPropagation(); + } + + searchInput(e){ + clearTimeout(this.searchCid); + this.searchCid = setTimeout(() => this.setState({ searchVal: e.target.value }), this.props.delay); + } + + componentWillReceiveProps(props){ + if(!props.show){ + this.setState({ searchVal: '', }) + } + } + + render({ data, prop, template, theme, sels, empty, filterable, filterMethod, delay, searchTips }) { const { name, value, disabled } = prop; - - const arr = data.map(item => { + + const arr = (filterable ? data.filter((item, index) => filterMethod(this.state.searchVal, item, index, prop)) : data).map(item => { const selected = !!sels.find(sel => sel[value] == item[value]) const iconStyle = { color: selected ? theme.color : '' } @@ -36,14 +53,25 @@ class General extends Component{ ) }) - if(!data.length){ + if(!arr.length){ arr.push(
{ empty }
) } + const searchClass = ['xm-search', filterable ? '':'dis'].join(' '); + const search = ( +
+ + +
+ ); + return ( -
{ arr }
+
+ { search } +
{ arr }
+
) } } diff --git a/src/style/index.less b/src/style/index.less index 3c2387b..c7378bc 100644 --- a/src/style/index.less +++ b/src/style/index.less @@ -200,8 +200,41 @@ xm-select{ color: @disabledColor !important; } } + + .xm-search{ + background-color: #FFF !important; + position: relative; + padding: 0 10px; + cursor: pointer; + + &>i{ + position: absolute; + } + + &-input{ + border: none; + border-bottom: 1px solid #E6E6E6; + padding-left: 27px; + cursor: text; + } + } } + .xm-input{ + cursor: pointer; + border-radius: 2px; + border-width: 1px; + border-style: solid; + border-color: #E6E6E6; + display: block; + width: 100%; + box-sizing: border-box; + background-color: #FFF; + height: 36px; + line-height: 1.3; + padding-left: 10px; + outline: 0; + } .dis{ display: none;