nimble-ui
Version:
1 lines • 17.2 kB
JavaScript
module.exports=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}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get: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="M2W1")}({"0Zk/":function(t,e,n){"use strict";e.a=function(t,e){return Object(o.a)(t,e).replace(/^[a-z]/,function(t){return t.toUpperCase()})};var o=n("lXuC")},"5fCB":function(t,e,n){"use strict";var o=n("E5mE"),r=n("eY/N");e.a=function t(){for(var e=!0,n=void 0,i=arguments.length,a=Array(i),u=0;u<i;u++)a[u]=arguments[u];if(a instanceof Array&&(n=a.slice(0,1)[0]),"boolean"==typeof n&&(e=n,a.splice(0,1),e||(n=a.splice(0,1)[0])),a&&a.length<1)return"boolean"==typeof n?a[1]:n;e&&(n=null);for(var c=0;c<a.length;c++){var s=a[c];if(s instanceof Object)if(e){for(var p in n&&n instanceof Object||(n=s instanceof Array?[]:{}),s)if(s.hasOwnProperty(p)){var f=s[p];if(h(f)){var l=h(n[p])&&n[p]||(f instanceof Array?[]:{});n[p]=t(l,f)}else void 0!==f?n[p]=f:void 0!==n[p]&&(n[p]=f)}}else n=n&&n instanceof Object?Object.assign(n,s):s}return n;function h(t){return t&&(Object(o.a)(t,"Array")||Object(r.a)(t))||!1}}},"76is":function(t,e,n){"use strict";n.d(e,"a",function(){return o});var o={SHOW:"showChange",HIDE:"hideChange",CONFIRM:"confirmChange",CANCEL:"cancelChange",CLOSE_POPUP:"closePopup",CLOSE:"close",OPEN_PAGE:"openPage",GO_BACK_PAGE:"goBackPage"}},E5mE:function(t,e,n){"use strict";e.a=function(t,e){var n=!1;try{n=Object.prototype.toString.call(t)==="[object "+e+"]"}catch(t){}return n}},FNmr:function(t,e,n){"use strict";e.a=function(t,e){var n="";if(t&&e)if(e.name){var r="$s"+(n=Object(o.a)(e.name));t.prototype&&!t.prototype[r]&&function(t,e,n){if(t&&e&&n){t[n]=e;try{Object.defineProperty(t,n,{get:function(){var t=this;return e._getParent=function(){return t},e},enumerable:!1,configurable:!1})}catch(t){}}}(t.prototype,e,r)}else console.error("Mount is not defined for the image name");return n};var o=n("0Zk/")},M2W1:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n("wSSq");var r=function(t){function e(n,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,n,o));return r.name="Popup",r._setSPopup(n),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.install=function(e,n){var o=this;t.prototype.install.call(this,e,n);t.prototype._getParent=function(){if(this!==o)return this._getParent!==o.getParent&&o._getParent()}},e}(o.a);function i(t,e){return new r(t,e)}n.d(e,"PopupBase",function(){return o.a}),i.install=function(t,e){t.use(i(t,e),e)};e.default=i},XAAj:function(t,e,n){"use strict";e.a=function(t){var e=document.createEvent("undefined"!=typeof MouseEvent?"MouseEvents":"Event");return e.initEvent(t,!0,!1),e}},Z05q:function(t,e,n){"use strict";e.a=function(t,e,n){if(t&&(t.tagName||t===window||t===document)&&e&&"string"==typeof e){var i=Object(o.a)(e);i._constructed=!0,i=Object(r.a)(!1,i,n),t.dispatchEvent(i)}};var o=n("XAAj"),r=n("5fCB")},Z9R9:function(t,e,n){"use strict";var o=n("qd2b");e.a=o.a},ZMJv:function(t,e,n){"use strict";var o=n("uGS0");e.a=o.a},"eY/N":function(t,e,n){"use strict";e.a=function(t){if(!Object(o.a)(t,"Object"))return!1;var e=Object.getPrototypeOf(t);if(!e)return!0;var n=r.call(e,"constructor")&&e.constructor;return"function"==typeof n&&r.toString.call(n)===r.toString.call(Object)};var o=n("E5mE"),r=Object.prototype.hasOwnProperty},ekq3:function(t,e,n){"use strict";var o=n("zagf");e.a=o.a},lXuC:function(t,e,n){"use strict";e.a=function(t,e){var n="("+(e||"_|-")+")";return t=(t=(t=(t+"").replace(new RegExp(n+"?(?:(?:[A-Z]{2,}[A-Z]"+n+"*$)|(?:[A-Z]{2,}(?=[A-Z])))","g"),function(t){return(((e||"")+"").split("|")[0]||"-")+(t=t.replace(new RegExp(n),"")).toLowerCase()})).replace(new RegExp("(?:^"+n+"?([a-z]))|(?:"+n+"$)","gi"),function(t,e,n){return(n||"").toLowerCase()})).replace(new RegExp(n+"([a-z])","gi"),function(t,e,n){return(n||"").toUpperCase()})}},q44f:function(t,e,n){"use strict";n.d(e,"a",function(){return o});var o=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.inputBlur=function(){var t=document.activeElement;if(t&&"input"===(t.tagName||"").toLowerCase()){var e=t;e.blur(),setTimeout(function(){e.scrollIntoView()},20)}},e}(n("Z9R9").a)},qd2b:function(t,e,n){"use strict";var o=n("5fCB"),r=n("Z05q"),i=n("zagf");var a=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._events={}}return t.prototype.$dispatchEvent=function(t,e,n){return Object(r.a)(t,e,n)},t.prototype.$on=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push([e,n])},t.prototype.$once=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this,o=this,r=!1,i=function i(){o.$off(t,i),r||(r=!0,e.apply(n,arguments))};i.fn=e,o.$on(t,i)},t.prototype.$off=function(t,e){var n=this._events&&this._events[t];if(n)for(var o=n.length;o--;)(n[o][0]===e||n[o][0]&&n[o][0].fn===e)&&(n[o][0]=void 0)},t.prototype.$emit=function(t){var e=this._events&&this._events[t];if(e){for(var n=e.length,o=[].concat(e),r=arguments.length,a=Array(r>1?r-1:0),u=1;u<r;u++)a[u-1]=arguments[u];for(var c=0;c<n;c++){var s=o[c],p=s[0],f=s[1];Object(i.a)(p,a,f)}}},t}(),u=n("FNmr");n.d(e,"a",function(){return c});var c=function(t){function e(n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var o=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this));return o.name="",o.defaultOption={},o.setDefaultOptions(!0,n),o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.singleton=function(t){var e=this._singleton||this.instance(t);return this._singleton=e,e},e.instance=function(t){return new this(t)},e.install=function(t,e){var n=this.instance(e);return t&&t.use instanceof Function&&t.use(n,e),n},e.prototype.getParent=function(){return Object(i.a)(this._getParent||this._vue&&this._vue.prototype||null,[],this)},e.prototype.install=function(t,e){this._vue=this._vue||t;var n=Object(u.a)(t,this);return this.setDefaultOptions(e&&n&&e[n]||e),this},e.prototype.setDefaultOptions=function(t){var e=void 0,n=!0;"boolean"==typeof t?(n=t,e=arguments[1]||{}):e=t,e&&(this.defaultOption=Object(o.a)(n,this.defaultOption||{},e))},e.prototype.getOptions=function(){for(var t=[{},this.defaultOption||{}],e=!0,n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return"boolean"==typeof r[0]&&(e=r[0],r.splice(0,1)),r&&r.length>0&&(t=t.concat(r)),o.a.apply(void 0,[e].concat(t))},e.prototype.preload=function(){var t=this;return new Promise(function(e,n){e(t)})},e}(a)},rRBi:function(t,e,n){"use strict";var o=n("5fCB");e.a=o.a},uGS0:function(t,e,n){"use strict";e.a=function(t,e,n,i){var a=t;!e||e instanceof Array||(e=[e]);return new Promise(function(u,c){(a=Object(o.a)(t||a,e,i||null))instanceof Promise||Object(r.a)(a,"Promise")||a&&a.then instanceof Function?a.then(u,c):u(n?{default:a}:a)})};var o=n("zagf"),r=n("E5mE")},wSSq:function(t,e,n){"use strict";var o=n("ZMJv"),r=n("ekq3"),i=n("76is"),a={confirmFilter:function(t){return{type:"confirm",data:t}},cancelFilter:function(t){return{type:"cancel",data:t}},closeFilter:function(t){return{type:"close",data:t}},hideFilter:function(t){return{type:"hide",data:t}}},u=n("q44f");var c=function(){for(var t=!1,e=void 0,n=void 0,o=arguments.length,r=Array(o),i=0;i<o;i++)r[i]=arguments[i];if(r instanceof Array&&(n=r.splice(0,1)[0]),"boolean"==typeof n&&(t=n,n=r.splice(0,1)[0]),r&&r.length<1)return"boolean"==typeof n?r[1]:n;t?r[0]instanceof Array?e=[]:r[0]instanceof Object&&(e={}):e=n;for(var a=0;a<r.length;a++){var u=r[a];if(u instanceof Object)for(var c in n)n.hasOwnProperty(c)&&c in u&&(!t||t&&void 0!==u[c])&&(e[c]=u[c])}return e},s=n("rRBi");var p=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._Vue=this._Vue||e}return t.prototype._initCom=function(t,e){var n=t,o=(e=e||{}).parent;if(!o){var i=Object(r.a)(this._getParent,[],this);i&&i.$vnode&&(o=i)}var a=void 0;if(o&&(a={parent:o,store:o.$store||o.$parent&&o.$parent.$store}),!(t instanceof Function)){if(!(this._Vue instanceof Function))return console.log(new Error("挂载组件时候未找到Vue")),{};n=this._Vue.extend(t)}return e&&e.props&&(e.propsData=e.props,delete e.props),new n(Object.assign({},e,a||{}))},t.prototype.instCom=function(t,e){var n=(e=e||{}).el;return n||(n=document.body),e.el=document.createElement("div"),Object(r.a)(n.appendChild,[e.el],n),this._initCom(t,e)},t.prototype.updataProps=function(t,e){t&&e&&Object.assign(t,e)},t.prototype.setVue=function(t){this._Vue=t||this._Vue},t}();var f=function(t){t.mixin({beforeDestroy:function(){this.$emit("destroyPopupCore")}})},l=function(t){function e(n,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,o));return r.name="PopupCore",r._mountCom=null,r.setDefaultOptions(o),r._initMountCom(n),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype._instPopup=function(t){var e=this;t=e.getOptions(t);var n=Object(s.a)({},t);return n.props=c(!0,{maskFlag:"",props:"",content:"",isOpen:!0,isShow:!0,maskCloseFlag:"",isCloseBtn:"",alignCla:"",wrapCla:"",transition:"",transitionCls:"",routerOption:"",isHeight:!1,scrollEl:"",isDisableScroll:""},t),new Promise(function(r,i){(function(e){if(t.content&&t.content.prototype&&t.content.prototype.$mount)return new Promise(function(t,n){t(e)});return Object(o.a)(e)})(t.content).then(function(a){n.props.content=a,Object(o.a)(t.popupComponent).then(function(t){var o=e._mountCom.instCom(t,n);r(o)},i)})})},e.prototype.createPopup=function(t,e,n){var o=this,a=o.getOptions(e,{content:t});return new Promise(function(t,e){o._instPopup(a).then(function(e){var u=e.$refs.hook_is,c={component:u,popup:e,updateProps:function(t){e&&(e.$data.myProps=Object.assign({},e.$data.myProps,t))},updateData:function(t){u=e.$refs.hook_is,console.warn("请不要使用updateData修改数据"),u&&o._mountCom.updataProps(u.$data,t)},show:function(){e&&e.show()},hide:function(){e&&e.hide()},closePopup:function(){e&&e.closePopup()},close:function(){e&&e.close()}};function s(){if(e){e.$parent&&e.$parent.$off("destroyPopupCore",s);var t=e.$el;e.$destroy();var o=t.parentNode;o&&o.removeChild(t),Object(r.a)(n)}c.popup=null,c.component=null,e=null,u=null}e&&e.$parent&&e.$parent.$once("destroyPopupCore",s),e.$on(i.a.CLOSE,function(){s()}),u?(a&&a.data instanceof Object&&c.updateData(a.data),t(c)):setTimeout(function(){a&&a.data instanceof Object&&c.updateData(a.data),c.component=e.$refs.hook_is,t(c)})},e)})},e.prototype._initMountCom=function(t){var e=this;if(e._mountCom)e._mountCom.setVue(t);else{var n=new p(t);t&&(Object(r.a)(f,[t]),f=null),n._getParent=function(){return e._getParent&&e._getParent()},e._mountCom=n}},e.prototype.install=function(e,n){this._initMountCom(e),t.prototype.install.call(this,e,n)},e}(u.a);n.d(e,"a",function(){return h});var h=function(t){function e(n,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,o));return r.name="PopupBase",r.defaultOption=a,r._cache={},r.setDefaultOptions(o),r._setSPopup(n),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype._initWatch=function(t,e,n){var a=this;return new Promise(function(u,c){var s,p=null;if(!t)return c(new Error("popup 不能为空"));for(var f=((s={})[i.a.CONFIRM]=function(t){d(t,e.confirmFilter)},s[i.a.HIDE]=function(t){v(t,e.hideFilter)},s[i.a.CLOSE]=function(t){v(t,e.closeFilter),void 0!==p&&clearTimeout(p),p=setTimeout(function(){Object(r.a)(n||t,t)},0)},s[i.a.CANCEL]=function(t){d(t,e.cancelFilter)},s),l=Object.keys(f),h=0;h<l.length;h++){var y=l[h];t.$on(y,f[y])}function v(e,n){return Object(o.a)(n||e,e).then(function(e){for(var n=0;n<l.length;n++){var o=l[n];t.$off(o,f[o])}u(e)})}function d(t,n){Object(o.a)(n||t,t).then(function(t){"show"===e.showFlag?a.hide(e.key):a.closePopup(e.key),u(t)})}})},e.prototype._handlePopup=function(t,e,n,o){var r=this._getPopup(t);return!!r&&(!o&&this._removePopup(t),r&&r[e](n),!0)},e.prototype._initPopup=function(t,e){return e=this.getOptions(e),this.sPopup.createPopup(t,e)},e.prototype._addPopup=function(){var t,e=(t=regeneratorRuntime.mark(function t(e,n,o,r){var i,a;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i=this,e=e||"default",a=r&&i._getPopup(e),r&&a&&a.close(e),t.next=6,i._initPopup(n,o);case 6:return a=t.sent,r&&(i.close(e),i._cache[e]=a),t.abrupt("return",a);case 9:case"end":return t.stop()}},t,this)}),function(){var e=t.apply(this,arguments);return new Promise(function(t,n){return function o(r,i){try{var a=e[r](i),u=a.value}catch(t){return void n(t)}if(!a.done)return Promise.resolve(u).then(function(t){o("next",t)},function(t){o("throw",t)});t(u)}("next")})});return function(t,n,o,r){return e.apply(this,arguments)}}(),e.prototype._removePopup=function(t){delete this._cache[t||"default"]},e.prototype._getPopup=function(t){t=t||"default";return this._cache[t]},e.prototype._setSPopup=function(t){var e=this;if(e.sPopup)e.sPopup._initMountCom(t);else{var n=new l(t);n._getParent=function(){return e._getParent&&e._getParent()},e.sPopup=n}},e.prototype.popupData=function(t,e,n){var o=this,i=o.getOptions(e);"show"===i.showFlag?o.show(i.key):o.close(i.key);var a=new Promise(function(e,u){var c=o._getPopup(i.key);c&&c.popup&&"show"===i.showFlag?(o._initWatch(c.popup,i).then(e,u),Object(r.a)(n,[c.popup])):o.openPopup(t,Object.assign({},i),!0).then(function(t){Object.assign(a,t),t.popup&&o._initWatch(t.popup,i).then(e,u),Object(r.a)(n,[t.popup])})});return a},e.prototype.openPopup=function(t,e,n){return e=e||{},this._addPopup(e.key,t,e,n)},e.prototype.updateProps=function(t,e){return this._handlePopup(t,"updateProps",e,!0)},e.prototype.updateData=function(t,e){return this._handlePopup(t,"updateData",e,!0)},e.prototype.show=function(t){return this._handlePopup(t,"show",null,!0)},e.prototype.hide=function(t){return this._handlePopup(t,"hide",null,!0)},e.prototype.closePopup=function(t){return this._handlePopup(t,"closePopup")},e.prototype.close=function(t){return this._handlePopup(t,"close")},e.prototype.closeAll=function(){var t=this._cache;for(var e in t)t.hasOwnProperty(e)&&this.close(e)},e.prototype.install=function(e,n){this._setSPopup(e),t.prototype.install.call(this,e,n)},e}(u.a)},zagf:function(t,e,n){"use strict";e.a=function(t,e,n){var o=t;t instanceof Function&&(o=t.apply(n,e));return o}}});