From 4c5d0dcccb60d288d7047069d3143bc455b1b85f Mon Sep 17 00:00:00 2001 From: maplemei Date: Mon, 23 Sep 2019 15:46:57 +0800 Subject: [PATCH] v1.0.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 调整IE不兼容的问题, 支持IE10以上 --- dist/xm-select.js | 2 +- src/components/core/index.js | 2 +- src/components/element/framework.js | 21 +++++++++++++++++---- src/components/element/model/general.js | 14 ++++++++------ src/style/index.less | 9 ++++++--- 5 files changed, 33 insertions(+), 15 deletions(-) diff --git a/dist/xm-select.js b/dist/xm-select.js index da60724..f3ce10e 100644 --- a/dist/xm-select.js +++ b/dist/xm-select.js @@ -1 +1 @@ -!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=(a=o,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),i=o.sources.map(function(e){return"/*# sourceURL="+o.sourceRoot+e+" */"});return[n].concat(i).concat([r]).join("\n")}var a;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 a=c++;n=l||(l=b(t)),o=A.bind(null,n,a,!1),r=A.bind(null,n,a,!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 a=new Blob([o],{type:"text/css"}),s=e.href;e.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}.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=a()),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;)a.push(c[l]);for(t&&null!=t.children&&(a.length||a.push(t.children),delete t.children);a.length;)if((o=a.pop())&&void 0!==o.pop)for(l=o.length;l--;)a.push(o[l]);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===s?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 c(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&&T(e)}function b(e,t){return e.normalizedNodeName===t||e.nodeName.toLowerCase()===t.toLowerCase()}function y(e){var t=c({},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 a in n)a in r||(e.style[a]="");for(var a in r)e.style[a]="number"==typeof r[a]&&!1===f.test(a)?r[a]+"px":r[a]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var s=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,g,s):e.removeEventListener(t,g,s),(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 l=i&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?l?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(l?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function g(e){return this._listeners[e.type](e)}var A=[],w=0,k=!1,C=!1;function S(){for(var e;e=A.shift();)e.componentDidMount&&e.componentDidMount()}function O(e,t,n,o,r,i){w++||(k=null!=r&&void 0!==r.ownerSVGElement,C=null!=e&&!("__preactattr_"in e));var a=function e(t,n,o,r,i){var a=t,s=k;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):(a=document.createTextNode(n),t&&(t.parentNode&&t.parentNode.replaceChild(a,t),j(t,!0))),a.__preactattr_=!0,a;var l,c,u=n.nodeName;if("function"==typeof u)return function(e,t,n,o){for(var r=e&&e._component,i=r,a=e,s=r&&e._componentConstructor===t.nodeName,l=s,c=y(t);r&&!l&&(r=r._parentComponent);)l=r.constructor===t.nodeName;return r&&l&&(!o||r._component)?(R(r,c,3,n,o),e=r.base):(i&&!s&&(I(i),e=a=null),r=E(t.nodeName,c,n),e&&!r.nextBase&&(r.nextBase=e,a=null),R(r,c,1,n,o),e=r.base,a&&e!==a&&(a._component=null,j(a,!1))),e}(t,n,o,r);if(k="svg"===u||"foreignObject"!==u&&k,u=String(u),(!t||!b(t,u))&&(l=u,(c=k?document.createElementNS("http://www.w3.org/2000/svg",l):document.createElement(l)).normalizedNodeName=l,a=c,t)){for(;t.firstChild;)a.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(a,t),j(t,!0)}var p=a.firstChild,f=a.__preactattr_,d=n.children;if(null==f){f=a.__preactattr_={};for(var h=a.attributes,m=h.length;m--;)f[h[m].name]=h[m].value}return!C&&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 a,s,l,c,u,p,f,d,h=t.childNodes,m=[],y={},x=0,g=0,A=h.length,w=0,k=n?n.length:0;if(0!==A)for(var C=0;C"===t?(s(),o=1):o&&("="===t?(o=4,n=r,r=""):"/"===t?(s(),3===o&&(a=a[0]),o=a,(a=a[0]).push(o,4),o=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(s(),o=2):r+=t)}return s(),a},N="function"==typeof Map,V=N?new Map:{},D=N?function(e){var t=V.get(e);return t||V.set(e,t=M(e)),t}:function(e){for(var t="",n=0;n1?t:t[0]}).bind(l);function L(){for(var e=[],t=0;t=t||this.changePageIndex(n+1)}},{key:"changePageIndex",value:function(e){this.setState({pageIndex:e})}},{key:"searchInput",value:function(e){var t=this,n=e.target.value;setTimeout(function(){t.state.inputOver&&(clearTimeout(t.searchCid),t.searchCid=setTimeout(function(){return t.setState({searchVal:n,remote:!0})},t.props.delay))},0)}},{key:"focus",value:function(){this.searchInputRef.focus()}},{key:"handleComposition",value:function(e){var t=e.type;"compositionstart"===t?this.setState({inputOver:!1}):"compositionend"===t&&this.setState({inputOver:!0})}},{key:"componentWillReceiveProps",value:function(e){var t=this;e.show?setTimeout(function(){return t.focus()},0):this.setState({searchVal:""})}},{key:"render",value:function(e){var t=this,n=e.data,o=e.prop,r=e.template,i=e.theme,a=e.sels,s=e.empty,c=e.filterable,u=e.filterMethod,p=e.remoteSearch,f=e.remoteMethod,d=(e.delay,e.searchTips),h=o.name,m=o.value,b=o.disabled,y=n;c&&(p?this.state.remote&&(this.setState({loading:!0,remote:!1}),f(this.state.searchVal,function(e){t.setState({loading:!1}),t.props.onReset(e)})):y=n.filter(function(e,n){return u(t.state.searchVal,e,n,o)}));var v=l("div",{class:["xm-search",c?"":"dis"].join(" ")},l("i",{class:"xm-iconfont xm-icon-sousuo"}),l("input",{type:"text",class:"xm-input xm-search-input",placeholder:d,value:this.state.searchVal,ref:function(e){t.searchInputRef=e},autoFocus:!0,onClick:this.blockClick.bind(this),onInput:this.searchInput.bind(this),onCompositionStart:this.handleComposition.bind(this),onCompositionUpdate:this.handleComposition.bind(this),onCompositionEnd:this.handleComposition.bind(this)})),x="";if(e.paging){var g=Math.floor((y.length-1)/e.pageSize)+1;this.state.pageIndex>g&&this.changePageIndex(g);var A=(this.state.pageIndex-1)*e.pageSize,w=A+e.pageSize;y=y.slice(A,w);var k={cursor:"no-drop",color:"#d2d2d2"},C={},S={};this.state.pageIndex<=1&&(C=k),this.state.pageIndex==g&&(S=k);x=l("div",{class:"xm-paging"},l("span",{style:C,onClick:this.pagePrevClick.bind(this)},"上一页"),l("span",null,this.state.pageIndex," / ",g),l("span",{style:S,onClick:function(e){return t.pageNextClick.bind(t,e,g)()}},"下一页"))}return(y=y.map(function(e){var o=!!a.find(function(t){return t[m]==e[m]}),s=o?{color:i.color,border:"none",fontSize:"18px"}:{borderColor:i.color};return l("div",{class:["xm-option",e[b]?" disabled":"",o?" selected":""].join(" "),value:e[m],onClick:t.optionClick.bind(t,e,o,e[b])},l("i",{class:"xm-option-icon xm-iconfont xm-icon-duox",style:s}),l("div",{class:"xm-option-content",dangerouslySetInnerHTML:{__html:r({data:n,item:e,arr:a,name:e[h],value:e[m]})}}))})).length||y.push(l("div",{class:"xm-select-empty"},s)),l("div",{onClick:this.blockClick},l("div",null,v,l("div",{style:{maxHeight:e.height,overflow:"auto"}},y),e.paging&&x),this.state.loading&&l("div",{class:"loading"},l("span",{class:"loader"})))}}])&&te(n.prototype,o),r&&te(n,r),t}();function ae(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:[];this.setState({data:e})}},{key:"value",value:function(e,t){var n=this.props.data,o=this.props.prop.value,r=this.props.direction;this.setState({sels:e.map(function(e){return"object"===ce(e)?e[o]:e}).map(function(e){return n.find(function(t){return t[o]==e})}).filter(function(e){return e}),show:t,direction:r,directionVal:""})}},{key:"onReset",value:function(e){this.resetDate(e)}},{key:"onClick",value:function(e){var t=!this.state.show;if(t){if(this.props.show&&0==this.props.show())return;this.props.onClose(this.props.el);var n=this.state.direction;if("auto"===n){var o=document.documentElement.clientHeight,r=this.base.getBoundingClientRect();n=o-r.y-r.height-20>300?"down":"up"}this.setState({directionVal:n})}else{if(this.props.hidn&&0==this.props.hidn())return;this.bodyView.scroll(0,0)}this.setState({show:t}),e&&e.stopPropagation()}},{key:"componentWillReceiveProps",value:function(e){this.resetDate(e.data)}},{key:"render",value:function(e,t){var n=this,o=t.sels,r=t.show,i=e.tips,a=e.theme,s=e.prop,c=e.style,u=e.radio,p=e.repeat,f=e.clickClose,d=e.on,h={borderColor:a.color},m={style:se({},c,r?h:{}),onClick:this.onClick.bind(this),ua:-1!=navigator.userAgent.indexOf("Mac OS")?"mac":"win"},b=r?"xm-icon xm-icon-expand":"xm-icon",y={tips:i,show:!o.length},v=s.value,x=function(e,t,r,i){if(!r){if(!t||p&&!i)u?n.setState({sels:[e]}):n.setState({sels:[].concat(ae(o),[e])});else{var a=o.findIndex(function(t){return t[v]==e[v]});-1!=a&&(o.splice(a,1),n.setState(o))}d&&d({arr:o,item:e,selected:!t}),f&&!i&&n.onClick()}},g=se({},e,{data:this.state.data,sels:o,ck:x,title:o.map(function(e){return e[s.name]}).join(",")}),A=se({},e,{data:this.state.data,sels:o,ck:x,show:r,onReset:this.onReset.bind(this)}),w=["xm-body",this.state.directionVal,r?"":"dis"].join(" ");return l("xm-select",m,l("i",{class:b}),l(H,y),l($,g),l("div",{class:w,ref:function(e){return n.bodyView=e}},l(ie,A)))}}])&&ue(n.prototype,o),r&&ue(n,r),t}(),me={tips:"请选择",empty:"暂无数据",searchTips:"请选择"},be={zn:me,en:{tips:"please selected",empty:"no data",searchTips:"please search"}},ye=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"zn",t=be[e]||me;return{data:[],initValue:null,tips:t.tips,empty:t.empty,delay:500,searchTips:t.searchTips,filterable:!1,filterMethod:function(e,t,n,o){return!e||-1!=t[o.name].indexOf(e)},remoteSearch:!1,remoteMethod:function(e,t){t([])},direction:"auto",style:{},height:"200px",paging:!1,pageSize:10,radio:!1,repeat:!1,clickClose:!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(e,t){return"已选中 ".concat(t.length," 项, 共 ").concat(e.length," 项")}}}},show:function(){},hidn:function(){},template:function(e){e.item,e.sels;var t=e.name;e.value;return t},on:function(e){e.arr,e.item,e.selected}}};function ve(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xe(){return(xe=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;this.options=Object.assign(this.options,t);var o,r=(o=this.options.el,document.querySelector(o));if(r){n&&Se[this.options.el]&&Se[this.options.el].reset();var i,a,s;return i=l(he,xe({},this.options,{onReset:function(t){e.options.data=t},onClose:Ce,onRef:function(t){return Se[e.options.el]=t}})),s=a=r,O(a.firstElementChild,i,{},!1,s,!1),ke[this.options.el]=this,this}L("没有找到渲染对象: ".concat(t.el,", 请检查"))}},{key:"reset",value:function(){var e=this.options;return this.options=ye(e.language),this.update(function(e){for(var t=1;t>>0;for(t&&(n=t),o=new Array(a),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 position: absolute;\n top: 0;\n bottom: 0px;\n left: 10px;\n right: 30px;\n overflow: auto hidden;\n}\nxm-select > .xm-label .scroll {\n overflow-y: hidden;\n}\nxm-select > .xm-label .scroll .label-content {\n height: calc(100% - 20px);\n display: flex;\n align-items: baseline;\n}\nxm-select > .xm-label .scroll .label-content:after {\n content: '-';\n opacity: 0;\n}\nxm-select > .xm-label .xm-label-block {\n display: flex;\n position: relative;\n padding: 0px 5px;\n margin-right: 5px;\n height: 26px;\n line-height: 26px;\n border-radius: 3px;\n vertical-align: middle;\n color: #FFF;\n}\nxm-select > .xm-label .xm-label-block > span {\n display: flex;\n color: #FFF;\n}\nxm-select > .xm-label .xm-label-block > i {\n color: #FFF;\n margin-left: 8px;\n font-size: 12px;\n cursor: pointer;\n display: flex;\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 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.up {\n top: auto;\n bottom: 42px;\n}\nxm-select > .xm-body .xm-option {\n display: flex;\n align-items: center;\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-icon {\n color: transparent;\n display: flex;\n border: 1px solid #E6E6E6;\n border-radius: 3px;\n height: 18px;\n width: 18px;\n justify-content: center;\n align-items: center;\n}\nxm-select > .xm-body .xm-option-content {\n display: flex;\n position: relative;\n padding-left: 15px;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n color: #666;\n width: 100%;\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 .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 {\n color: #C2C2C2 !important;\n}\nxm-select > .xm-body .xm-search {\n background-color: #FFF !important;\n position: relative;\n padding: 0 10px;\n margin-bottom: 5px;\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-body .xm-paging {\n padding: 0 10px;\n display: flex;\n}\nxm-select > .xm-body .xm-paging > span:first-child {\n border-radius: 2px 0 0 2px;\n}\nxm-select > .xm-body .xm-paging > span:last-child {\n border-radius: 0 2px 2px 0;\n}\nxm-select > .xm-body .xm-paging > span {\n display: flex;\n flex: auto;\n justify-content: center;\n vertical-align: middle;\n padding: 0 15px;\n height: 28px;\n line-height: 28px;\n margin: 0 -1px 0 0;\n background-color: #fff;\n color: #333;\n font-size: 12px;\n border: 1px solid #e2e2e2;\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}\nxm-select .loading {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(255, 255, 255, 0.6);\n display: flex;\n align-items: center;\n justify-content: center;\n}\nxm-select .loading .loader {\n border: 0.2em dotted currentcolor;\n border-radius: 50%;\n -webkit-animation: 1s loader linear infinite;\n animation: 1s loader linear infinite;\n display: inline-block;\n width: 1em;\n height: 1em;\n color: inherit;\n vertical-align: middle;\n pointer-events: 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,d09GRgABAAAAAAsYAAsAAAAAEQwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADMAAABCsP6z7U9TLzIAAAE8AAAARAAAAFY8ukovY21hcAAAAYAAAACrAAACPBtV6wxnbHlmAAACLAAABnEAAAmMovtEvWhlYWQAAAigAAAAMQAAADYSctBCaGhlYQAACNQAAAAgAAAAJAgBA69obXR4AAAI9AAAABsAAAAwMCX//WxvY2EAAAkQAAAAGgAAABoN8gwubWF4cAAACSwAAAAeAAAAIAEiAM9uYW1lAAAJTAAAAUUAAAJtPlT+fXBvc3QAAAqUAAAAhAAAALJ1LunfeJxjYGRgYOBikGPQYWB0cfMJYeBgYGGAAJAMY05meiJQDMoDyrGAaQ4gZoOIAgCKIwNPAHicY2BkYWacwMDKwMHUyXSGgYGhH0IzvmYwYuRgYGBiYGVmwAoC0lxTGByeMbwwZ27438AQw9zMcAQozAiSAwDk4AxmeJzlks0JwzAMhZ8bN/1xD4GU0h2Se26BbJMJOkkn6KmTPbJF8mT5UGg3qMRn0EPIRs8A9gAq0YsIhDcCLF5SQ9YrnLMe8VB9RSMlMjCxYcueIyfOy7CuAFHU7lP9iqApt5L3ksBJbzlgZ9PVkXDUvbWa6x8T/i0u+XyWKtmmHW0NDI55yeRok2DjaKdg65jX7Bzzm71jXnN08vzJkQvg7Ng/WAYH9Qb3wzM/AHicjVVvbFzFEd/Zfbv7/vn9uXf33vl8Pt/dO99BHOzEZ9/DKTImRS0KjUoLDUFCjtpCMGkT1D9qldQmhkiUSv2G1BBB1VYqilGREOIDViWEGzttqkpI/cAXqyL5gFRALVIF+VCJe9fZd+fEpR/o6d3s7G9mZ2dmZ3a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KgxAERTAAwCmuAa3eJxjYWBgYAFhRiiNFf//z6L8/x+IDQAkCQRQAAAAAAAAjAEAATgBfgGaAiACbgMMA2AEhATGAAB4nGNgZGBg4GE4DMQgwATEXEDIwPAfzGcAAB2tAfIAAHicZY9NTsMwEIVf+gekEqqoYIfkBWIBKP0Rq25YVGr3XXTfpk6bKokjx63UA3AejsAJOALcgDvwSCebNpbH37x5Y08A3OAHHo7fLfeRPVwyO3INF7gXrlN/EG6QX4SbaONVuEX9TdjHM6bCbXRheYPXuGL2hHdhDx18CNdwjU/hOvUv4Qb5W7iJO/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 +!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=(a=o,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),i=o.sources.map(function(e){return"/*# sourceURL="+o.sourceRoot+e+" */"});return[n].concat(i).concat([r]).join("\n")}var a;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 a=c++;n=l||(l=b(t)),o=A.bind(null,n,a,!1),r=A.bind(null,n,a,!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 a=new Blob([o],{type:"text/css"}),s=e.href;e.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}.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=a()),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;)a.push(c[l]);for(t&&null!=t.children&&(a.length||a.push(t.children),delete t.children);a.length;)if((o=a.pop())&&void 0!==o.pop)for(l=o.length;l--;)a.push(o[l]);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===s?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 c(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&&T(e)}function b(e,t){return e.normalizedNodeName===t||e.nodeName.toLowerCase()===t.toLowerCase()}function y(e){var t=c({},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 a in n)a in r||(e.style[a]="");for(var a in r)e.style[a]="number"==typeof r[a]&&!1===f.test(a)?r[a]+"px":r[a]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var s=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,g,s):e.removeEventListener(t,g,s),(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 l=i&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?l?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(l?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function g(e){return this._listeners[e.type](e)}var A=[],w=0,k=!1,C=!1;function S(){for(var e;e=A.shift();)e.componentDidMount&&e.componentDidMount()}function O(e,t,n,o,r,i){w++||(k=null!=r&&void 0!==r.ownerSVGElement,C=null!=e&&!("__preactattr_"in e));var a=function e(t,n,o,r,i){var a=t,s=k;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):(a=document.createTextNode(n),t&&(t.parentNode&&t.parentNode.replaceChild(a,t),j(t,!0))),a.__preactattr_=!0,a;var l,c,u=n.nodeName;if("function"==typeof u)return function(e,t,n,o){for(var r=e&&e._component,i=r,a=e,s=r&&e._componentConstructor===t.nodeName,l=s,c=y(t);r&&!l&&(r=r._parentComponent);)l=r.constructor===t.nodeName;return r&&l&&(!o||r._component)?(R(r,c,3,n,o),e=r.base):(i&&!s&&(I(i),e=a=null),r=E(t.nodeName,c,n),e&&!r.nextBase&&(r.nextBase=e,a=null),R(r,c,1,n,o),e=r.base,a&&e!==a&&(a._component=null,j(a,!1))),e}(t,n,o,r);if(k="svg"===u||"foreignObject"!==u&&k,u=String(u),(!t||!b(t,u))&&(l=u,(c=k?document.createElementNS("http://www.w3.org/2000/svg",l):document.createElement(l)).normalizedNodeName=l,a=c,t)){for(;t.firstChild;)a.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(a,t),j(t,!0)}var p=a.firstChild,f=a.__preactattr_,d=n.children;if(null==f){f=a.__preactattr_={};for(var h=a.attributes,m=h.length;m--;)f[h[m].name]=h[m].value}return!C&&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 a,s,l,c,u,p,f,d,h=t.childNodes,m=[],y={},x=0,g=0,A=h.length,w=0,k=n?n.length:0;if(0!==A)for(var C=0;C"===t?(s(),o=1):o&&("="===t?(o=4,n=r,r=""):"/"===t?(s(),3===o&&(a=a[0]),o=a,(a=a[0]).push(o,4),o=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(s(),o=2):r+=t)}return s(),a},M="function"==typeof Map,N=M?new Map:{},D=M?function(e){var t=N.get(e);return t||N.set(e,t=V(e)),t}:function(e){for(var t="",n=0;n1?t:t[0]}).bind(l);function L(){for(var e=[],t=0;t=t||this.changePageIndex(n+1)}},{key:"changePageIndex",value:function(e){this.setState({pageIndex:e})}},{key:"searchInput",value:function(e){var t=this,n=e.target.value;setTimeout(function(){t.state.inputOver&&(clearTimeout(t.searchCid),t.searchCid=setTimeout(function(){return t.setState({searchVal:n,remote:!0})},t.props.delay))},0)}},{key:"focus",value:function(){this.searchInputRef.focus()}},{key:"handleComposition",value:function(e){var t=e.type;"compositionstart"===t?this.setState({inputOver:!1}):"compositionend"===t&&this.setState({inputOver:!0})}},{key:"componentWillReceiveProps",value:function(e){var t=this;this.props.show!=e.show&&(e.show?setTimeout(function(){return t.focus()},0):this.setState({searchVal:""}))}},{key:"render",value:function(e){var t=this,n=e.data,o=e.prop,r=e.template,i=e.theme,a=e.sels,s=e.empty,c=e.filterable,u=e.filterMethod,p=e.remoteSearch,f=e.remoteMethod,d=(e.delay,e.searchTips),h=o.name,m=o.value,b=o.disabled,y=n;c&&(p?this.state.remote&&(this.setState({loading:!0,remote:!1}),f(this.state.searchVal,function(e){t.setState({loading:!1}),t.props.onReset(e)})):y=n.filter(function(e,n){return u(t.state.searchVal,e,n,o)}));var v=l("div",{class:["xm-search",c?"":"dis"].join(" ")},l("i",{class:"xm-iconfont xm-icon-sousuo"}),l("input",{type:"text",class:"xm-input xm-search-input",placeholder:d,value:this.state.searchVal,ref:function(e){t.searchInputRef=e},autoFocus:!0,onClick:this.blockClick.bind(this),onInput:this.searchInput.bind(this),onCompositionStart:this.handleComposition.bind(this),onCompositionUpdate:this.handleComposition.bind(this),onCompositionEnd:this.handleComposition.bind(this)})),x="";if(e.paging){var g=Math.floor((y.length-1)/e.pageSize)+1;this.state.pageIndex>g&&this.changePageIndex(g);var A=(this.state.pageIndex-1)*e.pageSize,w=A+e.pageSize;y=y.slice(A,w);var k={cursor:"no-drop",color:"#d2d2d2"},C={},S={};this.state.pageIndex<=1&&(C=k),this.state.pageIndex==g&&(S=k);x=l("div",{class:"xm-paging"},l("span",{style:C,onClick:this.pagePrevClick.bind(this)},"上一页"),l("span",null,this.state.pageIndex," / ",g),l("span",{style:S,onClick:function(e){return t.pageNextClick.bind(t,e,g)()}},"下一页"))}return(y=y.map(function(e){var o=!!a.find(function(t){return t[m]==e[m]}),s=o?{color:i.color,border:"none",fontSize:"18px"}:{borderColor:i.color};return l("div",{class:["xm-option",e[b]?" disabled":"",o?" selected":""].join(" "),value:e[m],onClick:t.optionClick.bind(t,e,o,e[b])},l("i",{class:"xm-option-icon xm-iconfont xm-icon-duox",style:s}),l("div",{class:"xm-option-content",dangerouslySetInnerHTML:{__html:r({data:n,item:e,arr:a,name:e[h],value:e[m]})}}))})).length||y.push(l("div",{class:"xm-select-empty"},s)),l("div",{onClick:this.blockClick},l("div",null,v,l("div",{style:{maxHeight:e.height,overflow:"auto"}},y),e.paging&&x),this.state.loading&&l("div",{class:"loading"},l("span",{class:"loader"})))}}])&&te(n.prototype,o),r&&te(n,r),t}();function ae(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:[];this.setState({data:e})}},{key:"value",value:function(e,t){var n=this.props.data,o=this.props.prop.value,r=this.props.direction;this.setState({sels:e.map(function(e){return"object"===ce(e)?e[o]:e}).map(function(e){return n.find(function(t){return t[o]==e})}).filter(function(e){return e}),show:t,direction:r,directionVal:""})}},{key:"onReset",value:function(e){this.resetDate(e)}},{key:"onClick",value:function(e){var t=!this.state.show;if(t){if(this.props.show&&0==this.props.show())return;this.props.onClose(this.props.el);var n=this.state.direction;if("auto"===n){this.bodyView.style.display="block",this.bodyView.style.visibility="hidden";var o=this.bodyView.getBoundingClientRect().height;this.bodyView.style.display="",this.bodyView.style.visibility="";var r=document.documentElement.clientHeight,i=this.base.getBoundingClientRect();n=r-(i.y||i.top)-i.height-20>o||(i.y||i.top)0&&void 0!==arguments[0]?arguments[0]:"zn",t=be[e]||me;return{data:[],initValue:null,tips:t.tips,empty:t.empty,delay:500,searchTips:t.searchTips,filterable:!1,filterMethod:function(e,t,n,o){return!e||-1!=t[o.name].indexOf(e)},remoteSearch:!1,remoteMethod:function(e,t){t([])},direction:"auto",style:{},height:"200px",paging:!1,pageSize:10,radio:!1,repeat:!1,clickClose:!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(e,t){return"已选中 ".concat(t.length," 项, 共 ").concat(e.length," 项")}}}},show:function(){},hidn:function(){},template:function(e){e.item,e.sels;var t=e.name;e.value;return t},on:function(e){e.arr,e.item,e.selected}}};function ve(){return(ve=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;this.options=xe({},this.options,t);var o,r=(o=this.options.el,document.querySelector(o));if(r){n&&Oe[this.options.el]&&Oe[this.options.el].reset();var i,a,s;return i=l(he,ve({},this.options,{onReset:function(t){e.options.data=t},onClose:Se,onRef:function(t){return Oe[e.options.el]=t}})),s=a=r,O(a.firstElementChild,i,{},!1,s,!1),Ce[this.options.el]=this,this}L("没有找到渲染对象: ".concat(t.el,", 请检查"))}},{key:"reset",value:function(){var e=this.options;return this.options=ye(e.language),this.update(xe({},ke[e.el])),Oe[this.options.el].reset(),this}},{key:"opened",value:function(){var e=Oe[this.options.el];return!e.state.show&&e.onClick(),this}},{key:"closed",value:function(){var e=Oe[this.options.el];return e.state.show&&e.onClick(),this}},{key:"getValue",value:function(){return e=Oe[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 Oe[this.options.el].value(e,!!t),this;L("请传入数组结构...")}}])&&Ae(t.prototype,n),o&&Ae(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),a=i.length>>>0;for(t&&(n=t),o=new Array(a),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 position: absolute;\n top: 0;\n bottom: 0px;\n left: 10px;\n right: 30px;\n overflow: auto hidden;\n}\nxm-select > .xm-label .scroll {\n overflow-y: hidden;\n}\nxm-select > .xm-label .scroll .label-content {\n height: calc(100% - 20px);\n display: flex;\n align-items: baseline;\n}\nxm-select > .xm-label .scroll .label-content:after {\n content: '-';\n opacity: 0;\n}\nxm-select > .xm-label .xm-label-block {\n display: flex;\n position: relative;\n padding: 0px 5px;\n margin-right: 5px;\n height: 26px;\n line-height: 26px;\n border-radius: 3px;\n align-items: baseline;\n}\nxm-select > .xm-label .xm-label-block > span {\n display: flex;\n color: #FFF;\n}\nxm-select > .xm-label .xm-label-block > i {\n color: #FFF;\n margin-left: 8px;\n font-size: 12px;\n cursor: pointer;\n display: flex;\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 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.up {\n top: auto;\n bottom: 42px;\n}\nxm-select > .xm-body .xm-option {\n display: flex;\n align-items: center;\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-icon {\n color: transparent;\n display: flex;\n border: 1px solid #E6E6E6;\n border-radius: 3px;\n height: 18px;\n width: 18px;\n justify-content: center;\n align-items: center;\n}\nxm-select > .xm-body .xm-option-content {\n display: flex;\n position: relative;\n padding-left: 15px;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n color: #666;\n width: calc(100% - 20px);\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 .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 {\n color: #C2C2C2 !important;\n}\nxm-select > .xm-body .xm-search {\n background-color: #FFF !important;\n position: relative;\n padding: 0 10px;\n margin-bottom: 5px;\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-body .xm-paging {\n padding: 0 10px;\n display: flex;\n margin-top: 5px;\n}\nxm-select > .xm-body .xm-paging > span:first-child {\n border-radius: 2px 0 0 2px;\n}\nxm-select > .xm-body .xm-paging > span:last-child {\n border-radius: 0 2px 2px 0;\n}\nxm-select > .xm-body .xm-paging > span {\n display: flex;\n flex: auto;\n justify-content: center;\n vertical-align: middle;\n padding: 0 15px;\n height: 28px;\n line-height: 28px;\n margin: 0 -1px 0 0;\n background-color: #fff;\n color: #333;\n font-size: 12px;\n border: 1px solid #e2e2e2;\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}\nxm-select .loading {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(255, 255, 255, 0.6);\n display: flex;\n align-items: center;\n justify-content: center;\n}\nxm-select .loading .loader {\n border: 0.2em dotted currentcolor;\n border-radius: 50%;\n -webkit-animation: 1s loader linear infinite;\n animation: 1s loader linear infinite;\n display: inline-block;\n width: 1em;\n height: 1em;\n color: inherit;\n vertical-align: middle;\n pointer-events: 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;base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q25YVGr3XXTfpk6bKokjx63UA3AejsAJOALcgDvwSCebNpbH37x5Y08A3OAHHo7fLfeRPVwyO3INF7gXrlN/EG6QX4SbaONVuEX9TdjHM6bCbXRheYPXuGL2hHdhDx18CNdwjU/hOvUv4Qb5W7iJO/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/src/components/core/index.js b/src/components/core/index.js index aab9b18..5caebdf 100644 --- a/src/components/core/index.js +++ b/src/components/core/index.js @@ -38,7 +38,7 @@ class xmOptions { */ update(options = {}, isNew){ //记录最新的配置项 - this.options = Object.assign(this.options, options); + this.options = {...this.options, ...options}; //如果dom不存在, 则不进行渲染事项 let dom = selector(this.options.el); diff --git a/src/components/element/framework.js b/src/components/element/framework.js index 918dd80..7f5827d 100644 --- a/src/components/element/framework.js +++ b/src/components/element/framework.js @@ -60,11 +60,24 @@ class Framework extends Component{ let direction = this.state.direction; if(direction === 'auto'){ + + //用于控制js获取下拉框的高度 + this.bodyView.style.display = 'block'; + this.bodyView.style.visibility = 'hidden'; + + //获取下拉元素的高度 + let bodyViewRect = this.bodyView.getBoundingClientRect(); + let bodyViewHeight = bodyViewRect.height; + + //还原控制效果 + this.bodyView.style.display = ''; + this.bodyView.style.visibility = ''; + //确定下拉框是朝上还是朝下 - let bodyHeight = document.documentElement.clientHeight; + let clientHeight = document.documentElement.clientHeight; let rect = this.base.getBoundingClientRect(); - let diff = bodyHeight - rect.y - rect.height - 20; - direction = diff > 300 ? 'down' : 'up'; + let diff = clientHeight - (rect.y || rect.top) - rect.height - 20; + direction = diff > bodyViewHeight || (rect.y || rect.top) < bodyViewHeight ? 'down' : 'up'; } this.setState({ directionVal: direction }) }else{ @@ -72,7 +85,7 @@ class Framework extends Component{ return; } //如果产生滚动条, 关闭下拉后回到顶部 - this.bodyView.scroll(0, 0); + this.bodyView.scroll && this.bodyView.scroll(0, 0); } this.setState({ show }); diff --git a/src/components/element/model/general.js b/src/components/element/model/general.js index f41e4fd..0d8e1d8 100644 --- a/src/components/element/model/general.js +++ b/src/components/element/model/general.js @@ -80,12 +80,14 @@ class General extends Component{ } componentWillReceiveProps(props){ - if(!props.show){ - //清空输入框的值 - this.setState({ searchVal: '' }); - }else{ - //聚焦输入框 - setTimeout(() => this.focus(), 0); + if(this.props.show != props.show){ + if(!props.show){ + //清空输入框的值 + this.setState({ searchVal: '' }); + }else{ + //聚焦输入框 + setTimeout(() => this.focus(), 0); + } } } diff --git a/src/style/index.less b/src/style/index.less index 1a1db1a..bc695d4 100644 --- a/src/style/index.less +++ b/src/style/index.less @@ -44,6 +44,9 @@ xm-select{ color: @fontColor; text-overflow: ellipsis; user-select: none; + -ms-user-select: none; + -moz-user-select: none; + -webkit-user-select: none; } background-color: #FFF; @@ -120,8 +123,7 @@ xm-select{ height: 26px; line-height: 26px; border-radius: 3px; - vertical-align: middle; - color: #FFF; + align-items: baseline; & > span{ display: flex; @@ -199,7 +201,7 @@ xm-select{ white-space: nowrap; text-overflow: ellipsis; color: #666; - width: 100%; + width: calc(100% - 20px); } } @@ -247,6 +249,7 @@ xm-select{ .xm-paging{ padding: 0 10px; display: flex; + margin-top: 5px; &>span:first-child{ border-radius: 2px 0 0 2px;