hotime/example/tpt/js/chunk-856f3c38.29c2fcc0.js

2 lines
10 KiB
JavaScript
Raw Normal View History

(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-856f3c38","chunk-e624c1ca"],{"1da1":function(t,e,r){"use strict";r.d(e,"a",function(){return n});r("d3b7");function c(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function n(u){return function(){var t=this,a=arguments;return new Promise(function(e,r){var n=u.apply(t,a);function o(t){c(n,e,r,o,i,"next",t)}function i(t){c(n,e,r,o,i,"throw",t)}o(void 0)})}}},"4de4":function(t,e,r){"use strict";var n=r("23e7"),o=r("b727").filter;n({target:"Array",proto:!0,forced:!r("1dde")("filter")},{filter:function(t){return o(this,t,1<arguments.length?arguments[1]:void 0)}})},"4e15":function(t,e,r){"use strict";r.d(e,"a",function(){return o}),r.d(e,"b",function(){return i});var c=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(c.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(c.Q)(null),a=Object(c.X)(null),u=Object(c.Q)(""),t=()=>{var t;e.value&&(t=Object(c.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(u.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(c.I)(()=>{t()}),Object(c.ib)(()=>o.modelValue,t=>{if(t!==u.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(c.L)(),Object(c.n)("div",a,null,512)}]]),r=Object(c.t)({props:{editor:{type:Object},mode:{type:String,default:"default"},defaultConfig:{type:Object,default:{}}},setup(e){const r=Object(c.Q)(null);return Object(c.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 u={ref:"selector"};var i=e(r,[["render",function(t,e,r,n,o,i){return Object(c.L)(),Object(c.n)("div",u,null,512)}]])},"560e":function(t,e,r){},"96cf":function(e,t,r){e=function(a){"use strict";var c,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 u(t,e,r,n){var o,i,a,u,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,u=s,function(t,e){if(u===d)throw new Error("Generator is already running");if(u===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===c){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=c,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)return r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y;{if(!n.done)return n;r[e.resultName]=n.value,r.