UNPKG

jodit-pro

Version:

PRO Version of Jodit Editor

2 lines (1 loc) 1.82 kB
var f=Object.defineProperty;var l=(p,t)=>f(p,"name",{value:t,configurable:!0});var s,h=function(p,t,e,o){var n=arguments.length,i=n<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(p,t,e,o);else for(var a=p.length-1;a>=0;a--)(r=p[a])&&(i=(n<3?r(i):n>3?r(t,e,i):r(t,e))||i);return n>3&&i&&Object.defineProperty(t,e,i),i};import{UISettingsPopup as P}from"../settings-popup/settings-popup.js";import{component as g}from"jodit/esm/core/decorators/component/component.js";import{watch as m}from"jodit/esm/core/decorators/watch/watch.js";import{UIElement as d}from"jodit/esm/core/ui/element.js";import{ToolbarButton as b}from"jodit/esm/modules/toolbar/button/button.js";let u=(s=class extends d{className(){return"UISettingsButton"}constructor(t,e,o,n,i){super(t),this.extraState=e,this.options=o,this.getConversation=n,this.updateConversation=i,this.closeCallback=()=>{},this.settingsPopup=null,this.button=new b(this.jodit,{name:"settings",tooltip:"Settings",popup:l((r,a,c)=>(this.closeCallback=c,this.openSettingsPopup()),"popup")}),this.button.state.variant="initial",this.button.state.size="small",this.container.appendChild(this.button.container)}setParentView(t){var e,o;return(e=this.settingsPopup)===null||e===void 0||e.setParentView(t),(o=this.button)===null||o===void 0||o.setParentView(t),super.setParentView(t)}onChangeOptionsClosePopup(t){this.closeCallback()}openSettingsPopup(){return this.settingsPopup||(this.settingsPopup=new P(this.jodit,this.extraState,this.options,this.getConversation,this.updateConversation)),this.settingsPopup.update(),this.settingsPopup}},l(s,"UISettingsButton"),s);h([m("extraState.displayMode")],u.prototype,"onChangeOptionsClosePopup",null),u=h([g],u);export{u as UISettingsButton};