SettingsSeparator.783a306a.js 3.25 KB
import{d as a}from"./helpers.de7566d0.js";import{a as i,m as u}from"./vuex.esm.8fdeb4b6.js";import{G as c,a as p}from"./Row.830f6397.js";import{n as l}from"./_plugin-vue2_normalizer.61652a7c.js";const h={components:{GridColumn:c,GridRow:p},props:{optionsSeparator:{type:String,required:!0},showMoreSlug:{type:String,required:!0}},data(){return{strings:{custom:this.$t.__("Custom separator:",this.$td),showMore:this.$t.__("Show More",this.$td),showLess:this.$t.__("Show Less",this.$td)},showMoreSeparators:!1,showMoreInitial:!0,customSeparator:null,separators:["–","»","›","‣","→","•","/","|"],moreSeparators:["-","—","«","←",">","≥","\","+","►"]}},watch:{showMoreSeparators(o){if(this.showMoreInitial){this.showMoreInitial=!1;return}this.toggleRadio({slug:this.showMoreSlug,value:o})},customSeparator(o){o!==null&&(this.$emit("change",o),this.separators.concat(this.moreSeparators).includes(o)&&(this.customSeparator=null))}},computed:{...i(["options","settings"]),hiddenSeparator(){return this.optionsSeparator===this.customSeparator||this.moreSeparators.includes(this.optionsSeparator)?this.optionsSeparator:null},decodedSeparators(){return this.separators.map(o=>a(o))},decodedMoreSeparators(){return this.moreSeparators.map(o=>a(o))},decodedCustomSeparator(){return a(this.hiddenSeparator)}},methods:{...u(["toggleRadio"]),setSeparator(o){this.customSeparator=null,this.$emit("change",o)}},mounted(){this.showMoreSeparators=this.settings.toggledRadio[this.showMoreSlug],this.customSeparator=this.optionsSeparator.includes(this.separators.concat(this.moreSeparators))?null:this.optionsSeparator}};var d=function(){var t=this,r=t._self._c;return r("grid-row",{staticClass:"aioseo-separators"},[!t.showMoreSeparators&&t.hiddenSeparator?r("grid-column",{attrs:{xs:"2",sm:"1"}},[r("div",{staticClass:"active separator"},[t._v(" "+t._s(t.decodedCustomSeparator)+" ")])]):t._e(),t._l(t.decodedSeparators,function(s,e){return r("grid-column",{key:e,attrs:{xs:"2",sm:"1"}},[r("div",{staticClass:"separator",class:{active:t.optionsSeparator===s},on:{click:function(n){return t.setSeparator(s)}}},[t._v(" "+t._s(s)+" ")])])}),t.showMoreSeparators?t._l(t.decodedMoreSeparators,function(s,e){return r("grid-column",{key:`m_${e}`,attrs:{xs:"2",sm:"1"}},[r("div",{staticClass:"separator",class:{active:t.optionsSeparator===s},on:{click:function(n){return t.setSeparator(s)}}},[t._v(" "+t._s(s)+" ")])])}):t._e(),t.showMoreSeparators?t._e():r("grid-column",{attrs:{xs:t.hiddenSeparator?"3":"4"}},[r("div",{staticClass:"show-more"},[r("a",{attrs:{href:"#"},on:{click:function(s){s.preventDefault(),t.showMoreSeparators=!0}}},[t._v(" "+t._s(t.strings.showMore)+"… ")])])]),t.showMoreSeparators?r("grid-column",[r("div",{staticClass:"custom-separator"},[t._v(" "+t._s(t.strings.custom)+" "),r("base-input",{attrs:{spellcheck:!1,size:"medium"},model:{value:t.customSeparator,callback:function(s){t.customSeparator=s},expression:"customSeparator"}})],1)]):t._e(),t.showMoreSeparators?r("grid-column",[r("div",{staticClass:"show-more"},[r("a",{attrs:{href:"#"},on:{click:function(s){s.preventDefault(),t.showMoreSeparators=!1}}},[t._v(" "+t._s(t.strings.showLess)+"… ")])])]):t._e()],2)},m=[],_=l(h,d,m,!1,null,null,null,null);const w=_.exports;export{w as C};