plh-ui 2.6.9 → 2.6.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- (function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["PlhUi"]=e():t["PlhUi"]=e()})(window,(function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var s=e[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},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 i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)n.d(i,s,function(e){return t[e]}.bind(null,s));return i},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="f069")}({2877:function(t,e,n){"use strict";function i(t,e,n,i,s,a,r,o){var l,u="function"===typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),i&&(u.functional=!0),a&&(u._scopeId="data-v-"+a),r?(l=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),s&&s.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(r)},u._ssrRegister=l):s&&(l=o?function(){s.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:s),l)if(u.functional){u._injectStyles=l;var h=u.render;u.render=function(t,e){return l.call(e),h(t,e)}}else{var p=u.beforeCreate;u.beforeCreate=p?[].concat(p,l):[l]}return{exports:t,options:u}}n.d(e,"a",(function(){return i}))},"442c":function(t,e,n){"use strict";n("f4e2")},f069:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t._self._c;return e("span",{ref:"countup",staticClass:"plh-countup"})},s=[],a=function(){return(a=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var s in e=arguments[n])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t}).apply(this,arguments)},r=function(){function t(t,e,n){var i=this;this.endVal=e,this.options=n,this.version="2.6.0",this.defaults={startVal:0,decimalPlaces:0,duration:2,useEasing:!0,useGrouping:!0,useIndianSeparators:!1,smartEasingThreshold:999,smartEasingAmount:333,separator:",",decimal:".",prefix:"",suffix:"",enableScrollSpy:!1,scrollSpyDelay:200,scrollSpyOnce:!1},this.finalEndVal=null,this.useEasing=!0,this.countDown=!1,this.error="",this.startVal=0,this.paused=!0,this.once=!1,this.count=function(t){i.startTime||(i.startTime=t);var e=t-i.startTime;i.remaining=i.duration-e,i.useEasing?i.countDown?i.frameVal=i.startVal-i.easingFn(e,0,i.startVal-i.endVal,i.duration):i.frameVal=i.easingFn(e,i.startVal,i.endVal-i.startVal,i.duration):i.frameVal=i.startVal+(i.endVal-i.startVal)*(e/i.duration);var n=i.countDown?i.frameVal<i.endVal:i.frameVal>i.endVal;i.frameVal=n?i.endVal:i.frameVal,i.frameVal=Number(i.frameVal.toFixed(i.options.decimalPlaces)),i.printValue(i.frameVal),e<i.duration?i.rAF=requestAnimationFrame(i.count):null!==i.finalEndVal?i.update(i.finalEndVal):i.options.onCompleteCallback&&i.options.onCompleteCallback()},this.formatNumber=function(t){var e,n,s,a,r=t<0?"-":"";e=Math.abs(t).toFixed(i.options.decimalPlaces);var o=(e+="").split(".");if(n=o[0],s=o.length>1?i.options.decimal+o[1]:"",i.options.useGrouping){a="";for(var l=3,u=0,h=0,p=n.length;h<p;++h)i.options.useIndianSeparators&&4===h&&(l=2,u=1),0!==h&&u%l==0&&(a=i.options.separator+a),u++,a=n[p-h-1]+a;n=a}return i.options.numerals&&i.options.numerals.length&&(n=n.replace(/[0-9]/g,(function(t){return i.options.numerals[+t]})),s=s.replace(/[0-9]/g,(function(t){return i.options.numerals[+t]}))),r+i.options.prefix+n+s+i.options.suffix},this.easeOutExpo=function(t,e,n,i){return n*(1-Math.pow(2,-10*t/i))*1024/1023+e},this.options=a(a({},this.defaults),n),this.formattingFn=this.options.formattingFn?this.options.formattingFn:this.formatNumber,this.easingFn=this.options.easingFn?this.options.easingFn:this.easeOutExpo,this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.endVal=this.validateValue(e),this.options.decimalPlaces=Math.max(this.options.decimalPlaces),this.resetDuration(),this.options.separator=String(this.options.separator),this.useEasing=this.options.useEasing,""===this.options.separator&&(this.options.useGrouping=!1),this.el="string"==typeof t?document.getElementById(t):t,this.el?this.printValue(this.startVal):this.error="[CountUp] target is null or undefined","undefined"!=typeof window&&this.options.enableScrollSpy&&(this.error?console.error(this.error,t):(window.onScrollFns=window.onScrollFns||[],window.onScrollFns.push((function(){return i.handleScroll(i)})),window.onscroll=function(){window.onScrollFns.forEach((function(t){return t()}))},this.handleScroll(this)))}return t.prototype.handleScroll=function(t){if(t&&window&&!t.once){var e=window.innerHeight+window.scrollY,n=t.el.getBoundingClientRect(),i=n.top+window.pageYOffset,s=n.top+n.height+window.pageYOffset;s<e&&s>window.scrollY&&t.paused?(t.paused=!1,setTimeout((function(){return t.start()}),t.options.scrollSpyDelay),t.options.scrollSpyOnce&&(t.once=!0)):(window.scrollY>s||i>e)&&!t.paused&&t.reset()}},t.prototype.determineDirectionAndSmartEasing=function(){var t=this.finalEndVal?this.finalEndVal:this.endVal;this.countDown=this.startVal>t;var e=t-this.startVal;if(Math.abs(e)>this.options.smartEasingThreshold&&this.options.useEasing){this.finalEndVal=t;var n=this.countDown?1:-1;this.endVal=t+n*this.options.smartEasingAmount,this.duration=this.duration/2}else this.endVal=t,this.finalEndVal=null;null!==this.finalEndVal?this.useEasing=!1:this.useEasing=this.options.useEasing},t.prototype.start=function(t){this.error||(t&&(this.options.onCompleteCallback=t),this.duration>0?(this.determineDirectionAndSmartEasing(),this.paused=!1,this.rAF=requestAnimationFrame(this.count)):this.printValue(this.endVal))},t.prototype.pauseResume=function(){this.paused?(this.startTime=null,this.duration=this.remaining,this.startVal=this.frameVal,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count)):cancelAnimationFrame(this.rAF),this.paused=!this.paused},t.prototype.reset=function(){cancelAnimationFrame(this.rAF),this.paused=!0,this.resetDuration(),this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.printValue(this.startVal)},t.prototype.update=function(t){cancelAnimationFrame(this.rAF),this.startTime=null,this.endVal=this.validateValue(t),this.endVal!==this.frameVal&&(this.startVal=this.frameVal,null==this.finalEndVal&&this.resetDuration(),this.finalEndVal=null,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count))},t.prototype.printValue=function(t){var e;if(this.el){var n=this.formattingFn(t);null!==(e=this.options.plugin)&&void 0!==e&&e.render?this.options.plugin.render(this.el,n):"INPUT"===this.el.tagName?this.el.value=n:"text"===this.el.tagName||"tspan"===this.el.tagName?this.el.textContent=n:this.el.innerHTML=n}},t.prototype.ensureNumber=function(t){return"number"==typeof t&&!isNaN(t)},t.prototype.validateValue=function(t){var e=Number(t);return this.ensureNumber(e)?e:(this.error="[CountUp] invalid start or end value: ".concat(t),null)},t.prototype.resetDuration=function(){this.startTime=null,this.duration=1e3*Number(this.options.duration),this.remaining=this.duration},t}(),o={startVal:{type:Number,required:!1,default:0},endVal:{type:Number,required:!0,default:0},duration:{type:Number,required:!1,default:1e3},decimalPlaces:{type:Number,default:0},options:{type:Object,default:()=>{}}},l={name:"plh-countup",props:{...o},data(){return{delay:this.duration/1e3}},computed:{instance(){const t=this.$el,e=new r(t,this.endVal,{startVal:this.startVal,duration:this.delay,decimalPlaces:this.decimalPlaces,...this.options});return e}},mounted(){0===this.endVal&&this.create()},beforeDestroy(){},watch:{endVal:{handler(t){this.create()},deep:!1}},methods:{create(){this.instance.error||(this.delay<0?this.$emit("ready",this.instance,r):this.instance.start(()=>{setTimeout(()=>{this.$emit("ready",this.instance,r)},this.duration)}))},reset(){if(this.instance)return this.instance.reset()}}},u=l,h=(n("442c"),n("2877")),p=Object(h["a"])(u,i,s,!1,null,null,null),d=p.exports;d.install=t=>t.component(d.name,d);e["default"]=d},f4e2:function(t,e,n){}})["default"]}));
1
+ (function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["PlhUi"]=e():t["PlhUi"]=e()})(window,(function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var s=e[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},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 i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)n.d(i,s,function(e){return t[e]}.bind(null,s));return i},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="f069")}({2877:function(t,e,n){"use strict";function i(t,e,n,i,s,a,r,o){var l,u="function"===typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),i&&(u.functional=!0),a&&(u._scopeId="data-v-"+a),r?(l=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),s&&s.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(r)},u._ssrRegister=l):s&&(l=o?function(){s.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:s),l)if(u.functional){u._injectStyles=l;var h=u.render;u.render=function(t,e){return l.call(e),h(t,e)}}else{var d=u.beforeCreate;u.beforeCreate=d?[].concat(d,l):[l]}return{exports:t,options:u}}n.d(e,"a",(function(){return i}))},4375:function(t,e,n){"use strict";n("ae2c")},ae2c:function(t,e,n){},f069:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t._self._c;return e("span",{ref:"countup",staticClass:"plh-countup"})},s=[],a=function(){return(a=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var s in e=arguments[n])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t}).apply(this,arguments)},r=function(){function t(t,e,n){var i=this;this.endVal=e,this.options=n,this.version="2.6.0",this.defaults={startVal:0,decimalPlaces:0,duration:2,useEasing:!0,useGrouping:!0,useIndianSeparators:!1,smartEasingThreshold:999,smartEasingAmount:333,separator:",",decimal:".",prefix:"",suffix:"",enableScrollSpy:!1,scrollSpyDelay:200,scrollSpyOnce:!1},this.finalEndVal=null,this.useEasing=!0,this.countDown=!1,this.error="",this.startVal=0,this.paused=!0,this.once=!1,this.count=function(t){i.startTime||(i.startTime=t);var e=t-i.startTime;i.remaining=i.duration-e,i.useEasing?i.countDown?i.frameVal=i.startVal-i.easingFn(e,0,i.startVal-i.endVal,i.duration):i.frameVal=i.easingFn(e,i.startVal,i.endVal-i.startVal,i.duration):i.frameVal=i.startVal+(i.endVal-i.startVal)*(e/i.duration);var n=i.countDown?i.frameVal<i.endVal:i.frameVal>i.endVal;i.frameVal=n?i.endVal:i.frameVal,i.frameVal=Number(i.frameVal.toFixed(i.options.decimalPlaces)),i.printValue(i.frameVal),e<i.duration?i.rAF=requestAnimationFrame(i.count):null!==i.finalEndVal?i.update(i.finalEndVal):i.options.onCompleteCallback&&i.options.onCompleteCallback()},this.formatNumber=function(t){var e,n,s,a,r=t<0?"-":"";e=Math.abs(t).toFixed(i.options.decimalPlaces);var o=(e+="").split(".");if(n=o[0],s=o.length>1?i.options.decimal+o[1]:"",i.options.useGrouping){a="";for(var l=3,u=0,h=0,d=n.length;h<d;++h)i.options.useIndianSeparators&&4===h&&(l=2,u=1),0!==h&&u%l==0&&(a=i.options.separator+a),u++,a=n[d-h-1]+a;n=a}return i.options.numerals&&i.options.numerals.length&&(n=n.replace(/[0-9]/g,(function(t){return i.options.numerals[+t]})),s=s.replace(/[0-9]/g,(function(t){return i.options.numerals[+t]}))),r+i.options.prefix+n+s+i.options.suffix},this.easeOutExpo=function(t,e,n,i){return n*(1-Math.pow(2,-10*t/i))*1024/1023+e},this.options=a(a({},this.defaults),n),this.formattingFn=this.options.formattingFn?this.options.formattingFn:this.formatNumber,this.easingFn=this.options.easingFn?this.options.easingFn:this.easeOutExpo,this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.endVal=this.validateValue(e),this.options.decimalPlaces=Math.max(this.options.decimalPlaces),this.resetDuration(),this.options.separator=String(this.options.separator),this.useEasing=this.options.useEasing,""===this.options.separator&&(this.options.useGrouping=!1),this.el="string"==typeof t?document.getElementById(t):t,this.el?this.printValue(this.startVal):this.error="[CountUp] target is null or undefined","undefined"!=typeof window&&this.options.enableScrollSpy&&(this.error?console.error(this.error,t):(window.onScrollFns=window.onScrollFns||[],window.onScrollFns.push((function(){return i.handleScroll(i)})),window.onscroll=function(){window.onScrollFns.forEach((function(t){return t()}))},this.handleScroll(this)))}return t.prototype.handleScroll=function(t){if(t&&window&&!t.once){var e=window.innerHeight+window.scrollY,n=t.el.getBoundingClientRect(),i=n.top+window.pageYOffset,s=n.top+n.height+window.pageYOffset;s<e&&s>window.scrollY&&t.paused?(t.paused=!1,setTimeout((function(){return t.start()}),t.options.scrollSpyDelay),t.options.scrollSpyOnce&&(t.once=!0)):(window.scrollY>s||i>e)&&!t.paused&&t.reset()}},t.prototype.determineDirectionAndSmartEasing=function(){var t=this.finalEndVal?this.finalEndVal:this.endVal;this.countDown=this.startVal>t;var e=t-this.startVal;if(Math.abs(e)>this.options.smartEasingThreshold&&this.options.useEasing){this.finalEndVal=t;var n=this.countDown?1:-1;this.endVal=t+n*this.options.smartEasingAmount,this.duration=this.duration/2}else this.endVal=t,this.finalEndVal=null;null!==this.finalEndVal?this.useEasing=!1:this.useEasing=this.options.useEasing},t.prototype.start=function(t){this.error||(t&&(this.options.onCompleteCallback=t),this.duration>0?(this.determineDirectionAndSmartEasing(),this.paused=!1,this.rAF=requestAnimationFrame(this.count)):this.printValue(this.endVal))},t.prototype.pauseResume=function(){this.paused?(this.startTime=null,this.duration=this.remaining,this.startVal=this.frameVal,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count)):cancelAnimationFrame(this.rAF),this.paused=!this.paused},t.prototype.reset=function(){cancelAnimationFrame(this.rAF),this.paused=!0,this.resetDuration(),this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.printValue(this.startVal)},t.prototype.update=function(t){cancelAnimationFrame(this.rAF),this.startTime=null,this.endVal=this.validateValue(t),this.endVal!==this.frameVal&&(this.startVal=this.frameVal,null==this.finalEndVal&&this.resetDuration(),this.finalEndVal=null,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count))},t.prototype.printValue=function(t){var e;if(this.el){var n=this.formattingFn(t);null!==(e=this.options.plugin)&&void 0!==e&&e.render?this.options.plugin.render(this.el,n):"INPUT"===this.el.tagName?this.el.value=n:"text"===this.el.tagName||"tspan"===this.el.tagName?this.el.textContent=n:this.el.innerHTML=n}},t.prototype.ensureNumber=function(t){return"number"==typeof t&&!isNaN(t)},t.prototype.validateValue=function(t){var e=Number(t);return this.ensureNumber(e)?e:(this.error="[CountUp] invalid start or end value: ".concat(t),null)},t.prototype.resetDuration=function(){this.startTime=null,this.duration=1e3*Number(this.options.duration),this.remaining=this.duration},t}(),o={startVal:{type:Number,required:!1,default:0},endVal:{type:Number,required:!0,default:0},duration:{type:Number,required:!1,default:1e3},decimalPlaces:{type:Number,default:0},options:{type:Object,default:()=>{}}},l={name:"plh-countup",props:{...o},data(){return{instance:null,delay:this.duration/1e3}},mounted(){this.instance=new r(this.$el,this.endVal,{startVal:this.startVal,duration:this.delay,decimalPlaces:this.decimalPlaces,...this.options}),0===this.endVal&&this.create()},beforeDestroy(){this._readyTimer&&clearTimeout(this._readyTimer)},watch:{endVal:{handler(t){this.instance&&this.instance.update(t),this.create()},deep:!1}},methods:{create(){this.instance&&!this.instance.error&&(this.delay<0?this.$emit("ready",this.instance,r):this.instance.start(()=>{this._readyTimer&&clearTimeout(this._readyTimer),this._readyTimer=setTimeout(()=>{this.$emit("ready",this.instance,r)},this.duration)}))},reset(){if(this.instance)return this.instance.reset()}}},u=l,h=(n("4375"),n("2877")),d=Object(h["a"])(u,i,s,!1,null,null,null),p=d.exports;p.install=t=>t.component(p.name,p);e["default"]=p}})["default"]}));
@@ -1 +1 @@
1
- (function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["PlhUi"]=t():e["PlhUi"]=t()})(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},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="0416")}({"0416":function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e._self._c;return t("el-drawer",e._b({ref:"drawer",staticClass:"plh-drawer",attrs:{visible:e.drawerVisible,direction:"rtl","wrapper-closable":"view"===e.type,"close-on-press-escape":"view"===e.type,"append-to-body":!0,"destroy-on-close":!0,size:e.width},on:{"update:visible":function(t){e.drawerVisible=t}}},"el-drawer",e.$attrs,!1),[t("template",{slot:"title"},[t("div",{staticClass:"el-drawer__title"},[e._t("title",(function(){return[t("span",[e._v(e._s(e.title))])]}))],2)]),e._t("default"),e.hasFooter?[t("div",{staticClass:"drawer-footer"},[e._t("footer",(function(){return["view"===e.type?[t("plh-button",{attrs:{size:e.size},on:{click:function(t){return e.onCancel()}}},[e._v("关闭")])]:[t("plh-button",{attrs:{size:e.size},on:{click:function(t){return e.onCancel()}}},[e._v("取消")]),t("plh-button",{attrs:{type:"primary",size:e.size},on:{click:function(t){return e.onConfirm()}}},[e._v("确定")])]]}))],2)]:e._e()],2)},o=[],i={visible:{type:Boolean,default:!1},size:{type:String,default:"small"},width:{type:[String,Number],default:"640px"},type:{type:String,default:"add"},title:{type:String,default:""},hasFooter:{type:Boolean,default:!0}},s={name:"plh-drawer",props:{...i},data(){return{}},computed:{drawerVisible:{get(){return this.visible},set(e){this.$emit("update:visible",e)}}},watch:{},created(){},mounted(){},destroyed(){},methods:{closeDrawer(){this.$refs.drawer.closeDrawer()},onCancel(){this.$emit("cancel")},onConfirm(){this.$emit("confirm")}}},a=s,l=(n("a1e4"),n("2877")),u=Object(l["a"])(a,r,o,!1,null,null,null),c=u.exports;c.install=e=>e.component(c.name,c);t["default"]=c},2877:function(e,t,n){"use strict";function r(e,t,n,r,o,i,s,a){var l,u="function"===typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),i&&(u._scopeId="data-v-"+i),s?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},u._ssrRegister=l):o&&(l=a?function(){o.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:o),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(e,t){return l.call(t),c(e,t)}}else{var d=u.beforeCreate;u.beforeCreate=d?[].concat(d,l):[l]}return{exports:e,options:u}}n.d(t,"a",(function(){return r}))},a1e4:function(e,t,n){"use strict";n("a31e")},a31e:function(e,t,n){}})["default"]}));
1
+ (function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["PlhUi"]=t():e["PlhUi"]=t()})(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},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="0416")}({"0146":function(e,t,n){},"0416":function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e._self._c;return t("el-drawer",e._b({ref:"drawer",staticClass:"plh-drawer",attrs:{visible:e.drawerVisible,direction:"rtl","wrapper-closable":"view"===e.type,"close-on-press-escape":"view"===e.type,"append-to-body":!0,"destroy-on-close":!0,size:e.width},on:{"update:visible":function(t){e.drawerVisible=t}}},"el-drawer",e.$attrs,!1),[t("template",{slot:"title"},[t("div",{staticClass:"el-drawer__title"},[e._t("title",(function(){return[t("span",[e._v(e._s(e.title))])]}))],2)]),e._t("default"),e.hasFooter?[t("div",{staticClass:"drawer-footer"},[e._t("footer",(function(){return["view"===e.type?[t("plh-button",{attrs:{size:e.size},on:{click:function(t){return e.onCancel()}}},[e._v("关闭")])]:[t("plh-button",{attrs:{size:e.size},on:{click:function(t){return e.onCancel()}}},[e._v("取消")]),t("plh-button",{attrs:{type:"primary",size:e.size},on:{click:function(t){return e.onConfirm()}}},[e._v("确定")])]]}))],2)]:e._e()],2)},o=[],i={visible:{type:Boolean,default:!1},size:{type:String,default:"small"},width:{type:[String,Number],default:"640px"},type:{type:String,default:"add"},title:{type:String,default:""},hasFooter:{type:Boolean,default:!0}},s={name:"plh-drawer",props:{...i},computed:{drawerVisible:{get(){return this.visible},set(e){this.$emit("update:visible",e)}}},methods:{closeDrawer(){this.$refs.drawer.closeDrawer()},onCancel(){this.$emit("cancel")},onConfirm(){this.$emit("confirm")}}},a=s,l=(n("a4eb"),n("2877")),u=Object(l["a"])(a,r,o,!1,null,null,null),c=u.exports;c.install=e=>e.component(c.name,c);t["default"]=c},2877:function(e,t,n){"use strict";function r(e,t,n,r,o,i,s,a){var l,u="function"===typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),i&&(u._scopeId="data-v-"+i),s?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},u._ssrRegister=l):o&&(l=a?function(){o.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:o),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(e,t){return l.call(t),c(e,t)}}else{var f=u.beforeCreate;u.beforeCreate=f?[].concat(f,l):[l]}return{exports:e,options:u}}n.d(t,"a",(function(){return r}))},a4eb:function(e,t,n){"use strict";n("0146")}})["default"]}));
@@ -1 +1 @@
1
- (function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["PlhUi"]=t():e["PlhUi"]=t()})(window,(function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},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 i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},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="9038")}({"041d":function(e,t,n){"use strict";n("5553")},"1ae5":function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));const i={B:1,KB:1024,MB:1048576,M:1048576,GB:1073741824,G:1073741824}},2877:function(e,t,n){"use strict";function i(e,t,n,i,o,r,a,s){var c,l="function"===typeof e?e.options:e;if(t&&(l.render=t,l.staticRenderFns=n,l._compiled=!0),i&&(l.functional=!0),r&&(l._scopeId="data-v-"+r),a?(c=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},l._ssrRegister=c):o&&(c=s?function(){o.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:o),c)if(l.functional){l._injectStyles=c;var u=l.render;l.render=function(e,t){return c.call(t),u(e,t)}}else{var p=l.beforeCreate;l.beforeCreate=p?[].concat(p,c):[c]}return{exports:e,options:l}}n.d(t,"a",(function(){return i}))},5553:function(e,t,n){},9038:function(e,t,n){"use strict";n.r(t);var i=function(){var e=this,t=e._self._c;return t("Editor",{ref:"editor",attrs:{"api-key":e.apiKey,init:e.init},model:{value:e.model,callback:function(t){e.model=t},expression:"model"}})},o=[],r=["onActivate","onAddUndo","onBeforeAddUndo","onBeforeExecCommand","onBeforeGetContent","onBeforeRenderUI","onBeforeSetContent","onBeforePaste","onBlur","onChange","onClearUndos","onClick","onContextMenu","onCopy","onCut","onDblclick","onDeactivate","onDirty","onDrag","onDragDrop","onDragEnd","onDragGesture","onDragOver","onDrop","onExecCommand","onFocus","onFocusIn","onFocusOut","onGetContent","onHide","onInit","onKeyDown","onKeyPress","onKeyUp","onLoadContent","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onNodeChange","onObjectResizeStart","onObjectResized","onObjectSelected","onPaste","onPostProcess","onPostRender","onPreProcess","onProgressState","onRedo","onRemove","onReset","onSaveContent","onSelectionChange","onSetAttrib","onSetContent","onShow","onSubmit","onUndo","onVisualAid"],a=function(e){return-1!==r.map((function(e){return e.toLowerCase()})).indexOf(e.toLowerCase())},s=function(e,t,n){Object.keys(t).filter(a).forEach((function(i){var o=t[i];"function"===typeof o&&("onInit"===i?o(e,n):n.on(i.substring(2),(function(e){return o(e,n)})))}))},c=function(e,t){var n=e.$props.modelEvents?e.$props.modelEvents:null,i=Array.isArray(n)?n.join(" "):n;t.on(i||"change input undo redo",(function(){e.$emit("input",t.getContent({format:e.$props.outputFormat}))}))},l=function(e,t,n){var i=t.$props.value?t.$props.value:"",o=t.$props.initialValue?t.$props.initialValue:"";n.setContent(i||(t.initialized?t.cache:o)),t.$watch("value",(function(e,i){n&&"string"===typeof e&&e!==i&&e!==n.getContent({format:t.$props.outputFormat})&&n.setContent(e)})),t.$listeners.input&&c(t,n),s(e,t.$listeners,n),t.initialized=!0},u=0,p=function(e){var t=Date.now(),n=Math.floor(1e9*Math.random());return u++,e+"_"+n+u+String(t)},d=function(e){return null!==e&&"textarea"===e.tagName.toLowerCase()},f=function(e){return"undefined"===typeof e||""===e?[]:Array.isArray(e)?e:e.split(" ")},m=function(e,t){return f(e).concat(f(t))},h=function(e){return null===e||void 0===e},g=function(){return{listeners:[],scriptId:p("tiny-script"),scriptLoaded:!1}},y=function(){var e=g(),t=function(e,t,n,i){var o=t.createElement("script");o.referrerPolicy="origin",o.type="application/javascript",o.id=e,o.src=n;var r=function(){o.removeEventListener("load",r),i()};o.addEventListener("load",r),t.head&&t.head.appendChild(o)},n=function(n,i,o){e.scriptLoaded?o():(e.listeners.push(o),n.getElementById(e.scriptId)||t(e.scriptId,n,i,(function(){e.listeners.forEach((function(e){return e()})),e.scriptLoaded=!0})))},i=function(){e=g()};return{load:n,reinitialize:i}},v=y(),b=n("c4a9"),S={apiKey:String,cloudChannel:String,id:String,init:Object,initialValue:String,inline:Boolean,modelEvents:[String,Array],plugins:[String,Array],tagName:String,toolbar:[String,Array],value:String,disabled:Boolean,tinymceScriptSrc:String,outputFormat:{type:String,validator:function(e){return"html"===e||"text"===e}}},$=function(){return $=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},$.apply(this,arguments)},x=function(e,t,n){return e(n||"div",{attrs:{id:t}})},C=function(e,t){return e("textarea",{attrs:{id:t},style:{visibility:"hidden"}})},_=function(e){return function(){var t=$($({},e.$props.init),{readonly:e.$props.disabled,selector:"#"+e.elementId,plugins:m(e.$props.init&&e.$props.init.plugins,e.$props.plugins),toolbar:e.$props.toolbar||e.$props.init&&e.$props.init.toolbar,inline:e.inlineEditor,setup:function(t){e.editor=t,t.on("init",(function(n){return l(n,e,t)})),e.$props.init&&"function"===typeof e.$props.init.setup&&e.$props.init.setup(t)}});d(e.element)&&(e.element.style.visibility="",e.element.style.display=""),Object(b["a"])().init(t)}},w={props:S,created:function(){this.elementId=this.$props.id||p("tiny-vue"),this.inlineEditor=this.$props.init&&this.$props.init.inline||this.$props.inline,this.initialized=!1},watch:{disabled:function(){this.editor.setMode(this.disabled?"readonly":"design")}},mounted:function(){if(this.element=this.$el,null!==Object(b["a"])())_(this)();else if(this.element&&this.element.ownerDocument){var e=this.$props.cloudChannel?this.$props.cloudChannel:"5",t=this.$props.apiKey?this.$props.apiKey:"no-api-key",n=h(this.$props.tinymceScriptSrc)?"https://cdn.tiny.cloud/1/"+t+"/tinymce/"+e+"/tinymce.min.js":this.$props.tinymceScriptSrc;v.load(this.element.ownerDocument,n,_(this))}},beforeDestroy:function(){null!==Object(b["a"])()&&Object(b["a"])().remove(this.editor)},deactivated:function(){var e;this.inlineEditor||(this.cache=this.editor.getContent(),null===(e=Object(b["a"])())||void 0===e||e.remove(this.editor))},activated:function(){!this.inlineEditor&&this.initialized&&_(this)()},render:function(e){return this.inlineEditor?x(e,this.elementId,this.$props.tagName):C(e,this.elementId)}},j=w;const O=["advlist anchor autolink autoresize autosave \n charmap code codesample \n directionality \n emoticons \n fullpage fullscreen \n help hr \n image imagetools importcss insertdatetime indent2em \n link lists \n media\n nonbreaking noneditable \n pagebreak powerpaste preview print \n save searchreplace spellchecker \n tabfocus table textpattern toc \n visualblocks visualchars wordcount pageembed"];var E=O;const k=["undo redo searchreplace | \n bold italic underline strikethrough subscript superscript forecolor backcolor removeformat | \n fontselect fontsizeselect formatselect lineheight","alignleft aligncenter alignright alignjustify outdent indent indent2em | \n bullist numlist | \n image link pageembed charmap emoticons hr codesample table insertdatetime anchor pagebreak blockquote | \n code preview fullscreen"];var z=k,M={value:{type:String,default:""},accept:{default:"image/jpeg,image/jpg,image/png",type:String},uploadFn:{type:Function},options:{type:Object},limitSize:{type:Number,default:200},limitUnit:{type:String,default:"KB"},apiKey:{type:String,default:"no-api-key"}},P=n("1ae5"),B={name:"plh-editor",components:{Editor:j},props:{...M},data(){return{init:{height:500,menubar:!0,language:"zh_CN",branding:!1,plugins:E,toolbar:z,min_height:400,max_height:500,zIndex:3e3,paste_as_text:!1,fontsize_formats:"10px 12px 14px 16px 18px 20px 22px 24px 26px 28px 30px 32px 36px 40px",font_formats:"微软雅黑='微软雅黑'; 宋体='宋体'; 楷体='楷体'; 仿宋='仿宋'; 隶书='隶书'; 幼圆='幼圆'\n Andale Mono=andale mono,times; Arial=arial,helvetica,sans-serif; Arial Black=arial black,avant garde;\n Book Antiqua=book antiqua,palatino; Comic Sans MS=comic sans ms,sans-serif;\n Courier New=courier new,courier; Georgia=georgia,palatino; Helvetica=helvetica;\n Impact=impact,chicago; Symbol=symbol; Tahoma=tahoma,arial,helvetica,sans-serif;\n Terminal=terminal,monaco; Times New Roman=times new roman,times; Trebuchet MS=trebuchet ms,geneva;\n Verdana=verdana,geneva; Webdings=webdings; Wingdings=wingdings,zapf dingbats",external_plugins:{indent2em:"https://cdn.digitalcnzz.com/static/tinymce/indent2em/plugin.min.js",pageembed:"https://cdn.digitalcnzz.com/static/tinymce/pageembed/plugin.min.js"},images_upload_handler:(e,t,n)=>{const i=e.blob(),o=this.limitUnit.toUpperCase(),r=P["a"][o];r||n("限制文件存储单位limitUnit的类型错误");const a=i.size/r<this.limitSize;a||n(`上传图片大小不能超过${this.limitSize}${this.limitUnit}!`),this.accept.indexOf(i.type)>=0?this.uploadFn(i).then(e=>{t(e.url)}).catch(()=>{n("图片上传失败")}):n("图片格式错误")},...this.options}}},computed:{model:{get(){return this.value},set(e){this.$emit("input",e),this.$emit("change",e)}}},watch:{},created(){},mounted(){},destroyed(){},methods:{}},A=B,D=(n("041d"),n("2877")),U=Object(D["a"])(A,i,o,!1,null,null,null),I=U.exports;I.install=e=>e.component(I.name,I);t["default"]=I},c4a9:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return o}));var i=function(){return"undefined"!==typeof window?window:e},o=function(){var e=i();return e&&e.tinymce?e.tinymce:null}}).call(this,n("c8ba"))},c8ba:function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(i){"object"===typeof window&&(n=window)}e.exports=n}})["default"]}));
1
+ (function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["PlhUi"]=t():e["PlhUi"]=t()})(window,(function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},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 i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},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="9038")}({"1ae5":function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));const i={B:1,KB:1024,MB:1048576,M:1048576,GB:1073741824,G:1073741824}},2818:function(e,t,n){},2877:function(e,t,n){"use strict";function i(e,t,n,i,o,r,a,s){var c,l="function"===typeof e?e.options:e;if(t&&(l.render=t,l.staticRenderFns=n,l._compiled=!0),i&&(l.functional=!0),r&&(l._scopeId="data-v-"+r),a?(c=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},l._ssrRegister=c):o&&(c=s?function(){o.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:o),c)if(l.functional){l._injectStyles=c;var u=l.render;l.render=function(e,t){return c.call(t),u(e,t)}}else{var p=l.beforeCreate;l.beforeCreate=p?[].concat(p,c):[c]}return{exports:e,options:l}}n.d(t,"a",(function(){return i}))},"4ee3":function(e,t,n){"use strict";n("2818")},9038:function(e,t,n){"use strict";n.r(t);var i=function(){var e=this,t=e._self._c;return t("Editor",{ref:"editor",attrs:{"api-key":e.apiKey,tinymceScriptSrc:e.tinymceScriptSrc,init:e.init},model:{value:e.model,callback:function(t){e.model=t},expression:"model"}})},o=[],r=["onActivate","onAddUndo","onBeforeAddUndo","onBeforeExecCommand","onBeforeGetContent","onBeforeRenderUI","onBeforeSetContent","onBeforePaste","onBlur","onChange","onClearUndos","onClick","onContextMenu","onCopy","onCut","onDblclick","onDeactivate","onDirty","onDrag","onDragDrop","onDragEnd","onDragGesture","onDragOver","onDrop","onExecCommand","onFocus","onFocusIn","onFocusOut","onGetContent","onHide","onInit","onKeyDown","onKeyPress","onKeyUp","onLoadContent","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onNodeChange","onObjectResizeStart","onObjectResized","onObjectSelected","onPaste","onPostProcess","onPostRender","onPreProcess","onProgressState","onRedo","onRemove","onReset","onSaveContent","onSelectionChange","onSetAttrib","onSetContent","onShow","onSubmit","onUndo","onVisualAid"],a=function(e){return-1!==r.map((function(e){return e.toLowerCase()})).indexOf(e.toLowerCase())},s=function(e,t,n){Object.keys(t).filter(a).forEach((function(i){var o=t[i];"function"===typeof o&&("onInit"===i?o(e,n):n.on(i.substring(2),(function(e){return o(e,n)})))}))},c=function(e,t){var n=e.$props.modelEvents?e.$props.modelEvents:null,i=Array.isArray(n)?n.join(" "):n;t.on(i||"change input undo redo",(function(){e.$emit("input",t.getContent({format:e.$props.outputFormat}))}))},l=function(e,t,n){var i=t.$props.value?t.$props.value:"",o=t.$props.initialValue?t.$props.initialValue:"";n.setContent(i||(t.initialized?t.cache:o)),t.$watch("value",(function(e,i){n&&"string"===typeof e&&e!==i&&e!==n.getContent({format:t.$props.outputFormat})&&n.setContent(e)})),t.$listeners.input&&c(t,n),s(e,t.$listeners,n),t.initialized=!0},u=0,p=function(e){var t=Date.now(),n=Math.floor(1e9*Math.random());return u++,e+"_"+n+u+String(t)},d=function(e){return null!==e&&"textarea"===e.tagName.toLowerCase()},f=function(e){return"undefined"===typeof e||""===e?[]:Array.isArray(e)?e:e.split(" ")},m=function(e,t){return f(e).concat(f(t))},h=function(e){return null===e||void 0===e},g=function(){return{listeners:[],scriptId:p("tiny-script"),scriptLoaded:!1}},y=function(){var e=g(),t=function(e,t,n,i){var o=t.createElement("script");o.referrerPolicy="origin",o.type="application/javascript",o.id=e,o.src=n;var r=function(){o.removeEventListener("load",r),i()};o.addEventListener("load",r),t.head&&t.head.appendChild(o)},n=function(n,i,o){e.scriptLoaded?o():(e.listeners.push(o),n.getElementById(e.scriptId)||t(e.scriptId,n,i,(function(){e.listeners.forEach((function(e){return e()})),e.scriptLoaded=!0})))},i=function(){e=g()};return{load:n,reinitialize:i}},v=y(),b=n("c4a9"),S={apiKey:String,cloudChannel:String,id:String,init:Object,initialValue:String,inline:Boolean,modelEvents:[String,Array],plugins:[String,Array],tagName:String,toolbar:[String,Array],value:String,disabled:Boolean,tinymceScriptSrc:String,outputFormat:{type:String,validator:function(e){return"html"===e||"text"===e}}},$=function(){return $=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},$.apply(this,arguments)},x=function(e,t,n){return e(n||"div",{attrs:{id:t}})},C=function(e,t){return e("textarea",{attrs:{id:t},style:{visibility:"hidden"}})},_=function(e){return function(){var t=$($({},e.$props.init),{readonly:e.$props.disabled,selector:"#"+e.elementId,plugins:m(e.$props.init&&e.$props.init.plugins,e.$props.plugins),toolbar:e.$props.toolbar||e.$props.init&&e.$props.init.toolbar,inline:e.inlineEditor,setup:function(t){e.editor=t,t.on("init",(function(n){return l(n,e,t)})),e.$props.init&&"function"===typeof e.$props.init.setup&&e.$props.init.setup(t)}});d(e.element)&&(e.element.style.visibility="",e.element.style.display=""),Object(b["a"])().init(t)}},w={props:S,created:function(){this.elementId=this.$props.id||p("tiny-vue"),this.inlineEditor=this.$props.init&&this.$props.init.inline||this.$props.inline,this.initialized=!1},watch:{disabled:function(){this.editor.setMode(this.disabled?"readonly":"design")}},mounted:function(){if(this.element=this.$el,null!==Object(b["a"])())_(this)();else if(this.element&&this.element.ownerDocument){var e=this.$props.cloudChannel?this.$props.cloudChannel:"5",t=this.$props.apiKey?this.$props.apiKey:"no-api-key",n=h(this.$props.tinymceScriptSrc)?"https://cdn.tiny.cloud/1/"+t+"/tinymce/"+e+"/tinymce.min.js":this.$props.tinymceScriptSrc;v.load(this.element.ownerDocument,n,_(this))}},beforeDestroy:function(){null!==Object(b["a"])()&&Object(b["a"])().remove(this.editor)},deactivated:function(){var e;this.inlineEditor||(this.cache=this.editor.getContent(),null===(e=Object(b["a"])())||void 0===e||e.remove(this.editor))},activated:function(){!this.inlineEditor&&this.initialized&&_(this)()},render:function(e){return this.inlineEditor?x(e,this.elementId,this.$props.tagName):C(e,this.elementId)}},j=w;const O=["advlist anchor autolink autoresize autosave \n charmap code codesample \n directionality \n emoticons \n fullpage fullscreen \n help hr \n image imagetools importcss insertdatetime indent2em \n link lists \n media\n nonbreaking noneditable \n pagebreak powerpaste preview print \n save searchreplace spellchecker \n tabfocus table textpattern toc \n visualblocks visualchars wordcount pageembed"];var E=O;const k=["undo redo searchreplace | \n bold italic underline strikethrough subscript superscript forecolor backcolor removeformat | \n fontselect fontsizeselect formatselect lineheight","alignleft aligncenter alignright alignjustify outdent indent indent2em | \n bullist numlist | \n image link pageembed charmap emoticons hr codesample table insertdatetime anchor pagebreak blockquote | \n code preview fullscreen"];var M=k,P={value:{type:String,default:""},accept:{default:"image/jpeg,image/jpg,image/png",type:String},uploadFn:{type:Function},options:{type:Object},limitSize:{type:Number,default:200},limitUnit:{type:String,default:"KB"},apiKey:{type:String,default:"no-api-key"},tinymceScriptSrc:{type:String,default:null}},z=n("1ae5"),B={name:"plh-editor",components:{Editor:j},props:{...P},data(){return{init:{height:500,menubar:!0,language:"zh_CN",branding:!1,plugins:E,toolbar:M,min_height:400,max_height:500,zIndex:3e3,paste_as_text:!1,fontsize_formats:"10px 12px 14px 16px 18px 20px 22px 24px 26px 28px 30px 32px 36px 40px",font_formats:"微软雅黑='微软雅黑'; 宋体='宋体'; 楷体='楷体'; 仿宋='仿宋'; 隶书='隶书'; 幼圆='幼圆'\n Andale Mono=andale mono,times; Arial=arial,helvetica,sans-serif; Arial Black=arial black,avant garde;\n Book Antiqua=book antiqua,palatino; Comic Sans MS=comic sans ms,sans-serif;\n Courier New=courier new,courier; Georgia=georgia,palatino; Helvetica=helvetica;\n Impact=impact,chicago; Symbol=symbol; Tahoma=tahoma,arial,helvetica,sans-serif;\n Terminal=terminal,monaco; Times New Roman=times new roman,times; Trebuchet MS=trebuchet ms,geneva;\n Verdana=verdana,geneva; Webdings=webdings; Wingdings=wingdings,zapf dingbats",external_plugins:{},images_upload_handler:(e,t,n)=>{const i=e.blob(),o=this.limitUnit.toUpperCase(),r=z["a"][o];r||n("限制文件存储单位limitUnit的类型错误");const a=i.size/r<this.limitSize;a||n(`上传图片大小不能超过${this.limitSize}${this.limitUnit}!`),this.accept.indexOf(i.type)>=0?this.uploadFn(i).then(e=>{t(e.url)}).catch(()=>{n("图片上传失败")}):n("图片格式错误")},...this.options}}},computed:{model:{get(){return this.value},set(e){this.$emit("input",e),this.$emit("change",e)}}}},A=B,D=(n("4ee3"),n("2877")),U=Object(D["a"])(A,i,o,!1,null,null,null),I=U.exports;I.install=e=>e.component(I.name,I);t["default"]=I},c4a9:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return o}));var i=function(){return"undefined"!==typeof window?window:e},o=function(){var e=i();return e&&e.tinymce?e.tinymce:null}}).call(this,n("c8ba"))},c8ba:function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(i){"object"===typeof window&&(n=window)}e.exports=n}})["default"]}));
package/lib/form/index.js CHANGED
@@ -1 +1 @@
1
- (function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["PlhUi"]=t():e["PlhUi"]=t()})(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s="92c3")}({2638:function(e,t,r){"use strict";function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t,r=1;r<arguments.length;r++)for(var n in t=arguments[r],t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},n.apply(this,arguments)}var i=["attrs","props","domProps"],o=["class","style","directives"],l=["on","nativeOn"],a=function(e){return e.reduce((function(e,t){for(var r in t)if(e[r])if(-1!==i.indexOf(r))e[r]=n({},e[r],t[r]);else if(-1!==o.indexOf(r)){var a=e[r]instanceof Array?e[r]:[e[r]],c=t[r]instanceof Array?t[r]:[t[r]];e[r]=[].concat(a,c)}else if(-1!==l.indexOf(r))for(var u in t[r])if(e[r][u]){var d=e[r][u]instanceof Array?e[r][u]:[e[r][u]],f=t[r][u]instanceof Array?t[r][u]:[t[r][u]];e[r][u]=[].concat(d,f)}else e[r][u]=t[r][u];else if("hook"===r)for(var p in t[r])e[r][p]=e[r][p]?s(e[r][p],t[r][p]):t[r][p];else e[r]=t[r];else e[r]=t[r];return e}),{})},s=function(e,t){return function(){e&&e.apply(this,arguments),t&&t.apply(this,arguments)}};e.exports=a},2877:function(e,t,r){"use strict";function n(e,t,r,n,i,o,l,a){var s,c="function"===typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=r,c._compiled=!0),n&&(c.functional=!0),o&&(c._scopeId="data-v-"+o),l?(s=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(l)},c._ssrRegister=s):i&&(s=a?function(){i.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:i),s)if(c.functional){c._injectStyles=s;var u=c.render;c.render=function(e,t){return s.call(t),u(e,t)}}else{var d=c.beforeCreate;c.beforeCreate=d?[].concat(d,s):[s]}return{exports:e,options:c}}r.d(t,"a",(function(){return n}))},"92c3":function(e,t,r){"use strict";r.r(t);var n,i,o=r("2638"),l=r.n(o),a={value:{type:Object},items:{type:Array,default:()=>[]},size:{type:String,default:"medium"},inline:{type:Boolean,default:!1},trim:{type:Boolean,default:!1}},s={name:"plh-form",props:{...a},computed:{model:{get(){return this.value},set(e){this.$emit("input",e)}}},methods:{validate(...e){return this.$refs.form.validate(...e)},validateField(...e){return this.$refs.form.validateField(...e)},resetFields(...e){return this.$refs.form.resetFields(...e)},clearValidate(...e){return this.$refs.form.clearValidate(...e)},validateHandle(...e){this.$emit("validate",...e)},placeholder(e){const t=["select","picker","cascader"];let r="输入",n=t.some(t=>e.tag&&e.tag.indexOf(t)>-1);return n&&(r="选择"),e.attrs&&e.attrs.placeholder||`请${r}${e.label||"内容"}`},renderFormItem(e,t,r,n){const i="function"===typeof t.label;return e("el-form-item",{key:r,attrs:{prop:t.key,label:i?null:t.label,"label-width":t.labelWidth,rules:t.rules}},[n,i&&e("template",{slot:"label"},[t.label(e,t)])])},renderItem(e){return this.items.map((t,r)=>{const n={item:t,$index:r,self:this};let i=e=>{let r={};const i=t.trim||this.trim;r[t.key]=e,i&&"string"===typeof e&&(r[t.key]=e.trim());const o={...this.model,...r};this.$emit("input",o,{...n})},o=this.model[t.key],l=t.render?t.render(e,{model:this.model,item:t,value:o,input:i}):e(t.tag||"el-input",{ref:t.ref,attrs:{clearable:!0,size:this.size,...t.attrs,placeholder:this.placeholder(t)},props:{...t.props,value:o},on:{...t.on,input:i,change:e=>(this.$emit("change",this.model,{...n}),t.on&&t.on.change&&t.on.change(e,{data:this.model,...n}))},nativeOn:{keydown:e=>{13===e.keyCode&&(e.preventDefault(),this.$emit("enter",e))},...t.nativeOn}},this.renderChildren(e,t));return this.inline?this.renderFormItem(e,t,r,l):e("el-col",{attrs:{span:t.col}},[this.renderFormItem(e,t,r,l)])})},renderChildren(e,t){return t.children&&[...t.children.options].map((r,n)=>{let i=t.children.tag,o={...r};return"el-radio"!==i&&"el-radio-button"!==i&&"el-checkbox"!==i&&"el-checkbox-button"!==i||(o={...o,slot:r.label,label:r.value}),e(t.children.tag,{key:n,attrs:r.attrs,props:{...t.children.props,...o}},o.slot||o.label)})}},render(e){const t=this.$parent&&this.$parent.$createElement?this.$parent.$createElement:e;return e("el-form",l()([{ref:"form"},{props:{model:this.model}},{},{attrs:this.$attrs},{attrs:{size:this.size,inline:this.inline},on:{validate:this.validateHandle},class:"plh-form"}]),[e("el-row",{class:"form-list-all",attrs:{type:"flex"}},[this.renderItem(t)])])}},c=s,u=(r("f41b"),r("2877")),d=Object(u["a"])(c,n,i,!1,null,null,null),f=d.exports;f.install=e=>e.component(f.name,f);t["default"]=f},cc3b:function(e,t,r){},f41b:function(e,t,r){"use strict";r("cc3b")}})["default"]}));
1
+ (function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["PlhUi"]=t():e["PlhUi"]=t()})(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s="92c3")}({2638:function(e,t,r){"use strict";function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t,r=1;r<arguments.length;r++)for(var n in t=arguments[r],t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},n.apply(this,arguments)}var i=["attrs","props","domProps"],o=["class","style","directives"],l=["on","nativeOn"],s=function(e){return e.reduce((function(e,t){for(var r in t)if(e[r])if(-1!==i.indexOf(r))e[r]=n({},e[r],t[r]);else if(-1!==o.indexOf(r)){var s=e[r]instanceof Array?e[r]:[e[r]],c=t[r]instanceof Array?t[r]:[t[r]];e[r]=[].concat(s,c)}else if(-1!==l.indexOf(r))for(var u in t[r])if(e[r][u]){var d=e[r][u]instanceof Array?e[r][u]:[e[r][u]],f=t[r][u]instanceof Array?t[r][u]:[t[r][u]];e[r][u]=[].concat(d,f)}else e[r][u]=t[r][u];else if("hook"===r)for(var p in t[r])e[r][p]=e[r][p]?a(e[r][p],t[r][p]):t[r][p];else e[r]=t[r];else e[r]=t[r];return e}),{})},a=function(e,t){return function(){e&&e.apply(this,arguments),t&&t.apply(this,arguments)}};e.exports=s},2877:function(e,t,r){"use strict";function n(e,t,r,n,i,o,l,s){var a,c="function"===typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=r,c._compiled=!0),n&&(c.functional=!0),o&&(c._scopeId="data-v-"+o),l?(a=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(l)},c._ssrRegister=a):i&&(a=s?function(){i.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:i),a)if(c.functional){c._injectStyles=a;var u=c.render;c.render=function(e,t){return a.call(t),u(e,t)}}else{var d=c.beforeCreate;c.beforeCreate=d?[].concat(d,a):[a]}return{exports:e,options:c}}r.d(t,"a",(function(){return n}))},"513e":function(e,t,r){},"67ff":function(e,t,r){"use strict";r("513e")},"92c3":function(e,t,r){"use strict";r.r(t);var n,i,o=r("2638"),l=r.n(o),s={value:{type:Object},items:{type:Array,default:()=>[]},size:{type:String,default:"medium"},inline:{type:Boolean,default:!1},trim:{type:Boolean,default:!1}},a={name:"plh-form",props:{...s},computed:{model:{get(){return this.value},set(e){this.$emit("input",e)}}},methods:{validate(...e){return this.$refs.form.validate(...e)},validateField(...e){return this.$refs.form.validateField(...e)},resetFields(...e){return this.$refs.form.resetFields(...e)},clearValidate(...e){return this.$refs.form.clearValidate(...e)},validateHandle(...e){this.$emit("validate",...e)},placeholder(e){const t=["select","picker","cascader"];let r="输入",n=t.some(t=>e.tag&&e.tag.indexOf(t)>-1);return n&&(r="选择"),e.attrs&&e.attrs.placeholder||`请${r}${e.label||"内容"}`},renderFormItem(e,t,r,n){const i="function"===typeof t.label;return e("el-form-item",{key:r,attrs:{prop:t.key,label:i?null:t.label,"label-width":t.labelWidth,rules:t.rules}},[n,i&&e("template",{slot:"label"},[t.label(e,t)])])},renderItem(e){return this.items.map((t,r)=>{const n={item:t,$index:r,self:this};let i=e=>{let r={};const i=t.trim||this.trim;if(r[t.key]=e,i&&"string"===typeof e&&(r[t.key]=e.trim()),this.model[t.key]===r[t.key])return;const o={...this.model,...r};this.$emit("input",o,{...n})},o=this.model[t.key],l=t.render?t.render(e,{model:this.model,item:t,value:o,input:i}):e(t.tag||"el-input",{ref:t.ref,attrs:{clearable:!0,size:this.size,...t.attrs,placeholder:this.placeholder(t)},props:{...t.props,value:o},on:{...t.on,input:i,change:e=>(this.$emit("change",this.model,{...n}),t.on&&t.on.change&&t.on.change(e,{data:this.model,...n}))},nativeOn:{keydown:e=>{13===e.keyCode&&(e.preventDefault(),this.$emit("enter",e))},...t.nativeOn}},this.renderChildren(e,t));return this.inline?this.renderFormItem(e,t,r,l):e("el-col",{attrs:{span:t.col}},[this.renderFormItem(e,t,r,l)])})},renderChildren(e,t){return t.children&&t.children.options.map((r,n)=>{let i=t.children.tag,o={...r};return"el-radio"!==i&&"el-radio-button"!==i&&"el-checkbox"!==i&&"el-checkbox-button"!==i||(o={...o,slot:r.label,label:r.value}),e(t.children.tag,{key:n,attrs:r.attrs,props:{...t.children.props,...o}},o.slot||o.label)})}},render(e){const t=this.$parent&&this.$parent.$createElement?this.$parent.$createElement:e;return e("el-form",l()([{ref:"form"},{props:{model:this.model}},{},{attrs:this.$attrs},{attrs:{size:this.size,inline:this.inline},on:{validate:this.validateHandle},class:"plh-form"}]),[e("el-row",{class:"form-list-all",attrs:{type:"flex"}},[this.renderItem(t)])])}},c=a,u=(r("67ff"),r("2877")),d=Object(u["a"])(c,n,i,!1,null,null,null),f=d.exports;f.install=e=>e.component(f.name,f);t["default"]=f}})["default"]}));