UNPKG

v-intl-listformat

Version:
2 lines (1 loc) 2 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.VIntlListFormat=e()}(this,function(){"use strict";var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};var e=function(t,e,n,o,r,i,s,l,d,a){"boolean"!=typeof s&&(d=l,l=s,s=!1);var u,f="function"==typeof n?n.options:n;if(t&&t.render&&(f.render=t.render,f.staticRenderFns=t.staticRenderFns,f._compiled=!0,r&&(f.functional=!0)),o&&(f._scopeId=o),i?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,d(t)),t&&t._registeredComponents&&t._registeredComponents.add(i)},f._ssrRegister=u):e&&(u=s?function(){e.call(this,a(this.$root.$options.shadowRoot))}:function(t){e.call(this,l(t))}),u)if(f.functional){var p=f.render;f.render=function(t,e){return u.call(e),p(t,e)}}else{var c=f.beforeCreate;f.beforeCreate=c?[].concat(c,u):[u]}return n},n={name:"VIntlListFormat",props:{payload:{type:Array,default:function(){return[]},required:!0},locale:{type:String,default:"en",required:!1},listType:{type:String,default:null,required:!1},listStyle:{type:String,default:null,required:!1}},computed:{listFormat:function(){var e=this,n="object"===("undefined"==typeof navigator?"undefined":t(navigator))?navigator.vendor:"Unknown",o={type:e.listType,style:e.listStyle};return n&&n.includes("Google")?(null===o.type&&(o={}),null===o.style&&delete o.style,new Intl.ListFormat(e.locale,o).format(e.payload)):"Unfortunately your browser does not support this plugin!"}}},o=function(){var t=this.$createElement;return(this._self._c||t)("span",[this._v(this._s(this.listFormat))])};o._withStripped=!0;return e({render:o,staticRenderFns:[]},void 0,n,void 0,!1,void 0,void 0,void 0)});