1 line
435 KiB
JavaScript
1 line
435 KiB
JavaScript
|
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.eruda=t():e.eruda=t()}(self,function(){var __webpack_modules__={422:function(e,t,n){"use strict";n.d(t,{Z:function(){return C}});var s=n(5671),c=n(3144),l=n(9340),u=n(2963),d=n(1120),t=n(2461),a=n.n(t),t=n(3990),o=n.n(t),t=n(6768),r=n.n(t),t=n(4331),i=n.n(t),t=n(5610),t=n.n(t),h=n(7483),f=n.n(h),h=n(6341),p=n.n(h),h=n(3875),m=n.n(h),h=n(6954),v=n.n(h);function g(e){var t="luna-".concat(e,"-");function n(e){return a()(i()(e).split(/\s+/),function(e){return p()(e,t)?e:e.replace(/[\w-]+/,function(e){return"".concat(t).concat(e)})}).join(" ")}return function(e){if(/<[^>]*>/g.test(e))try{var t=f().parse(e);return function e(t,n){for(var o=0,r=t.length;o<r;o++){var i=t[o];n(i),i.content&&e(i.content,n)}}(t,function(e){e.attrs&&e.attrs.class&&(e.attrs.class=n(e.attrs.class))}),f().stringify(t)}catch(t){}return n(e)}}function b(){var e=v()();return"os x"===e?"mac":e}n(9585),t();var h=n(1443),t=n.n(h),h=n(1512),y=n.n(h),h=n(3783),w=n.n(h),h=n(6329),_=n.n(h),h=n(4193),x=n.n(h),h=n(5852),A=n.n(h);var k=function(e){(0,l.Z)(a,e);n=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();var n,o,i=function(){var e,t=(0,d.Z)(n);return e=o?(e=(0,d.Z)(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),(0,u.Z)(this,e)};function a(e,t){var r,t=t.compName,n=(2<arguments.length&&void 0!==arguments[2]?arguments[2]:{}).theme,n=void 0===n?"light":n;return(0,s.Z)(this,a),(r=i.call(this)).subComponents=[],r.compName=t,r.c=g(t),r.options={},r.container=e,r.$container=y()(e),r.$container.addClass(["luna-".concat(t),r.c("platform-".concat(b()))]),r.on("optionChange",function(e,t,n){var o=r.c;"theme"===e&&(r.$container.rmClass(o("theme-".concat(n))).addClass(o("theme-".concat(t))),w()(r.subComponents,function(e){return e.setOption("theme",t)}))}),r.setOption("theme",n),r}return(0,c.Z)(a,[{key:"destroy",value:function(){this.destroySubComponents();var e=this.c;this.$container.rmClass("luna-".concat(this.compName)).rmClass(e("platform-".concat(b()))).rmClass(e("theme-".concat(this.options.theme))),this.$container.html(""),this.emit("destroy"),this.removeAllListeners()}},{key:"setOption",value:function(e,t){var o=this,r=this.options,n={};"string"==typeof e?n[e]=t:n=e,w()(n,function(e,t){var n=r[t];r[t]=e,o.emit("optionChange",t,e,n)})}},{key:"getOption",value:function(e){return this.options[e]}},{key:"addSubComponent",value:function(e){e.setOption("theme",this.options.theme),this.subComponents.push(e)}},{key:"removeSubComponent",value:function(t){A()(this.subComponents,function(e){return e===t})}},{key:"destroySubComponents",value:function(){w()(this.subComponents,function(e){return e.destroy()}),this.subComponents=[]}},{key:"initOptions",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};x()(e,t),_()(this.options,e)}},{key:"find",value:function(e){return this.$container.find(this.c(e))}}]),a}(t());e=n.hmd(e);var C=function(){(0,l.Z)(i,k);n=i,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();var n,o,r=function(){var e,t=(0,d.Z)(n);return e=o?(e=(0,d.Z)(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),(0,u.Z)(this,e)};function i(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return(0,s.Z)(this,i),(e=r.call(this,e,{compName:"box-model"})).initOptions(t),e.options.element&&e.render(),e.bindEvent(),e}return(0,c.Z)(i,[{key:"bindEvent",value:function(){var t=this;this.on("optionChange",function(e){"element"===e&&t.render()})}},{key:"render",value:function(){var e=this.c,t=this.getBoxModelData(
|