forked from golang/hotime
2 lines
12 KiB
JavaScript
2 lines
12 KiB
JavaScript
|
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-642e42d4"],{"1da1":function(t,e,r){"use strict";r.d(e,"a",function(){return n});r("d3b7");function u(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function n(c){return function(){var t=this,a=arguments;return new Promise(function(e,r){var n=c.apply(t,a);function o(t){u(n,e,r,o,i,"next",t)}function i(t){u(n,e,r,o,i,"throw",t)}o(void 0)})}}},2532:function(t,e,r){"use strict";var n=r("23e7"),o=r("5a34"),i=r("1d80"),a=r("577e");n({target:"String",proto:!0,forced:!r("ab13")("includes")},{includes:function(t){return!!~a(i(this)).indexOf(a(o(t)),1<arguments.length?arguments[1]:void 0)}})},"44e7":function(t,e,r){var n=r("861d"),o=r("c6b6"),i=r("b622")("match");t.exports=function(t){var e;return n(t)&&(void 0!==(e=t[i])?!!e:"RegExp"==o(t))}},"4e15":function(t,e,r){"use strict";r.d(e,"a",function(){return o}),r.d(e,"b",function(){return i});var u=r("f2bf"),l=r("cb23"),n=Object.defineProperty,f=Object.defineProperties,s=Object.getOwnPropertyDescriptors,h=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,y=(t,e,r)=>e in t?n(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;function g(t){var e=`请使用 '@${t}' 事件,不要放在 props 中`;return e+=`
|
||
|
Please use '@${t}' event instead of props`}e=(t,e)=>{for(var[r,n]of e)t[r]=n;return t},r=Object(u.t)({props:{mode:{type:String,default:"default"},defaultContent:{type:Array,default:[]},defaultHtml:{type:String,default:""},defaultConfig:{type:Object,default:{}},modelValue:{type:String,default:""}},setup(o,i){const e=Object(u.Q)(null),a=Object(u.X)(null),c=Object(u.Q)(""),t=()=>{var t;e.value&&(t=Object(u.ab)(o.defaultContent),Object(l.createEditor)({selector:e.value,mode:o.mode,content:t||[],html:o.defaultHtml||o.modelValue||"",config:(t=((t,e)=>{for(var r in e=e||{})d.call(e,r)&&y(t,r,e[r]);if(h)for(var r of h(e))p.call(e,r)&&y(t,r,e[r]);return t})({},o.defaultConfig),f(t,s({onCreated(t){if(a.value=t,i.emit("onCreated",t),o.defaultConfig.onCreated)throw t=g("onCreated"),new Error(t)},onChange(t){var e=t.getHtml();if(c.value=e,i.emit("update:modelValue",e),i.emit("onChange",t),o.defaultConfig.onChange)throw e=g("onChange"),new Error(e)},onDestroyed(t){if(i.emit("onDestroyed",t),o.defaultConfig.onDestroyed)throw t=g("onDestroyed"),new Error(t)},onMaxLength(t){if(i.emit("onMaxLength",t),o.defaultConfig.onMaxLength)throw t=g("onMaxLength"),new Error(t)},onFocus(t){if(i.emit("onFocus",t),o.defaultConfig.onFocus)throw t=g("onFocus"),new Error(t)},onBlur(t){if(i.emit("onBlur",t),o.defaultConfig.onBlur)throw t=g("onBlur"),new Error(t)},customAlert(t,e){if(i.emit("customAlert",t,e),o.defaultConfig.customAlert)throw t=g("customAlert"),new Error(t)},customPaste:(t,e)=>{var r;if(o.defaultConfig.customPaste)throw r=g("customPaste"),new Error(r);let n;return i.emit("customPaste",t,e,t=>{n=t}),n}})))}))};return Object(u.I)(()=>{t()}),Object(u.ib)(()=>o.modelValue,t=>{if(t!==c.value){const o=a.value;if(null!=o){var e=o.isDisabled(),r=o.isFocused(),n=JSON.stringify(o.selection);if(o.enable(),o.focus(),o.select([]),o.deleteFragment(),l.SlateTransforms.setNodes(o,{type:"paragraph"},{mode:"highest"}),o.dangerouslyInsertHtml(t),!r)return void(o.deselect(),o.blur());if(e)return void(o.deselect(),o.disable());try{o.select(JSON.parse(n))}catch(t){o.select(l.SlateEditor.start(o,[]))}}}}),{box:e}}});const a={ref:"box",style:{height:"100%"}};var o=e(r,[["render",function(t,e,r,n,o,i){return Object(u.L)(),Object(u.n)("div",a,null,512)}]]),r=Object(u.t)({props:{editor:{type:Object},mode:{type:String,default:"default"},defaultConfig:{type:Object,default:{}}},setup(e){const r=Object(u.Q)(null);return Object(u.jb)(()=>{var t=e["editor"];if(null!=t)if(r.value){if(null==t)throw new Error("Not found instance of Editor when create <Toolbar/> component");l.DomEditor.getToolbar(t)||Object(l.createToolbar)({editor:t,selector:r.value||"<div></div>",mode:e.mode,config:e.defaultConfig})}}),{selector:r}}});const c={ref:"selector"};var i=e(r,[["render",function(t,e,r,n,o,i){return Object(u.L)(),Object(u.n)("div",c,null,512)}]])},"560e":function(t,e,r){},"5a34":function(t,e,r){var n=r("44e7");t.exports=function(t){if(n(t))throw TypeError("The method doesn't accept regular expressions");return t}},"96cf":function(e,t,r){e=function(a){"use strict";var u,t=Object.prototype,l=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",o=e.toStringTag||"@@toStringTag";function i(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(t){i=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o,i,a,c,e=e&&e.prototype instanceof g?e:g,e=Object.create(e.prototype),n=new L(n||[]);return e._invoke=(o=t,i=r,a=n,c=s,function(t,e){if(c===d)throw new Error("Generator is already running");if(c===p){if("throw"===t)throw e;return P()}for(a.method=t,a.arg=e;;){var r=a.delegate;if(r){r=function t(e,r){var n=e.iterator[r.method];if(n===u){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=u,t(e,r),"throw"===r.method))return y;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}n=f(n,e.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,y;n=n.arg;if(!n)
|